namespace ComplianceDAL.DTO.GSTEWayBill; public class GSTEWayBillDTO { public int EWayBillId { get; set; } public int ArtifactId { get; set; } public int DocumentId { get; set; } public string DocumentType { get; set; } = "Invoice"; public string DocumentNumber { get; set; } = string.Empty; public DateTime? DocumentDate { get; set; } public string EWBNumber { get; set; } = string.Empty; public string GSTIN { get; set; } = string.Empty; public string FromGSTIN { get; set; } = string.Empty; public string FromName { get; set; } = string.Empty; public string FromAddress { get; set; } = string.Empty; public string FromPincode { get; set; } = string.Empty; public string FromStateCode { get; set; } = string.Empty; public string ToGSTIN { get; set; } = string.Empty; public string ToName { get; set; } = string.Empty; public string ToAddress { get; set; } = string.Empty; public string ToPincode { get; set; } = string.Empty; public string ToStateCode { get; set; } = string.Empty; public string TransporterGSTIN { get; set; } = string.Empty; public string TransporterName { get; set; } = string.Empty; public string TransportDocNumber { get; set; } = string.Empty; public DateTime? TransportDocDate { get; set; } public string VehicleNumber { get; set; } = string.Empty; public string VehicleType { get; set; } = "R"; public int TransportMode { get; set; } = 1; public int Distance { 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 string Status { get; set; } = "Active"; public DateTime? ValidUpto { get; set; } public DateTime? CancelledOn { get; set; } public string CancellationReason { get; set; } = string.Empty; public string SubmissionMode { get; set; } = "API"; public string BatchId { 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 GenerateEWayBillRequestDTO { public int DocumentId { get; set; } public string DocumentType { get; set; } = "Invoice"; public string SubmissionMode { get; set; } = "API"; // Transport details (optional override — if blank, pulled from ERP) public string TransporterGSTIN { get; set; } = string.Empty; public string VehicleNumber { get; set; } = string.Empty; public int TransportMode { get; set; } = 1; public int Distance { get; set; } } // Matches GB4's EwayBillFromIRN(CriteriaDTO, LoginDTO) — generates an e-way bill directly off an // already-generated IRN. No SubmissionMode: GB4 has no Offline/Type branch for this path since it's // inherently tied to an already-uploaded e-invoice, so it always calls the portal. public class GenerateEWayBillFromIRNRequestDTO { public int DocumentId { get; set; } public string DocumentType { get; set; } = "Invoice"; } public class GenerateBulkEWayBillRequestDTO { public List DocumentIds { get; set; } = []; public string DocumentType { get; set; } = "Invoice"; public string SubmissionMode { get; set; } = "API"; public string GSTIN { get; set; } = string.Empty; } // Matches GB4's EwayCancelDTO (ewbNo/cancelRsnCode/cancelRmrk). EWayBillId is a GB5 addition, needed // to look up the TGST_EWAYBILL row (and its ArtifactId/SubmissionMode) for the cancel call and audit // logging, since GB4 identifies the row to cancel purely by EBNUMBER against TMMHEAD. public class CancelEWayBillRequestDTO { public int EWayBillId { get; set; } public string EWBNumber { get; set; } = string.Empty; public int CancelReasonType { get; set; } // GST portal e-way cancel reason code (1=Duplicate, 2=Order Cancelled, 3=Data Entry Mistake, 4=Others) public string CancellationReason { get; set; } = string.Empty; public string SubmissionMode { get; set; } = "API"; } public class UpdateVehicleRequestDTO { public int EWayBillId { get; set; } public string EWBNumber { get; set; } = string.Empty; public string VehicleNumber { get; set; } = string.Empty; public string VehicleType { get; set; } = "R"; public string TransportDocNumber { get; set; } = string.Empty; public DateTime? TransportDocDate { get; set; } public int TransportMode { get; set; } = 1; public string FromPlace { get; set; } = string.Empty; public string FromStateCode { get; set; } = string.Empty; public string Reason { get; set; } = string.Empty; } public class EWayBillPortalResponseDTO { public bool IsSuccess { get; set; } public string EWBNumber { get; set; } = string.Empty; public DateTime? ValidUpto { get; set; } public string ErrorCode { get; set; } = string.Empty; public string ErrorMessage { get; set; } = string.Empty; public int HttpStatusCode { get; set; } public string RawResponse { get; set; } = string.Empty; } public class EWayBillCoverageDTO { public string GSTIN { get; set; } = string.Empty; public string ReturnPeriod { get; set; } = string.Empty; public int TotalDocuments { get; set; } public int WithEWB { get; set; } public int WithoutEWB { get; set; } public int Cancelled { get; set; } public int Expired { get; set; } public decimal CoveragePercent { get; set; } }