Interface CouponApi


public interface CouponApi
CouponApi contains all the api operations for handling Coupon of DzidziApp.
  • Method Details

    • getCouponById

      Coupon getCouponById(UUID couponId)
      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

      List<Coupon> getCouponsByCouponIds(List<UUID> couponIds)
      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

      Coupon addCoupon(AddCouponRequest addCouponRequest)
      Adds/creates a new coupon with the given request.
      Parameters:
      addCouponRequest - the AddCouponRequest contains the properties to add a new coupon.
      Returns:
      the coupon created/added
    • findCouponByCouponNumber

      Coupon findCouponByCouponNumber(String couponNumber)
      Finds coupon by the coupon number
      Parameters:
      couponNumber - the number of the coupon
      Returns:
      the found coupon
    • deleteCoupon

      void deleteCoupon(UUID couponId)
      Deletes a coupon by the given id
      Parameters:
      couponId - the id of the coupon
    • checkIfCouponIsActive

      void checkIfCouponIsActive(String couponNumber)
    • getCouponsByRestaurantId

      List<Coupon> getCouponsByRestaurantId(UUID restaurantId)
    • getCouponsByOrganization

      List<Coupon> getCouponsByOrganization()
    • findCoupons

      DzidziPaginationDTO<Coupon> findCoupons(FindCouponRequest findCouponRequest)