Files
ColaFlow/docs/plans/sprint_4_story_0_task_3.md
Yaojia Wang b3c92042ed docs(backend): Add Sprint 4 backend API verification and optional enhancement story
Backend APIs are 100% ready for Sprint 4 frontend implementation. Created comprehensive verification report and optional enhancement story for advanced UX fields.

Changes:
- Created backend_api_verification.md (detailed API analysis)
- Created Story 0: Backend API Enhancements (optional P2)
- Created 6 tasks for Story 0 implementation
- Updated Sprint 4 to include backend verification status
- Verified Story/Task CRUD APIs are complete
- Documented missing optional fields (AcceptanceCriteria, Tags, StoryPoints, Order)
- Provided workarounds for Sprint 4 MVP

Backend Status:
- Story API: 100% complete (8 endpoints)
- Task API: 100% complete (9 endpoints)
- Security: Multi-tenant isolation verified
- Missing optional fields: Can be deferred to future sprint

Frontend can proceed with P0/P1 Stories without blockers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 21:45:09 +01:00

1.9 KiB

task_id, story_id, sprint_id, status, type, assignee, created_date, completion_date
task_id story_id sprint_id status type assignee created_date completion_date
task_3 story_0 sprint_4 not_started backend backend 2025-11-05 null

Task 3: Add Order Field to Task Entity

What to do

Add an Order field to the WorkTask entity to support manual task reordering via drag-and-drop in the frontend.

Files to modify

  • colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Domain/Aggregates/ProjectAggregate/WorkTask.cs
  • colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Infrastructure/Persistence/Configurations/WorkTaskConfiguration.cs

Implementation

WorkTask.cs Changes

Add property:

public int Order { get; private set; }

Update Create method to set default Order:

public static WorkTask Create(TenantId tenantId, string title, string description, StoryId storyId, TaskPriority priority, UserId createdBy)
{
    // Existing validation...

    return new WorkTask
    {
        // Existing fields...
        Order = 0, // Default order
        // ...
    };
}

Add method:

public void UpdateOrder(int newOrder)
{
    if (newOrder < 0)
        throw new DomainException("Task order cannot be negative");

    Order = newOrder;
    UpdatedAt = DateTime.UtcNow;
}

WorkTaskConfiguration.cs Changes

Add column configuration and index:

builder.Property(t => t.Order)
    .IsRequired()
    .HasDefaultValue(0);

builder.HasIndex(t => new { t.StoryId, t.Order })
    .HasDatabaseName("IX_Tasks_StoryId_Order");

Acceptance

  • WorkTask entity has Order property (int, default 0)
  • Create method sets default Order to 0
  • UpdateOrder method validates non-negative
  • EF Core configuration includes Order column
  • Composite index created (StoryId, Order)
  • Code compiles successfully
  • Validation tests written
  • Tests passing