namespace ComplianceDAL.DTO.GSTInward; public class GSTInwardDTO { public int InwardId { get; set; } public string SupplierGSTIN { get; set; } = string.Empty; public string SupplierName { get; set; } = string.Empty; public string OurGSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; public string InvoiceNumber { get; set; } = string.Empty; public DateTime? InvoiceDate { get; set; } public decimal InvoiceValue { 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 bool ITCEligible { get; set; } = true; public string AcceptanceStatus { get; set; } = "Pending"; public string Source { get; set; } = "2B"; public int SourceDocumentId { get; set; } public int? MatchedDocumentId { get; set; } public string MatchedEntityType { get; set; } = string.Empty; 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 GSTReconDTO { public int ReconId { get; set; } public string ReconType { get; set; } = string.Empty; public string Period { get; set; } = string.Empty; public string OurGSTIN { get; set; } = string.Empty; public int? InwardId { get; set; } public int? OutwardId { get; set; } public string Status { get; set; } = "Pending"; public decimal DiffTaxableValue { get; set; } public decimal DiffIGST { get; set; } public decimal DiffCGST { get; set; } public decimal DiffSGST { get; set; } public decimal DiffCess { get; set; } public string Notes { get; set; } = string.Empty; public int? ResolvedById { get; set; } public DateTime? ResolvedOn { get; set; } public int ClientId { get; set; } public string DatabaseName { get; set; } = string.Empty; public int CreatedById { get; set; } public DateTime CreatedOn { get; set; } // Join fields for reconciliation view public string SupplierGSTIN { get; set; } = string.Empty; public string SupplierName { get; set; } = string.Empty; public string InvoiceNumber { get; set; } = string.Empty; public DateTime? InvoiceDate { get; set; } public decimal PortalTaxableValue { get; set; } public decimal PortalIGST { get; set; } public decimal PortalCGST { get; set; } public decimal PortalSGST { get; set; } public int? MatchedDocumentId { get; set; } } // Request DTOs public class SyncFromPortalRequestDTO { public string OurGSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; // MMYYYY public string Source { get; set; } = "2B"; // 2A or 2B public bool ForceResync { get; set; } } public class GSTInwardFilterDTO { public string OurGSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; public string SupplierGSTIN { get; set; } = string.Empty; public string Source { get; set; } = string.Empty; public string AcceptanceStatus { get; set; } = string.Empty; public int Page { get; set; } = 1; public int PageSize { get; set; } = 50; } public class GSTReconFilterDTO { public string OurGSTIN { get; set; } = string.Empty; public string Period { get; set; } = string.Empty; public string ReconType { get; set; } = "InwardVs2B"; public string Status { get; set; } = string.Empty; public int Page { get; set; } = 1; public int PageSize { get; set; } = 50; } // Import: flat list of inward records (pre-parsed from portal or CSV) public class GSTInwardImportDTO { public string SupplierGSTIN { get; set; } = string.Empty; public string SupplierName { get; set; } = string.Empty; public string OurGSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; public string InvoiceNumber { get; set; } = string.Empty; public DateTime? InvoiceDate { get; set; } public decimal InvoiceValue { 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 bool ITCEligible { get; set; } = true; public string Source { get; set; } = "2B"; } public class ImportGSTInwardRequestDTO { public List Records { get; set; } = []; } // Generate: read purchase documents straight from the ERP for OU/GSTIN/Company/Period — no FE // round-trip. Single ReturnPeriod (not a date range): the ITC claim period is a business decision, // not derivable from the supplier invoice's own date, so it must stay a single-period concept like // every other period-based method in this module (SyncFromPortalAsync, RunReconciliationAsync, etc). public class GenerateGSTInwardBatchRequestDTO { public int OUId { get; set; } // 0 = all OUs public int CompanyId { get; set; } // 0 = all companies public string OurGSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; // MMYYYY public bool ForceResync { get; set; } } public class ReconResolutionDTO { public int ReconId { get; set; } public string Status { get; set; } = string.Empty; // Accepted/Resolved/Rejected public int? MatchedDocumentId { get; set; } public string MatchedEntityType { get; set; } = "PurchaseInvoice"; public string Notes { get; set; } = string.Empty; } public class RunReconciliationRequestDTO { public string OurGSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; public string ReconType { get; set; } = "InwardVs2B"; } // Summary row for reconciliation dashboard public class ReconSummaryDTO { public string ReconType { get; set; } = string.Empty; public string Period { get; set; } = string.Empty; public string OurGSTIN { get; set; } = string.Empty; public int TotalRecords { get; set; } public int Matched { get; set; } public int Mismatch { get; set; } public int MissingInPortal { get; set; } public int MissingInERP { get; set; } public int Resolved { get; set; } public decimal TotalDiffIGST { get; set; } public decimal TotalDiffCGST { get; set; } public decimal TotalDiffSGST { get; set; } }