namespace Brizco.Repository.Handlers.ShiftPlan;

public class GetShiftPlansQueryHandler : IRequestHandler<GetShiftPlansQuery, List<ShiftPlanSDto>>
{
    private readonly IRepositoryWrapper _repositoryWrapper;
    private readonly ICurrentUserService _currentUserService;

    public GetShiftPlansQueryHandler(IRepositoryWrapper repositoryWrapper, ICurrentUserService currentUserService)
    {
        _repositoryWrapper = repositoryWrapper;
        _currentUserService = currentUserService;
    }
    public async Task<List<ShiftPlanSDto>> Handle(GetShiftPlansQuery request, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();

        var shifts = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>().TableNoTracking
            .OrderByDescending(s => s.CreatedAt)
            .Skip(request.Page * 15).Take(15)
            .Select(ShiftPlanMapper.ProjectToSDto)
            .ToListAsync(cancellationToken);

        return shifts;
    }
}