refactor(web-client-tpos, order-service): improve API deserialization, update DTO types for Dapper compatibility, and refine API proxying for staff schedules and order cancellations.
This commit is contained in:
@@ -26,20 +26,21 @@ public record RevenueReportDto(
|
||||
string Period,
|
||||
Guid ShopId,
|
||||
decimal TotalRevenue,
|
||||
int TotalOrders,
|
||||
long TotalOrders,
|
||||
List<RevenuePeriodDto> Data
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// EN: Revenue data for a single period.
|
||||
/// VI: Dữ liệu doanh thu cho một kỳ.
|
||||
/// EN: Revenue data for a single period (class for Dapper compatibility).
|
||||
/// VI: Dữ liệu doanh thu cho một kỳ (class cho tương thích Dapper).
|
||||
/// </summary>
|
||||
public record RevenuePeriodDto(
|
||||
DateTime PeriodStart,
|
||||
decimal Revenue,
|
||||
int OrderCount,
|
||||
decimal AvgOrderValue
|
||||
);
|
||||
public class RevenuePeriodDto
|
||||
{
|
||||
public DateTime PeriodStart { get; set; }
|
||||
public decimal Revenue { get; set; }
|
||||
public long OrderCount { get; set; }
|
||||
public decimal AvgOrderValue { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// EN: Handler for GetRevenueReportQuery.
|
||||
|
||||
@@ -19,16 +19,17 @@ public record GetTopProductsQuery(
|
||||
) : IRequest<List<TopProductDto>>;
|
||||
|
||||
/// <summary>
|
||||
/// EN: Top product DTO.
|
||||
/// VI: DTO sản phẩm bán chạy.
|
||||
/// EN: Top product DTO (class for Dapper compatibility).
|
||||
/// VI: DTO sản phẩm bán chạy (class cho tương thích Dapper).
|
||||
/// </summary>
|
||||
public record TopProductDto(
|
||||
Guid ProductId,
|
||||
string ProductName,
|
||||
int TotalQuantity,
|
||||
decimal TotalRevenue,
|
||||
int OrderCount
|
||||
);
|
||||
public class TopProductDto
|
||||
{
|
||||
public Guid ProductId { get; set; }
|
||||
public string ProductName { get; set; } = string.Empty;
|
||||
public long TotalQuantity { get; set; }
|
||||
public decimal TotalRevenue { get; set; }
|
||||
public long OrderCount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// EN: Handler for GetTopProductsQuery.
|
||||
|
||||
Reference in New Issue
Block a user