namespace ComplianceDAL.DTO.GSTOutward; public class GSTOutwardDTO { public int OutwardId { get; set; } // Nullable: TGST_OUTWARD.ARTIFACTID is a nullable FK to TCOMPLIANCE_ARTIFACT — SyncGSTOutwardAsync // never creates an artifact row (that's the E-Invoice/E-Way Bill flow's job), so this stays null // for ERP-synced rows. A non-nullable int here previously defaulted to 0, which violated the FK // the moment a real UPSERT ran (0 is not a valid TCOMPLIANCE_ARTIFACT.ARTIFACTID under IDENTITY). public int? ArtifactId { get; set; } public string GSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; public int SourceDocumentId { get; set; } public string InvoiceNumber { get; set; } = string.Empty; public DateTime? InvoiceDate { get; set; } public decimal InvoiceValue { get; set; } public string ReceiverGSTIN { get; set; } = string.Empty; public string ReceiverName { get; set; } = string.Empty; public string POS { get; set; } = string.Empty; public string SupplyType { get; set; } = string.Empty; public string InvoiceType { get; set; } = "B2B"; public string HSNCode { get; set; } = string.Empty; public string UOM { get; set; } = string.Empty; public decimal Quantity { 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 int FilingStatus { get; set; } public string AckReferenceNumber { get; set; } = string.Empty; public int? OriginalOutwardId { get; set; } public int ClientId { get; set; } public string DatabaseName { get; set; } = string.Empty; public int CreatedById { get; set; } public DateTime CreatedOn { get; set; } public int? ModifiedById { get; set; } public DateTime? ModifiedOn { get; set; } } public class SyncGSTOutwardRequestDTO { public string GSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; // MMYYYY public bool ForceResync { get; set; } public int OUId { get; set; } // 0 = all OUs (default, unchanged behavior) public int CompanyId { get; set; } // 0 = all companies (default, unchanged behavior) } public class GSTOutwardFilterDTO { public string GSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; public string InvoiceType { get; set; } = string.Empty; public int FilingStatus { get; set; } = -1; public int Page { get; set; } = 1; public int PageSize { get; set; } = 50; } public class SubmitGSTOutwardRequestDTO { public string GSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; } public class FileGSTReturnRequestDTO { public string GSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; public string ReturnType { get; set; } = "GSTR1"; public string EVCOtp { get; set; } = string.Empty; } // GSTR-1 preview sections public class GSTR1PreviewDTO { public string GSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; public List B2B { get; set; } = []; public List B2CL { get; set; } = []; public List B2CS { get; set; } = []; public List EXP { get; set; } = []; public List CDNR { get; set; } = []; public List HSN { get; set; } = []; public GSTR1NilDTO NIL { get; set; } = new(); public GSTR1SummaryDTO Summary { get; set; } = new(); } public class GSTR1B2BDTO { public string ReceiverGSTIN { get; set; } = string.Empty; public string ReceiverName { get; set; } = string.Empty; public List Invoices { get; set; } = []; } public class GSTR1B2CLDTO { public string POS { get; set; } = string.Empty; public List Invoices { get; set; } = []; } public class GSTR1B2CSDTO { public string POS { get; set; } = string.Empty; public string SupplyType { get; set; } = string.Empty; public decimal IGSTRate { get; set; } public decimal CGSTRate { get; set; } public decimal SGSTRate { get; set; } public decimal TaxableValue { get; set; } public decimal IGSTAmount { get; set; } public decimal CGSTAmount { get; set; } public decimal SGSTAmount { get; set; } public decimal CessAmount { get; set; } } public class GSTR1InvoiceDTO { public string InvoiceNumber { get; set; } = string.Empty; public DateTime? InvoiceDate { get; set; } public decimal InvoiceValue { get; set; } public string POS { get; set; } = string.Empty; 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 class GSTR1EXPDTO { public string ExportType { get; set; } = "WPAY"; // WPAY/WOPAY public List Invoices { get; set; } = []; } public class GSTR1CDNRDTO { public string ReceiverGSTIN { get; set; } = string.Empty; public List Notes { get; set; } = []; } public class GSTR1NoteDTO { public string NoteType { get; set; } = "C"; // C=Credit, D=Debit public string NoteNumber { get; set; } = string.Empty; public DateTime? NoteDate { get; set; } public decimal NoteValue { get; set; } public decimal TaxableValue { get; set; } public decimal IGSTAmount { get; set; } public decimal CGSTAmount { get; set; } public decimal SGSTAmount { get; set; } public decimal CessAmount { get; set; } } public class GSTR1HSNDTO { public string HSNCode { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; public string UOM { get; set; } = string.Empty; public decimal Quantity { get; set; } public decimal TotalValue { get; set; } public decimal TaxableValue { get; set; } public decimal IGSTAmount { get; set; } public decimal CGSTAmount { get; set; } public decimal SGSTAmount { get; set; } public decimal CessAmount { get; set; } } public class GSTR1NilDTO { public decimal NilSupplies { get; set; } public decimal ExemptSupplies { get; set; } public decimal NonGSTSupplies { get; set; } } public class GSTR1SummaryDTO { public int TotalInvoices { get; set; } public decimal TotalTaxableValue { get; set; } public decimal TotalIGST { get; set; } public decimal TotalCGST { get; set; } public decimal TotalSGST { get; set; } public decimal TotalCess { get; set; } public decimal TotalInvoiceValue { get; set; } }