Class PricingPlanRevisionBuilder
Object
PricingPlanRevisionBuilder
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.
The revision type is one of the Pricing Plan Revision Types that the Pricing Plan Type of the Pricing Plan allows:
- A type named with
withRevisionType(String)must be one of the allowed types and must be Active. - Without
withRevisionType(String), the builder selects the allowed type that is Active. If no allowed type is Active, or more than one is,build()throws anIllegalArgumentException.
Example:
def ppr = api.createPricingPlanRevision(ppTypedId)
.withName("my-revision")
.withLabel("My Revision")
.withDescription("Created via Groovy API")
.withRevisionType(pprtTypedId)
.build()
- Since:
- 17.0
-
Constructor Summary
ConstructorsConstructorDescriptionPricingPlanRevisionBuilder(PersistedObjectService objService, String ppTypedId) -
Method Summary
Modifier and TypeMethodDescriptionPricingPlanRevisionbuild()Creates and persists the PricingPlanRevision with the configured properties.withDescription(String description) Sets the description of the revision.Sets the display label of the revision.Sets the unique name (business key) of the revision.withRevisionType(String pprtTypedId) Sets the revision type.
-
Constructor Details
-
PricingPlanRevisionBuilder
-
-
Method Details
-
withName
Sets the unique name (business key) of the revision.- Parameters:
name- unique name- Returns:
- this builder
-
withLabel
Sets the display label of the revision.- Parameters:
label- display label- Returns:
- this builder
-
withDescription
Sets the description of the revision.- Parameters:
description- description text- Returns:
- this builder
-
withRevisionType
Sets the revision type. It must be one of the types allowed by the Pricing Plan Type of the Pricing Plan, and it must be Active. If omitted, the builder selects the only allowed type that is Active.- Parameters:
pprtTypedId- typed ID of the revision type (e.g."42.PPRT")- Returns:
- this builder
- Since:
- 18.0
-
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, or the revision type cannot be resolved, or the resolved revision type is archivedIllegalStateException- if the revision fails validation
-