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

namespace Indotalent.Infrastructure.Database.Demo;

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

        var salesTeams = new List<SalesTeam>
        {
            new SalesTeam { Name = "The Trailblazers" },
            new SalesTeam { Name = "Revenue Rockets" },
            new SalesTeam { Name = "Deal Makers" },
            new SalesTeam { Name = "Sales Ninjas" },
            new SalesTeam { Name = "Profit Pioneers" },
            new SalesTeam { Name = "Closing Crew" },
            new SalesTeam { Name = "Growth Gurus" },
            new SalesTeam { Name = "The Persuaders" },
            new SalesTeam { Name = "Market Mavens" },
            new SalesTeam { Name = "Sales Savants" }
        };

        foreach (var salesTeam in salesTeams)
        {
            await context.SalesTeam.AddAsync(salesTeam);
        }

        await context.SaveChangesAsync();
    }
}