Interface CouponWsFacades<T extends AbstractCouponWsDTO>

    • Method Detail

      • getCouponWsDTO

        T getCouponWsDTO​(java.lang.String couponId)
        Given the couponId string, returns the coupon DTO, otherwise throws exception
        Parameters:
        couponId - a string to be used to find a coupon
        Returns:
        - an instance of coupon DTO
      • createCoupon

        T createCoupon​(T coupon)
        Creates the coupon, given the coupon data. Throws exception otherwise
        Parameters:
        coupon - - data to create coupon with
        Returns:
        - a new instance of coupon
      • updateCoupon

        void updateCoupon​(T coupon)
        Updates the coupon identified by it couponId
        Parameters:
        coupon - - data to update coupon with
      • updateCouponStatus

        void updateCouponStatus​(java.lang.String couponId,
                                java.lang.Boolean active)
        Updates status of a coupon identified by it couponId
        Parameters:
        couponId - - identifier of a coupon to set status
        active - - coupon status to set
      • validateCoupon

        CouponValidationResponseWsDTO validateCoupon​(java.lang.String couponId,
                                                     java.lang.String customerId)
        Validates the given couponId for the given customer, throws an exception if coupon id or customer id is invalid
        Parameters:
        couponId - a string to be used to validate a coupon
        customerId - the user id
        Returns:
        - an instance of CouponValidationResponseWsDTO
        Throws:
        CouponNotFoundException
      • getCoupons

        SearchPageData getCoupons​(PaginationData pagination,
                                  java.util.List<SortData> sort)
        Returns a restricted size list (page) of available coupons
        Parameters:
        pagination - - pagination instructions
        sort - - sort instructions
        Returns:
        - an instance of SearchPageData containing a list of coupons, registered in the system