@spiffcommerce/core 21.2.1 → 21.2.2-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -836,6 +836,28 @@ interface Product {
836
836
  * The Spiff SKU code for the product.
837
837
  */
838
838
  skuCode?: string;
839
+ /**
840
+ * Price breaks for this product when dealing with quantity.
841
+ */
842
+ priceBreaks?: ProductPriceBreak[];
843
+ }
844
+ /**
845
+ * A price break represents a minimum quantity of a product and the price that will be charged for that quantity.
846
+ * This can be seen as an override for the base price of the product.
847
+ */
848
+ interface ProductPriceBreak {
849
+ /**
850
+ * The id of this price breal.
851
+ */
852
+ id: string;
853
+ /**
854
+ * The minimum quantity of this price break. A positive integer.
855
+ */
856
+ minQty: number;
857
+ /**
858
+ * A percentage to apply to the overall price. A value between 0-1 where 1 retains 100% of the original price and 0 completely discounts it to free.
859
+ */
860
+ percentage: number;
839
861
  }
840
862
  interface ProductTag {
841
863
  id: string;
@@ -1422,6 +1444,14 @@ interface ExperienceOptions {
1422
1444
  * should get an instance of this class from a Client you have constructed previously.
1423
1445
  */
1424
1446
  interface WorkflowExperience {
1447
+ /**
1448
+ * Get the bundle this experience is part of. May be undefined.
1449
+ */
1450
+ getBundle(): Bundle | undefined;
1451
+ /**
1452
+ * Set the bundle this experience is part of. Can be cleared using undefined.
1453
+ */
1454
+ setBundle(bundle: Bundle | undefined): any;
1425
1455
  /**
1426
1456
  * Returns the client that was responsible for spawning this experience.
1427
1457
  */
@@ -1582,10 +1612,16 @@ declare class WorkflowExperienceImpl implements WorkflowExperience {
1582
1612
  readonly workflowManager: WorkflowManager;
1583
1613
  readonly isReadOnly: boolean;
1584
1614
  readonly cachedStepHandles: Map<string, StepHandle<any>>;
1615
+ /**
1616
+ * Bundle this experience has been added to.
1617
+ */
1618
+ private bundle?;
1585
1619
  private renderableScenes;
1586
1620
  private renderableSceneCallbacks;
1587
1621
  private eventCallbacks;
1588
1622
  constructor(client: SpiffCommerceClient, experienceOptions: ExperienceOptions);
1623
+ getBundle(): Bundle | undefined;
1624
+ setBundle(bundle: Bundle): void;
1589
1625
  getClient(): SpiffCommerceClient;
1590
1626
  getIsReadOnly(): boolean;
1591
1627
  getCommandContext(): CommandContext;
@@ -1598,6 +1634,7 @@ declare class WorkflowExperienceImpl implements WorkflowExperience {
1598
1634
  getBasePriceSubunits(includeAdditionalProduct?: boolean): number;
1599
1635
  getAdditionalProductPriceSubunits(): number | undefined;
1600
1636
  getTotalPriceSubunits(): number;
1637
+ private getPriceSubUnitsAfterPriceBreaks;
1601
1638
  copySelectionsViaGlobalConfiguration(bundle: Bundle, experience: WorkflowExperience, filter?: StepHandle<AnyStepData>[]): Promise<void>;
1602
1639
  getStepByName(name: string): TextStepHandle | FrameStepHandle | ShapeStepHandle | InformationStepHandle | IllustrationStepHandle | MaterialStepHandle | ModelStepHandle | PictureStepHandle | QuestionStepHandle | undefined;
1603
1640
  getStepsByType(type: StepType): StepHandle<AnyStepData>[];