// EN: Admin DTOs for merchant management.
// VI: DTOs Admin cho quản lý merchant.

namespace MerchantService.API.Application.Queries.Admin;

#region Merchant List DTOs

/// <summary>
/// EN: Admin view of merchant in list.
/// VI: View admin của merchant trong danh sách.
/// </summary>
public record AdminMerchantListItemDto(
    Guid Id,
    Guid UserId,
    string BusinessName,
    string Type,
    string Status,
    string VerificationStatus,
    int ShopsCount,
    int SubscriptionPlanId,
    string SubscriptionPlanName,
    DateTime CreatedAt,
    DateTime? VerifiedAt);

/// <summary>
/// EN: Paginated result for merchant list.
/// VI: Kết quả phân trang cho danh sách merchant.
/// </summary>
public record AdminMerchantListResultDto(
    List<AdminMerchantListItemDto> Items,
    int TotalCount,
    int Page,
    int PageSize,
    int TotalPages);

#endregion

#region Merchant Detail DTOs

/// <summary>
/// EN: Business info for admin view.
/// VI: Thông tin doanh nghiệp cho admin view.
/// </summary>
public record AdminBusinessInfoDto(
    string? TaxId,
    string? LegalName,
    string? Address,
    string? Phone,
    string? Email,
    string? Website);

/// <summary>
/// EN: Settlement config for admin view.
/// VI: Cấu hình thanh toán cho admin view.
/// </summary>
public record AdminSettlementConfigDto(
    decimal CommissionRate,
    string PayoutFrequency,
    string? BankAccount);

/// <summary>
/// EN: Detailed admin view of a merchant.
/// VI: View chi tiết admin của merchant.
/// </summary>
public record AdminMerchantDetailDto(
    Guid Id,
    Guid UserId,
    string BusinessName,
    string Type,
    string Status,
    string VerificationStatus,
    AdminBusinessInfoDto? BusinessInfo,
    AdminSettlementConfigDto? SettlementConfig,
    int ShopsCount,
    int StaffCount,
    int SubscriptionPlanId,
    string SubscriptionPlanName,
    DateTime CreatedAt,
    DateTime? UpdatedAt,
    DateTime? VerifiedAt,
    Guid? VerifiedBy,
    List<AdminShopSummaryDto>? Shops = null);

/// <summary>
/// EN: Shop summary for merchant detail view.
/// VI: Tóm tắt cửa hàng cho trang chi tiết merchant.
/// </summary>
public record AdminShopSummaryDto(
    Guid Id, string Name, string? Category, string? Status, DateTime CreatedAt);

#endregion

#region Statistics DTOs

/// <summary>
/// EN: Merchant statistics for admin dashboard.
/// VI: Thống kê merchant cho dashboard admin.
/// </summary>
public record AdminMerchantStatisticsDto(
    int TotalMerchants,
    int PendingApproval,
    int Active,
    int Suspended,
    int Banned,
    int TotalShops,
    int PublishedShops,
    int TotalStaff);

#endregion

#region Shop DTOs

/// <summary>
/// EN: Admin view of shop in list.
/// VI: View admin của shop trong danh sách.
/// </summary>
public record AdminShopListItemDto(
    Guid Id,
    Guid MerchantId,
    string MerchantBusinessName,
    string Name,
    string Slug,
    string Status,
    string? Category,
    DateTime CreatedAt);

/// <summary>
/// EN: Paginated result for shop list.
/// VI: Kết quả phân trang cho danh sách shop.
/// </summary>
public record AdminShopListResultDto(
    List<AdminShopListItemDto> Items,
    int TotalCount,
    int Page,
    int PageSize,
    int TotalPages);

#endregion
