// ============================================================ // GoodBooks ERP — Skill Management Module // DTO : SkillAssessmentDTO // Table : TASSESSMENT (E2) — Transaction table, INSERT-ONLY // Joins : MSKILL (S3), MSKILLLEVEL (S4) x2 (achieved + previous), // MEMPLOYEE (employee name), // MUSER (assessor name), // MPRODUCTFAMILY, MMODEL (when scoped) // Updated: Aligned to new DDL schema v1.0 // // CRITICAL RULE — TASSESSMENT IS INSERT-ONLY: // Every level change = one new row. // NEVER UPDATE or DELETE rows in this table. // This is the permanent tamper-proof audit record. // Profile current state lives in MEMPLOYEESKILL (E1). // ============================================================ namespace SkillManagementDAL.DTO.SkillAssessment { public class SkillAssessmentDTO { // ── Primary key ────────────────────────────────────────── public int AssessmentId { get; set; } // ── Business columns (TASSESSMENT) ────────────────────── public string? AssessmentName { get; set; } public string? AssessmentCode { get; set; } public int EmployeeId { get; set; } public int SkillId { get; set; } public List SkillIds { get; set; } = new(); // Multi-select input: one TASSESSMENT row inserted per SkillId public List SkillNames { get; set; } = new(); // Multi-select display: sibling SkillNames from the same save event public int ProductFamilyId { get; set; } = -1; // -1 = not applicable public int ModelId { get; set; } = -1; // -1 = not applicable public List ModelIds { get; set; } = new(); // Multi-select input: one TASSESSMENT row inserted per (SkillId, ModelId) pair public List ModelNames { get; set; } = new(); // Multi-select display: sibling ModelNames from the same save event public byte LevelAchieved { get; set; } // 1-4 CHECK BETWEEN 1 AND 4 public byte PreviousLevel { get; set; } // 0-4 0=first assessment CHECK BETWEEN 0 AND 4 public int AssessedById { get; set; } // FK -> MUSER.USERID public byte AssessMethod { get; set; } // 0=Observation,1=PracticalTest,2=Supervisor,3=Dojo,4=OJT,5=SelfAssessment public string? EvidenceRef { get; set; } // test sheet ref, video ID, document number etc. public string? Remarks { get; set; } // ── Standard fields (TASSESSMENT) ─────────────────────── public short Version { get; set; } // TASSESSMENT.VERSION (was missing from old DTO) public byte Status { get; set; } = 1; // 0=Pending,1=Active,2=Deleted,3=Amended,4=Inactive,5=Archived public short SortOrder { get; set; } = 9999; // TASSESSMENT.SORTORDER (was missing from old DTO) public int CreatedById { get; set; } public DateTime? CreatedOn { get; set; } // TASSESSMENT.CREATEDON (was missing from old DTO) public int ModifiedById { get; set; } // TASSESSMENT.MODIFIEDBYID (was missing from old DTO) public DateTime? ModifiedOn { get; set; } // TASSESSMENT.MODIFIEDON (was missing from old DTO) public byte SourceType { get; set; } = 5; // 1=Framework,2=Devadmin,3=Impadmin,4=Admin,5=User (was missing) public int TenantId { get; set; } // ── Joined display fields — MSKILL (S3) ────────────────── public string? SkillName { get; set; } // MSKILL.SKILLNAME public string? SkillCode { get; set; } // MSKILL.SKILLCODE (was missing from old DTO) public byte SkillScope { get; set; } // MSKILL.SKILLSCOPE (was missing — needed for product/model context) // ── Joined display fields — MSKILLLEVEL (S4) — achieved ── public string? LevelLabel { get; set; } // MSKILLLEVEL.LEVELLABEL at SLNO = LevelAchieved public string? LevelDescriptor { get; set; } // MSKILLLEVEL.LEVELDESCRIPTOR at SLNO = LevelAchieved (was missing) // ── Joined display fields — MSKILLLEVEL (S4) — previous ── public string? PreviousLevelLabel { get; set; } // MSKILLLEVEL.LEVELLABEL at SLNO = PreviousLevel (NULL when PreviousLevel=0) public string? PreviousLevelDescriptor { get; set; } // MSKILLLEVEL.LEVELDESCRIPTOR at SLNO = PreviousLevel (was missing) // ── Joined display fields — MUSER ──────────────────────── public string? AssessorName { get; set; } // MUSER.USERNAME (ASSESSEDBYID -> MUSER.USERID) // ── Joined display fields — MEMPLOYEE ──────────────────── public string? EmployeeName { get; set; } // MEMPLOYEE.EMPLOYEENAME (EMPLOYEEID -> MEMPLOYEE.EMPLOYEEID) public string? AssesseByName { get; set; } // MEMPLOYEE.EMPLOYEENAME (EMPLOYEEID -> MEMPLOYEE.EMPLOYEEID) — the assessee // ── Joined display fields — MPRODUCTFAMILY / MMODEL ────── public string? ProductFamilyName { get; set; } // MPRODUCTFAMILY name (when PRODUCTFAMILYID != -1) public string? ModelName { get; set; } // MMODEL name (when MODELID != -1) // Change all from DateOnly? to DateTime? public DateTime? TrainingPlanDate { get; set; } public DateTime? ActualTrainDt { get; set; } public DateTime? NextReviewDt { get; set; } public DateTime? AssessedDt { get; set; } } // Row shape for SkillAssessmentQB.GET_SIBLINGS — used to populate SkillIds/SkillNames on GetSkillAssessment public class SkillAssessmentSiblingDTO { public int AssessmentId { get; set; } public int SkillId { get; set; } public string? SkillName { get; set; } public int ModelId { get; set; } public string? ModelName { get; set; } } }