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:
Ho Ngoc Hai
2026-03-29 03:25:00 +07:00
parent b81c6ac176
commit c8a70f8d80
2 changed files with 3 additions and 1 deletions

View File

@@ -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; }
}

View File

@@ -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