8018710d31
- USERNAME_FIELD = "phone_number" (was "email") — email is optional on this platform; most customers will be phone-only - Add REQUIRED_FIELDS = [] to make the intent explicit - Update create_superuser to accept phone_number as the identifier and pass it through to create_user as a keyword argument - All 35 backend tests pass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Backend Notes (MVP Readiness)
High-Level Takeaways
- Authentica OTP integration is implemented; Moyasar capture/refund are TODOs.
- External calls (OTP, notifications, payment gateway) run synchronously in request/response paths, increasing latency risk.
- Cross-app coupling (bookings ↔ notifications ↔ accounts/payments) will get harder to evolve without clearer service boundaries.
- Phone-first auth works, but
USERNAME_FIELDis email; align identifier strategy to avoid future auth confusion.
Near-Term Focus
- Hardening Authentica integration (timeouts, retries, async delivery) and aligning notification provider choices.
Authentica E2E Run the real Authentica OTP flow only when explicitly enabled.
Env vars (in backend/.env or shell):
AUTHENTICA_E2E=1AUTHENTICA_API_KEY=...AUTHENTICA_E2E_PHONE=...(must receive OTP)AUTHENTICA_E2E_CODE=...(required; no interactive prompt)
Command:
cd backend
PYTEST_ADDOPTS='' python3 -m pytest apps/accounts/tests -m external
Suggested flow:
- Trigger the E2E test to send the OTP, then set
AUTHENTICA_E2E_CODEand re-run if needed.
- Decide and document payment lifecycle scope (capture/refund supported vs explicitly out of scope).
- Add timeouts/logging for external calls or introduce minimal async jobs for OTP/notifications.
- Keep booking, payment, and notification orchestration in service layers, not views.