using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using SportsDivision.Domain.Entities;
using SportsDivision.Infrastructure.Identity;

namespace SportsDivision.Infrastructure.Data;

public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
    public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) { }

    public DbSet<Zone> Zones => Set<Zone>();
    public DbSet<School> Schools => Set<School>();
    public DbSet<Student> Students => Set<Student>();
    public DbSet<EventLevel> EventLevels => Set<EventLevel>();
    public DbSet<Event> Events => Set<Event>();
    public DbSet<Tournament> Tournaments => Set<Tournament>();
    public DbSet<TournamentEventLevel> TournamentEventLevels => Set<TournamentEventLevel>();
    public DbSet<EventRegistration> EventRegistrations => Set<EventRegistration>();
    public DbSet<RelayTeam> RelayTeams => Set<RelayTeam>();
    public DbSet<RelayTeamMember> RelayTeamMembers => Set<RelayTeamMember>();
    public DbSet<Round> Rounds => Set<Round>();
    public DbSet<Heat> Heats => Set<Heat>();
    public DbSet<HeatLane> HeatLanes => Set<HeatLane>();
    public DbSet<HighJumpHeight> HighJumpHeights => Set<HighJumpHeight>();
    public DbSet<HighJumpAttempt> HighJumpAttempts => Set<HighJumpAttempt>();
    public DbSet<Score> Scores => Set<Score>();
    public DbSet<ScoringConstant> ScoringConstants => Set<ScoringConstant>();
    public DbSet<PlacementPointConfig> PlacementPointConfigs => Set<PlacementPointConfig>();

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        modelBuilder.ApplyConfigurationsFromAssembly(typeof(ApplicationDbContext).Assembly);
    }
}
