feat: add application timeline history (#3237)

* feat: add application timeline history

* fix: address application timeline review

* fix: keep application tracker e2e stable

* fix: use stable timeline e2e selector

* fix: target timeline note input in e2e
This commit is contained in:
Amruth Pillai
2026-07-09 00:36:45 +02:00
committed by GitHub
parent 1124d3dfda
commit 18d0c14aa1
22 changed files with 6651 additions and 115 deletions
+14 -6
View File
@@ -26,16 +26,24 @@ export const contactSchema = z.object({
export type Contact = z.infer<typeof contactSchema>;
// Timeline events: `stage` entries are auto-appended when an application moves; `note`
// entries are added manually from the detail panel.
export const activityEventSchema = z.object({
const timelineBaseSchema = z.object({
id: z.string().min(1),
type: z.enum(["stage", "note", "created"]),
text: z.string().trim().min(1),
at: z.coerce.date(),
});
export type ActivityEvent = z.infer<typeof activityEventSchema>;
export const applicationTimelineEntrySchema = z.discriminatedUnion("type", [
timelineBaseSchema.extend({
type: z.literal("stage"),
stage: applicationStatusSchema,
}),
timelineBaseSchema.extend({
type: z.literal("note"),
text: z.string().trim().min(1),
}),
]);
export type ApplicationTimelineEntry = z.infer<typeof applicationTimelineEntrySchema>;
export type ActivityEvent = ApplicationTimelineEntry;
// Reserved for AI enrichment output (autofill / match-score). Free-form so the shape can
// evolve without a migration. See the AI roadmap in the applications feature.