Package com.dzidzi.api
Interface CouponApi
public interface CouponApi
CouponApi contains all the api operations for handling
Coupon of DzidziApp.-
Method Summary
Modifier and TypeMethodDescriptionaddCoupon(AddCouponRequest addCouponRequest) Adds/creates a new coupon with the given request.voidcheckIfCouponIsActive(String couponNumber) voiddeleteCoupon(UUID couponId) Deletes a coupon by the given idfindCouponByCouponNumber(String couponNumber) Finds coupon by the coupon numberfindCoupons(FindCouponRequest findCouponRequest) getCouponById(UUID couponId) Finds coupon by the given id.getCouponsByCouponIds(List<UUID> couponIds) Finds coupons by the given coupon ids.getCouponsByRestaurantId(UUID restaurantId)
-
Method Details
-
getCouponById
Finds coupon by the given id.- Parameters:
couponId- the id of the coupon- Returns:
- the coupon found
- Throws:
com.dzidzi.exception.EntityNotFoundException- when coupon is not found
-
getCouponsByCouponIds
Finds coupons by the given coupon ids.- Parameters:
couponIds- list of coupon ids- Returns:
- list of coupons
- Throws:
com.dzidzi.exception.EntityNotFoundException- when coupon is not found
-
addCoupon
Adds/creates a new coupon with the given request.- Parameters:
addCouponRequest- theAddCouponRequestcontains the properties to add a new coupon.- Returns:
- the coupon created/added
-
findCouponByCouponNumber
Finds coupon by the coupon number- Parameters:
couponNumber- the number of the coupon- Returns:
- the found coupon
-
deleteCoupon
Deletes a coupon by the given id- Parameters:
couponId- the id of the coupon
-
checkIfCouponIsActive
-
getCouponsByRestaurantId
-
getCouponsByOrganization
-
findCoupons
-