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, }); }
public async Task <IActionResult> CreateBookable([FromBody] BookableCreateRequest createRequest) { await _bookableHandler.Create(BookableMapper.MapToBookable(createRequest)); return(Ok()); }