// EN: Query to get merchant profile.
// VI: Query để lấy profile merchant.

using MediatR;

namespace MerchantService.API.Application.Queries.Merchants;

/// <summary>
/// EN: Query to get the current merchant's profile.
/// VI: Query để lấy profile của merchant hiện tại.
/// </summary>
public record GetMerchantProfileQuery : IRequest<MerchantProfileDto?>;

/// <summary>
/// EN: Query to get a merchant by ID (admin).
/// VI: Query để lấy merchant theo ID (admin).
/// </summary>
public record GetMerchantByIdQuery(Guid MerchantId) : IRequest<MerchantProfileDto?>;

/// <summary>
/// EN: Merchant profile DTO.
/// VI: DTO profile merchant.
/// </summary>
public record MerchantProfileDto
{
    public Guid Id { get; init; }
    public Guid UserId { get; init; }
    public string BusinessName { get; init; } = null!;
    public string Type { get; init; } = null!;
    public string Status { get; init; } = null!;
    public string VerificationStatus { get; init; } = null!;
    public BusinessInfoDto? BusinessInfo { get; init; }
    public SettlementConfigDto? SettlementConfig { get; init; }
    public DateTime? VerifiedAt { get; init; }
    public DateTime CreatedAt { get; init; }
    public DateTime? UpdatedAt { get; init; }
    public int ShopCount { get; init; }
}

public record BusinessInfoDto
{
    public string? TaxId { get; init; }
    public string? BusinessLicenseNumber { get; init; }
    public string? CompanyRegistrationNumber { get; init; }
    public DateTime? EstablishedDate { get; init; }
    public bool IsComplete { get; init; }
}

public record SettlementConfigDto
{
    public BankAccountDto? BankAccount { get; init; }
    public decimal CommissionRate { get; init; }
    public string SettlementCycle { get; init; } = null!;
    public bool AutoSettlement { get; init; }
    public bool IsComplete { get; init; }
}

public record BankAccountDto
{
    public string? BankCode { get; init; }
    public string? BankName { get; init; }
    public string? AccountNumber { get; init; }
    public string? AccountHolderName { get; init; }
}
