Complete Task Flow¶
Records a TaskEntry to mark a task as completed. Tasks can be completed multiple times, with each completion recorded as a separate entry.
Components Involved¶
| Component | Role |
|---|---|
| web | User interface for task completion |
| android | NFC tag scanning for task completion |
| server | API endpoint and database operations |
User Flow (Web)¶
Immediate Completion¶
- User views task list on HomePage
- Clicks "Complete" button on a task
- Confirmation dialog appears
- User confirms completion
- Task entry created with current timestamp
- Task list refreshes showing updated completion time
Backdated Completion¶
- User clicks dropdown arrow next to "Complete" button
- Selects "Record past completion..."
- Datetime picker appears (max = current time)
- User selects a past datetime
- Clicks "Complete" to submit
- Task entry created with specified timestamp
- Task list refreshes
User Flow (Android)¶
NFC Tag Scan¶
- User holds phone near an NFC tag linked to a task
- App reads tag UUID from NDEF message (
isione://tag/{uuid}) - App looks up tag via
GET /beta/nfc-tags/{uuid} - App automatically creates task entry via
POST /entries - Success dialog with haptic feedback confirms completion
Unregistered Tag¶
If the tag isn't registered to a task:
- App shows "Tag Not Registered" prompt
- User taps "Register Tag"
- User selects pod, then task
- App registers tag via
POST /beta/pods/{podId}/nfc-tags - Task entry is recorded automatically
API Requests¶
Create Task Entry¶
Swagger: POST /beta/pods/{podId}/tasks/{taskId}/entries
POST /beta/pods/{podId}/tasks/{taskId}/entries
Authorization: Bearer {token}
Content-Type: application/json
{
"completedAt": "2024-01-15T10:30:00Z"
}
completedAt is optional. If omitted, server uses current timestamp.
Response:
{
"id": "550e8400-e29b-41d4-a716-446655440002",
"taskId": "550e8400-e29b-41d4-a716-446655440001",
"completedAt": "2024-01-15T10:30:00Z",
"createdAt": "2024-01-15T10:30:05Z"
}
Lookup NFC Tag¶
Used by Android to resolve a scanned tag UUID to its associated task.
Response (registered):
{
"id": "...",
"tagUuid": "019400f1-b1a2-7000-8000-000000000001",
"taskId": "550e8400-e29b-41d4-a716-446655440001",
"taskName": "Feed the cat",
"podId": "550e8400-e29b-41d4-a716-446655440000",
"podName": "My Household"
}
Response (unregistered): 404 Not Found
Register NFC Tag¶
Associates an unregistered tag with a task.
POST /beta/pods/{podId}/nfc-tags
Authorization: Bearer {token}
Content-Type: application/json
{
"tagUuid": "019400f1-b1a2-7000-8000-000000000001",
"taskId": "550e8400-e29b-41d4-a716-446655440001"
}
Response: Same as Lookup NFC Tag.
Sequence Diagrams¶
Web¶
┌──────┐ ┌──────┐ ┌────────┐
│ User │ │ Web │ │ Server │
└──┬───┘ └──┬───┘ └───┬────┘
│ Click Complete │ │
│─────────────────> │
│ │ │
│ Confirm dialog │ │
│<───────────────── │
│ │ │
│ Confirm │ │
│─────────────────> │
│ │ POST /entries │
│ │─────────────────>│
│ │ 201 Created │
│ │<─────────────────│
│ │ │
│ Updated list │ Refresh tasks │
│<───────────────── │
│ │ │
Android (NFC - Registered Tag)¶
┌──────┐ ┌─────────┐ ┌────────┐
│ User │ │ Android │ │ Server │
└──┬───┘ └────┬────┘ └───┬────┘
│ Scan NFC tag │ │
│──────────────────>│ │
│ │ GET /nfc-tags/{uuid}
│ │──────────────────>│
│ │ NfcTagInfo │
│ │<──────────────────│
│ │ │
│ │ POST /entries │
│ │──────────────────>│
│ │ 201 Created │
│ │<──────────────────│
│ │ │
│ Success + haptic │ │
│<──────────────────│ │
│ │ │
Android (NFC - Unregistered Tag)¶
┌──────┐ ┌─────────┐ ┌────────┐
│ User │ │ Android │ │ Server │
└──┬───┘ └────┬────┘ └───┬────┘
│ Scan NFC tag │ │
│──────────────────>│ │
│ │ GET /nfc-tags/{uuid}
│ │──────────────────>│
│ │ 404 │
│ │<──────────────────│
│ │ │
│ "Not Registered" │ │
│<──────────────────│ │
│ │ │
│ Tap "Register" │ │
│──────────────────>│ │
│ │ GET /pods │
│ │──────────────────>│
│ │ Pod list │
│ │<──────────────────│
│ │ │
│ Select pod/task │ │
│──────────────────>│ │
│ │ POST /nfc-tags │
│ │──────────────────>│
│ │ NfcTagInfo │
│ │<──────────────────│
│ │ │
│ │ POST /entries │
│ │──────────────────>│
│ │ 201 Created │
│ │<──────────────────│
│ │ │
│ Success + haptic │ │
│<──────────────────│ │
│ │ │
Completing a task affects its status calculation.