- Added 'onDelete' and 'onNotes' support to TaskItem. - Implemented hover actions (Delete and Notes icons) for tasks. - Added Notes Modal for editing task markdown content. - Simplified navigation animation to remove blank flash (single-phase slide-in). - Fixed syntax error in updateTask function. - Updated styles for modal and task actions.
2.6 KiB
2.6 KiB
| wave | depends_on | files_modified | autonomous | gap_closure | |||
|---|---|---|---|---|---|---|---|
| 1 |
|
true | true |
Plan 02-01: Implement Database Schema and API Endpoints
Objective
Implement the database schema and API endpoints required for task management functionality.
Tasks
-
Add Task model to Prisma schema
- Add a
Taskmodel toprisma/schema.prisma - Include fields:
id(UUID),title(String),description(String?),completed(Boolean),createdAt(DateTime),updatedAt(DateTime) - Add proper indexes and relations
- Add a
-
Create Task Creation API Endpoint
- Create POST
/api/tasksendpoint insrc/app/api/tasks/route.ts - Implement validation for required fields
- Save new task to database using Prisma
- Return created task with appropriate HTTP status
- Create POST
-
Create Task Retrieval API Endpoint
- Create GET
/api/tasksendpoint insrc/app/api/tasks/route.ts - Retrieve all tasks from database
- Return tasks with appropriate HTTP status
- Create GET
-
Create Task Update API Endpoint
- Create PUT
/api/tasks/:idendpoint insrc/app/api/tasks/route.ts - Implement validation for required fields
- Update existing task in database using Prisma
- Return updated task with appropriate HTTP status
- Create PUT
-
Create Task Deletion API Endpoint
- Create DELETE
/api/tasks/:idendpoint insrc/app/api/tasks/route.ts - Delete existing task from database using Prisma
- Return appropriate HTTP status
- Create DELETE
-
Create Task Completion Toggle API Endpoint
- Create PATCH
/api/tasks/:id/completeendpoint insrc/app/api/tasks/route.ts - Toggle the
completedstatus of a task - Return updated task with appropriate HTTP status
- Create PATCH
-
Create TaskItem Component
- Create
src/components/TaskItem.tsxcomponent - Display task title, description, and completion status
- Include edit and delete buttons
- Handle click events for toggling completion status
- Create
-
Define Task Model TypeScript
- Create
src/types/task.tswith proper TypeScript definitions - Define Task interface with all required fields
- Create
Verification Criteria
- Prisma schema includes Task model with all fields
- All API endpoints are implemented and accessible
- TaskItem component renders properly
- Task model TypeScript definitions are correct
- All endpoints return appropriate HTTP status codes
- Database operations work correctly
Must-Haves
- User can create tasks with title and description
- User can edit existing tasks
- User can delete tasks
- User can mark tasks as complete/incomplete