task-d.6.1

This commit is contained in:
phaichayon
2026-07-01 10:29:00 +07:00
parent 6d6cd3a6df
commit 0a144f0f9e
14 changed files with 364 additions and 129 deletions

View File

@@ -125,3 +125,29 @@ Lead Source
* Edit/Detail ยังรองรับ status/lost reason ตาม business rule
* `npm run typecheck`
* `npm run build`
---
# Implementation Result - 2026-07-01
Status: Completed
Implemented:
- Simplified Create Lead UX by hiding `Lost Reason`, `Status`, and `Marketing Owner` from create mode while keeping them available in edit mode.
- Forced create default rules server-side so new leads always open with `new_job` status, `open` outcome, no lost reason, and `ownerMarketingUserId = current user`.
- Added persisted `leadChannel` support on `crm_leads` and exposed it in the UI as `Lead Source`.
- Reused the existing `crm_lead_channel` master-option foundation for the new Lead Source select field.
- Updated lead reference data, DTOs, server mapping, and detail view to carry and display `Lead Source`.
- Rebuilt the lead form around the repo's TanStack Form pattern with explicit create-vs-edit behavior.
Verification:
- `npm run typecheck` -> PASS
- `npm run build` -> PASS
- `npm run audit:pdf` -> PASS
Notes:
- Build still reports existing Turbopack warnings about workspace-root lockfile detection and broad file tracing in storage/template infrastructure. The task did not introduce a blocking build issue.
- Added migration file `drizzle/0001_lead_channel_and_status_default.sql` plus a journal entry for the new `lead_channel` column and removal of the old raw `status` default on `crm_leads`.
Implementation report:
- [task-d.6.1-lead-create-form-ux-default-rules-2026-07-01.md](/C:/Users/mtpphtaps/Documents/gitea/alla-allaos-fullstack/docs/implementation/task-d.6.1-lead-create-form-ux-default-rules-2026-07-01.md)