Example #1
0
        public async Task <IActionResult> CalculateOffer([FromBody] NewOfferDto offer)
        {
            if (offer == null || offer.Alternatives == null)
            {
                return(BadRequest($"Invalid model."));
            }

            try
            {
                var response = await _offerService.CalculateOfferAsync(offer);

                return(Ok(response));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e));
            }
        }