Skip to main content

Flows

1) Mobile auth + profile bootstrap

sequenceDiagram
participant U as Mobile User
participant API as /api/mobile/v1/auth
participant ACC as Account Module
U->>API: POST check-email/register/login
API->>ACC: validate + create/authenticate
ACC-->>U: token/session
U->>API: GET/PUT /profile/* (auth:sanctum)

2) Coupon claim/use flow

sequenceDiagram
participant M as Mobile App
participant C as Coupon API
participant DB as coupons/coupon_claims
M->>C: GET /coupon, GET /coupon/{id}
M->>C: POST /coupon/{id}/claim
C->>DB: persist claim + status
M->>C: POST /coupon/{id} (use)
C->>DB: update redemption state

3) Reservation flow (membership-gated)

flowchart LR
A[Authenticated member] --> B[/reservation POST]
B --> C{membership middleware}
C -->|pass| D[Create reservation]
D --> E[reserved_courses + reservations]
C -->|fail| F[Reject request]

4) Admin operational flow

  • Admin login (api/admin/v1/auth/login or dashboard login form)
  • Manage store/course/coupon/news/reservation
  • Broadcast push notification
  • Review member stats/history

Failure paths

  • Invalid token / missing sanctum auth => unauthorized.
  • OTP throttle (throttle:otp) saat request OTP berulang.
  • Chat routes bergantung middleware init-firestore; kegagalan init memblokir conversation path (verification required).