Domain Decoupling & Refactoring Proposal
Extracted from fork codewithsharma/FloCafe (branch: modular-verticles):
Overview
Refactor monolithic routes into standalone domain boundaries for Tax calculations and Payment tender processing.
Proposed Changes
- Tax Engine & Route Boundary:
- Consolidate tax HTTP routes into
main/routes/tax.ts.
- Freeze tax snapshot contract and decouple tax calculation logic into
main/services/tax-engine.ts and main/services/tax.ts.
- Add snapshot contract test suite (
tests/tax-snapshot-contract.test.ts, tests/tax-boundary.test.ts).
- Payment Tender Boundary:
- Extract payment process, tender validation, and split payment logic into
main/services/payment-tender.ts.
- Isolate payment domain logic from restaurant-specific dining order assumptions.
- Reference:
tests/payment-boundary.test.ts, tests/payment-without-restaurant.test.ts.
Domain Decoupling & Refactoring Proposal
Extracted from fork
codewithsharma/FloCafe(branch:modular-verticles):Overview
Refactor monolithic routes into standalone domain boundaries for Tax calculations and Payment tender processing.
Proposed Changes
main/routes/tax.ts.main/services/tax-engine.tsandmain/services/tax.ts.tests/tax-snapshot-contract.test.ts,tests/tax-boundary.test.ts).main/services/payment-tender.ts.tests/payment-boundary.test.ts,tests/payment-without-restaurant.test.ts.