# API Contracts - BuyerKiosk Live

This document defines the complete API contract between the BuyerKiosk Live Flutter app and the backend services. It serves as the authoritative reference for all HTTP endpoints, real-time messaging, and push notification integrations.

---

## Base Configuration

| Environment | Base URL | Status |
|-------------|----------|--------|
| Development | `https://try.buyerkiosk.com/api/` | Active |
| Production | `https://buyerkiosk.com/api/` | Production |

**Request Configuration:**
- Content-Type: `application/x-www-form-urlencoded`
- Method: All endpoints use `POST`
- Authentication: `APIKey` parameter in POST body
- Timeout: 30 seconds (configurable)

**Configuration File:** `lib/core/constants/api_constants.dart`

---

## Authentication

### Verify API Key

Validates an API key and returns user information, accessible stores, and linked employee records.

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/verify` |
| Purpose | Validate API key, retrieve user/store/employee info |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | The API key to verify |

**Success Response (200):**

```json
{
  "success": true,
  "user": {
    "id": 4,
    "username": "jsmith",
    "email": "john@example.com",
    "displayName": "John Smith",
    "firstName": "John",
    "lastName": "Smith",
    "title": "Store Manager",
    "locale": "en_US"
  },
  "stores": [
    {
      "typeNum": "pc00",
      "storeType": 1,
      "storeCity": "Dallas",
      "storeName": "Plato's Closet",
      "employee": {
        "employeeId": 35194463,
        "firstName": "John",
        "lastName": "Smith",
        "fullName": "John Smith",
        "role": 2,
        "active": true,
        "linkType": "manual",
        "linkedAt": "2025-12-01 20:02:22"
      }
    }
  ],
  "storeCount": 1
}
```

**Employee Role Codes:**

| Code | Role | Description |
|------|------|-------------|
| 1 | Owner | Full access including permission configuration |
| 2 | Manager | Management features, task list editing |
| 3 | Shift Lead | Performance, notes, and metrics access |
| 4 | Employee | Basic queue and task access |

**Store Type Codes:**

| Code | Brand |
|------|-------|
| 1 | Plato's Closet |
| 2 | Once Upon a Child |
| 3 | Style Encore |
| 4 | Clothes Mentor |
| 5 | Home Once More |
| 6 | Play It Again Sports |

**Error Responses:**

| Status | Error | Meaning |
|--------|-------|---------|
| 400 | `Invalid API key format` | Malformed key |
| 400 | `Missing APIKey parameter` | No key provided |
| 401 | `Invalid API key` | Key not recognized |
| 401 | `User account not found` | No user for key |
| 403 | `User account is disabled` | Account deactivated |
| 500 | `An internal error occurred` | Server error |

---

## Dashboard & Store Endpoints

### Get Dashboard (All Stores)

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/dashboard` |
| Purpose | Retrieve all stores with summary metrics |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |

**Response:** Array of store objects with queue counts and basic metrics.

---

### Get Store Page Details

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/storePage/:typeNum` |
| Purpose | Detailed metrics for a single store |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |

**Response:** Store details including sales metrics, labor data, and performance indicators.

---

## Queue Management

### Get Current Queue

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/currentQueue/:typeNum` |
| Purpose | Retrieve active buy queue items |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |

**Response:** Array of queue items with buyer info, wait times, and status.

---

### Get Completed Buys

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/completedBuys/:typeNum` |
| Purpose | Retrieve completed transactions |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |

**Response:** Array of completed buy records with totals and timestamps.

---

### Get Buyer Stats

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/buyerStats/:typeNum` |
| Purpose | Buyer performance statistics |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |

**Response:** Buyer performance metrics including averages and rankings.

---

## Workbook Notes

Notes are store announcements with support for reactions and comments.

