using CalledIt.DataAccess.Entities;
using Microsoft.EntityFrameworkCore;

namespace CalledIt.DataAccess;

public class CalledItDbContext : DbContext
{
    public CalledItDbContext(DbContextOptions<CalledItDbContext> options) 
        : base(options)
    {
    }

    public DbSet<UserEntity> Users { get; set; }

    public DbSet<CompetitionEntity> Competitions { get; set; }

    public DbSet<TeamEntity> Teams { get; set; }

    public DbSet<MatchEntity> Matches { get; set; }

    public DbSet<BetEntity> Bets { get; set; }

    public DbSet<RevokedTokenEntity> RevokedTokens { get; set; }

    public DbSet<RefreshTokenEntity> RefreshTokens { get; set; }

    public DbSet<GroupEntity> Groups { get; set; }

    public DbSet<GroupMemberEntity> GroupMembers { get; set; }

    public DbSet<UserCompetitionStatsEntity> UserCompetitionStats { get; set; }

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