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

namespace Indotalent.Infrastructure.Database.Demo;

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

        var bookingGroups = new List<BookingGroup>
        {
            new BookingGroup { Name = "Vehicle" },
            new BookingGroup { Name = "Room" },
            new BookingGroup { Name = "Electronic" }
        };

        foreach (var bookingGroup in bookingGroups)
        {
            await context.BookingGroup.AddAsync(bookingGroup);
        }

        await context.SaveChangesAsync();
    }
}