using Microsoft.EntityFrameworkCore;
using SportsDivision.Domain.Entities;
using SportsDivision.Domain.Enums;
using SportsDivision.Domain.Interfaces;
using SportsDivision.Infrastructure.Data;

namespace SportsDivision.Infrastructure.Repositories;

public class EventLevelRepository : Repository<EventLevel>, IEventLevelRepository
{
    public EventLevelRepository(ApplicationDbContext context) : base(context) { }
    public async Task<IEnumerable<EventLevel>> GetBySchoolLevelAsync(SchoolLevel level) => await _dbSet.Where(e => e.SchoolLevel == level).OrderBy(e => e.SortOrder).ToListAsync();
    public async Task<IEnumerable<EventLevel>> GetBySexAsync(Sex sex) => await _dbSet.Where(e => e.Sex == sex).OrderBy(e => e.SortOrder).ToListAsync();
}
