namespace TMSDAL.DTO.TrainingNeed
{
// =============================================================
// TRAINING NEED DTO
// =============================================================
public class TrainingNeedDTO
{
// =========================================================
// PRIMARY KEY
// =========================================================
public int TrainingNeedId { get; set; }
// =========================================================
// BASIC INFORMATION
// =========================================================
public string NeedCode { get; set; } = string.Empty;
public string NeedTitle { get; set; } = string.Empty;
public string? Description { get; set; }
// =========================================================
// TRAINING DOMAIN
// =========================================================
public int TrainingDomainId { get; set; }
public string? DomainName { get; set; }
// =========================================================
// SOURCE INFORMATION
// =========================================================
///
/// See TMSDAL.Enums.NeedSourceType — ManualHR=0, SkillGap=1, CompetencyGap=2,
/// AppraisalOutput=3, OKRReview=4, RCACAPAAction=5, BusinessChange=6, PeriodicSchedule=7,
/// ManagerNomination=8, SelfNominated=9, RegulatoryRequirement=10, Retraining=11.
///
public byte NeedSourceType { get; set; }
public string? SourceRefEntity { get; set; }
public int? SourceRefId { get; set; }
// =========================================================
// PRIORITY & AUDIENCE
// =========================================================
///
/// 1 = Low
/// 2 = Medium
/// 3 = High
///
public byte Priority { get; set; }
///
/// 1 = Employee
/// 2 = Department
/// 3 = Group
/// 4 = Organization
///
public byte AudienceType { get; set; }
public string? AudienceFilter { get; set; }
public int TargetHeadCount { get; set; } = 0;
// =========================================================
// TRAINING REQUIREMENT
// =========================================================
public byte IsMandatory { get; set; } = 0;
public DateTime? ComplianceDeadline { get; set; }
// =========================================================
// STATUS
// =========================================================
public byte NeedStatus { get; set; } = 0;
// =========================================================
// REQUEST INFORMATION
// =========================================================
public int RaisedById { get; set; }
public string? RaisedByName { get; set; }
public DateTime? RaisedOn { get; set; }
// =========================================================
// APPROVAL INFORMATION
// =========================================================
public int? ApprovedById { get; set; }
public string? ApprovedByName { get; set; }
public DateTime? ApprovedOn { get; set; }
public string? RejectionReason { get; set; }
// =========================================================
// TARGET INFORMATION
// =========================================================
public int? EmployeeId { get; set; }
public string? EmployeeFullName { get; set; }
public int? DepartmentId { get; set; }
public string? DepartmentName { get; set; }
public string? TargetPopulation { get; set; }
// =========================================================
// REMARKS
// =========================================================
public string? Remarks { get; set; }
// =========================================================
// SYSTEM FIELDS
// =========================================================
public short Version { get; set; } = 1;
public byte Status { get; set; } = 1;
public short SortOrder { get; set; } = 1;
// =========================================================
// AUDIT FIELDS
// =========================================================
public int CreatedById { get; set; }
public string? CreatedByName { get; set; }
public DateTime? CreatedOn { get; set; }
public int ModifiedById { get; set; }
public string? ModifiedByName { get; set; }
public DateTime? ModifiedOn { get; set; }
// =========================================================
// MULTI TENANT
// =========================================================
public byte SourceType { get; set; } = 5;
public int TenantId { get; set; }
}
// =============================================================
// TRAINING NEED LIST DTO
// =============================================================
public class TrainingNeedListDTO
{
public int TrainingNeedId { get; set; }
public string NeedCode { get; set; } = string.Empty;
public string NeedTitle { get; set; } = string.Empty;
public byte NeedSourceType { get; set; }
public string? SourceRefEntity { get; set; }
public byte Priority { get; set; }
public byte AudienceType { get; set; }
public byte NeedStatus { get; set; }
public byte IsMandatory { get; set; }
public string? DomainName { get; set; }
public string? EmployeeFullName { get; set; }
public string? DepartmentName { get; set; }
public int TargetHeadCount { get; set; }
public DateTime? ComplianceDeadline { get; set; }
public DateTime? RaisedOn { get; set; }
public DateTime? CreatedOn { get; set; }
public byte Status { get; set; }
}
// =============================================================
// SUBMIT TRAINING NEED DTO
// =============================================================
public class SubmitTrainingNeedDTO
{
public int TrainingNeedId { get; set; }
public byte CurrentStatus { get; set; }
public int NeedStatus { get; set; }
public byte RequestedStatus { get; set; }
public string? Remarks { get; set; }
public string? RejectionReason { get; set; }
public int ModifiedById { get; set; }
public DateTime? ModifiedOn { get; set; }
}
// =============================================================
// PROPOSE TRAINING NEED DTO
// =============================================================
///
/// The generalized, non-interactive entry point any producer module (SkillGapLink today;
/// PMS/OKR/Quality potentially in future) uses to raise a Training Need programmatically —
/// see ITrainingNeedBLL.ProposeTrainingNeed. Deliberately narrower than TrainingNeedDTO/
/// SaveTrainingNeed, which is UI-form shaped (mandates a human RaisedById, forced Draft
/// status handled internally either way). TrainingDomainId may be left at its 0 default when
/// the producer has no natural domain to supply — ProposeTrainingNeed resolves a tenant
/// default in that case.
///
public class ProposeTrainingNeedDTO
{
public string NeedTitle { get; set; } = string.Empty;
public string? Description { get; set; }
public int TrainingDomainId { get; set; }
/// Required — see TMSDAL.Enums.NeedSourceType.
public byte NeedSourceType { get; set; }
/// Required — e.g. "TSKILLGAPLINK". Combined with SourceRefId + NeedSourceType
/// to dedupe repeated Propose calls for the same underlying condition.
public string SourceRefEntity { get; set; } = string.Empty;
/// Required — PK of the record in SourceRefEntity that triggered this need.
public int SourceRefId { get; set; }
public byte Priority { get; set; } = (byte)TMSDAL.Enums.Priority.Medium;
public int? EmployeeId { get; set; }
public int? DepartmentId { get; set; }
public byte IsMandatory { get; set; } = 0;
public DateTime? ComplianceDeadline { get; set; }
public string? Remarks { get; set; }
}
// =============================================================
// PAGED RESULT DTO
// =============================================================
public class PagedResult
{
public List Items { get; set; } = new();
public int TotalRecords { get; set; }
public int Page { get; set; }
public int Size { get; set; }
}
}