using MediatR;

namespace WhatsAppService.API.Application.Queries;

/// <summary>
/// EN: Query to get conversations by shop with pagination.
/// VI: Query để lấy conversations theo shop với phân trang.
/// </summary>
public record GetConversationsQuery(
    Guid ShopId,
    int? StatusId,
    int Skip = 0,
    int Take = 20
) : IRequest<GetConversationsResult>;

/// <summary>
/// EN: Result of GetConversationsQuery.
/// VI: Kết quả của GetConversationsQuery.
/// </summary>
public record GetConversationsResult(
    List<ConversationViewModel> Conversations,
    int TotalCount);

/// <summary>
/// EN: Conversation view model.
/// VI: View model cho conversation.
/// </summary>
public record ConversationViewModel(
    Guid Id,
    string CustomerWaId,
    string Status,
    Guid? AssignedAgentId,
    DateTime? LastMessageAt,
    DateTime CreatedAt,
    DateTime? ExpiresAt,
    int MessageCount);
