namespace MMDAL.DTO.Allocation; /// /// Maps 1:1 to GB5_TVP_TALLOCATION. Populated by AllocationPostingBLL for SP_SaveAllocations. /// All enriched fields are filled by BLL (@IsEnriched=1 path — SP skips module-table joins). /// public class AllocationTVPDTO { // ── Core fields (always populated) ───────────────────────────────────── public int AllocationId { get; set; } public int AllotedAllocationId { get; set; } // = AllocationId for Type=0; source AllocationId for Type=1 public short AllocationType { get; set; } // 0=Source (self-ref), 1=Against (derived) public short AllocationNature { get; set; } public int ObjectHeaderTypeId { get; set; } // EntityId of TMMHEAD public int ObjectHeaderId { get; set; } // DocumentId (TMMHEAD.DOCUMENTID) public int ObjectTypeId { get; set; } // EntityId of TMMDETAIL public int ObjectId { get; set; } // DocumentDetailId (TMMDETAIL.DOCUMENTDETAILID) public int BizTransactionTypeId { get; set; } public int OuId { get; set; } public decimal Quantity { get; set; } public decimal RejectedQuantity { get; set; } public decimal ReworkQuantity { get; set; } public decimal OtherQuantity { get; set; } public decimal ExcessQuantity { get; set; } public int? ProcessId { get; set; } public short IsConsolidated { get; set; } // ── Chain link ───────────────────────────────────────────────────────── public int? PreAllotedAllocationId { get; set; } // links Type=1 row back to its Type=0 source // ── Enriched fields (BLL populates; @IsEnriched=1 skips SP joins) ────── public DateOnly? DocumentDate { get; set; } public string? DocumentNumber { get; set; } public string? ReferenceNumber { get; set; } public DateOnly? ReferenceDate { get; set; } public string? PartyReferenceNumber { get; set; } public DateOnly? PartyReferenceDate { get; set; } public DateOnly? PendingDate { get; set; } public int? ItemId { get; set; } public int? SkuId { get; set; } public int? PartyBranchId { get; set; } public int? WorkCenterId { get; set; } public short? OutputType { get; set; } public short? DemandSupplyType { get; set; } public short? DocStatus { get; set; } public int? HeaderAllocationId { get; set; } public int? DetailAllocationId { get; set; } public int? GeneratedAllocationId { get; set; } public int? InterOuId { get; set; } public int? CreatedById { get; set; } // ── Tenant (embedded so SP derives via SELECT TOP 1) ─────────────────── public int TenantId { get; set; } }