Ejemplo n.º 1
0
        public async Task <IActionResult> Update([FromBody] CardCostConfig.Request request)
        {
            try
            {
                await _cardCostConfigurationService.Update(
                    new CardCost
                {
                    Country = request.Country,
                    Cost    = request.Cost.Value
                });

                return(NoContent());
            }
            catch (CardCostNotConfiguredException)
            {
                return(NotFound());
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([FromBody] CardCostConfig.Request request)
        {
            try
            {
                await _cardCostConfigurationService.Add(
                    new CardCost
                {
                    Country = request.Country,
                    Cost    = request.Cost.Value
                });

                return(NoContent());
            }
            catch (CardCostAlreadyExistsException)
            {
                return(Conflict());
            }
        }