// ============================================================ // GoodBooks ERP — Skill Management Module // DTO : SkillProductMapDTO // Table : MSKILLPRODUCT (M1) — child/mapping table // Joins : MSKILL (S3), // MPRODUCTFAMILY (product family name — external table), // MMODEL (model name — external table) // Updated: Aligned to new DDL schema v1.0 // // CRITICAL — MSKILLPRODUCT IS A CHILD/MAPPING TABLE: // It has EXACTLY 8 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 8): // MAPID, SKILLID, SLNO, PRODUCTFAMILYID, MODELID, // SPECIFICPARAMETERS, ISACTIVE, REMARKS // // USAGE CONTEXT: // This table is only relevant when MSKILL.SKILLSCOPE = 1 // (ProductFamily) or SKILLSCOPE = 2 (Model). // SKILLSCOPE = 0 (General) skills have no product map rows. // // Tenant scoping is done via parent MSKILL join: // JOIN MSKILL S ON S.SKILLID = MSKILLPRODUCT.SKILLID // WHERE S.TENANTID = @TenantId // ============================================================ namespace SkillManagementDAL.DTO.SkillProductMap { public class SkillProductMapDTO { // ── Primary key ────────────────────────────────────────── public int MapId { get; set; } // ── Business columns (MSKILLPRODUCT) — all 8 ──────────── public int SkillId { get; set; } // MSKILLPRODUCT.SKILLID FK -> MSKILL.SKILLID public short SlNo { get; set; } // MSKILLPRODUCT.SLNO sequence within skill public int ProductFamilyId { get; set; } = -1; // MSKILLPRODUCT.PRODUCTFAMILYID -1 = not applicable public int ModelId { get; set; } = -1; // MSKILLPRODUCT.MODELID -1 = not applicable public List ProductFamilyIds { get; set; } = new(); // Multi-select input: one MSKILLPRODUCT row inserted per ProductFamilyId public List ProductFamilyNames { get; set; } = new(); // Multi-select display: sibling ProductFamilyNames for this skill public List ModelIds { get; set; } = new(); // Multi-select input: one MSKILLPRODUCT row inserted per (ProductFamilyId, ModelId) pair public List ModelNames { get; set; } = new(); // Multi-select display: sibling ModelNames for this skill public string? SpecificParameters { get; set; } // MSKILLPRODUCT.SPECIFICPARAMETERS JSON: product-specific config public byte IsActive { get; set; } = 1; // MSKILLPRODUCT.ISACTIVE 0=No, 1=Yes public string? Remarks { get; set; } // MSKILLPRODUCT.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) // This map is only applicable when SkillScope = 1 or 2 // ── Joined display fields — external tables ─────────────── // NOTE: adjust table/column names to match your actual schema public string? ProductFamilyName { get; set; } // MPRODUCTFAMILY.FAMILYNAME (was in DTO but no join existed) public string? ModelName { get; set; } // MMODEL.MODELNAME (was in DTO but no join existed) } }