2.4 KiB
2.4 KiB
PLAN - Task Milestone Tagging
Tag tasks with their specific project milestone to track alignment and timelines.
Proposed Changes
Database Layer
[NEW] 2026_05_25_164000_add_milestone_id_to_tasks_table.php
- Create a new migration to add nullable
milestone_idtotasksreferencingproject_milestones(id)withnullOnDelete().
Backend Models & Relations
[MODIFY] Task.php
- Add
milestone_idto fillable attributes list. - Define
milestone(): BelongsTorelationship pointing toProjectMilestone.
[MODIFY] ProjectMilestone.php
- Define
tasks(): HasManyrelationship pointing toTask.
Backend Controllers
[MODIFY] TaskController.php
- index: Load
'milestones'on$projectand'milestone'on project tasks. - store: Validate and resolve optional
milestone_id(viaProjectMilestone::resolveUlidToId) before task creation. - update: Validate and resolve optional
milestone_idon task update.
Frontend Components
[MODIFY] Index.tsx
- Add
milestone_idtotaskFormstate. - Render milestone dropdown in the "Add Task" dialog.
- Display milestone badge under the task name in table view.
- Display milestone in Task Details Dialog grid.
[MODIFY] KanbanBoard.tsx
- Render milestone badge on the kanban card.
[MODIFY] Show.tsx
- Add
milestone_idtotaskFormstate. - Render milestone dropdown in "Add Task" modal.
- Display milestone badge under task name in table.
Verification Plan
Automated Tests
- Run migration:
php artisan migrate - Verify tests in TaskManagement.
Manual Verification
- Access
/tasks?project=<ulid>. - Add a new task, select a milestone, and verify the badge appears on the board, in details, and table list.