2.7 KiB
2.7 KiB
Task E.1: Quotation Stabilization Before Approval
1. Files Added
docs/adr/0007-quotation-revision-strategy.mddocs/adr/0008-attachment-storage-strategy.md
2. Files Modified
src/db/seeds/foundation.seed.tssrc/features/foundation/master-options/types.tssrc/features/crm/quotations/api/types.tssrc/features/crm/quotations/server/service.tssrc/features/crm/quotations/components/quotation-form-sheet.tsxsrc/features/crm/quotations/components/quotation-detail.tsxsrc/features/crm/enquiries/server/service.tsdocs/implementation/technical-debt.md
3. Options Seeded
crm_quotation_typecranedockdoorsolarcellserviceother
crm_discount_typefixedpercentage
crm_unitpcssetlotjob
crm_sent_viaemailmanualsystem
crm_quotation_customer_roleownerconsultantcontractorbilling
crm_quotation_topic_typescopeexclusionpayment
4. Revision Rule Confirmed
draft: cannot revisecancelled: cannot reviseaccepted: can reviserejected: can revisesent: can reviseapproved: can revise
Implementation notes:
- revision guard now runs in quotation server service before a new revision is created
- revision readiness is based on quotation status master-option code, not on UI-only conditions
- new revision rows attempt to start with
revisedstatus when that option exists
5. Approval Readiness
- quotation status seed now explicitly supports:
draftpending_approvalapprovedrejectedsentacceptedlostcancelledrevised
- quotation detail now exposes a placeholder
Submit for approvalaction fordraftandrevisedquotations - no approval table or approval workflow was added in Task E.1
6. Remaining Risks
- quotation summary still does not support mixed tax rollup from per-line tax strategies
- attachments are still metadata-only and not backed by upload/storage plumbing
- revision snapshot still excludes follow-ups and attachments
- CRM entity relationships still rely on organization-scoped validation instead of database foreign keys
- approval workflow is still pending and starts in Task F
7. Task F Readiness
- quotation forms now read status, quotation type, currency, discount type, unit, sent via, customer role, and topic type from master options instead of hardcoded UI choices where practical
- quotation revision eligibility is explicit and server-enforced
- approval-ready status vocabulary exists before approval workflow work begins
- ADR notes now capture the revision and attachment strategies so Task F can build on stable assumptions
8. Verification
npx tsc --noEmit