using Indotalent.Data.Entities;
using Microsoft.EntityFrameworkCore;

namespace Indotalent.Infrastructure.Database.Demo;

public static class PaymentMethodSeeder
{
    public static async Task GenerateDataAsync(AppDbContext context)
    {
        if (await context.PaymentMethod.AnyAsync()) return;

        var paymentMethods = new List<PaymentMethod>
        {
            new PaymentMethod { Name = "Credit Card" },
            new PaymentMethod { Name = "Debit Card" },
            new PaymentMethod { Name = "Bank Transfer" },
            new PaymentMethod { Name = "PayPal" },
            new PaymentMethod { Name = "Cash" }
        };

        foreach (var paymentMethod in paymentMethods)
        {
            await context.PaymentMethod.AddAsync(paymentMethod);
        }

        await context.SaveChangesAsync();
    }
}