using Baya.Domain.Entities.Reviews;

namespace Baya.Infrastructure.Persistence.Configuration.ReviewsConfig;

/// <summary>
/// The starter review-tag vocabulary, seeded via <c>HasData</c> so it lands with the migration on a fresh DB.
/// Ids are fixed and deterministic (1…5, sort_order = id) so re-running is idempotent and the model snapshot
/// stays stable. Growing the vocabulary is another seeded/admin row, not a schema change.
/// </summary>
internal static class ReviewsSeed
{
    // (id, code, label_fa, label_en)
    private static readonly (long Id, string Code, string LabelFa, string LabelEn)[] TagRows =
    [
        (1, ReviewTagCodes.Punctual, "وقت‌شناس", "Punctual"),
        (2, ReviewTagCodes.Professional, "حرفه‌ای", "Professional"),
        (3, ReviewTagCodes.Clean, "تمیز و بهداشتی", "Clean"),
        (4, ReviewTagCodes.Kind, "مهربان", "Kind"),
        (5, ReviewTagCodes.Communicative, "خوش‌برخورد", "Communicative"),
    ];

    public static object[] Tags()
    {
        var ts = SeedConstants.Timestamp;
        return TagRows
            .Select(t => (object)new
            {
                t.Id,
                t.Code,
                t.LabelFa,
                t.LabelEn,
                IsActive = true,
                SortOrder = (int)t.Id,
                CreatedAt = ts
            })
            .ToArray();
    }
}
