Interface OverlappingPriceValidityError

All Superinterfaces:
ErrorObject

public interface OverlappingPriceValidityError extends ErrorObject

Returned when a given Price validity period conflicts with an existing one. Every Price of a Product Variant with the same combination of currency, country, Customer Group, and Channel must have non-overlapping validity periods (validFrom and validUntil).

The error is returned as a failed response to the Create Product or Update Product request.


Example to create an instance using the builder pattern

     OverlappingPriceValidityError overlappingPriceValidityError = OverlappingPriceValidityError.builder()
             .message("{message}")
             .conflictingPrice("{conflictingPrice}")
             .currency("{currency}")
             .build()
 
  • Field Details

    • OVERLAPPING_PRICE_VALIDITY

      static final String OVERLAPPING_PRICE_VALIDITY
      discriminator value for OverlappingPriceValidityError
      See Also:
  • Method Details

    • getCode

      @NotNull @NotNull String getCode()
      Description copied from interface: ErrorObject

      Error identifier.

      Specified by:
      getCode in interface ErrorObject
      Returns:
      code
    • getMessage

      @NotNull @NotNull String getMessage()

      "Two prices have overlapping validity periods."

      Specified by:
      getMessage in interface ErrorObject
      Returns:
      message
    • getConflictingPrice

      @NotNull @NotNull String getConflictingPrice()

      Unique identifier of the conflicting Embedded Price.

      Returns:
      conflictingPrice
    • getCurrency

      @NotNull @NotNull String getCurrency()

      Currency code of the Price.

      Returns:
      currency
    • getCountry

      String getCountry()

      Country code of the Price.

      Returns:
      country
    • getCustomerGroup

      @Valid @Valid CustomerGroupResourceIdentifier getCustomerGroup()

      CustomerGroup for which the Price is valid.

      Returns:
      customerGroup
    • getChannel

      @Valid @Valid ChannelResourceIdentifier getChannel()

      Channel for which the Price is valid.

      Returns:
      channel
    • getValidFrom

      ZonedDateTime getValidFrom()

      Date and time (UTC) from which the Embedded Price is valid.

      Returns:
      validFrom
    • getValidUntil

      ZonedDateTime getValidUntil()

      Date and time (UTC) until which the Embedded Price is valid.

      Returns:
      validUntil
    • getConflictingValidFrom

      ZonedDateTime getConflictingValidFrom()

      Date and time (UTC) from which the conflicting Embedded Price is valid.

      Returns:
      conflictingValidFrom
    • getConflictingValidUntil

      ZonedDateTime getConflictingValidUntil()

      Date and time (UTC) until which the conflicting Embedded Price is valid.

      Returns:
      conflictingValidUntil
    • setMessage

      void setMessage(String message)

      "Two prices have overlapping validity periods."

      Specified by:
      setMessage in interface ErrorObject
      Parameters:
      message - value to be set
    • setConflictingPrice

      void setConflictingPrice(String conflictingPrice)

      Unique identifier of the conflicting Embedded Price.

      Parameters:
      conflictingPrice - value to be set
    • setCurrency

      void setCurrency(String currency)

      Currency code of the Price.

      Parameters:
      currency - value to be set
    • setCountry

      void setCountry(String country)

      Country code of the Price.

      Parameters:
      country - value to be set
    • setCustomerGroup

      void setCustomerGroup(CustomerGroupResourceIdentifier customerGroup)

      CustomerGroup for which the Price is valid.

      Parameters:
      customerGroup - value to be set
    • setChannel

      void setChannel(ChannelResourceIdentifier channel)

      Channel for which the Price is valid.

      Parameters:
      channel - value to be set
    • setValidFrom

      void setValidFrom(ZonedDateTime validFrom)

      Date and time (UTC) from which the Embedded Price is valid.

      Parameters:
      validFrom - value to be set
    • setValidUntil

      void setValidUntil(ZonedDateTime validUntil)

      Date and time (UTC) until which the Embedded Price is valid.

      Parameters:
      validUntil - value to be set
    • setConflictingValidFrom

      void setConflictingValidFrom(ZonedDateTime conflictingValidFrom)

      Date and time (UTC) from which the conflicting Embedded Price is valid.

      Parameters:
      conflictingValidFrom - value to be set
    • setConflictingValidUntil

      void setConflictingValidUntil(ZonedDateTime conflictingValidUntil)

      Date and time (UTC) until which the conflicting Embedded Price is valid.

      Parameters:
      conflictingValidUntil - value to be set
    • of

      factory method
      Returns:
      instance of OverlappingPriceValidityError
    • of

      factory method to create a shallow copy OverlappingPriceValidityError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      Specified by:
      copyDeep in interface ErrorObject
    • deepCopy

      @Nullable static OverlappingPriceValidityError deepCopy(@Nullable OverlappingPriceValidityError template)
      factory method to create a deep copy of OverlappingPriceValidityError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for OverlappingPriceValidityError
      Returns:
      builder
    • builder

      create builder for OverlappingPriceValidityError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withOverlappingPriceValidityError

      default <T> T withOverlappingPriceValidityError(Function<OverlappingPriceValidityError,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static tools.jackson.core.type.TypeReference<OverlappingPriceValidityError> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference