namespace MMDAL.DTO.MMHead { public class LoadMMHeadDTO { // ─── Header (driven by the first source document) ──────────────────────── public int SourceDocumentId { get; set; } public int PartyId { get; set; } public int PartyBranchId { get; set; } public int StoreId { get; set; } public int CurrencyId { get; set; } public int OUId { get; set; } public int CompanyId { get; set; } public decimal ExchangeRate { get; set; } public int SourceBizTransactionTypeId { get; set; } public int BizTransactionClassId { get; set; } public int AllocationId { get; set; } // ─── Charge config change detection ────────────────────────────────────── // ChargeConfigChanged = true signals the FE to show a diff dialog before loading. // The Charges list always reflects the CURRENT active config; // InputValues are sourced from the source document where formula codes match. public bool ChargeConfigChanged { get; set; } public int? SourceConfigVersionId { get; set; } public int? CurrentConfigVersionId { get; set; } // ─── Rich detail collections ────────────────────────────────────────────── public List Details { get; set; } = []; public List Charges { get; set; } = []; public List PackDetails { get; set; } = []; public List Batches { get; set; } = []; public List Attachments { get; set; } = []; } public class LoadMMDetailDTO { public int SourceDocumentId { get; set; } public int SourceDetailId { get; set; } public int ItemId { get; set; } public string ItemCode { get; set; } = string.Empty; public string ItemName { get; set; } = string.Empty; public int SKUId { get; set; } public string SKUCode { get; set; } = string.Empty; public string SKUName { get; set; } = string.Empty; public decimal Quantity { get; set; } // All pending quantity types from TPENDINGALLOCATION: public decimal PendingQuantity { get; set; } public decimal PendingRejectedQuantity { get; set; } public decimal PendingReworkQuantity { get; set; } public decimal PendingOtherQuantity { get; set; } public int UOMId { get; set; } public string UOMCode { get; set; } = string.Empty; public string UOMName { get; set; } = string.Empty; public decimal Rate { get; set; } public int StoreId { get; set; } // INDENT source populates these to allow header construction without a separate header query public int PartyId { get; set; } public int PartyBranchId { get; set; } public int OUId { get; set; } public int CompanyId { get; set; } public int AllocationId { get; set; } public int AllotedBizTransactionClassId { get; set; } public decimal GrossWeight { get; set; } public decimal NetWeight { get; set; } public int PackId { get; set; } public decimal PackQuantity { get; set; } } // Sparse-aware: InputValue carries the rate/% from the source document. // CalculatedValue is intentionally omitted — it is recomputed on new document save. // IsFromCurrentConfig / IsFromSourceConfig enable the FE diff display when config changed. public class LoadMMChargesDTO { public int SourceDetailId { get; set; } // -1 = header-level charge public int ChargeDetailId { get; set; } public int FormulaId { get; set; } public string FormulaCode { get; set; } = string.Empty; public string FormulaName { get; set; } = string.Empty; public byte OperationType { get; set; } public byte InputType { get; set; } public int SlNo { get; set; } public decimal InputValue { get; set; } public bool IsFromCurrentConfig { get; set; } public bool IsFromSourceConfig { get; set; } } public class LoadMMPackDetailDTO { public int SourceDetailId { get; set; } public int PackNumberId { get; set; } public decimal GoodQuantity { get; set; } public decimal RejectedQuantity { get; set; } public decimal GrossWeight { get; set; } public decimal NetWeight { get; set; } } public class LoadMMBatchDTO { public int SourceDetailId { get; set; } public int LotId { get; set; } public string LotNumber { get; set; } = string.Empty; public DateTime LotDate { get; set; } public int ItemId { get; set; } public int SKUId { get; set; } } public class LoadMMAttachmentDTO { public int ItemId { get; set; } public int AttachmentId { get; set; } public string FileName { get; set; } = string.Empty; // maps to GET_MM_DOCUMENT_ITEM_IMAGES.FileName public string LinkUrl { get; set; } = string.Empty; } }