using System; namespace RecruitmentDAL.DTO.CandidateConversion { // Request shape for RecruitmentBLL.CandidateConversion.ICandidateConversionBLL // .ConvertCandidateToEmployeeAsync — the Candidate->Employee "final joining event" (Phase 3 // of the Recruitment build-out plan). CandidateDTO (name/email/phone) plus the identity of // the specific hired Application together carry everything the pipeline itself already // knows; everything below is what PayRollBLL.Employee.EmployeeBLL.SaveEmployee genuinely // needs that a Candidate record has no way to know on its own — an explicit, HR-supplied // set, not something this conversion should guess/auto-fill. See CandidateConversionBLL's // class doc comment for exactly which MEMPLOYEE columns were found to be NOT NULL + FK- // enforced (i.e. truly mandatory, not just NOT NULL-with-a-zero-default) during this // DTO's design, and for the ones deliberately left out (defaulted to 0/HR completes later // via the standard Employee edit screen). public class CandidateConversionRequestDTO { // The Candidate being converted. Must not already carry a real EmployeeId (CandidateDTO // .EmployeeId defaults to -1 — "not yet converted" — see that DTO's doc comment). public int CandidateId { get; set; } = -1; // The specific hired Application (Candidate x JobRequisition) that authorizes this // conversion — needed both to validate the pipeline is genuinely at a Hired-terminal // stage (see CandidateConversionBLL) and to resolve JobRequisitionId for the // requester-notification step (IEcpIntegrationService.NotifyRequesterOnHireAsync). public int ApplicationId { get; set; } = -1; // ── HR-supplied, MEMPLOYEE NOT NULL + FK-enforced (verified against // DB/Migrations/20260824_FullBaseSchema_SqlServer/chunk_003_of_016.sql — no sensible // zero-default exists for any of these four; SaveEmployee will hit a live FK // violation without them) ── public int WorkOUId { get; set; } = -1; // FK MORGANIZATIONUNIT public int DepartmentId { get; set; } = -1; // FK MDEPARTMENT public int CostCenterId { get; set; } = -1; // FK MCOSTCENTER — found during this // task's verification pass; the prior // research pass had only flagged // WorkOUId/DepartmentId as FK-enforced. public int EmployeeCodeDefineId { get; set; } = -1; // -> EmployeeDTO.CodeDefineId via // CodeGeneration.AssignCode (FK MCODEDEFINE) // ── HR-supplied by business necessity even though NOT FK-enforced at the DB level // (DesignationId is a "GCM"/generic-code-master column with no hard FK — but a // converted hire with no Designation is meaningless data, so it is still required // here) ── public int DesignationId { get; set; } = -1; // Business-critical: this call IS "the final joining event" — the date the candidate // actually joins as an employee. SaveEmployee's own DB default (GETDATE()) would silently // record "today" for every conversion regardless of the real joining date, so this is // required rather than left to that default. public DateTime? DateOfJoining { get; set; } } }