namespace QMSDAL.DTO { // ── TPCSCARDMATERIAL — raw material batch record per stage ─────────────── public class PcsCardMaterialDTO { public int PcsCardMaterialId { get; set; } public int PcsCardStaeId { get; set; } public short SlNo { get; set; } // Material identity public int ItemId { get; set; } = -1; // FK to MITEM (-1 if uncatalogued) public string MaterialName { get; set; } = string.Empty; public string GradeCode { get; set; } = string.Empty; public string BatchNo { get; set; } = string.Empty; // mandatory — never empty public int LotId { get; set; } = -1; // FK to MLOT (-1 if free-text batch) // Quantity consumed public decimal Quantity { get; set; } public int UomId { get; set; } = -1; // Date tracking — critical for adhesives, paints, catalysts with short shelf lives public DateTime? DateOfManufacture { get; set; } // DOM public DateTime? DateOpened { get; set; } // DOO public DateTime? DateOfExpiry { get; set; } // DOE // IsExpired: computed server-side in DAL (DateOfExpiry < UtcNow.Date → 1 else 0) // FE value is ignored — always recomputed on save public byte IsExpired { get; set; } public string? Remarks { get; set; } // ── Joined / computed — not persisted ──────────────────────────────── public string? UomName { get; set; } } // ── Wrapper for SavePcsCardMaterial endpoint ───────────────────────────── public class PcsStageMaterialsDTO { public int PcsCardStaeId { get; set; } public IEnumerable Materials { get; set; } = []; } }