### Get Notes (Paginated)

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/notes/:typeNum` |
| Purpose | Paginated notes feed for infinite scroll |

**Request Parameters:**

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `APIKey` | string | Yes | - | Your API key |
| `limit` | int | No | 10 | Items per page (1-50) |
| `offset` | int | No | 0 | Pagination offset |
| `includeManagerOnly` | string | No | "false" | Include manager-only notes |
| `employeeId` | int | No | null | For checking user reaction status |

**Response:**

```json
{
  "success": true,
  "data": [
    {
      "id": 42,
      "authorEmployeeId": 35235297,
      "authorName": "Kay Oss",
      "title": "Holiday Schedule",
      "content": "Submit availability by Friday",
      "startDate": "2025-11-15",
      "endDate": "2025-12-01",
      "isManagerOnly": false,
      "isPinned": true,
      "reactionCount": 4,
      "commentCount": 2,
      "userHasReacted": false,
      "reactionCounts": { "like": 3, "heart": 1 },
      "createdAt": "2025-11-18 18:49:56"
    }
  ],
  "hasMore": true,
  "offset": 0,
  "limit": 10
}
```

---

### Create Note (by Author Name)

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/notes/:typeNum/createByName` |
| Purpose | Create note with auto employee matching |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |
| `authorName` | string | Yes | Author's full name |
| `content` | string | Yes | Note content |
| `startDate` | string | Yes | Start date (Y-m-d) |
| `title` | string | No | Optional title |
| `endDate` | string | No | End date (null = indefinite) |
| `isManagerOnly` | bool | No | Restrict to managers |
| `isPinned` | bool | No | Pin to top |

**Response:**

```json
{
  "success": true,
  "noteId": 57,
  "matchedEmployee": true,
  "employeeId": 35194463
}
```

---

### Create Note (by Employee ID)

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/notes/:typeNum/create` |
| Purpose | Create note with explicit employee ID |

Same as above but uses `authorEmployeeId` instead of `authorName`.

---

### Update Note

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/notes/:typeNum/:noteId/update` |
| Purpose | Update note fields |

**Request Parameters:** Same as create (all optional except APIKey).

---

### Delete Note

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/notes/:typeNum/:noteId/delete` |
| Purpose | Soft delete a note |

---

### Add Reaction

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/notes/:typeNum/:noteId/react` |
| Purpose | Add like/heart reaction |

**Request Parameters:**

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `APIKey` | string | Yes | - | Your API key |
| `employeeId` | int | No | 0 | Employee ID (0 = anonymous) |
| `reactionType` | string | No | "like" | `"like"` or `"heart"` |

---

### Remove Reaction

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/notes/:typeNum/:noteId/unreact` |
| Purpose | Remove reaction from note |

---

### Add Comment

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/notes/:typeNum/:noteId/comment` |
| Purpose | Add comment to note |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |
| `comment` | string | Yes | Comment text (max 2000 chars) |
| `employeeId` | int | No | Employee ID |

---

### Get Comments

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/notes/:typeNum/:noteId/comments` |
| Purpose | Retrieve all comments for a note |

---

## Task Management (Definitions)

Task definitions define what tasks exist and when they appear.

### Get Tasks

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/tasks/:typeNum` |
| Purpose | Retrieve all task definitions |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |
| `groupId` | int | No | Filter by task group |

**Response:**

```json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "taskName": "Open All Registers",
      "comment": "Before store opens",
      "taskGroup": 1,
      "recurOn": "MON TUE WED THU FRI SAT",
      "priority": 1,
      "sortOrder": 0,
      "startDate": null,
      "endDate": null,
      "timeOfDay": "08:00:00",
      "groupName": "OPENING"
    }
  ]
}
```

**Priority Values:**

| Value | Name | Visual |
|-------|------|--------|
| 1 | High | Red indicator |
| 2 | Normal | Purple indicator |
| 3 | Low | Grey indicator |

**Recurrence Days:** Space-separated codes: `SUN MON TUE WED THU FRI SAT`

---

### Get Task Groups

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/tasks/:typeNum/groups` |
| Purpose | Retrieve task groups (OPENING, CLOSING, etc.) |

---

### Create Task

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/tasks/:typeNum/create` |
| Purpose | Create new task definition |

**Request Parameters:**

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `APIKey` | string | Yes | - | Your API key |
| `taskName` | string | Yes | - | Task name |
| `taskGroup` | int | Yes | - | Group ID |
| `comment` | string | No | "" | Description |
| `recurOn` | string | No | "SUN MON..." | Active days |
| `priority` | int | No | 2 | Priority level |
| `sortOrder` | int | No | 0 | Display order |
| `startDate` | string | No | null | Start date |
| `endDate` | string | No | null | End date |
| `timeOfDay` | string | No | null | Recommended time |

---

### Update Task

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/tasks/:typeNum/:taskId/update` |
| Purpose | Update task definition |

Only include fields to update; omitted fields remain unchanged.

---

### Delete Task

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/tasks/:typeNum/:taskId/delete` |
| Purpose | Permanently delete task |

---

