public async Task <IActionResult> CreateCoupon([FromBody] CreateCouponRequestDto dto) { try { var coupon = await _couponService.CreateCouponAsync(dto); return(Ok(coupon)); } catch (NotFoundException ex) { return(NotFound(ex.Message)); } catch (BadRequestException ex) { return(BadRequest(ex.Message)); } catch (Exception ex) { _logger.LogCritical($"CreateCoupon() error {ex}"); return(StatusCode(500, "Internal Server Error: " + ex.Message)); } }
public async Task <CouponDto> CreateCouponAsync(CreateCouponRequestDto dto) { throw new Exception(); }