stylist / backend / Stylist.Web / Controllers / SchedulesController.cs
SchedulesController.cs
Raw
using Microsoft.AspNetCore.Mvc;
using Stylist.Domain.Repositories.Interfaces;

namespace Stylist.Web.Controllers
{
    public class SchedulesController : ApiController
    {
        private readonly IScheduleRepository _scheduleRepository;
        public SchedulesController(IScheduleRepository scheduleRepository)
        {
            _scheduleRepository = scheduleRepository;
        }

        [HttpGet(ApiEndpoints.Schedules.GetAllHairdresserAvailableSlotsByDate)]
        public async Task<IActionResult> GetBySalon([FromRoute] int hairdresserId, int duration, DateTime date)
        {
            return Ok(await _scheduleRepository.GetAllHairdresserAvailableSlotsByDate(hairdresserId, date, duration));
        }
    }
}