Exemplo n.º 1
0
 public static Bookable MapToBookable(BookableCreateRequest request)
 {
     return(new()
     {
         Id = Guid.Empty,
         Name = request.Name,
         From = request.From ?? ApplicationTime.UtcNow(),
         To = request.To ?? DateTime.MaxValue,
         Foresight = request.Foresight,
         StartInterval = request.StartInterval,
         DaysAndTimes = request.DaysAndTimes,
         NonBookableDays = request.NonBookableDays,
     });
 }
Exemplo n.º 2
0
        public async Task <IActionResult> CreateBookable([FromBody] BookableCreateRequest createRequest)
        {
            await _bookableHandler.Create(BookableMapper.MapToBookable(createRequest));

            return(Ok());
        }