namespace ComplianceDAL.DTO.CanonicalInvoice; public class CanonicalInvoiceDTO { public int DocumentId { get; set; } public string DocumentNumber { get; set; } = string.Empty; public DateTime DocumentDate { get; set; } public string DocumentType { get; set; } = string.Empty; public string SupplyType { get; set; } = string.Empty; public CanonicalPartyDTO Supplier { get; set; } = new(); public CanonicalPartyDTO Receiver { get; set; } = new(); public List Lines { get; set; } = []; public decimal TotalTaxableValue { get; set; } public decimal TotalIGSTAmount { get; set; } public decimal TotalCGSTAmount { get; set; } public decimal TotalSGSTAmount { get; set; } public decimal TotalCessAmount { get; set; } public decimal TotalInvoiceValue { get; set; } public string POS { get; set; } = string.Empty; public bool IsExport { get; set; } public bool IsReverseCharge { get; set; } public string ShippingBillNumber { get; set; } = string.Empty; public DateTime? ShippingBillDate { get; set; } public string EComGSTIN { get; set; } = string.Empty; // Header-level charges — sourced from the TMMCHARGESPIVOT row where DOCUMENTDETAILID = -1 public decimal DiscountAmount { get; set; } public decimal OtherChargesAmount { get; set; } public decimal RoundOffAmount { get; set; } // Populated only when the document has a distinct ship-to address from the bill-to (Receiver) public CanonicalPartyDTO? ShipTo { get; set; } // Transport fields — populated when building for E-Way Bill generation public string? TransporterGSTIN { get; set; } public string? TransporterName { get; set; } public string? VehicleNumber { get; set; } public int TransportMode { get; set; } = 1; public int Distance { get; set; } } public class CanonicalPartyDTO { public string GSTIN { get; set; } = string.Empty; public string LegalName { get; set; } = string.Empty; public string TradeName { get; set; } = string.Empty; public string Address1 { get; set; } = string.Empty; public string Address2 { get; set; } = string.Empty; public string City { get; set; } = string.Empty; public string Pincode { get; set; } = string.Empty; public string StateCode { get; set; } = string.Empty; public string StateName { get; set; } = string.Empty; public string PAN { get; set; } = string.Empty; public string Email { get; set; } = string.Empty; public string Phone { get; set; } = string.Empty; } public class CanonicalLineDTO { public int LineNumber { get; set; } public int ItemId { get; set; } public string ItemCode { get; set; } = string.Empty; public string ItemName { get; set; } = string.Empty; public string HSNCode { get; set; } = string.Empty; public string UOM { get; set; } = string.Empty; public decimal Quantity { get; set; } public decimal Rate { get; set; } public decimal Value { get; set; } public decimal Discount { get; set; } public decimal OtherCharges { get; set; } public decimal TaxableValue { get; set; } public decimal IGSTRate { get; set; } public decimal IGSTAmount { get; set; } public decimal CGSTRate { get; set; } public decimal CGSTAmount { get; set; } public decimal SGSTRate { get; set; } public decimal SGSTAmount { get; set; } public decimal CessRate { get; set; } public decimal CessAmount { get; set; } public string ItemNature { get; set; } = string.Empty; } public class InvoicePostedEvent { public int DocumentId { get; set; } public string DocumentType { get; set; } = string.Empty; public string GSTIN { get; set; } = string.Empty; public string Framework { get; set; } = "GST_INDIA"; public int ClientId { get; set; } public string DatabaseName { get; set; } = string.Empty; public int UserId { get; set; } }