feat: refactor task priority handling to use ProjectTaskPriority across commands, DTOs, and repositories
This commit is contained in:
@@ -10,7 +10,7 @@ public record AddTaskToPhaseCommand(
|
||||
Guid PhaseId,
|
||||
string Name,
|
||||
string? Description = null,
|
||||
TaskPriority Priority = TaskPriority.Medium,
|
||||
ProjectTaskPriority Priority = ProjectTaskPriority.Medium,
|
||||
int OrderIndex = 0,
|
||||
DateTime? DueDate = null
|
||||
) : IBaseCommand;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace GozareshgirProgramManager.Application.Modules.Projects.Commands.Change
|
||||
public record ChangeTaskPriorityCommand(
|
||||
Guid Id,
|
||||
ProjectHierarchyLevel Level,
|
||||
TaskPriority Priority
|
||||
ProjectTaskPriority Priority
|
||||
) : IBaseCommand;
|
||||
|
||||
public class ChangeTaskPriorityCommandHandler : IBaseCommandHandler<ChangeTaskPriorityCommand>
|
||||
@@ -47,7 +47,7 @@ public class ChangeTaskPriorityCommandHandler : IBaseCommandHandler<ChangeTaskPr
|
||||
}
|
||||
|
||||
// Task-level priority update
|
||||
private async Task<OperationResult> HandleTaskLevelAsync(Guid taskId, TaskPriority priority, CancellationToken ct)
|
||||
private async Task<OperationResult> HandleTaskLevelAsync(Guid taskId, ProjectTaskPriority priority, CancellationToken ct)
|
||||
{
|
||||
var task = await _taskRepository.GetByIdAsync(taskId, ct);
|
||||
if (task is null)
|
||||
@@ -63,7 +63,7 @@ public class ChangeTaskPriorityCommandHandler : IBaseCommandHandler<ChangeTaskPr
|
||||
}
|
||||
|
||||
// Phase-level bulk priority update
|
||||
private async Task<OperationResult> HandlePhaseLevelAsync(Guid phaseId, TaskPriority priority, CancellationToken ct)
|
||||
private async Task<OperationResult> HandlePhaseLevelAsync(Guid phaseId, ProjectTaskPriority priority, CancellationToken ct)
|
||||
{
|
||||
var phase = await _phaseRepository.GetWithTasksAsync(phaseId);
|
||||
if (phase is null)
|
||||
@@ -83,7 +83,7 @@ public class ChangeTaskPriorityCommandHandler : IBaseCommandHandler<ChangeTaskPr
|
||||
}
|
||||
|
||||
// Project-level bulk priority update across all phases
|
||||
private async Task<OperationResult> HandleProjectLevelAsync(Guid projectId, TaskPriority priority, CancellationToken ct)
|
||||
private async Task<OperationResult> HandleProjectLevelAsync(Guid projectId, ProjectTaskPriority priority, CancellationToken ct)
|
||||
{
|
||||
var project = await _projectRepository.GetWithFullHierarchyAsync(projectId);
|
||||
if (project is null)
|
||||
|
||||
@@ -15,7 +15,7 @@ public class GetTaskDto
|
||||
// Task-specific fields
|
||||
public TimeSpan SpentTime { get; init; }
|
||||
public TimeSpan RemainingTime { get; init; }
|
||||
public TaskPriority Priority { get; set; }
|
||||
public ProjectTaskPriority Priority { get; set; }
|
||||
public List<GetTaskSectionDto> Sections { get; init; }
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ public class ProjectBoardListQueryHandler : IBaseQueryHandler<ProjectBoardListQu
|
||||
ProjectName = x.Task.Phase.Project.Name,
|
||||
TaskName = x.Task.Name,
|
||||
SectionStatus = x.Status,
|
||||
TaskPriority = x.Task.Priority,
|
||||
Progress = new ProjectProgressDto()
|
||||
{
|
||||
CompleteSecond = x.FinalEstimatedHours.TotalSeconds,
|
||||
|
||||
@@ -13,6 +13,7 @@ public class ProjectBoardListResponse
|
||||
public string? AssignedUser { get; set; }
|
||||
public string OriginalUser { get; set; }
|
||||
public string SkillName { get; set; }
|
||||
public ProjectTaskPriority TaskPriority { get; set; }
|
||||
|
||||
}
|
||||
public class ProjectProgressDto
|
||||
|
||||
Reference in New Issue
Block a user