Example #1
0
        public static void InsertCouponItem(ICouponService categorytService, decimal minAmountLimit, int rate, decimal discountAmount, DiscountType discountType)
        {
            Coupon coupon = new Coupon();

            coupon.MinAmountLimit = minAmountLimit;
            coupon.Rate           = rate;
            coupon.DiscountAmount = discountAmount;
            coupon.DiscountType   = (int)discountType;
            categorytService.Add(coupon);
        }
Example #2
0
        public IActionResult Post([FromBody] Coupon body)
        {
            var entity = _manager.Add(body);

            return(ResponseJson(entity));
        }
Example #3
0
        public async Task <IActionResult> Add([FromBody] CreateCouponModel model)
        {
            var result = await _couponService.Add(model);

            return(Created(result.Id.ToString(), null));
        }