using MediatR;
using SolutionErp.Application.Master.Suppliers.Import;

namespace SolutionErp.Application.Master.Suppliers.Queries.GetSupplierImportTemplate;

/// <summary>
/// Tải file .xlsx mẫu "Database NCC" (30 cột, header ROW 4) — Supplier import v2 (S113).
/// Bytes sinh từ ISupplierExcelImportService.BuildTemplate() (single-source token, 0 drift).
/// </summary>
public sealed record GetSupplierImportTemplateQuery : IRequest<byte[]>;

public sealed class GetSupplierImportTemplateQueryHandler(ISupplierExcelImportService importService)
    : IRequestHandler<GetSupplierImportTemplateQuery, byte[]>
{
    public Task<byte[]> Handle(GetSupplierImportTemplateQuery request, CancellationToken ct)
        => Task.FromResult(importService.BuildTemplate());
}
