Skip to content

Architecture: Decouple tax engine & payment tender domain boundaries #282

Description

@khaira777

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

  1. 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).
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendBackend (Express/SQLite)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions