Created detailed implementation plans for Sprint 2 backend work: Story 1: Audit Log Foundation (Phase 1) - Task 1: Design AuditLog database schema and create migration - Task 2: Create AuditLog entity and Repository - Task 3: Implement EF Core SaveChangesInterceptor - Task 4: Write unit tests for audit logging - Task 5: Integrate with ProjectManagement Module Story 2: Audit Log Core Features (Phase 2) - Task 1: Implement Changed Fields Detection (JSON Diff) - Task 2: Integrate User Context Tracking - Task 3: Add Multi-Tenant Isolation - Task 4: Implement Audit Query API - Task 5: Write Integration Tests Story 3: Sprint Management Module - Task 1: Create Sprint Aggregate Root and Domain Events - Task 2: Implement Sprint Repository and EF Core Configuration - Task 3: Create CQRS Commands and Queries - Task 4: Implement Burndown Chart Calculation - Task 5: Add SignalR Real-Time Notifications - Task 6: Write Integration Tests Total: 3 Stories, 16 Tasks, 24 Story Points (8+8+8) Estimated Duration: 10-12 days All tasks include: - Detailed technical implementation guidance - Code examples and file paths - Testing requirements (>= 90% coverage) - Performance benchmarks (< 5ms audit overhead) - Multi-tenant security validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4.3 KiB
4.3 KiB
task_id, story, status, estimated_hours, created_date, assignee
| task_id | story | status | estimated_hours | created_date | assignee |
|---|---|---|---|---|---|
| sprint_2_story_1_task_5 | sprint_2_story_1 | not_started | 3 | 2025-11-05 | Backend Team |
Task 5: Integrate with ProjectManagement Module
Story: Story 1 - Audit Log Foundation (Phase 1) Estimated: 3 hours
Description
Integrate the audit logging infrastructure with the existing ProjectManagement Module to ensure all Epic/Story/Task operations are automatically audited.
Acceptance Criteria
- Audit logging works for Project CRUD operations
- Audit logging works for Epic CRUD operations
- Audit logging works for Story CRUD operations
- Audit logging works for Task CRUD operations
- Integration tests verify audit logs are created
- No performance degradation (< 5ms overhead)
Implementation Details
No Code Changes Required - The EF Core Interceptor automatically captures all changes!
Verification Steps:
- Run Integration Tests:
cd colaflow-api
dotnet test --filter "FullyQualifiedName~ProjectManagement.IntegrationTests"
- Verify Audit Logs Created:
- Create a Project → Check AuditLog table for "Create" entry
- Update an Epic → Check AuditLog table for "Update" entry
- Delete a Story → Check AuditLog table for "Delete" entry
- Performance Benchmark:
// Add to integration tests
[Fact]
public async Task CreateProject_ShouldHaveMinimalPerformanceOverhead()
{
// Measure time with audit logging enabled
var stopwatch = Stopwatch.StartNew();
await Mediator.Send(new CreateProjectCommand { /* ... */ });
stopwatch.Stop();
Assert.True(stopwatch.ElapsedMilliseconds < 100, "Project creation took too long");
}
Files to Update:
- Integration Test Verification:
colaflow-api/tests/ColaFlow.Application.IntegrationTests/ProjectManagement/AuditLogIntegrationTests.cs
public class AuditLogIntegrationTests : IntegrationTestBase
{
[Fact]
public async Task CreateProject_ShouldCreateAuditLog()
{
// Arrange
var command = new CreateProjectCommand
{
Name = "Test Project",
Key = "TEST",
Description = "Test Description"
};
// Act
var projectId = await Mediator.Send(command);
// Assert
var auditLogs = await Context.AuditLogs
.Where(a => a.EntityType == "Project" && a.EntityId == projectId)
.ToListAsync();
Assert.Single(auditLogs);
Assert.Equal(AuditAction.Create, auditLogs[0].Action);
Assert.Equal(TenantId, auditLogs[0].TenantId);
}
[Fact]
public async Task UpdateEpic_ShouldCreateAuditLog_WithOldAndNewValues()
{
// Create Epic first
var epicId = await CreateTestEpic();
// Update Epic
await Mediator.Send(new UpdateEpicCommand
{
EpicId = epicId,
Title = "Updated Title"
});
// Assert audit log created
var auditLogs = await Context.AuditLogs
.Where(a => a.EntityType == "Epic" && a.EntityId == epicId && a.Action == AuditAction.Update)
.ToListAsync();
Assert.Single(auditLogs);
Assert.NotNull(auditLogs[0].OldValues);
Assert.NotNull(auditLogs[0].NewValues);
}
[Fact]
public async Task DeleteTask_ShouldCreateAuditLog()
{
// Test delete operation audit logging
// ...
}
}
Technical Notes
- The SaveChangesInterceptor automatically captures all EF Core operations
- No changes to Command Handlers required
- Verify multi-tenant isolation works correctly
- Check audit logs in database after each operation
Testing
Integration Tests to Create:
- Project Create/Update/Delete audit logging
- Epic Create/Update/Delete audit logging
- Story Create/Update/Delete audit logging
- Task Create/Update/Delete audit logging
- Multi-tenant isolation verification
- Performance overhead verification (< 5ms)
Run Tests:
dotnet test --filter "FullyQualifiedName~AuditLogIntegration"
Definition of Done
- All 4 entity types (Project/Epic/Story/Task) are audited
- Integration tests verify audit logs are created
- Multi-tenant isolation verified
- Performance benchmark met (< 5ms overhead)
- Git commit created
Created: 2025-11-05 by Backend Agent