feat: add optional date field to schedule alarms on specific dates
Add YYYY-MM-DD date parameter to /set endpoint. When provided, the alarm fires at the exact date instead of the next occurrence of hour:minute. - AlarmEntity: add nullable date column - AlarmDatabase: bump to version 2, add migration 1→2 - AppModule: register migration - KtorService: parse date, validate it's not in the past - MainViewModel: accept optional date in createAlarm() - README: document new date parameter
This commit is contained in:
parent
5793af5772
commit
c78cb8a77d
6 changed files with 69 additions and 9 deletions
|
|
@ -31,6 +31,14 @@ Response: `201 Created`
|
|||
|
||||
`hour` must be 0-23, `minute` must be 0-59. `label` is optional (defaults to empty).
|
||||
|
||||
To set an alarm for a specific future date, add an optional `date` field in `YYYY-MM-DD` format. Without `date`, the alarm fires at the next occurrence of the given time (today or tomorrow).
|
||||
|
||||
```bash
|
||||
curl -X POST http://PHONE_IP:8080/set \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"hour": 8, "minute": 0, "label": "Vacation start", "date": "2026-10-08"}'
|
||||
```
|
||||
|
||||
### Remove an alarm
|
||||
|
||||
```bash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue