Package net.pricefx.common.apibuilder.pricingplan


package net.pricefx.common.apibuilder.pricingplan
Builders that create Pricing Plan objects from a logic.

Entry points: api.createPricingPlanRevision() and api.createPricingPlanScenario().

  • Create a revision in an existing Pricing Plan. The revision starts in DRAFT status, without active dates.
  • Create a scenario in a DRAFT revision. The scenario type comes from the types that the Pricing Plan Type of the parent Pricing Plan allows.

build() saves the object and returns it as a map. It throws an IllegalArgumentException when no name is set.

Both calls modify data, so they work only in the contexts listed under Object modifications in PublicGroovyAPI. In any other context they return null.

Example: create a revision, then a scenario in it.


 def ppr = api.createPricingPlanRevision(ppTypedId)
     .withName("my-revision")
     .withLabel("My Revision")
     .build()

 def pps = api.createPricingPlanScenario(ppr.typedId)
     .withName("my-scenario")
     .withLabel("My Scenario")
     .withScenarioType(ppstTypedId)
     .build()
 

Reference

Since:
17.0