Class DigitalCardCreationPayload


  • public class DigitalCardCreationPayload
    extends Object
    Represents the payload for creating a digital loyalty card. This class contains details about the card number, type, and optional card properties. If a card number is not provided, a new one will be generated automatically.

    The type of the card must be valid, either "Permanent" or "Temporary".

    Author:
    nikritikos
    • Constructor Detail

      • DigitalCardCreationPayload

        public DigitalCardCreationPayload()
    • Method Detail

      • isCardTypeValid

        @AssertTrue(message="Unsupported card type")
        public boolean isCardTypeValid()
        Validates whether the provided card type is supported.
        Returns:
        true if the card type is valid, false otherwise.
      • getCardNumber

        public String getCardNumber()
        Gets the loyalty card number.
        Returns:
        the card number.
      • setCardNumber

        public void setCardNumber​(String cardNumber)
        Sets the loyalty card number.
        Parameters:
        cardNumber - the card number to set.
      • getType

        public String getType()
        Gets the type of the loyalty card.
        Returns:
        the card type.
      • setType

        public void setType​(String type)
        Sets the type of the loyalty card.
        Parameters:
        type - the card type to set.
      • getCardProperties

        public DigitalCardPropertiesPayload getCardProperties()
        Gets the loyalty card properties.
        Returns:
        the card properties.
      • setCardProperties

        public void setCardProperties​(DigitalCardPropertiesPayload cardProperties)
        Sets the loyalty card properties.
        Parameters:
        cardProperties - the card properties to set.
      • toString

        public String toString()
        Returns a string representation of the digital card creation payload.
        Overrides:
        toString in class Object
        Returns:
        a formatted string representing the payload.