Add Skill navigation to Phase/ProjectSection, refactor logic
- Add Skill navigation properties to PhaseSection and ProjectSection, with EF Core mappings and migration for foreign keys and indexes. - Refactor SetSkillFlags in GetProjectsListQueryHandler for clarity and efficiency; use eager loading for Skill. - Add HasRemainingTime() to TaskSection and enforce time check in ChangeStatusSectionCommandHandler. - Optimize EmployeeDocumentsRepository queries; add EmployeeId to WorkshopWithEmployeeDocumentsViewModel. - Improve CustomExceptionHandler to handle FluentValidation exceptions and return proper status codes. - Add FluentValidation package reference and perform minor code cleanups.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using GozareshgirProgramManager.Domain._Common;
|
||||
using GozareshgirProgramManager.Domain.SkillAgg.Entities;
|
||||
|
||||
namespace GozareshgirProgramManager.Domain.ProjectAgg.Entities;
|
||||
|
||||
@@ -22,6 +23,7 @@ public class PhaseSection : EntityBase<Guid>
|
||||
|
||||
// Navigation property
|
||||
public ProjectPhase Phase { get; private set; } = null!;
|
||||
public Skill? Skill { get; set; }
|
||||
|
||||
public void UpdateUser(long userId)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using GozareshgirProgramManager.Domain._Common;
|
||||
using GozareshgirProgramManager.Domain.SkillAgg.Entities;
|
||||
|
||||
namespace GozareshgirProgramManager.Domain.ProjectAgg.Entities;
|
||||
|
||||
@@ -21,6 +22,7 @@ public class ProjectSection : EntityBase<Guid>
|
||||
public Guid SkillId { get; private set; }
|
||||
|
||||
public Project Project { get; private set; } = null!;
|
||||
public Skill? Skill { get; set; }
|
||||
|
||||
public void UpdateUser(long userId)
|
||||
{
|
||||
|
||||
@@ -210,4 +210,11 @@ public class TaskSection : EntityBase<Guid>
|
||||
{
|
||||
_additionalTimes.Clear();
|
||||
}
|
||||
|
||||
public bool HasRemainingTime()
|
||||
{
|
||||
var totalSpent = GetTotalTimeSpent();
|
||||
var finalEstimate = FinalEstimatedHours;
|
||||
return totalSpent < finalEstimate;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user