diff --git a/DoliMiddlewareApi/Dtos/query/InvoicePaymentDto.cs b/DoliMiddlewareApi/Dtos/query/InvoicePaymentDto.cs index f751820..5f3765b 100644 --- a/DoliMiddlewareApi/Dtos/query/InvoicePaymentDto.cs +++ b/DoliMiddlewareApi/Dtos/query/InvoicePaymentDto.cs @@ -3,8 +3,8 @@ namespace DoliMiddlewareApi.Dtos.query; public class InvoicePaymentDto { public required string @Ref { get; set; } - public DateTime PaymentDate { get; set; } + public DateOnly PaymentDate { get; set; } public string? Type { get; set; } public string? TransactionNum { get; set; } - public int Amount { get; set; } + public decimal Amount { get; set; } } \ No newline at end of file diff --git a/DoliMiddlewareApi/Mappers/InvoiceMapper.cs b/DoliMiddlewareApi/Mappers/InvoiceMapper.cs index fb2d612..3197dd9 100644 --- a/DoliMiddlewareApi/Mappers/InvoiceMapper.cs +++ b/DoliMiddlewareApi/Mappers/InvoiceMapper.cs @@ -118,11 +118,11 @@ public static class InvoiceMapper { Ref = response.@ref ?? "", PaymentDate = DateTime.TryParseExact(response.date, "yyyy-MM-dd HH:mm:ss", - CultureInfo.InvariantCulture, DateTimeStyles.None, out var date) ? date : DateTime.MinValue, + CultureInfo.InvariantCulture, DateTimeStyles.None, out var date) ? DateOnly.FromDateTime(date) : DateOnly.MinValue, Type = response.type ?? "", TransactionNum = response.num ?? "", Amount = decimal.TryParse(response.amount, NumberStyles.Any, CultureInfo.InvariantCulture, - out decimal amount) ? (int)Math.Round(amount, 0) : 0 + out decimal amount) ? Math.Round(amount, 2) : 0 }; } } \ No newline at end of file