feat(08-01): add status column to threadCandidates and wire through backend

- Schema: status TEXT NOT NULL DEFAULT 'researching' on thread_candidates
- Zod: candidateStatusSchema enum (researching/ordered/arrived) added to createCandidateSchema
- Service: getThreadWithCandidates selects status, createCandidate sets status, updateCandidate accepts status
- Client hooks: CandidateWithCategory and CandidateResponse types include status field
- Migration generated and applied

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 14:09:18 +01:00
parent 9342085dd1
commit ca1c2a2e57
8 changed files with 512 additions and 19 deletions

View File

@@ -36,6 +36,9 @@ export const updateThreadSchema = z.object({
categoryId: z.number().int().positive().optional(),
});
// Candidate status
export const candidateStatusSchema = z.enum(["researching", "ordered", "arrived"]);
// Candidate schemas (same fields as items)
export const createCandidateSchema = z.object({
name: z.string().min(1, "Name is required"),
@@ -45,6 +48,7 @@ export const createCandidateSchema = z.object({
notes: z.string().optional(),
productUrl: z.string().url().optional().or(z.literal("")),
imageFilename: z.string().optional(),
status: candidateStatusSchema.optional(),
});
export const updateCandidateSchema = createCandidateSchema.partial();