using System.Collections.Generic; using System.Text.Json.Serialization; namespace PayRollBLL.SAPPaySlip.DTO { // Represents the top-level OData envelope: { "d": { "results": [...] } } public class SapPaySlipODataResponse { [JsonPropertyName("d")] public SapPaySlipODataData D { get; set; } = new(); } public class SapPaySlipODataData { [JsonPropertyName("results")] public List Results { get; set; } = new(); } // Maps each record returned by the SAP ZPY_PAYSLIP_SRV OData service. // __metadata is intentionally omitted — JSON deserialization ignores unknown fields. public class SapPaySlipODataItem { [JsonPropertyName("EmployeeID")] public string EmployeeID { get; set; } = string.Empty; [JsonPropertyName("FiscalYear")] public string FiscalYear { get; set; } = string.Empty; [JsonPropertyName("Month")] public string Month { get; set; } = string.Empty; // Base64-encoded PDF generated by Adobe LiveCycle Designer on the SAP side. // Callers should decode with Convert.FromBase64String() and serve as application/pdf. [JsonPropertyName("PayslipForm")] public string PayslipForm { get; set; } = string.Empty; } // Clean outbound DTO returned to the API consumer. public record SapPaySlipResultDTO( string EmployeeID, string FiscalYear, string Month, string PayslipForm ); }