# Live App ↔ Backend — API Coordination

Requests from the BuyerKiosk Live (owner/manager) app go here. Backend updates the
"Backend Response" sections. See CLAUDE.md → "Inter-Agent Communication".

---

## Completed / Outgoing Backend Updates

### [2026-06-12] New push notification type: `overtime`
**Type**: `new-endpoint` (push payload)
**Affects**: Approaching-overtime alerts (manager/owner visibility)

#### Summary
The backend now sends a push notification to Live-app users when an employee
**escalates** into an overtime tier for the current work week (ok→approaching,
approaching→breach, or ok→breach). One **digest** push is sent per run summarizing
all employees who escalated, so managers get at most one ping per evaluation cycle
(hourly job, deduped via `scheduleOvertimeAlerts`). Push only — no SMS.

Recipients are resolved by the presence of a Live-app device token
(`userDeviceTokens.appId = 'live'`), so only owners/managers receive it.

#### Payload
FCM message `data`:
```
{
  "type": "overtime",                                  // notificationType
  "title": "Overtime alert" | "Approaching overtime",  // title (breach present → "Overtime alert")
  "body":  "<digest text>",                            // e.g. "Dave is projected to 44.0h this week — over the 40h overtime threshold."
  "typeNum": "ou21271",
  "weekStart": "2026-06-15",                           // Y-m-d, store-local week start
  "count": "2",                                         // number of escalated employees
  "target_route": "/schedule/timesheets",
  "deep_link": "buyerkiosklive://schedule/{typeNum}/timesheets"
}
```

#### Mobile Action Required
- [ ] Handle `type == "overtime"`: on tap, route to the timesheet/schedule view
      for `typeNum` (use `target_route` / `deep_link`).
- [ ] No special UI needed beyond the standard notification; `title`/`body` are
      display-ready.

Backend source: `OvertimeAlertService` + `OvertimeAlertJob`
(`scheduling:overtime-alerts`, per-store, hourly).
