Files
alla-allaos-fullstack/docs/implementation/task-d2-billing-customer-project-parties.md
phaichayon 5be6c54272 taks-d.2.1
2026-06-17 14:46:52 +07:00

1.9 KiB

Task D.2 Billing Customer + Project Parties

Scope delivered

  • Kept the main CRM field named Billing Customer on enquiry and quotation forms/detail pages.
  • Added a separate Project Parties model for enquiries and aligned quotation related customers to the same business concept.
  • Added remark support on quotation project parties and introduced enquiry project-party persistence.
  • Switched role sourcing to the shared master-option category crm_project_party_role.
  • Added compatibility mapping so legacy quotation roles such as owner and billing still render correctly.

Data model

  • Added crm_enquiry_customers for enquiry project parties.
  • Added remark column to crm_quotation_customers.
  • Generated migration drizzle/0010_calm_wendell_rand.sql.

Server behavior

  • Enquiry create/update now sync Project Parties transactionally.
  • Quotation create/update now sync Project Parties transactionally.
  • Billing customer is auto-added as a billing_customer project party during sync.
  • Duplicate customerId + roleCode combinations are de-duplicated during main form sync and rejected in quotation detail CRUD.
  • Quotation project-party reads normalize legacy role codes to current shared role options.

UI changes

  • Enquiry form now has Billing Customer plus a Project Parties editor.
  • Enquiry detail now shows Billing Customer and Project Parties separately.
  • Quotation form now has Billing Customer plus a Project Parties editor.
  • Quotation detail overview separates Billing Customer and Project Parties.
  • Quotation customer tab is relabeled to Project Parties, shows role clearly, and supports remark editing.

Verification

  • npx tsc --noEmit passes.
  • npm run lint still fails because of pre-existing repo issues outside this task, including:
    • src/components/ui/input-group.tsx
    • src/features/chat/components/message-composer.tsx
    • src/components/forms/demo-form.tsx