public SearchFixtureData() { RequestCase1 = SetRequestCase1(); RequestCase2 = SetRequestCase2(); RequestCase3 = SetRequestCase3(); RequestCase4 = SetRequestCase4(); ValidRequestCase1 = SetValidRequestCase1(); HotelAvailabilityRequestCase1 = SetHotelAvailabilityRequestCase1(); }
public HotelAvailabilityRequest Request(SearchRequest searchRequest) { var request = new HotelAvailabilityRequest(); request.CheckIn = searchRequest.FromDate.Value; request.CheckOut = searchRequest.ToDate.Value; request.Nights = (searchRequest.ToDate.Value - searchRequest.FromDate.Value).Days; request.Adults = searchRequest.Adults; request.Children = searchRequest.Children; request.Infants = searchRequest.Infants; request.Rooms = searchRequest.Rooms; request.HotelCategory = searchRequest.HotelCategory; return(request); }
public async Task <IActionResult> SearchHotels(HotelAvailabilityRequest request) { var query = new SearchHotelAvailabilityQuery( request.Infants, request.Children, request.Adults, request.StayDate, request.HotelName, request.NetPrice, request.Region, request.Country, request.Available); var result = await _mediatr.Send(query, new CancellationToken()); return(result != null ? (IActionResult)Ok(result) : NotFound(new { Message = $"No Hotels were found." })); }
public HotelAvailabilityResponse SearchHotelAvailability(HotelAvailabilityRequest request) { return(new HotelAvailabilityResponse()); }