fix(order): include payment_method in order list API response
OrderSummaryDto and ListOrdersByShop Dapper query were missing the payment_method column, causing the POS history tab to always show "Chưa thanh toán" (Unpaid) even for completed/paid orders. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,7 @@ public record OrderSummaryDto
|
||||
public Guid? TableId { get; init; }
|
||||
public string Status { get; init; } = string.Empty;
|
||||
public decimal TotalAmount { get; init; }
|
||||
public string? PaymentMethod { get; init; }
|
||||
public long ItemCount { get; init; }
|
||||
public DateTime CreatedAt { get; init; }
|
||||
}
|
||||
|
||||
@@ -40,13 +40,14 @@ public class ListOrdersByShopQueryHandler : IRequestHandler<ListOrdersByShopQuer
|
||||
// EN: Get paged data
|
||||
// VI: Lấy dữ liệu phân trang
|
||||
var sql = $@"
|
||||
SELECT
|
||||
SELECT
|
||||
o.id AS Id,
|
||||
o.shop_id AS ShopId,
|
||||
o.customer_id AS CustomerId,
|
||||
o.table_id AS TableId,
|
||||
os.name AS Status,
|
||||
o.total_amount AS TotalAmount,
|
||||
o.payment_method AS PaymentMethod,
|
||||
o.created_at AS CreatedAt,
|
||||
(SELECT COUNT(*) FROM order_items WHERE order_id = o.id) AS ItemCount
|
||||
FROM orders o
|
||||
|
||||
Reference in New Issue
Block a user