using MediatR;

namespace FnbEngine.API.Application.Commands;

public record CreateRecipeCommand : IRequest<Guid>
{
    public Guid ShopId { get; init; }
    public Guid ProductId { get; init; }
    public string Name { get; init; } = "";
    public string? Instructions { get; init; }
    public int PrepTimeMinutes { get; init; }
    public List<IngredientItem>? Ingredients { get; init; }
}

public record UpdateRecipeCommand : IRequest<bool>
{
    public Guid RecipeId { get; init; }
    public Guid ShopId { get; init; }
    public Guid ProductId { get; init; }
    public string Name { get; init; } = "";
    public string? Instructions { get; init; }
    public int PrepTimeMinutes { get; init; }
    public List<IngredientItem>? Ingredients { get; init; }
}

public record DeleteRecipeCommand(Guid RecipeId) : IRequest<bool>;

// EN: Ingredient item DTO — includes optional inventory item link for COGS.
// VI: DTO nguyên liệu — bao gồm liên kết tùy chọn đến mặt hàng tồn kho để tính giá vốn.
public record IngredientItem(string IngredientName, decimal Quantity, string Unit, decimal CostPerUnit,
    Guid? InventoryItemId = null, decimal QuantityPerServing = 0);
