# v6 Implementation Notes

## Design rule
The old PHP system is a reference for behavior. Laravel must centralize financial logic in services, not controllers.

## Critical services
- PricingEngine: calculates delivery, overweight, COD fee, tax, plus/without collection amount.
- ShipmentCreatorService: creates shipment + financial row + initial status history.
- ShipmentStatusService: validates status transitions and logs history.
- CodSettlementEngine: previews customer settlement and prevents duplicate shipment settlement.
- CashLedgerService: records money movement and reversal entries.

## Accounting lock rules
- No hard delete for financial rows.
- Reversal entry instead of deletion.
- Settlement cannot be cancelled after paid unless a reversal workflow is created.
- Shipment cannot enter two active COD settlements.

## Known unresolved business decisions
- Status 301 meaning: Lost or Defect.
- Tax rate and whether weight above 35kg is exempt.
- Final XLSX column order for each customer template.
