add: enhance ProjectBoardListQueryHandler and ProjectPhase to manage task section statuses and deployment states
This commit is contained in:
@@ -23,7 +23,7 @@ public class ProjectBoardListQueryHandler : IBaseQueryHandler<ProjectBoardListQu
|
||||
{
|
||||
var currentUserId = _authHelper.GetCurrentUserId();
|
||||
var queryable = _programManagerDbContext.TaskSections.AsNoTracking()
|
||||
.Where(x => x.InitialEstimatedHours > TimeSpan.Zero)
|
||||
.Where(x => x.InitialEstimatedHours > TimeSpan.Zero && x.Status != TaskSectionStatus.Completed)
|
||||
.Include(x => x.Task)
|
||||
.ThenInclude(x => x.Phase)
|
||||
.ThenInclude(x => x.Project)
|
||||
|
||||
@@ -23,6 +23,7 @@ public class ProjectPhase : ProjectHierarchyNode
|
||||
ProjectId = projectId;
|
||||
_tasks = new List<ProjectTask>();
|
||||
_phaseSections = new List<PhaseSection>();
|
||||
DeployStatus = ProjectDeployStatus.NoTCompleted;
|
||||
AddDomainEvent(new PhaseCreatedEvent(Id, projectId, name));
|
||||
}
|
||||
|
||||
@@ -36,6 +37,8 @@ public class ProjectPhase : ProjectHierarchyNode
|
||||
public DateTime? StartDate { get; private set; }
|
||||
public DateTime? EndDate { get; private set; }
|
||||
public int OrderIndex { get; private set; }
|
||||
public bool IsArchived { get; set; }
|
||||
public ProjectDeployStatus DeployStatus { get; set; }
|
||||
|
||||
#region Task Management
|
||||
|
||||
@@ -196,4 +199,26 @@ public class ProjectPhase : ProjectHierarchyNode
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void SetArchived()
|
||||
{
|
||||
IsArchived = true;
|
||||
}
|
||||
public void SetUnarchived()
|
||||
{
|
||||
IsArchived = false;
|
||||
}
|
||||
public void UpdateDeployStatus(ProjectDeployStatus status)
|
||||
{
|
||||
DeployStatus = status;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ProjectDeployStatus
|
||||
{
|
||||
NoTCompleted,
|
||||
PendingDevDeploy,
|
||||
DevDeployed,
|
||||
PendingDeploy,
|
||||
Deployed
|
||||
}
|
||||
|
||||
@@ -6,5 +6,6 @@ public enum TaskSectionStatus
|
||||
ReadyToStart = 1, // آماده شروع
|
||||
InProgress = 2, // درحال انجام
|
||||
Incomplete = 3, // ناتمام شده
|
||||
Completed = 4 // تکمیل شده
|
||||
PendingForCompletion = 5, // در انتظار تکمیل
|
||||
Completed = 5 // تکمیل شده
|
||||
}
|
||||
Reference in New Issue
Block a user