### Create Task Group

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/tasks/:typeNum/groups/create` |
| Purpose | Create new task group |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |
| `groupName` | string | Yes | Group name |

---

### Update Task Group

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/tasks/:typeNum/groups/:groupId/update` |
| Purpose | Rename task group |

---

### Delete Task Group

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/tasks/:typeNum/groups/:groupId/delete` |
| Purpose | Delete task group |

**Request Parameters:**

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `APIKey` | string | Yes | - | Your API key |
| `deleteTasks` | bool | No | false | Also delete tasks in group |

---

## Daily Task Completion

Tracks which tasks have been completed today, by whom, and with what notes.

### Get Today's Task Lists

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/workbook/:typeNum/lists` |
| Purpose | Task lists with completion status |

**Response:**

```json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "groupId": 1,
      "displayName": "OPENING",
      "startTime": "08:00:00",
      "totalCount": 11,
      "completedCount": 5,
      "completionPercentage": 45,
      "tasks": [
        {
          "id": 1,
          "taskName": "Open All Registers",
          "status": 2,
          "completedBy": 35194463,
          "completedAt": "2025-12-01 08:15:32",
          "completionNotes": "All systems go",
          "completedByFirstName": "John",
          "completedByLastName": "Smith"
        }
      ]
    }
  ]
}
```

**Task Status Values:**

| Value | Status | Description |
|-------|--------|-------------|
| 0 | Not Started | Task not begun |
| 1 | In Progress | Work in progress |
| 2 | Completed | Task finished |
| null | Not Tracked | No completion record |

---

### Get Active Task List (with Carryover)

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/workbook/:typeNum/lists/active` |
| Purpose | Current list plus incomplete tasks from earlier |

**Response:**

```json
{
  "success": true,
  "activeList": { ... },
  "carryoverTasks": [
    {
      "id": 55,
      "taskName": "Check backstock",
      "status": 0,
      "carryoverFromList": "OPENING",
      "originalStartTime": "08:00:00"
    }
  ],
  "nextListTime": "17:00:00",
  "nextListName": "CLOSING"
}
```

---

### Update Task Status

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/workbook/:typeNum/tasks/:taskId/status` |
| Purpose | Mark task as complete/incomplete |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |
| `status` | int | Yes | 0, 1, or 2 |
| `employeeId` | int | No | Employee completing |
| `notes` | string | No | Completion notes |

---

### Add Task Comment

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/workbook/:typeNum/tasks/:taskId/comment` |
| Purpose | Add comment to task |

**Request Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `APIKey` | string | Yes | Your API key |
| `comment` | string | Yes | Comment text (max 1000 chars) |
| `employeeId` | int | No | Employee adding comment |

---

### Get Task Comments

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/workbook/:typeNum/tasks/:taskId/comments` |
| Purpose | Retrieve comments for a task |

**Request Parameters:**

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `APIKey` | string | Yes | - | Your API key |
| `date` | string | No | today | Date (Y-m-d) |

---

