chore: mark US-006 complete in prd.json and update progress log

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Roberto Musso
2026-02-19 16:59:06 +01:00
parent fa1fd2b9f5
commit bdfaab85b6
2 changed files with 20 additions and 2 deletions

View File

@@ -104,8 +104,8 @@
"Typecheck passes"
],
"priority": 6,
"passes": false,
"notes": ""
"passes": true,
"notes": "Completed: projects.list (filters by clientId + includeArchived via drizzle and()), projects.listAll (id+name only), projects.get (returns null if not found), projects.create (UUID + status='active' + createdAt), projects.update (partial set object), projects.delete (nulls tasks.projectId then deletes project)"
},
{
"id": "US-007",

View File

@@ -51,6 +51,24 @@
- The `writingMode: 'vertical-rl'` + `transform: 'rotate(180deg)'` CSS pattern creates bottom-to-top text for vertical affordance labels
---
## 2026-02-19 - US-006
- What was implemented:
- Full `projectsRouter` replacing stubs in `src/main/router/index.ts`
- Added `and` to drizzle-orm imports
- `projects.list`: uses `and()` with optional conditions for `clientId` filter and archived filter (defaults to active only)
- `projects.listAll`: returns only `{ id, name }` columns for dropdown use
- `projects.get`: `.all()` then `result[0] ?? null` pattern for nullable single-record lookup
- `projects.create`: inserts with UUID, status='active', createdAt=Date.now()
- `projects.update`: partial set object — only sets defined fields
- `projects.delete`: nulls `tasks.projectId` for all tasks in the project, then deletes the project
- Files changed: `src/main/router/index.ts`, `prd.json`, `progress.txt`
- **Learnings for future iterations:**
- `and(...conditions)` from drizzle-orm accepts `(SQL | undefined)[]` — pass `undefined` for optional conditions and drizzle filters them out automatically
- For nullable single-record queries: use `.all()` and `result[0] ?? null` (strict mode forbids `.get()` direct null return without this pattern)
- `and()` returns `SQL<unknown> | undefined` which `.where()` accepts directly (no extra wrapping needed)
---
## 2026-02-19 - US-005
- What was implemented:
- Full clients tRPC router replacing stubs in `src/main/router/index.ts`