Financial Integrity & Refund Tracking Request
Extracted from fork codewithsharma/FloCafe (branch: develop):
Overview
Improvements to track refunds, ensure idempotency on financial transactions, handle cash refunds during shift/day close, and prevent math issues on partial refunds.
Proposed Changes
- Refunds Table & Idempotency Tracking:
- Add dedicated
refunds table and refund_idempotency table (Migration 72).
- Track
amount_cents, original_method, approved_by, and shift_id.
- Reference:
main/routes/refunds.ts, main/services/refund.ts.
- Partial Refund Over-Collection Fix:
- Fix calculation logic preventing over-collection or double refund balance mismatches on partial refunds.
- Reference: commit
fedbe4c.
- Cash Refund Integration into Day Close:
- Ensure cash refund subtractions are properly accounted for in expected cash counts during shift reconciliation and day close.
- Reference: commit
aaf8720.
- Fail-Closed DB Recovery Guard:
- Fail closed safely if the production SQLite database is missing or unreadable rather than generating a blank database in production mode.
- Reference: commit
e236542.
Financial Integrity & Refund Tracking Request
Extracted from fork
codewithsharma/FloCafe(branch:develop):Overview
Improvements to track refunds, ensure idempotency on financial transactions, handle cash refunds during shift/day close, and prevent math issues on partial refunds.
Proposed Changes
refundstable andrefund_idempotencytable (Migration 72).amount_cents,original_method,approved_by, andshift_id.main/routes/refunds.ts,main/services/refund.ts.fedbe4c.aaf8720.e236542.