diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/AssignStory/AssignStoryCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/AssignStory/AssignStoryCommandHandler.cs index 3606f5d..bbb6839 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/AssignStory/AssignStoryCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/AssignStory/AssignStoryCommandHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -19,7 +20,7 @@ public sealed class AssignStoryCommandHandler( public async Task Handle(AssignStoryCommand request, CancellationToken cancellationToken) { - // Get the project with story + // Get the project with story (Global Query Filter ensures tenant isolation) var storyId = StoryId.From(request.StoryId); var project = await _projectRepository.GetProjectWithStoryAsync(storyId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/AssignTask/AssignTaskCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/AssignTask/AssignTaskCommandHandler.cs index 67ff0aa..1f54cf2 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/AssignTask/AssignTaskCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/AssignTask/AssignTaskCommandHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -20,7 +21,7 @@ public sealed class AssignTaskCommandHandler( public async Task Handle(AssignTaskCommand request, CancellationToken cancellationToken) { - // Get the project containing the task + // Get the project containing the task (Global Query Filter ensures tenant isolation) var taskId = TaskId.From(request.TaskId); var project = await _projectRepository.GetProjectWithTaskAsync(taskId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateEpic/CreateEpicCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateEpic/CreateEpicCommandHandler.cs index e5277df..b53a15d 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateEpic/CreateEpicCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateEpic/CreateEpicCommandHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -19,14 +20,14 @@ public sealed class CreateEpicCommandHandler( public async Task Handle(CreateEpicCommand request, CancellationToken cancellationToken) { - // Get the project + // Get the project (Global Query Filter ensures tenant isolation) var projectId = ProjectId.From(request.ProjectId); var project = await _projectRepository.GetByIdAsync(projectId, cancellationToken); if (project == null) throw new NotFoundException("Project", request.ProjectId); - // Create epic through aggregate root + // Create epic through aggregate root (Project passes its TenantId) var createdById = UserId.From(request.CreatedBy); var epic = project.CreateEpic(request.Name, request.Description, createdById); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateStory/CreateStoryCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateStory/CreateStoryCommandHandler.cs index 0ac7695..aa814c2 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateStory/CreateStoryCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateStory/CreateStoryCommandHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -19,7 +20,7 @@ public sealed class CreateStoryCommandHandler( public async Task Handle(CreateStoryCommand request, CancellationToken cancellationToken) { - // Get the project with epic + // Get the project with epic (Global Query Filter ensures tenant isolation) var epicId = EpicId.From(request.EpicId); var project = await _projectRepository.GetProjectWithEpicAsync(epicId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateTask/CreateTaskCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateTask/CreateTaskCommandHandler.cs index 561bdaa..7bbe88e 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateTask/CreateTaskCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/CreateTask/CreateTaskCommandHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -20,7 +21,7 @@ public sealed class CreateTaskCommandHandler( public async Task Handle(CreateTaskCommand request, CancellationToken cancellationToken) { - // Get the project containing the story + // Get the project containing the story (Global Query Filter ensures tenant isolation) var storyId = StoryId.From(request.StoryId); var project = await _projectRepository.GetProjectWithStoryAsync(storyId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/DeleteStory/DeleteStoryCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/DeleteStory/DeleteStoryCommandHandler.cs index 9928c1f..5e54f06 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/DeleteStory/DeleteStoryCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/DeleteStory/DeleteStoryCommandHandler.cs @@ -1,4 +1,5 @@ using MediatR; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -18,7 +19,7 @@ public sealed class DeleteStoryCommandHandler( public async Task Handle(DeleteStoryCommand request, CancellationToken cancellationToken) { - // Get the project with story + // Get the project with story (Global Query Filter ensures tenant isolation) var storyId = StoryId.From(request.StoryId); var project = await _projectRepository.GetProjectWithStoryAsync(storyId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/DeleteTask/DeleteTaskCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/DeleteTask/DeleteTaskCommandHandler.cs index c904449..6c2c146 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/DeleteTask/DeleteTaskCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/DeleteTask/DeleteTaskCommandHandler.cs @@ -1,4 +1,5 @@ using MediatR; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -19,7 +20,7 @@ public sealed class DeleteTaskCommandHandler( public async Task Handle(DeleteTaskCommand request, CancellationToken cancellationToken) { - // Get the project containing the task + // Get the project containing the task (Global Query Filter ensures tenant isolation) var taskId = TaskId.From(request.TaskId); var project = await _projectRepository.GetProjectWithTaskAsync(taskId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateEpic/UpdateEpicCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateEpic/UpdateEpicCommandHandler.cs index 5f318ad..0eada19 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateEpic/UpdateEpicCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateEpic/UpdateEpicCommandHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -19,7 +20,7 @@ public sealed class UpdateEpicCommandHandler( public async Task Handle(UpdateEpicCommand request, CancellationToken cancellationToken) { - // Get the project containing the epic + // Get the project containing the epic (Global Query Filter ensures tenant isolation) var epicId = EpicId.From(request.EpicId); var project = await _projectRepository.GetProjectWithEpicAsync(epicId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateStory/UpdateStoryCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateStory/UpdateStoryCommandHandler.cs index 5c7dcd9..0e8b967 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateStory/UpdateStoryCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateStory/UpdateStoryCommandHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -19,7 +20,7 @@ public sealed class UpdateStoryCommandHandler( public async Task Handle(UpdateStoryCommand request, CancellationToken cancellationToken) { - // Get the project with story + // Get the project with story (Global Query Filter ensures tenant isolation) var storyId = StoryId.From(request.StoryId); var project = await _projectRepository.GetProjectWithStoryAsync(storyId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateTask/UpdateTaskCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateTask/UpdateTaskCommandHandler.cs index 52116cc..16e6c74 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateTask/UpdateTaskCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateTask/UpdateTaskCommandHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -20,7 +21,7 @@ public sealed class UpdateTaskCommandHandler( public async Task Handle(UpdateTaskCommand request, CancellationToken cancellationToken) { - // Get the project containing the task + // Get the project containing the task (Global Query Filter ensures tenant isolation) var taskId = TaskId.From(request.TaskId); var project = await _projectRepository.GetProjectWithTaskAsync(taskId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateTaskStatus/UpdateTaskStatusCommandHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateTaskStatus/UpdateTaskStatusCommandHandler.cs index 61c71d7..b3287e0 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateTaskStatus/UpdateTaskStatusCommandHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Commands/UpdateTaskStatus/UpdateTaskStatusCommandHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -20,7 +21,7 @@ public sealed class UpdateTaskStatusCommandHandler( public async Task Handle(UpdateTaskStatusCommand request, CancellationToken cancellationToken) { - // Get the project containing the task + // Get the project containing the task (Global Query Filter ensures tenant isolation) var taskId = TaskId.From(request.TaskId); var project = await _projectRepository.GetProjectWithTaskAsync(taskId, cancellationToken); diff --git a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Queries/GetEpicById/GetEpicByIdQueryHandler.cs b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Queries/GetEpicById/GetEpicByIdQueryHandler.cs index 0be1cf9..aafa8e6 100644 --- a/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Queries/GetEpicById/GetEpicByIdQueryHandler.cs +++ b/colaflow-api/src/Modules/ProjectManagement/ColaFlow.Modules.ProjectManagement.Application/Queries/GetEpicById/GetEpicByIdQueryHandler.cs @@ -1,5 +1,6 @@ using MediatR; using ColaFlow.Modules.ProjectManagement.Application.DTOs; +using ColaFlow.Modules.ProjectManagement.Application.Common.Interfaces; using ColaFlow.Modules.ProjectManagement.Domain.Repositories; using ColaFlow.Modules.ProjectManagement.Domain.ValueObjects; using ColaFlow.Modules.ProjectManagement.Domain.Exceptions; @@ -9,13 +10,15 @@ namespace ColaFlow.Modules.ProjectManagement.Application.Queries.GetEpicById; /// /// Handler for GetEpicByIdQuery /// -public sealed class GetEpicByIdQueryHandler(IProjectRepository projectRepository) +public sealed class GetEpicByIdQueryHandler( + IProjectRepository projectRepository) : IRequestHandler { private readonly IProjectRepository _projectRepository = projectRepository ?? throw new ArgumentNullException(nameof(projectRepository)); public async Task Handle(GetEpicByIdQuery request, CancellationToken cancellationToken) { + // Get the project containing the epic (Global Query Filter ensures tenant isolation) var epicId = EpicId.From(request.EpicId); var project = await _projectRepository.GetProjectWithEpicAsync(epicId, cancellationToken);