public async Task <IActionResult> GamingCheckInRequest([FromRoute] string venueId, [FromRoute] string areaId, [FromBody] GamingCheckInRequest checkIn)
        {
            try
            {
                // Check-in the patron to specified gaming area.
                await _patronService.SubmitGamingCheckIn(venueId, areaId, checkIn);

                // Log the check-in.
                _logger.LogInformation("Gaming check-in. [vId: {venueId}, aId: {areaId}]", venueId, areaId);

                // Return an empty OK status.
                return(Ok());
            }
            catch (VenueNotFoundException e)
            {
                // Error: Venue could not be found.
                _logger.LogInformation(e, "Venue could not be found to complete gaming check-in. [vId: {venueId}]", venueId);

                return(BadRequest(APIError.VenueNotFound()));
            }
            catch (AreaNotFoundException e)
            {
                _logger.LogInformation(e, "Could not find a gaming area in specified venue. [vId: {venueId}, aId: {areaId}]", venueId, areaId);

                return(BadRequest(APIError.AreaNotFound()));
            }
            catch (Exception e)
            {
                // Error: Unknown error.
                _logger.LogError(e, "Gaming check-in failed. [vId: {venueId}, aId: {areaId}]", venueId, areaId);

                return(BadRequest(APIError.UnknownError()));
            }
        }
        public async Task <IActionResult> DiningCheckIn([FromRoute] string venueId, [FromRoute] string areaId, [FromBody] DiningCheckInRequest checkIn)
        {
            try
            {
                // Check-in the group to the dining area.
                await _patronService.SubmitDiningCheckIn(venueId, areaId, checkIn);

                // Log the check-in.
                _logger.LogInformation("Dining check-in. [vId: {venueId}, aId: {areaId}, tN: {tableNumber}, count: {patronCount}]", venueId, areaId, checkIn.TableNumber, checkIn.People.Count);

                // Return empty OK status.
                return(Ok());
            }
            catch (VenueNotFoundException e)
            {
                // Error: Venue could not be found.
                _logger.LogInformation(e, "Venue could not be found to complete dining check-in. [vId: {venueId}]", venueId);

                return(BadRequest(APIError.VenueNotFound()));
            }
            catch (AreaNotFoundException e)
            {
                // Error: Are could not be found.
                _logger.LogInformation(e, "Could not find a dining area in specified venue. [vId: {venueId}, aId: {areaId}]", venueId, areaId);

                return(BadRequest(APIError.AreaNotFound()));
            }
            catch (ServiceNotFoundException e)
            {
                // Error: There is no active service in the specified area.
                _logger.LogInformation(e, "Venue area does not have an active service. [vId: {venueId}, aId: {areaId}]", venueId, areaId);

                return(BadRequest(APIError.AreaHasNoService()));
            }
            catch (Exception e)
            {
                // Error: Unknown error.
                _logger.LogError(e, "Dining check-in failed. [vId: {venueId}, aId: {areaId}, tN: {tableNumber}, count: {patronCount}]", venueId, areaId, checkIn.TableNumber, checkIn.People.Count);

                return(BadRequest(APIError.UnknownError()));
            }
        }
Exemplo n.º 3
0
        public async Task <IActionResult> GetVenueByURLName([FromRoute] string venueUrl)
        {
            try
            {
                return(Ok(await _venueService.GetVenueByURLName(venueUrl)));
            }
            catch (VenueNotFoundException)
            {
                // Error: Venue not found.
                _logger.LogInformation("Venue not found. [vUrl: {venueUrl}]", venueUrl);

                return(BadRequest(APIError.VenueNotFound()));
            }
            catch (Exception e)
            {
                // Error: Unknown error.
                _logger.LogError(e, "Failed to lookup venue. [vUrl: {venueUrl}]", venueUrl);

                return(BadRequest(APIError.UnknownError()));
            }
        }
Exemplo n.º 4
0
        public async Task <IActionResult> GetVenueById([FromRoute] string venueId)
        {
            try
            {
                // Pull venue information and return it.
                return(Ok(await _venueService.GetVenueById(venueId)));
            }
            catch (VenueNotFoundException)
            {
                // Error: Venue not found.
                _logger.LogInformation("Venue not found. [vId: {venueId}]", venueId);

                return(BadRequest(APIError.VenueNotFound()));
            }
            catch (Exception e)
            {
                // Error: Unknown error.
                _logger.LogError(e, "Failed to lookup venue. [vId: {venueId}]", venueId);

                return(BadRequest(APIError.UnknownError()));
            }
        }