fix: Backend-authoritative cash change calculation #3

Merged
schwifty merged 1 commit from schwifty/cash-change-backend-authoritative into main 2026-03-24 00:41:24 +00:00
Contributor

Cash change amount now sourced from backend response instead of client-side calc. Backend accounts for balance applied, fees, tax. Added CashCompletionResult struct and ratingRequired error case.

Cash change amount now sourced from backend response instead of client-side calc. Backend accounts for balance applied, fees, tax. Added CashCompletionResult struct and ratingRequired error case.
schwifty added 1 commit 2026-03-23 18:35:04 +00:00
Instead of calculating change client-side (which doesn't account for
balance applied, fees, etc.), the app now uses the Change value returned
by the /tasks/complete.php endpoint after processing.

Changes:
- APIService.completeTask now returns CashCompletionResult with backend values
- Added CashCompletionResult struct (cashReceived, orderTotal, change, fees, routing)
- CashCollectionSheet shows confirmed backend change after completion
- Added ratingRequired error case to APIError enum
- Client-side estimate still shown as preview before confirmation
schwifty force-pushed schwifty/cash-change-backend-authoritative from 46e008b20b to 873cbba2aa 2026-03-24 00:41:16 +00:00 Compare
schwifty merged commit 88a3a9d6e0 into main 2026-03-24 00:41:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: payfrit/payfrit-works-ios#3
No description provided.