using System.Collections.Generic; using System.Text.Json.Serialization; namespace PayRollBLL.SAP.Builders { // ── Shared JSON options (no custom numeric converters — amounts are pre-formatted strings) ── // See SapJsonOptions.cs for the shared instance used by all builders. // ──────────────────────────────────────────────────────────────────────────────────────────── // 580 Previous Employer Income // Service: ZPY_ITDEC_PREVIOUS_SRV / ITDecPreviousHeaderSet // ──────────────────────────────────────────────────────────────────────────────────────────── public class Sap580Payload { [JsonPropertyName("Date")] public string Date { get; init; } = string.Empty; [JsonPropertyName("NAV2ITDECPREVITEM")] public List NAV2ITDECPREVITEM { get; init; } = new(); [JsonPropertyName("NAV2ITDECPREVMSG")] public List NAV2ITDECPREVMSG { get; init; } = new(); } public class Sap580Item { [JsonPropertyName("EmployeeId")] public string EmployeeId { get; init; } = string.Empty; [JsonPropertyName("FiscalYear")] public string FiscalYear { get; init; } = string.Empty; [JsonPropertyName("FromDate")] public string FromDate { get; init; } = string.Empty; [JsonPropertyName("ToDate")] public string ToDate { get; init; } = string.Empty; [JsonPropertyName("PreviousSalary")] public string PreviousSalary { get; init; } = "0"; [JsonPropertyName("PreviousPerquisites")] public string PreviousPerquisites { get; init; } = "0"; [JsonPropertyName("PreviousProfitInLieu")] public string PreviousProfitInLieu { get; init; } = "0"; [JsonPropertyName("PreviousExemptions")] public string PreviousExemptions { get; init; } = "0"; [JsonPropertyName("PreviousPTAX")] public string PreviousPTAX { get; init; } = "0"; [JsonPropertyName("PreviousPF")] public string PreviousPF { get; init; } = "0"; [JsonPropertyName("PreviousIncomeTax")] public string PreviousIncomeTax { get; init; } = "0"; } // ──────────────────────────────────────────────────────────────────────────────────────────── // 581 HRA / Rent Paid // Service: ZPY_ITDEC_HRA_SRV / ITDecHRA_HeaderSet // ──────────────────────────────────────────────────────────────────────────────────────────── public class Sap581Payload { [JsonPropertyName("Date")] public string Date { get; init; } = string.Empty; [JsonPropertyName("Remarks")] public string Remarks { get; init; } = string.Empty; [JsonPropertyName("Nav2IT_Dec_HRA_Item")] public List Nav2IT_Dec_HRA_Item { get; init; } = new(); [JsonPropertyName("Nav2IT_Dec_HRA_Msg")] public List Nav2IT_Dec_HRA_Msg { get; init; } = new(); } public class Sap581Item { [JsonPropertyName("EmployeeID")] public string EmployeeID { get; init; } = string.Empty; [JsonPropertyName("FiscalYear")] public string FiscalYear { get; init; } = string.Empty; [JsonPropertyName("Particulars")] public string Particulars { get; init; } = string.Empty; [JsonPropertyName("From")] public string From { get; init; } = string.Empty; [JsonPropertyName("To")] public string To { get; init; } = string.Empty; [JsonPropertyName("Type")] public string Type { get; init; } = string.Empty; [JsonPropertyName("Declared")] public string Declared { get; init; } = "0"; [JsonPropertyName("Approved")] public string Approved { get; init; } = "0"; [JsonPropertyName("Remarks")] public string Remarks { get; init; } = string.Empty; [JsonPropertyName("LandLordName")] public string LandLordName { get; init; } = string.Empty; [JsonPropertyName("LandLordPAN")] public string LandLordPAN { get; init; } = string.Empty; [JsonPropertyName("LandLordTAN")] public string LandLordTAN { get; init; } = string.Empty; [JsonPropertyName("LandLordAddressLine1")] public string LandLordAddressLine1 { get; init; } = string.Empty; [JsonPropertyName("LandLordAddressLine2")] public string LandLordAddressLine2 { get; init; } = string.Empty; [JsonPropertyName("LandLordAddressLine3")] public string LandLordAddressLine3 { get; init; } = string.Empty; [JsonPropertyName("LandLordAddressLine4")] public string LandLordAddressLine4 { get; init; } = string.Empty; [JsonPropertyName("LandLordAddressLine5")] public string LandLordAddressLine5 { get; init; } = string.Empty; } // ──────────────────────────────────────────────────────────────────────────────────────────── // 584 House Property (Rental Income + Home Loan) // Service: ZPY_ITDEC_HOUSING_LOAN_SRV / ITDecHL_HeaderSet // ──────────────────────────────────────────────────────────────────────────────────────────── public class Sap584Payload { [JsonPropertyName("Date")] public string Date { get; init; } = string.Empty; [JsonPropertyName("Remarks")] public string Remarks { get; init; } = string.Empty; [JsonPropertyName("Nav2IT_Dec_HL_Item")] public List Nav2IT_Dec_HL_Item { get; init; } = new(); [JsonPropertyName("Nav2IT_Dec_HL_Msg")] public List Nav2IT_Dec_HL_Msg { get; init; } = new(); } public class Sap584Item { [JsonPropertyName("EmployeeID")] public string EmployeeID { get; init; } = string.Empty; [JsonPropertyName("FiscalYear")] public string FiscalYear { get; init; } = string.Empty; [JsonPropertyName("Type")] public string Type { get; init; } = string.Empty; // Particulars1 — rental income block [JsonPropertyName("Particulars1")] public string Particulars1 { get; init; } = string.Empty; [JsonPropertyName("AnnualRentalIncome")] public string AnnualRentalIncome { get; init; } = "0"; [JsonPropertyName("LocalTaxPaid")] public string LocalTaxPaid { get; init; } = "0"; [JsonPropertyName("NetAnnualValue")] public string NetAnnualValue { get; init; } = "0"; [JsonPropertyName("StandardDeduction")] public string StandardDeduction { get; init; } = "0"; [JsonPropertyName("InterestOnBorrowal")] public string InterestOnBorrowal { get; init; } = "0"; [JsonPropertyName("TotalDeduction")] public string TotalDeduction { get; init; } = "0"; [JsonPropertyName("NetIncome")] public string NetIncome { get; init; } = "0"; [JsonPropertyName("EligibleFor80EEA")] public string EligibleFor80EEA { get; init; } = string.Empty; [JsonPropertyName("PossesionObtained")] public string PossesionObtained { get; init; } = string.Empty; [JsonPropertyName("Remarks1")] public string Remarks1 { get; init; } = string.Empty; // Particulars2 — home loan / lender block [JsonPropertyName("Particulars2")] public string Particulars2 { get; init; } = string.Empty; [JsonPropertyName("PrinciplePaid")] public string PrinciplePaid { get; init; } = "0"; [JsonPropertyName("InterestPaid")] public string InterestPaid { get; init; } = "0"; [JsonPropertyName("Remarks2")] public string Remarks2 { get; init; } = string.Empty; [JsonPropertyName("LenderName")] public string LenderName { get; init; } = string.Empty; [JsonPropertyName("LenderPAN")] public string LenderPAN { get; init; } = string.Empty; [JsonPropertyName("LenderTAN")] public string LenderTAN { get; init; } = string.Empty; [JsonPropertyName("LenderAddressLine1")] public string LenderAddressLine1 { get; init; } = string.Empty; [JsonPropertyName("LenderAddressLine2")] public string LenderAddressLine2 { get; init; } = string.Empty; [JsonPropertyName("LenderAddressLine3")] public string LenderAddressLine3 { get; init; } = string.Empty; [JsonPropertyName("LenderAddressLine4")] public string LenderAddressLine4 { get; init; } = string.Empty; [JsonPropertyName("LenderAddressLine5")] public string LenderAddressLine5 { get; init; } = string.Empty; } // ──────────────────────────────────────────────────────────────────────────────────────────── // 585 Deductions (80D, 80E, 80G, etc.) // Service: ZPY_ITDEC_DEDUCT_SRV / DeductionHeaderSet // ──────────────────────────────────────────────────────────────────────────────────────────── public class Sap585Payload { [JsonPropertyName("Date")] public string Date { get; init; } = string.Empty; [JsonPropertyName("Remarks")] public string Remarks { get; init; } = string.Empty; [JsonPropertyName("NAV2DEDUCTIONITEM")] public List NAV2DEDUCTIONITEM { get; init; } = new(); [JsonPropertyName("NAV2DEDUCTIONMSG")] public List NAV2DEDUCTIONMSG { get; init; } = new(); } public class Sap585Item { [JsonPropertyName("EmployeeID")] public string EmployeeID { get; init; } = string.Empty; [JsonPropertyName("FiscalYear")] public string FiscalYear { get; init; } = string.Empty; [JsonPropertyName("ConsiderActual")] public string ConsiderActual { get; init; } = string.Empty; [JsonPropertyName("Section")] public string Section { get; init; } = string.Empty; [JsonPropertyName("Particulars")] public string Particulars { get; init; } = string.Empty; [JsonPropertyName("Declared")] public string Declared { get; init; } = "0"; [JsonPropertyName("Approved")] public string Approved { get; init; } = "0"; [JsonPropertyName("Remarks")] public string Remarks { get; init; } = string.Empty; } // ──────────────────────────────────────────────────────────────────────────────────────────── // 586 Contributions (80C, 80CCC, 80CCD) // Service: ZPY_IT586_CONTRIBUTIONS_SRV / IT586HeaderSet // ──────────────────────────────────────────────────────────────────────────────────────────── public class Sap586Payload { [JsonPropertyName("Date")] public string Date { get; init; } = string.Empty; [JsonPropertyName("Remarks")] public string Remarks { get; init; } = string.Empty; [JsonPropertyName("NAV2IT586ITEM")] public List NAV2IT586ITEM { get; init; } = new(); [JsonPropertyName("NAV2IT586MESSAGE")] public List NAV2IT586MESSAGE { get; init; } = new(); } public class Sap586Item { [JsonPropertyName("EmployeeID")] public string EmployeeID { get; init; } = string.Empty; [JsonPropertyName("FiscalYear")] public string FiscalYear { get; init; } = string.Empty; [JsonPropertyName("ConsiderActual")] public string ConsiderActual { get; init; } = string.Empty; [JsonPropertyName("Section")] public string Section { get; init; } = string.Empty; [JsonPropertyName("Particulars")] public string Particulars { get; init; } = string.Empty; [JsonPropertyName("Declared")] public string Declared { get; init; } = "0"; [JsonPropertyName("Approved")] public string Approved { get; init; } = "0"; [JsonPropertyName("Remarks")] public string Remarks { get; init; } = string.Empty; } // ──────────────────────────────────────────────────────────────────────────────────────────── // 584 Other Income Sources (second sub-type of infotype 584) // // SAP confirmation required: // - Exact ZPY_* service name (placeholder: ZPY_ITDEC_OTHERINCOME_SRV) // - Exact entity-set name (placeholder: ITDecOtherIncomeHeaderSet) // - Exact navigation-property names for items and messages // - Exact JSON field names for each income bucket // // The placeholders below follow SAP OData naming conventions and will be updated // once the SAP team provides the confirmed service specification. // ──────────────────────────────────────────────────────────────────────────────────────────── // TODO: Replace all placeholder names below with confirmed SAP service/field names. public class Sap584OtherIncomePayload { [JsonPropertyName("Date")] public string Date { get; init; } = string.Empty; [JsonPropertyName("Remarks")] public string Remarks { get; init; } = string.Empty; [JsonPropertyName("NAV2OTHERINCOME_ITEM")] public List NAV2OTHERINCOME_ITEM { get; init; } = new(); [JsonPropertyName("NAV2OTHERINCOME_MSG")] public List NAV2OTHERINCOME_MSG { get; init; } = new(); } // TODO: Confirm all field names with the SAP team before going live. public class Sap584OtherIncomeItem { [JsonPropertyName("EmployeeID")] public string EmployeeID { get; init; } = string.Empty; [JsonPropertyName("FiscalYear")] public string FiscalYear { get; init; } = string.Empty; [JsonPropertyName("BusinessProfit")] public string BusinessProfit { get; init; } = "0"; [JsonPropertyName("LTCGNormal")] public string LTCGNormal { get; init; } = "0"; [JsonPropertyName("LTCGSpecial")] public string LTCGSpecial { get; init; } = "0"; [JsonPropertyName("STCapitalGains")] public string STCapitalGains { get; init; } = "0"; [JsonPropertyName("Dividends")] public string Dividends { get; init; } = "0"; [JsonPropertyName("Interest")] public string Interest { get; init; } = "0"; [JsonPropertyName("OtherIncome")] public string OtherIncome { get; init; } = "0"; [JsonPropertyName("DigitalIncome")] public string DigitalIncome { get; init; } = "0"; } // ──────────────────────────────────────────────────────────────────────────────────────────── // 582 / 583 — OData endpoint specifications not provided in the current SAP document. // These infotypes use the old payload structure until the SAP team supplies // the correct ZPY_* service names and navigation property names. // ──────────────────────────────────────────────────────────────────────────────────────────── }