using MediatR;

namespace MktXService.API.Application.Commands;

/// <summary>
/// EN: Command to create a new template.
/// VI: Command để tạo template mới.
/// </summary>
public record CreateTemplateCommand(
    Guid MerchantId,
    string Name,
    string Type,
    string Content
) : IRequest<CreateTemplateResult>;

public record CreateTemplateResult(bool Success, Guid? TemplateId, string? Error);

/// <summary>
/// EN: Command to update a template.
/// VI: Command để cập nhật template.
/// </summary>
public record UpdateTemplateCommand(
    Guid TemplateId,
    string Name,
    string Content
) : IRequest<bool>;

/// <summary>
/// EN: Command to delete a template.
/// VI: Command để xóa template.
/// </summary>
public record DeleteTemplateCommand(Guid TemplateId) : IRequest<bool>;

/// <summary>
/// EN: Command to preview template with sample data.
/// VI: Command để xem trước template với dữ liệu mẫu.
/// </summary>
public record PreviewTemplateCommand(
    Guid TemplateId,
    Dictionary<string, object> Variables
) : IRequest<PreviewTemplateResult>;

public record PreviewTemplateResult(bool Success, string? RenderedContent, string? Error);
