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>
This commit is contained in:
Yaojia Wang
2025-11-05 21:45:09 +01:00
parent 8ce89c11e9
commit b3c92042ed
8 changed files with 1758 additions and 0 deletions

View File

@@ -0,0 +1,94 @@
---
task_id: task_1
story_id: story_0
sprint_id: sprint_4
status: not_started
type: backend
assignee: backend
created_date: 2025-11-05
completion_date: null
---
# Task 1: Add AcceptanceCriteria and Tags Fields to Story Entity
## What to do
Update the Story domain entity to include AcceptanceCriteria and Tags fields. These fields will be stored as JSON arrays in the database and exposed through the API.
**AcceptanceCriteria**: A list of testable criteria that define when a Story is complete.
**Tags**: A list of labels/categories for organizing and filtering Stories.
## Files to modify
- `colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Domain/Aggregates/ProjectAggregate/Story.cs`
- `colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Infrastructure/Persistence/Configurations/StoryConfiguration.cs`
## Implementation
### Story.cs Changes
Add properties:
```csharp
public List<string> AcceptanceCriteria { get; private set; } = new();
public List<string> Tags { get; private set; } = new();
```
Add methods:
```csharp
public void UpdateAcceptanceCriteria(List<string> criteria)
{
if (criteria != null && criteria.Count > 20)
throw new DomainException("Cannot have more than 20 acceptance criteria");
if (criteria != null && criteria.Any(c => c.Length > 500))
throw new DomainException("Each acceptance criterion cannot exceed 500 characters");
AcceptanceCriteria = criteria ?? new List<string>();
UpdatedAt = DateTime.UtcNow;
}
public void UpdateTags(List<string> tags)
{
if (tags != null && tags.Count > 10)
throw new DomainException("Cannot have more than 10 tags");
if (tags != null && tags.Any(t => t.Length > 50))
throw new DomainException("Each tag cannot exceed 50 characters");
if (tags != null && tags.Any(t => !Regex.IsMatch(t, @"^[a-zA-Z0-9_-]+$")))
throw new DomainException("Tags can only contain alphanumeric characters, hyphens, and underscores");
Tags = tags ?? new List<string>();
UpdatedAt = DateTime.UtcNow;
}
```
### StoryConfiguration.cs Changes
Add JSON column configuration:
```csharp
builder.Property(s => s.AcceptanceCriteria)
.HasColumnType("nvarchar(max)")
.HasConversion(
v => JsonSerializer.Serialize(v, (JsonSerializerOptions)null),
v => JsonSerializer.Deserialize<List<string>>(v, (JsonSerializerOptions)null) ?? new List<string>())
.IsRequired(false);
builder.Property(s => s.Tags)
.HasColumnType("nvarchar(max)")
.HasConversion(
v => JsonSerializer.Serialize(v, (JsonSerializerOptions)null),
v => JsonSerializer.Deserialize<List<string>>(v, (JsonSerializerOptions)null) ?? new List<string>())
.IsRequired(false);
```
## Acceptance
- [ ] Story entity has AcceptanceCriteria property
- [ ] Story entity has Tags property
- [ ] UpdateAcceptanceCriteria method validates input
- [ ] UpdateTags method validates input
- [ ] EF Core configuration serializes to JSON
- [ ] Code compiles successfully
- [ ] Domain validation tests written
- [ ] Tests passing