feat(workspace): unified application checklist (Phase 5 milestone 2)
Evolve the existing readiness workflow into one persisted, user-controlled checklist rather than adding a second tracker. ApplicationChecklistItem records only completion state and user intent. Each default system item carries a stable SystemKey and an AutoSignal — the same signal /readiness already computed — and re-syncs on every read: a satisfied signal auto-completes the item, a reverted signal reopens it, and a manual tick always wins. Users can add, reorder, dismiss and delete. Readiness is refactored into a projection of the checklist (score = completion percentage, completed/missing = live items by status). Its DTO shape and the workflowSignal/reminders health view are unchanged, so no API contract breaks. The workspace's next recommended action now comes from the first pending checklist item in category priority order (preparation, submission, follow-up, interview, custom), replacing the parallel ruleset — so the overview can never recommend something already ticked off, and a user's own task can be next. The table follows the established MariaDB-safe path: the scaffolded migration is a no-op and the idempotent reconciler owns the DDL for both providers. Verified on MariaDB 11 — auto_increment PK, varchar/datetime(6)/tinyint(1) columns, both indexes inside the key limit, cascade delete, unique system key per application, and NULL system keys not colliding for custom items. 329 backend tests, 94 frontend tests, type check, production build and both Docker builds pass locally. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -35,8 +35,38 @@ export type WorkspaceOverview = {
|
||||
lastAiAtUtc: string | null;
|
||||
recentActivity: WorkspaceActivity[];
|
||||
nextStep: WorkspaceNextStep | null;
|
||||
checklistProgress: ChecklistProgress | null;
|
||||
};
|
||||
|
||||
// Milestone 2 — the application checklist. One workflow surface: system items seed from the same
|
||||
// readiness signals the backend already computed, and the user owns everything after that.
|
||||
export type ChecklistStatus = "pending" | "done" | "dismissed";
|
||||
|
||||
export type ChecklistItem = {
|
||||
id: number;
|
||||
systemKey: string | null;
|
||||
title: string;
|
||||
description: string | null;
|
||||
category: string;
|
||||
status: ChecklistStatus;
|
||||
section: string | null;
|
||||
sortOrder: number;
|
||||
isSystemGenerated: boolean;
|
||||
isAutoCompleted: boolean;
|
||||
completedAt: string | null;
|
||||
};
|
||||
|
||||
export type ChecklistProgress = { total: number; completed: number; dismissed: number; percent: number };
|
||||
export type Checklist = { items: ChecklistItem[]; progress: ChecklistProgress };
|
||||
|
||||
export const CHECKLIST_CATEGORIES: { key: string; label: string }[] = [
|
||||
{ key: "preparation", label: "Before applying" },
|
||||
{ key: "submission", label: "Submitting" },
|
||||
{ key: "follow-up", label: "Follow-up" },
|
||||
{ key: "interview", label: "Interview" },
|
||||
{ key: "custom", label: "Your own tasks" },
|
||||
];
|
||||
|
||||
// Workspace navigation. Sections map to the Phase 5 milestones; each is added as its milestone lands
|
||||
// so the workspace is always usable rather than a shell of placeholders.
|
||||
export type WorkspaceSectionKey =
|
||||
@@ -48,7 +78,7 @@ export const WORKSPACE_SECTIONS: { key: WorkspaceSectionKey; label: string; mile
|
||||
{ key: "job-details", label: "Job Details" },
|
||||
{ key: "analysis", label: "Analysis" },
|
||||
{ key: "match", label: "Match" },
|
||||
{ key: "checklist", label: "Checklist", milestone: 2 },
|
||||
{ key: "checklist", label: "Checklist" },
|
||||
{ key: "cv", label: "CV", milestone: 6 },
|
||||
{ key: "cover-letter", label: "Cover Letter", milestone: 7 },
|
||||
{ key: "portfolio", label: "Portfolio", milestone: 8 },
|
||||
@@ -63,3 +93,16 @@ export const applicationWorkspaceApi = {
|
||||
overview: (jobId: number) =>
|
||||
api.get<WorkspaceOverview>(`/jobapplications/${jobId}/workspace`).then((r) => r.data),
|
||||
};
|
||||
|
||||
export const applicationChecklistApi = {
|
||||
get: (jobId: number) =>
|
||||
api.get<Checklist>(`/jobapplications/${jobId}/checklist`).then((r) => r.data),
|
||||
add: (jobId: number, title: string, description?: string, category?: string) =>
|
||||
api.post<ChecklistItem>(`/jobapplications/${jobId}/checklist`, { title, description, category }).then((r) => r.data),
|
||||
update: (jobId: number, itemId: number, patch: Partial<Pick<ChecklistItem, "title" | "description" | "category" | "status">>) =>
|
||||
api.patch<ChecklistItem>(`/jobapplications/${jobId}/checklist/${itemId}`, patch).then((r) => r.data),
|
||||
remove: (jobId: number, itemId: number) =>
|
||||
api.delete(`/jobapplications/${jobId}/checklist/${itemId}`).then(() => undefined),
|
||||
reorder: (jobId: number, orderedIds: number[]) =>
|
||||
api.put<Checklist>(`/jobapplications/${jobId}/checklist/order`, orderedIds).then((r) => r.data),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user