### Get Completed Tasks

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/workbook/:typeNum/completed` |
| Purpose | All completed tasks for a date |

---

## Today's Performance (KPIs)

### Get Today's Performance

| Property | Value |
|----------|-------|
| Endpoint | `POST /api/mobile/todayPerformance/:typeNum` |
| Purpose | Daily KPI metrics dashboard |

**Response:**

```json
{
  "success": true,
  "date": "2025-12-01",
  "storeId": "pc00",
  "sales": {
    "current": 1875.25,
    "formatted": "$1,875.25",
    "goal": 2500.00,
    "variance": -624.75,
    "comp": 1650.00,
    "status": "danger"
  },
  "avgTrans": {
    "current": 45.50,
    "formatted": "$45.50",
    "goal": 0,
    "comp": 42.00,
    "status": "neutral"
  },
  "tradePercent": {
    "current": 22.69,
    "formatted": "22.69%",
    "goal": 15,
    "status": "danger"
  },
  "salesLabor": {
    "transactions": 41,
    "laborHours": 5.58,
    "salesPerLaborHour": 336.02,
    "totalWages": 105.74
  },
  "backstock": {
    "pulled": 12,
    "added": 5,
    "recentActivity": [...]
  },
  "buys": {
    "count": 8,
    "compBuys": 425.00,
    "tradeTotal": 150.00,
    "percentTraded": 35.29
  }
}
```

**Status Values:**

| Status | Color | Meaning |
|--------|-------|---------|
| `good` | Green | Meeting/exceeding goal |
| `warning` | Yellow | Close to goal (90-99%) |
| `danger` | Red | Below goal (<90%) |
| `neutral` | Gray | No goal set |

---

## Real-time (Ably)

The app uses Ably for real-time updates. Events are published when data changes on the backend, triggering automatic UI refreshes.

### Channel Naming

| Channel Type | Format | Example |
|--------------|--------|---------|
| Store | `typeNum.toLowerCase()` | `pc00` |
| User | `user:{userId}` | `user:123` |

### Event Types

| Event | Constant | Trigger | Provider Refresh |
|-------|----------|---------|------------------|
| `workbook:task:complete` | Task completed | `todayTasksProvider` |
| `workbook:task:uncomplete` | Task unmarked | `todayTasksProvider` |
| `workbook:note:create` | Note created | `workbookNotesProvider` |
| `workbook:note:update` | Note updated | `workbookNotesProvider` |
| `workbook:note:delete` | Note deleted | `workbookNotesProvider` |
| `workbook:kpi:refresh` | KPI data changed | `todayPerformanceProvider` |
| `workbook:timepunch:clockin` | Employee clocked in | (future) |
| `workbook:timepunch:clockout` | Employee clocked out | (future) |
| `workbook:timepunch:breakstart` | Break started | (future) |
| `workbook:timepunch:breakend` | Break ended | (future) |
| `workbook:schedule:refresh` | Schedule changed | (future) |
| `workbook:whiteboard:save` | Whiteboard updated | (future) |

### Provider Refresh Mapping

When an Ably event is received, the app automatically refreshes the relevant data:

```
Event Type                    -> Provider Refreshed
---------------------------------------------------
task:complete/uncomplete      -> todayTasksProvider(typeNum)
note:create/update/delete     -> workbookNotesProvider(typeNum)
kpi:refresh                   -> todayPerformanceProvider(typeNum)
```

**Implementation:** `lib/presentation/providers/ably_provider.dart`

---

## Push Notifications

Push notifications are delivered via Firebase Cloud Messaging (FCM) through Ably. The backend publishes to Ably channels, which routes through FCM to devices.

### Notification Types

| Type | Constant | Description |
|------|----------|-------------|
| `note:comment` | Comment on user's note |
| `note:mention` | User mentioned in note |
| `note:reaction` | Reaction to user's note |
| `task:assigned` | Task assigned to user |
| `task:completed` | Assigned task completed |
| `task:reminder` | Task deadline approaching |
| `queue:new_buy` | New buy in queue |
| `queue:high_volume` | Queue volume alert |
| `schedule:reminder` | Shift reminder |
| `schedule:change` | Schedule changed |
| `kpi:alert` | KPI threshold alert |
| `kpi:daily_summary` | Daily KPI summary |

### Channel Structure

| Channel | Purpose | Format |
|---------|---------|--------|
| Store channel | Store-wide notifications | `pc00` |
| User channel | Direct user notifications | `user:123` |

### Backend Push Format

When sending push notifications from the backend:

```php
$channel->publish('notification', [
    'data' => [
        'type' => 'note:comment',
        'typeNum' => 'pc00',
        'noteId' => 123,
        'title' => 'New Comment',
        'body' => 'John commented on your note'
    ],
    'push' => [
        'notification' => [
            'title' => 'New Comment',
            'body' => 'John commented on your note'
        ],
        'data' => [
            'type' => 'note:comment',
            'typeNum' => 'pc00',
            'noteId' => '123'
        ]
    ]
]);
```

### Activation Flow

1. Event handlers set up in `main()` before `runApp()`
2. On dashboard load, `PushNotificationNotifier.activate()` called
3. Service initializes Ably Realtime client with push support
4. Device activation requested (`push.activate()`)
5. On success, subscribes to all user's store channels + user channel

**Implementation Files:**
- `lib/core/constants/push_notification_constants.dart`
- `lib/core/services/push_notification_service.dart`
- `lib/presentation/providers/push_notification_provider.dart`

---

## Error Handling

### HTTP Status Codes

| Code | Meaning | App Behavior |
|------|---------|--------------|
| 200 | Success | Process response |
| 201 | Created | Process response (create operations) |
| 400 | Bad Request | Show validation error |
| 401 | Unauthorized | Clear API key, redirect to install |
| 403 | Forbidden | Clear API key, redirect to install |
| 404 | Not Found | Show "not found" error |
| 500 | Server Error | Show error, enable retry |

### Retry Logic

The app automatically retries failed requests with exponential backoff:

| Setting | Value |
|---------|-------|
| Max Retries | 3 attempts |
| Initial Delay | 1 second |
| Backoff | Delay * (attempt + 1) |

**Retry Conditions:**
- Connection timeout
- Send timeout
- Receive timeout
- Connection error
- 5xx server errors

**Non-Retryable:**
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found

### Auth Error Caching

To prevent API spam on invalid keys, auth errors are cached:
- Cache duration: 30 seconds
- After cache expires, next request re-validates

**Implementation:** `lib/core/network/api_interceptors.dart`

---

## JSON Parsing Notes

The API may return numeric values as strings. Use custom JSON converters:

```dart
double _parseDouble(dynamic value) {
  if (value == null) return 0.0;
  if (value is num) return value.toDouble();
  if (value is String) return double.tryParse(value) ?? 0.0;
  return 0.0;
}

