add: enhance deployment status validation in ChangeDeployStatusProject command and include Activities in ProjectDeployBoardList query

This commit is contained in:
2025-12-30 17:19:59 +03:30
parent 45615684ed
commit aa37ca4b28
2 changed files with 6 additions and 0 deletions

View File

@@ -31,6 +31,11 @@ public class ChangeDeployStatusProjectCommandHandler : IBaseCommandHandler<Chang
{
return OperationResult.Failure("وضعیت استقرار نمی‌تواند از حالت 'تایید نشده' تغییر کند.");
}
if (request.Status == ProjectDeployStatus.NotCompleted)
{
return OperationResult.Failure("وضعیت استقرار نمی‌تواند به حالت 'تایید نشده' تغییر کند.");
}
project.UpdateDeployStatus(request.Status);
await _unitOfWork.SaveChangesAsync(cancellationToken);

View File

@@ -45,6 +45,7 @@ public class ProjectDeployBoardListQueryHandler:IBaseQueryHandler<GetProjectDepl
}
var query =await _dbContext.TaskSections
.Include(x=>x.Activities)
.Include(x=>x.Task)
.ThenInclude(x => x.Phase)
.ThenInclude(x => x.Project)