Wrapped all debug print() calls in APIService (avatar debugging),
BeaconScanner (scan/resolve logging), TaskDetailScreen (beacon state),
and AboutScreen (error logging) with IS_DEV checks so they are silent
in production builds. Preview-only prints in RatingDialog left as-is.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
When a worker completes a service point task and the API requires a
rating, a dialog now appears with 4 yes/no questions matching Android:
- Was the customer prepared?
- Was the scope clear?
- Was the customer respectful?
- Would you serve them again?
The rating is submitted with the task completion request via the
workerRating payload. Also handles rating_required during beacon
auto-complete by dismissing the countdown and showing the dialog.
Files changed:
- RatingDialog.swift (new) — rating dialog UI with toggle chips
- APIService.swift — added workerRating param + ratingRequired error
- TaskDetailScreen.swift — rating flow in completeTask + auto-complete
- project.pbxproj — added RatingDialog.swift to Xcode project
- Replace all .cfm endpoints with .php (PHP backend migration)
- Update debug strings and test walkthrough documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add cancelOrder parameter to completeTask API method
- Add Cancel Order button below Collect Cash in task detail
- Show confirmation alert before canceling
- On confirm, call complete endpoint with CancelOrder: true
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add profile endpoints (getProfile/updateProfile) to APIService
- Fix beacon dwell time: 5 → 30 samples to match Android (~3s)
- Make chat WebSocket dev-aware (uses IS_DEV flag)
- Add activeTaskCount field to Employment model
- Fix categoryName: remove incorrect fallback to taskTypeName
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add global IS_DEV flag controlling API endpoint (dev vs biz.payfrit.com),
dev ribbon banner, and magic OTP hints
- Add diagonal orange DEV ribbon overlay (Widgets/DevRibbon.swift)
- Replace app icon with properly centered dark-outline SVG on white background
- Fix display name with InfoPlist.strings localization
- Redesign business selection cards with initial letter, status pill, task count
- Make businesses only tappable when pending tasks > 0 (dimmed otherwise)
- Simplify LoginScreen and RootView to use IS_DEV directly
- Fix hardcoded dev URLs to respect IS_DEV flag
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>