int _parseInt(dynamic value) {
  if (value == null) return 0;
  if (value is int) return value;
  if (value is String) return int.tryParse(value) ?? 0;
  return 0;
}
```

---

## Endpoint Quick Reference

### Authentication
| Endpoint | Purpose |
|----------|---------|
| `POST /api/mobile/verify` | Validate API key |

### Dashboard & Store
| Endpoint | Purpose |
|----------|---------|
| `POST /api/mobile/dashboard` | All stores with metrics |
| `POST /api/mobile/storePage/:typeNum` | Store details |

### Queue Management
| Endpoint | Purpose |
|----------|---------|
| `POST /api/mobile/currentQueue/:typeNum` | Current buy queue |
| `POST /api/mobile/completedBuys/:typeNum` | Completed transactions |
| `POST /api/mobile/buyerStats/:typeNum` | Buyer performance |

### Workbook Notes
| Endpoint | Purpose |
|----------|---------|
| `POST /api/mobile/notes/:typeNum` | Get notes (paginated) |
| `POST /api/mobile/notes/:typeNum/create` | Create note (employee ID) |
| `POST /api/mobile/notes/:typeNum/createByName` | Create note (author name) |
| `POST /api/mobile/notes/:typeNum/:noteId/update` | Update note |
| `POST /api/mobile/notes/:typeNum/:noteId/delete` | Delete note |
| `POST /api/mobile/notes/:typeNum/:noteId/react` | Add reaction |
| `POST /api/mobile/notes/:typeNum/:noteId/unreact` | Remove reaction |
| `POST /api/mobile/notes/:typeNum/:noteId/comment` | Add comment |
| `POST /api/mobile/notes/:typeNum/:noteId/comments` | Get comments |

### Task Management
| Endpoint | Purpose |
|----------|---------|
| `POST /api/mobile/tasks/:typeNum` | Get task definitions |
| `POST /api/mobile/tasks/:typeNum/groups` | Get task groups |
| `POST /api/mobile/tasks/:typeNum/create` | Create task |
| `POST /api/mobile/tasks/:typeNum/:taskId/update` | Update task |
| `POST /api/mobile/tasks/:typeNum/:taskId/delete` | Delete task |
| `POST /api/mobile/tasks/:typeNum/groups/create` | Create group |
| `POST /api/mobile/tasks/:typeNum/groups/:groupId/update` | Update group |
| `POST /api/mobile/tasks/:typeNum/groups/:groupId/delete` | Delete group |

### Daily Task Completion
| Endpoint | Purpose |
|----------|---------|
| `POST /api/mobile/workbook/:typeNum/lists` | Today's task lists |
| `POST /api/mobile/workbook/:typeNum/lists/active` | Active list + carryover |
| `POST /api/mobile/workbook/:typeNum/completed` | Completed tasks by date |
| `POST /api/mobile/workbook/:typeNum/tasks/:taskId/status` | Update status |
| `POST /api/mobile/workbook/:typeNum/tasks/:taskId/comment` | Add comment |
| `POST /api/mobile/workbook/:typeNum/tasks/:taskId/comments` | Get comments |

### Today's Performance
| Endpoint | Purpose |
|----------|---------|
| `POST /api/mobile/todayPerformance/:typeNum` | KPI metrics |

---

## Version History

| Version | Date | Changes |
|---------|------|---------|
| 1.0 | 2025-12-05 | Initial API contracts documentation |
