Class PricingPlanRevisionBuilder

Object
PricingPlanRevisionBuilder

public class PricingPlanRevisionBuilder extends Object
Creates a Pricing Plan Revision (PPR) in an existing Pricing Plan. Obtain it with api.createPricingPlanRevision().

The builder creates the revision in DRAFT status. It sets no activeFrom or activeTo dates. The publish or schedule step assigns them later.

Example:


 def ppr = api.createPricingPlanRevision(ppTypedId)
     .withName("my-revision")
     .withLabel("My Revision")
     .withDescription("Created via Groovy API")
     .build()
 
Since:
17.0
  • Constructor Details

    • PricingPlanRevisionBuilder

      public PricingPlanRevisionBuilder(PersistedObjectService objService, String ppTypedId)
  • Method Details

    • withName

      public PricingPlanRevisionBuilder withName(String name)
      Sets the unique name (business key) of the revision.
      Parameters:
      name - unique name
      Returns:
      this builder
    • withLabel

      public PricingPlanRevisionBuilder withLabel(String label)
      Sets the display label of the revision.
      Parameters:
      label - display label
      Returns:
      this builder
    • withDescription

      public PricingPlanRevisionBuilder withDescription(String description)
      Sets the description of the revision.
      Parameters:
      description - description text
      Returns:
      this builder
    • build

      public PricingPlanRevision build()
      Creates and persists the PricingPlanRevision with the configured properties.
      Returns:
      the persisted PPR entity (converted to a safe map by the sandbox)
      Throws:
      IllegalArgumentException - if name was not set
      IllegalStateException - if the revision fails validation