// ============================================================ // GoodBooks ERP — Skill Management Module // DTO : SkillProcessStageMapDTO // Table : MROUTINGSKILL (M2) — child/mapping table // Joins : MSKILL (S3), MSKILLLEVEL (S4), // MROUTING (routing name — external table), // MROUTINGOP (routing operation name — external table), // MWORKCENTER (work centre name — external table) // Updated: Aligned to new DDL schema v1.0 // // CRITICAL — MROUTINGSKILL IS A CHILD/MAPPING TABLE: // It has EXACTLY 10 business columns and NO standard fields. // There is NO TENANTID, VERSION, STATUS, SORTORDER, // CREATEDBYID, MODIFIEDBYID, CREATEDON, MODIFIEDON, // or SOURCETYPE on this table. // Parent MSKILL audit covers the child lifecycle per DDL. // // DDL columns (all 10): // MAPID, SKILLID, SLNO, ROUTINGID, ROUTINGOPCODE, // ROUTINGOPID, WORKCENTERID, ISPREREQUISITE, // MINLEVELREQUIRED, REMARKS // // Tenant scoping is done via parent MSKILL join: // JOIN MSKILL S ON S.SKILLID = MROUTINGSKILL.SKILLID // WHERE S.TENANTID = @TenantId // ============================================================ namespace SkillManagementDAL.DTO.SkillProcessStageMap { public class SkillProcessStageMapDTO { // ── Primary key ────────────────────────────────────────── public int MapId { get; set; } // ── Business columns (MROUTINGSKILL) — all 10 ─────────── public int SkillId { get; set; } // MROUTINGSKILL.SKILLID FK -> MSKILL.SKILLID public short SlNo { get; set; } // MROUTINGSKILL.SLNO sequence within skill public int RoutingId { get; set; } = -1; // MROUTINGSKILL.ROUTINGID -1 = not applicable public string? RoutingOpCode { get; set; } // MROUTINGSKILL.ROUTINGOPCODE e.g. 'Op50', 'Op60' public int RoutingOpId { get; set; } = -1; // MROUTINGSKILL.ROUTINGOPID -1 = not applicable public int WorkCenterId { get; set; } = -1; // MROUTINGSKILL.WORKCENTERID -1 = not applicable public byte IsPrerequisite { get; set; } // MROUTINGSKILL.ISPREREQUISITE 0=No, 1=Yes public int SkillLevelId { get; set; } // NOTE: frontend currently sends "SlevelId" instead of "SkillLevelId" — // this shadow property accepts that spelling on incoming JSON and // forwards it into SkillLevelId, so the mismatch doesn't silently // bind to 0. Excluded from outgoing serialization (System.Text.Json // and Newtonsoft both used across this codebase) so it doesn't // duplicate SkillLevelId in GetBySkill/select-list responses. [System.Text.Json.Serialization.JsonPropertyName("SlevelId")] [Newtonsoft.Json.JsonIgnore] public int SlevelId { get => SkillLevelId; set => SkillLevelId = value; } public byte MinLevelRequired { get; set; } = 1; // MROUTINGSKILL.MINLEVELREQUIRED 1-4 CHECK BETWEEN 1 AND 4 public string? Remarks { get; set; } // MROUTINGSKILL.REMARKS // ── 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 0=General,1=ProductFamily,2=Model (was missing) // ── Joined display fields — MSKILLLEVEL (S4) ───────────── // Resolved at SLNO = MinLevelRequired — shows required level label public string? LevelLabel { get; set; } // MSKILLLEVEL.LEVELLABEL at SLNO = MinLevelRequired (was missing) public string? LevelDescriptor { get; set; } // MSKILLLEVEL.LEVELDESCRIPTOR at SLNO = MinLevelRequired (was missing) // ── Joined display fields — external tables ─────────────── // NOTE: adjust table/column names to match your actual schema public string? RoutingName { get; set; } // MROUTING.ROUTINGNAME (was in DTO but no join existed) public string? RoutingOpName { get; set; } // MROUTINGOP.OPNAME (was missing — display name for ROUTINGOPID) public string? WorkCenterName { get; set; } // MWORKCENTER.WCENTERNAME (was in DTO but no join existed) } }