// EN: DTOs for real-time POS/KDS hub notifications.
// VI: DTOs cho thông báo real-time POS/KDS hub.

namespace OrderService.API.Hubs;

/// <summary>
/// EN: DTO for order notification via SignalR.
/// VI: DTO cho thông báo order qua SignalR.
/// </summary>
public record OrderNotificationDto(
    Guid OrderId,
    Guid ShopId,
    string Status,
    IReadOnlyCollection<OrderItemNotificationDto> Items,
    decimal TotalAmount,
    Guid? CustomerId,
    Guid? TableId,
    DateTime CreatedAt,
    DateTime? UpdatedAt
);

/// <summary>
/// EN: DTO for order item in notification.
/// VI: DTO cho order item trong thông báo.
/// </summary>
public record OrderItemNotificationDto(
    Guid ItemId,
    Guid ProductId,
    string ProductName,
    string ProductType,
    int Quantity,
    decimal UnitPrice,
    decimal TotalPrice,
    string Status
);

/// <summary>
/// EN: DTO for kitchen ticket notification via SignalR.
/// VI: DTO cho thông báo phiếu bếp qua SignalR.
/// </summary>
public record KitchenTicketNotificationDto(
    Guid TicketId,
    Guid OrderId,
    IReadOnlyCollection<KitchenTicketItemDto> Items,
    int Priority,
    string Status,
    DateTime CreatedAt
);

/// <summary>
/// EN: DTO for kitchen ticket item.
/// VI: DTO cho item trong phiếu bếp.
/// </summary>
public record KitchenTicketItemDto(
    Guid ProductId,
    string ProductName,
    int Quantity,
    string? Notes
);

/// <summary>
/// EN: DTO for payment notification via SignalR.
/// VI: DTO cho thông báo thanh toán qua SignalR.
/// </summary>
public record PaymentNotificationDto(
    Guid OrderId,
    decimal Amount,
    string Method,
    string Status
);

/// <summary>
/// EN: DTO for table status change notification via SignalR.
/// VI: DTO cho thông báo thay đổi trạng thái bàn qua SignalR.
/// </summary>
public record TableStatusNotificationDto(
    Guid TableId,
    string TableName,
    string Status
);

/// <summary>
/// EN: DTO for order status change notification via SignalR.
/// VI: DTO cho thông báo thay đổi trạng thái order qua SignalR.
/// </summary>
public record OrderStatusChangedDto(
    Guid OrderId,
    string OldStatus,
    string NewStatus,
    DateTime ChangedAt
);
