Class CouponRequest

  • All Implemented Interfaces:
    EliquaAbstractRequestPayload
    Direct Known Subclasses:
    CouponRequestPlain, CouponUpdateRequest

    public abstract class CouponRequest
    extends CouponBasicPayload
    Abstract class representing a coupon request in the system.

    This class serves as a base for different types of coupon requests, allowing the system to manage various actions and attributes associated with coupons. The class supports polymorphism using the JsonTypeInfo and JsonSubTypes annotations, enabling dynamic coupon request types.

    Author:
    gkonomis
    • Constructor Detail

      • CouponRequest

        public CouponRequest()
    • Method Detail

      • getType

        public abstract String getType()
        Returns the type of the coupon request.

        This method should be implemented by subclasses to return the specific type of the coupon request (e.g., plain, special).

        Returns:
        The coupon request type.
      • setCouponCode

        public void setCouponCode​(String couponCode)
        Sets the coupon code.
        Overrides:
        setCouponCode in class CouponBasicPayload
        Parameters:
        couponCode - The coupon code to set.
      • setCouponSetCode

        public void setCouponSetCode​(String couponSetCode)
        Sets the coupon set code.
        Overrides:
        setCouponSetCode in class CouponBasicPayload
        Parameters:
        couponSetCode - The coupon set code to set.
      • getAction

        public String getAction()
        Gets the action to be performed on the coupon.
        Returns:
        The coupon action.
      • setAction

        public void setAction​(String action)
        Sets the action to be performed on the coupon.
        Parameters:
        action - The action to set.
      • getAttributes

        public List<EntityAttribute> getAttributes()
        Gets the list of attributes associated with this coupon request.
        Returns:
        The list of attributes.
      • addAtrribute

        public void addAtrribute​(EntityAttribute entityAttribute)
        Adds an attribute to the coupon request.
        Parameters:
        entityAttribute - The attribute to add.
      • isCouponValidity

        public boolean isCouponValidity()
        Checks if the coupon has validity dates.
        Returns:
        true if the coupon has validity dates; false otherwise.
      • setCouponValidity

        public void setCouponValidity​(boolean couponValidity)
        Sets whether the coupon has validity dates.
        Parameters:
        couponValidity - true if the coupon has validity dates; false otherwise.
      • toString

        public String toString()
        Converts the coupon request to a string representation.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the coupon request.