Update README with due date functionality documentation
Added due date field documentation to Todo model and included usage examples for creating todos with due dates and timezone handling.
This commit is contained in:
parent
2519513d99
commit
bd4441f91f
14
README.md
14
README.md
@ -108,9 +108,16 @@ Each todo has the following fields:
|
||||
- `completed`: Completion status (boolean, default: false)
|
||||
- `priority`: Priority level (low, medium, high, default: medium)
|
||||
- `category_id`: Reference to category (optional)
|
||||
- `project_id`: Reference to project (optional)
|
||||
- `due_date`: Due date and time with timezone (optional)
|
||||
- `parent_id`: Reference to parent todo for subtasks (optional)
|
||||
- `created_at`: Creation timestamp
|
||||
- `updated_at`: Last update timestamp
|
||||
|
||||
#### Due Date Features
|
||||
- `is_overdue`: Computed property indicating if todo is past due date
|
||||
- `days_until_due`: Computed property showing days until due (negative if overdue)
|
||||
|
||||
### Category Model
|
||||
Each category has the following fields:
|
||||
- `id`: Unique identifier (auto-generated)
|
||||
@ -136,6 +143,13 @@ curl -X POST "http://localhost:8000/api/v1/todos" \
|
||||
-d '{"title": "Review presentation", "description": "Review the quarterly presentation", "category_id": 1, "priority": "high"}'
|
||||
```
|
||||
|
||||
### Creating a Todo with Due Date
|
||||
```bash
|
||||
curl -X POST "http://localhost:8000/api/v1/todos" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"title": "Submit report", "description": "Submit quarterly report", "due_date": "2024-12-31T23:59:59Z", "priority": "high"}'
|
||||
```
|
||||
|
||||
### Filtering Todos by Category
|
||||
```bash
|
||||
curl "http://localhost:8000/api/v1/todos?category_id=1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user