Interface CouponWsFacades<T extends AbstractCouponWsDTO>
- All Known Implementing Classes:
AbstractCouponWsFacades,DefaultMultiCodeCouponWsFacades,DefaultSingleCodeCouponWsFacades
public interface CouponWsFacades<T extends AbstractCouponWsDTO>
Interface declaring basic web-services facade operations on coupons
-
Method Summary
Modifier and TypeMethodDescriptioncreateCoupon(T coupon) Creates the coupon, given the coupon data.getCoupons(PaginationData pagination, List<SortData> sort) Returns a restricted size list (page) of available couponsgetCouponWsDTO(String couponId) Given the couponId string, returns the coupon DTO, otherwise throws exceptionvoidupdateCoupon(T coupon) Updates the coupon identified by it couponIdvoidupdateCouponStatus(String couponId, Boolean active) Updates status of a coupon identified by it couponIdvalidateCoupon(String couponId) Validates the given couponId, throws an exception if coupon id is invalidvalidateCoupon(String couponId, String customerId) Validates the given couponId for the given customer, throws an exception if coupon id or customer id is invalid
-
Method Details
-
getCouponWsDTO
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
Creates the coupon, given the coupon data. Throws exception otherwise- Parameters:
coupon- - data to create coupon with- Returns:
- - a new instance of coupon
-
updateCoupon
Updates the coupon identified by it couponId- Parameters:
coupon- - data to update coupon with
-
updateCouponStatus
Updates status of a coupon identified by it couponId- Parameters:
couponId- - identifier of a coupon to set statusactive- - coupon status to set
-
validateCoupon
Validates the given couponId, throws an exception if coupon id is invalid- Parameters:
couponId- a string to be used to validate a coupon- Returns:
- - an instance of
CouponValidationResponseWsDTO - Throws:
CouponNotFoundException
-
validateCoupon
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 couponcustomerId- the user id- Returns:
- - an instance of
CouponValidationResponseWsDTO - Throws:
CouponNotFoundException
-
getCoupons
Returns a restricted size list (page) of available coupons- Parameters:
pagination- - pagination instructionssort- - sort instructions- Returns:
- - an instance of
SearchPageDatacontaining a list of coupons, registered in the system
-