generate references (#7882)

This commit is contained in:
Shahed Nasser
2024-07-01 16:02:36 +03:00
committed by GitHub
parent b9036eca1a
commit dd864da4e0
2424 changed files with 106679 additions and 116201 deletions

View File

@@ -32,7 +32,7 @@ const priceLists =
## Parameters
<TypeList types={[{"name":"data","type":"[AddPriceListPricesDTO](../../../interfaces/pricing.AddPriceListPricesDTO/page.mdx)[]","description":"The prices to add for each price list.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"price_list_id","type":"`string`","description":"The ID of the price list to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePriceListPriceDTO](../../../interfaces/pricing.CreatePriceListPriceDTO/page.mdx)[]","description":"The prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPriceListPrices"/>
<TypeList types={[{"name":"data","type":"[AddPriceListPricesDTO](../../../interfaces/pricing.AddPriceListPricesDTO/page.mdx)[]","description":"The prices to add for each price list.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"price_list_id","type":"`string`","description":"The ID of the price list to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePriceListPriceDTO](../../../interfaces/pricing.CreatePriceListPriceDTO/page.mdx)[]","description":"The prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceListPriceRules](../../../interfaces/pricing.CreatePriceListPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPriceListPrices"/>
## Returns

View File

@@ -67,11 +67,11 @@ const priceSet = await pricingModuleService.addPrices({
### Parameters
<TypeList types={[{"name":"data","type":"[AddPricesDTO](../../../interfaces/pricing.AddPricesDTO/page.mdx)","description":"The data defining the price set to add the prices to, along with the prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to add to the price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPrices"/>
<TypeList types={[{"name":"data","type":"[AddPricesDTO](../../../interfaces/pricing.AddPricesDTO/page.mdx)","description":"The data defining the price set to add the prices to, along with the prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to add to the price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPrices"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The price set that the prices were added to.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="addPrices"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The price set that the prices were added to.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"calculated_price","type":"[CalculatedPriceSet](../../../interfaces/pricing.CalculatedPriceSet/page.mdx)","description":"The calculated price based on the context.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_amount","type":"`null` \\| [BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The amount of the calculated price, or `null` if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_amount","type":"`null` \\| [BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The amount of the original price, or `null` if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The currency code of the calculated price, or null if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_calculated_price_price_list","type":"`boolean`","description":"Whether the calculated price is associated with a price list. During the calculation process, if no valid price list is found,\nthe calculated price is set to the original price, which doesn't belong to a price list. In that case, the value of this property is `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_original_price_price_list","type":"`boolean`","description":"Whether the original price is associated with a price list. During the calculation process, if the price list of the calculated price is of type override,\nthe original price will be the same as the calculated price. In that case, the value of this property is `true`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_price","type":"`object`","description":"The details of the calculated price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_price","type":"`object`","description":"The details of the original price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="addPrices"/>
## addPrices(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;
@@ -112,7 +112,7 @@ const priceSets = await pricingModuleService.addPrices([
### Parameters
<TypeList types={[{"name":"data","type":"[AddPricesDTO](../../../interfaces/pricing.AddPricesDTO/page.mdx)[]","description":"The data defining the prices to add per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to add to the price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPrices"/>
<TypeList types={[{"name":"data","type":"[AddPricesDTO](../../../interfaces/pricing.AddPricesDTO/page.mdx)[]","description":"The data defining the prices to add per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to add to the price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addPrices"/>
### Returns

View File

@@ -1,71 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/addRules
sidebar_label: addRules
---
import { TypeList } from "docs-ui"
# addRules - Pricing Module Reference
This documentation provides a reference to the `addRules` method. This belongs to the Pricing Module.
## addRules(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;
This method adds rules to a price set.
### Example
```ts
const priceSet = await pricingModuleService.addRules({
priceSetId: "pset_123",
rules: [
{
attribute: "region_id",
},
],
})
```
### Parameters
<TypeList types={[{"name":"data","type":"[AddRulesDTO](../../../interfaces/pricing.AddRulesDTO/page.mdx)","description":"The data defining the price set to add the rules to, along with the rules to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add the rules to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to add to a price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addRules"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The price set that the rules were added to.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="addRules"/>
## addRules(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;
This method adds rules to multiple price sets.
### Example
```ts
const priceSets = await pricingModuleService.addRules([
{
priceSetId: "pset_123",
rules: [
{
attribute: "region_id",
},
],
},
{
priceSetId: "pset_321",
rules: [
{
attribute: "customer_group_id",
},
],
},
])
```
### Parameters
<TypeList types={[{"name":"data","type":"[AddRulesDTO](../../../interfaces/pricing.AddRulesDTO/page.mdx)[]","description":"The data defining the rules to add per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"priceSetId","type":"`string`","description":"The ID of the price set to add the rules to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to add to a price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addRules"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of the price sets that the rules were added to.","expandable":false,"children":[{"name":"PriceSetDTO[]","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceSetDTO","type":"`object`","description":"A price set's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="addRules"/>

View File

@@ -63,7 +63,7 @@ const price = await pricingModuleService.calculatePrices(
## Parameters
<TypeList types={[{"name":"filters","type":"[PricingFilters](../../../interfaces/pricing.PricingFilters/page.mdx)","description":"The filters to apply on prices.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`[]","description":"IDs of the price sets to use in the\ncalculation.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"context","type":"[PricingContext](../../../interfaces/pricing.PricingContext/page.mdx)","description":"The context used to select the prices. For example, you can specify the region ID in this context, and only prices having the same value\nwill be retrieved.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"context","type":"`Record<string, [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)>`","description":"an object whose keys are the name of the context attribute. Its value can be a string or a BigNumberInput. For example, you can pass the `currency_code` property with its value being the currency code to calculate the price in.\nAnother example is passing the `quantity` property to calculate the price for that specified quantity, which finds a price set whose `min_quantity` and `max_quantity` conditions match the specified quantity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="calculatePrices"/>
<TypeList types={[{"name":"filters","type":"[PricingFilters](../../../interfaces/pricing.PricingFilters/page.mdx)","description":"The filters to apply on prices.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`[]","description":"IDs of the price sets to use in the\ncalculation.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"context","type":"[PricingContext](../../../interfaces/pricing.PricingContext/page.mdx)","description":"The context used to select the prices. For example, you can specify the region ID in this context, and only prices having the same value\nwill be retrieved.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"context","type":"`Record<string, [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)>`","description":"an object whose keys are the name of the context attribute. Its value can be a string or a BigNumberInput. For example, you can pass the `currency_code` property with its value being the currency code to calculate the price in.\nAnother example is passing the `quantity` property to calculate the price for that specified quantity, which finds a price set whose `min_quantity` and `max_quantity` conditions match the specified quantity.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="calculatePrices"/>
## Returns

View File

@@ -1,154 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/create
sidebar_label: create
---
import { TypeList } from "docs-ui"
# create - Pricing Module Reference
This documentation provides a reference to the `create` method. This belongs to the Pricing Module.
## create(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;
This method is used to create a new price set.
### Example
To create a default price set, don't pass any rules. For example:
```ts
const priceSet = await pricingModuleService.create({
rules: [],
prices: [
{
amount: 500,
currency_code: "USD",
min_quantity: 0,
max_quantity: 4,
rules: {},
},
{
amount: 400,
currency_code: "USD",
min_quantity: 5,
max_quantity: 10,
rules: {},
},
],
})
```
To create a price set and associate it with rule types:
```ts
const priceSet = await pricingModuleService.create({
rules: [
{ rule_attribute: "region_id" },
{ rule_attribute: "city" },
],
prices: [
{
amount: 300,
currency_code: "EUR",
rules: {
region_id: "PL",
city: "krakow",
},
},
{
amount: 400,
currency_code: "EUR",
rules: {
region_id: "PL",
},
},
{
amount: 450,
currency_code: "EUR",
rules: {
city: "krakow",
},
},
],
})
```
### Parameters
<TypeList types={[{"name":"data","type":"[CreatePriceSetDTO](../../../interfaces/pricing.CreatePriceSetDTO/page.mdx)","description":"The attributes of the price set to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="create"/>
## create(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;
This method is used to create multiple price sets.
### Example
```ts
const priceSets = await pricingModuleService.create([
// default price set
{
rules: [],
prices: [
{
amount: 500,
currency_code: "USD",
min_quantity: 0,
max_quantity: 4,
rules: {},
},
{
amount: 400,
currency_code: "USD",
min_quantity: 5,
max_quantity: 10,
rules: {},
},
],
},
// price set with rules
{
rules: [
{ rule_attribute: "region_id" },
{ rule_attribute: "city" },
],
prices: [
{
amount: 300,
currency_code: "EUR",
rules: {
region_id: "PL",
city: "krakow",
},
},
{
amount: 400,
currency_code: "EUR",
rules: {
region_id: "PL",
},
},
{
amount: 450,
currency_code: "EUR",
rules: {
city: "krakow",
},
},
],
},
])
```
### Parameters
<TypeList types={[{"name":"data","type":"[CreatePriceSetDTO](../../../interfaces/pricing.CreatePriceSetDTO/page.mdx)[]","description":"The price sets to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of created price sets.","expandable":false,"children":[{"name":"PriceSetDTO[]","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceSetDTO","type":"`object`","description":"A price set's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="create"/>

View File

@@ -1,33 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/createPriceListRules
sidebar_label: createPriceListRules
---
import { TypeList } from "docs-ui"
# createPriceListRules - Pricing Module Reference
This documentation provides a reference to the `createPriceListRules` method. This belongs to the Pricing Module.
This method is used to create price list rules.
## Example
```ts
const priceListRules =
await pricingModuleService.createPriceListRules([
{
rule_type_id: "rul-typ_123",
price_list_id: "plist_123",
},
])
```
## Parameters
<TypeList types={[{"name":"data","type":"[CreatePriceListRuleDTO](../../../interfaces/pricing.CreatePriceListRuleDTO/page.mdx)[]","description":"The price list rules to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rule_type_id","type":"`string`","description":"The ID of a rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"`string` \\| [RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)","description":"The ID of a rule type or the details of an existing rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of a price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list","type":"`string` \\| [PriceListDTO](../../../interfaces/pricing.PriceListDTO/page.mdx)","description":"The ID of a price list or the details of an existing price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceListRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceListRuleDTO](../../../interfaces/pricing.PriceListRuleDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created price list rules.","expandable":false,"children":[{"name":"PriceListRuleDTO[]","type":"[PriceListRuleDTO](../../../interfaces/pricing.PriceListRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceListRuleDTO","type":"`object`","description":"The price list rule's details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createPriceListRules"/>

View File

@@ -19,7 +19,7 @@ const priceRules =
await pricingModuleService.createPriceRules([
{
value: "VIP",
rule_type_id: "rul-typ_123",
attribute: "customer_group",
price_set_id: "pset_123",
},
])
@@ -27,7 +27,7 @@ const priceRules =
## Parameters
<TypeList types={[{"name":"data","type":"[CreatePriceRuleDTO](../../../interfaces/pricing.CreatePriceRuleDTO/page.mdx)[]","description":"The price rules to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type_id","type":"`string`","description":"The ID of the associated rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_id","type":"`string`","description":"The ID of the associated price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceRules"/>
<TypeList types={[{"name":"data","type":"[CreatePriceRuleDTO](../../../interfaces/pricing.CreatePriceRuleDTO/page.mdx)[]","description":"The price rules to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the price rule","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_id","type":"`string`","description":"The ID of the associated price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceRules"/>
## Returns

View File

@@ -0,0 +1,146 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/createPriceSets
sidebar_label: createPriceSets
---
import { TypeList } from "docs-ui"
# createPriceSets - Pricing Module Reference
This documentation provides a reference to the `createPriceSets` method. This belongs to the Pricing Module.
## createPriceSets(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;
This method is used to create a new price set.
### Example
To create a default price set, don't pass any rules. For example:
```ts
const priceSet = await pricingModuleService.createPriceSets({
rules: [],
prices: [
{
amount: 500,
currency_code: "USD",
min_quantity: 0,
max_quantity: 4,
rules: {},
},
{
amount: 400,
currency_code: "USD",
min_quantity: 5,
max_quantity: 10,
rules: {},
},
],
})
```
To create a price set and associate it with rule types:
```ts
const priceSet = await pricingModuleService.createPriceSets({
prices: [
{
amount: 300,
currency_code: "EUR",
rules: {
region_id: "PL",
city: "krakow",
},
},
{
amount: 400,
currency_code: "EUR",
rules: {
region_id: "PL",
},
},
{
amount: 450,
currency_code: "EUR",
rules: {
city: "krakow",
},
},
],
})
```
### Parameters
<TypeList types={[{"name":"data","type":"[CreatePriceSetDTO](../../../interfaces/pricing.CreatePriceSetDTO/page.mdx)","description":"The attributes of the price set to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceSets"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"calculated_price","type":"[CalculatedPriceSet](../../../interfaces/pricing.CalculatedPriceSet/page.mdx)","description":"The calculated price based on the context.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_amount","type":"`null` \\| [BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The amount of the calculated price, or `null` if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_amount","type":"`null` \\| [BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The amount of the original price, or `null` if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The currency code of the calculated price, or null if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_calculated_price_price_list","type":"`boolean`","description":"Whether the calculated price is associated with a price list. During the calculation process, if no valid price list is found,\nthe calculated price is set to the original price, which doesn't belong to a price list. In that case, the value of this property is `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_original_price_price_list","type":"`boolean`","description":"Whether the original price is associated with a price list. During the calculation process, if the price list of the calculated price is of type override,\nthe original price will be the same as the calculated price. In that case, the value of this property is `true`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_price","type":"`object`","description":"The details of the calculated price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_price","type":"`object`","description":"The details of the original price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="createPriceSets"/>
## createPriceSets(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;
This method is used to create multiple price sets.
### Example
```ts
const priceSets = await pricingModuleService.createPriceSets([
// default price set
{
rules: [],
prices: [
{
amount: 500,
currency_code: "USD",
min_quantity: 0,
max_quantity: 4,
rules: {},
},
{
amount: 400,
currency_code: "USD",
min_quantity: 5,
max_quantity: 10,
rules: {},
},
],
},
// price set with rules
{
prices: [
{
amount: 300,
currency_code: "EUR",
rules: {
region_id: "PL",
city: "krakow",
},
},
{
amount: 400,
currency_code: "EUR",
rules: {
region_id: "PL",
},
},
{
amount: 450,
currency_code: "EUR",
rules: {
city: "krakow",
},
},
],
},
])
```
### Parameters
<TypeList types={[{"name":"data","type":"[CreatePriceSetDTO](../../../interfaces/pricing.CreatePriceSetDTO/page.mdx)[]","description":"The price sets to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createPriceSets"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of created price sets.","expandable":false,"children":[{"name":"PriceSetDTO[]","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceSetDTO","type":"`object`","description":"A price set's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createPriceSets"/>

View File

@@ -1,36 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/createRuleTypes
sidebar_label: createRuleTypes
---
import { TypeList } from "docs-ui"
# createRuleTypes - Pricing Module Reference
This documentation provides a reference to the `createRuleTypes` method. This belongs to the Pricing Module.
This method is used to create new rule types.
## Example
```ts
const ruleTypes = await pricingModuleService.createRuleTypes([
{
name: "Region",
rule_attribute: "region_id",
},
{
name: "Customer Group",
rule_attribute: "customer_group_id",
},
])
```
## Parameters
<TypeList types={[{"name":"data","type":"[CreateRuleTypeDTO](../../../interfaces/pricing.CreateRuleTypeDTO/page.mdx)[]","description":"The rule types to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of the `calculatePrices`\nmethod to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context.\nThe higher the value, the higher the priority of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createRuleTypes"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of created rule types.","expandable":false,"children":[{"name":"RuleTypeDTO[]","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"RuleTypeDTO","type":"`object`","description":"A rule type's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createRuleTypes"/>

View File

@@ -1,27 +1,27 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/delete
sidebar_label: delete
slug: /references/pricing/deletePriceSets
sidebar_label: deletePriceSets
---
import { TypeList } from "docs-ui"
# delete - Pricing Module Reference
# deletePriceSets - Pricing Module Reference
This documentation provides a reference to the `delete` method. This belongs to the Pricing Module.
This documentation provides a reference to the `deletePriceSets` method. This belongs to the Pricing Module.
This method deletes price sets by their IDs.
## Example
```ts
await pricingModuleService.delete(["pset_123", "pset_321"])
await pricingModuleService.deletePriceSets(["pset_123", "pset_321"])
```
## Parameters
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the price sets to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="delete"/>
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the price sets to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deletePriceSets"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the price sets are successfully deleted.","expandable":false,"children":[]}]} sectionTitle="delete"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the price sets are successfully deleted.","expandable":false,"children":[]}]} sectionTitle="deletePriceSets"/>

View File

@@ -1,30 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/deleteRuleTypes
sidebar_label: deleteRuleTypes
---
import { TypeList } from "docs-ui"
# deleteRuleTypes - Pricing Module Reference
This documentation provides a reference to the `deleteRuleTypes` method. This belongs to the Pricing Module.
This method is used to delete rule types based on the provided IDs.
## Example
```ts
const ruleTypes = await pricingModuleService.deleteRuleTypes([
"rul-typ_123",
"rul-typ_321",
])
```
## Parameters
<TypeList types={[{"name":"ruleTypeIds","type":"`string`[]","description":"The IDs of the rule types to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteRuleTypes"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves once the rule types are deleted.","expandable":false,"children":[]}]} sectionTitle="deleteRuleTypes"/>

View File

@@ -1,32 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/removeRules
sidebar_label: removeRules
---
import { TypeList } from "docs-ui"
# removeRules - Pricing Module Reference
This documentation provides a reference to the `removeRules` method. This belongs to the Pricing Module.
This method remove rules from a price set.
## Example
```ts
await pricingModuleService.removeRules([
{
id: "pset_123",
rules: ["region_id"],
},
])
```
## Parameters
<TypeList types={[{"name":"data","type":"[RemovePriceSetRulesDTO](../../../interfaces/pricing.RemovePriceSetRulesDTO/page.mdx)[]","description":"The rules to remove per price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`string`[]","description":"The rules to remove. Each string is the `rule_attribute` of a rule to remove.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="removeRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when rules are successfully removed.","expandable":false,"children":[]}]} sectionTitle="removeRules"/>

View File

@@ -1,41 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/retrieve
sidebar_label: retrieve
---
import { TypeList } from "docs-ui"
# retrieve - Pricing Module Reference
This documentation provides a reference to the `retrieve` method. This belongs to the Pricing Module.
This method is used to retrieve a price set by its ID.
## Example
A simple example that retrieves a price set by its ID:
```ts
const priceSet =
await pricingModuleService.retrieve("pset_123")
```
To specify relations that should be retrieved:
```ts
const priceSet = await pricingModuleService.retrieve(
"pset_123",
{
relations: ["prices"],
}
)
```
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the price set to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/pricing.FindConfig/page.mdx)&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","description":"The configurations determining how the price set is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieve"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="retrieve"/>

View File

@@ -32,8 +32,8 @@ const priceRule =
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the price rule to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/pricing.FindConfig/page.mdx)&#60;[PriceRuleDTO](../../../interfaces/pricing.PriceRuleDTO/page.mdx)&#62;","description":"The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a price rule.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrievePriceRule"/>
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the price rule to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/pricing.FindConfig/page.mdx)&#60;[PriceRuleDTO](../../../interfaces/pricing.PriceRuleDTO/page.mdx)&#62;","description":"The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a price rule.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrievePriceRule"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceRuleDTO](../../../interfaces/pricing.PriceRuleDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved price rule.","expandable":false,"children":[{"name":"PriceRuleDTO","type":"[PriceRuleDTO](../../../interfaces/pricing.PriceRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price rule's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","description":"The associated price set.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_types","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_type_id","type":"`string`","description":"The ID of the associated rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)","description":"The associated rule type.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"value","type":"`string`","description":"The value of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_id","type":"`string`","description":"The ID of the associated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of the associated price list.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the price\\_rule was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the price\\_rule was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the price\\_rule was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrievePriceRule"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceRuleDTO](../../../interfaces/pricing.PriceRuleDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved price rule.","expandable":false,"children":[{"name":"PriceRuleDTO","type":"[PriceRuleDTO](../../../interfaces/pricing.PriceRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price rule's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","description":"The associated price set.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_price","type":"[CalculatedPriceSet](../../../interfaces/pricing.CalculatedPriceSet/page.mdx)","description":"The calculated price based on the context.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"attribute","type":"`string`","description":"The attribute of the price rule","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the price rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_id","type":"`string`","description":"The ID of the associated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of the associated price list.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the price\\_rule was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the price\\_rule was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the price\\_rule was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrievePriceRule"/>

View File

@@ -0,0 +1,41 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/retrievePriceSet
sidebar_label: retrievePriceSet
---
import { TypeList } from "docs-ui"
# retrievePriceSet - Pricing Module Reference
This documentation provides a reference to the `retrievePriceSet` method. This belongs to the Pricing Module.
This method is used to retrieve a price set by its ID.
## Example
A simple example that retrieves a price set by its ID:
```ts
const priceSet =
await pricingModuleService.retrievePriceSet("pset_123")
```
To specify relations that should be retrieved:
```ts
const priceSet = await pricingModuleService.retrievePriceSet(
"pset_123",
{
relations: ["prices"],
}
)
```
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the price set to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/pricing.FindConfig/page.mdx)&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","description":"The configurations determining how the price set is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrievePriceSet"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"calculated_price","type":"[CalculatedPriceSet](../../../interfaces/pricing.CalculatedPriceSet/page.mdx)","description":"The calculated price based on the context.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_amount","type":"`null` \\| [BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The amount of the calculated price, or `null` if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_amount","type":"`null` \\| [BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The amount of the original price, or `null` if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The currency code of the calculated price, or null if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_calculated_price_price_list","type":"`boolean`","description":"Whether the calculated price is associated with a price list. During the calculation process, if no valid price list is found,\nthe calculated price is set to the original price, which doesn't belong to a price list. In that case, the value of this property is `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_original_price_price_list","type":"`boolean`","description":"Whether the original price is associated with a price list. During the calculation process, if the price list of the calculated price is of type override,\nthe original price will be the same as the calculated price. In that case, the value of this property is `true`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_price","type":"`object`","description":"The details of the calculated price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_price","type":"`object`","description":"The details of the original price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="retrievePriceSet"/>

View File

@@ -1,41 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/retrieveRuleType
sidebar_label: retrieveRuleType
---
import { TypeList } from "docs-ui"
# retrieveRuleType - Pricing Module Reference
This documentation provides a reference to the `retrieveRuleType` method. This belongs to the Pricing Module.
This method is used to retrieve a rule type by its ID and and optionally based on the provided configurations.
## Example
A simple example that retrieves a rule type by its code:
```ts
const ruleType =
await pricingModuleService.retrieveRuleType("rul-typ_123")
```
To specify relations that should be retrieved:
```ts
const ruleType = await pricingModuleService.retrieveRuleType(
"rul-typ_123",
{
relations: ["price_sets"],
}
)
```
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the rule type to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/pricing.FindConfig/page.mdx)&#60;[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)&#62;","description":"The configurations determining how the rule type is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a rule type.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveRuleType"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved rule type.","expandable":false,"children":[{"name":"RuleTypeDTO","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)","optional":false,"defaultValue":"","description":"A rule type's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrieveRuleType"/>

View File

@@ -33,7 +33,7 @@ const priceLists =
## Parameters
<TypeList types={[{"name":"data","type":"[UpdatePriceListPricesDTO](../../../interfaces/pricing.UpdatePriceListPricesDTO/page.mdx)[]","description":"The attributes to update in a price list's prices. The price list's ID is specified\nin the `price_list_id` field.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"price_list_id","type":"`string`","description":"The ID of the price list to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[UpdatePriceListPriceDTO](../../../interfaces/pricing.UpdatePriceListPriceDTO/page.mdx)[]","description":"The prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The code of the currency to associate with the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceListPrices"/>
<TypeList types={[{"name":"data","type":"[UpdatePriceListPricesDTO](../../../interfaces/pricing.UpdatePriceListPricesDTO/page.mdx)[]","description":"The attributes to update in a price list's prices. The price list's ID is specified\nin the `price_list_id` field.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"price_list_id","type":"`string`","description":"The ID of the price list to add prices to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[UpdatePriceListPriceDTO](../../../interfaces/pricing.UpdatePriceListPriceDTO/page.mdx)[]","description":"The prices to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"The ID of the associated price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The code of the currency to associate with the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceListPriceRules](../../../interfaces/pricing.CreatePriceListPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceListPrices"/>
## Returns

View File

@@ -1,33 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/updatePriceListRules
sidebar_label: updatePriceListRules
---
import { TypeList } from "docs-ui"
# updatePriceListRules - Pricing Module Reference
This documentation provides a reference to the `updatePriceListRules` method. This belongs to the Pricing Module.
This method is used to update price list rules.
## Example
```ts
const priceListRules =
await pricingModuleService.updatePriceListRules([
{
id: "plrule_123",
rule_type_id: "rul-typ_123",
},
])
```
## Parameters
<TypeList types={[{"name":"data","type":"[UpdatePriceListRuleDTO](../../../interfaces/pricing.UpdatePriceListRuleDTO/page.mdx)[]","description":"The attributes to update for each price list rule. The price list rule is identified by the `id` property.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price list rule to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of a price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type_id","type":"`string`","description":"The ID of a rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list","type":"`string`","description":"The ID of a price list to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"`string`","description":"The ID of a rule type or the details of an existing rule type to be associated with the price list rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceListRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceListRuleDTO](../../../interfaces/pricing.PriceListRuleDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated price list rules.","expandable":false,"children":[{"name":"PriceListRuleDTO[]","type":"[PriceListRuleDTO](../../../interfaces/pricing.PriceListRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceListRuleDTO","type":"`object`","description":"The price list rule's details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updatePriceListRules"/>

View File

@@ -30,7 +30,7 @@ const priceLists =
## Parameters
<TypeList types={[{"name":"data","type":"[UpdatePriceListDTO](../../../interfaces/pricing.UpdatePriceListDTO/page.mdx)[]","description":"The attributes to update in each price list. The price list is identifed by the `id` field.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price list to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The price list's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The price list's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `string`","description":"The price list is enabled starting from this date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `string`","description":"The price list expires after this date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[PriceListStatus](../../../enums/pricing.PriceListStatus/page.mdx)","description":"The price list's status.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"ACTIVE","type":"`\"active\"`","description":"The price list is enabled and its prices can be used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"DRAFT","type":"`\"draft\"`","description":"The price list is disabled, meaning its prices can't be used yet.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules_count","type":"`number`","description":"The number of rules associated with the price list.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceListRules](../../../interfaces/pricing.CreatePriceListRules/page.mdx)","description":"The rules to be created and associated with the price list.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceLists"/>
<TypeList types={[{"name":"data","type":"[UpdatePriceListDTO](../../../interfaces/pricing.UpdatePriceListDTO/page.mdx)[]","description":"The attributes to update in each price list. The price list is identifed by the `id` field.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price list to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The price list's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The price list's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `string`","description":"The price list is enabled starting from this date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `string`","description":"The price list expires after this date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[PriceListStatus](../../../types/pricing.PriceListStatus/page.mdx)","description":"The price list's status.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceListRules](../../../interfaces/pricing.CreatePriceListRules/page.mdx)","description":"The rules to be created and associated with the price list.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceLists"/>
## Returns

View File

@@ -26,7 +26,7 @@ const priceRules =
## Parameters
<TypeList types={[{"name":"data","type":"[UpdatePriceRuleDTO](../../../interfaces/pricing.UpdatePriceRuleDTO/page.mdx)[]","description":"The price rules to update, each having attributes that should be updated in a price rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the price rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_id","type":"`string`","description":"The ID of the associated price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of the associated price list.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceRules"/>
<TypeList types={[{"name":"data","type":"[UpdatePriceRuleDTO](../../../interfaces/pricing.UpdatePriceRuleDTO/page.mdx)[]","description":"The price rules to update, each having attributes that should be updated in a price rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_set_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the price rule","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the price rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"priority","type":"`number`","description":"The priority of the price rule in comparison to other applicable price rules.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_id","type":"`string`","description":"The ID of the associated price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_list_id","type":"`string`","description":"The ID of the associated price list.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePriceRules"/>
## Returns

View File

@@ -1,36 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/updateRuleTypes
sidebar_label: updateRuleTypes
---
import { TypeList } from "docs-ui"
# updateRuleTypes - Pricing Module Reference
This documentation provides a reference to the `updateRuleTypes` method. This belongs to the Pricing Module.
This method is used to update existing rule types with the provided data.
## Example
```ts
const ruleTypes = await pricingModuleService.updateRuleTypes([
{
id: "rul-typ_123",
name: "Region",
},
{
id: "rul-typ_321",
name: "Customer Group",
},
])
```
## Parameters
<TypeList types={[{"name":"data","type":"[UpdateRuleTypeDTO](../../../interfaces/pricing.UpdateRuleTypeDTO/page.mdx)[]","description":"The rule types to update, each having the attributes that should be updated in a rule type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of the `calculatePrices` method to specify a rule for calculating the price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context. The higher the value, the higher the priority of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateRuleTypes"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of updated rule types.","expandable":false,"children":[{"name":"RuleTypeDTO[]","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"RuleTypeDTO","type":"`object`","description":"A rule type's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateRuleTypes"/>

View File

@@ -1,63 +0,0 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/upsert
sidebar_label: upsert
---
import { TypeList } from "docs-ui"
# upsert - Pricing Module Reference
This documentation provides a reference to the `upsert` method. This belongs to the Pricing Module.
## upsert(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;
This method updates existing price sets, or creates new ones if they don't exist.
### Example
```ts
const priceSets = await pricingModuleService.upsert([
{
prices: [
{
amount: 100,
currency_code: "USD",
},
],
},
{
id: "pset_123",
rules: [{ rule_attribute: "region_id" }],
},
])
```
### Parameters
<TypeList types={[{"name":"data","type":"[UpsertPriceSetDTO](../../../interfaces/pricing.UpsertPriceSetDTO/page.mdx)[]","description":"The attributes to update or create for each price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"A string indicating the ID of the price set to update.\nIf not provided, a price set is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsert"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated and created price sets.","expandable":false,"children":[{"name":"PriceSetDTO[]","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceSetDTO","type":"`object`","description":"A price set's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsert"/>
## upsert(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;
This method updates the price set if it exists, or creates a new ones if it doesn't.
### Example
```ts
const priceSet = await pricingModuleService.upsert({
id: "pset_123",
rules: [{ rule_attribute: "region_id" }],
})
```
### Parameters
<TypeList types={[{"name":"data","type":"[UpsertPriceSetDTO](../../../interfaces/pricing.UpsertPriceSetDTO/page.mdx)","description":"The attributes to update or create for the new price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"A string indicating the ID of the price set to update.\nIf not provided, a price set is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`object`[]","description":"The rules to associate with the price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rule_attribute","type":"`string`","description":"the value of the rule's `rule_attribute` attribute.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsert"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The updated or created price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rule_types","type":"[RuleTypeDTO](../../../interfaces/pricing.RuleTypeDTO/page.mdx)[]","description":"The rule types applied on this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The display name of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_attribute","type":"`string`","description":"The unique name used to later identify the rule\\_attribute. For example, it can be used in the `context` parameter of\nthe `calculatePrices` method to specify a rule for calculating the price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_priority","type":"`number`","description":"The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy\nthe provided context. The higher the value, the higher the priority of the rule type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the rule type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="upsert"/>

View File

@@ -0,0 +1,59 @@
---
displayed_sidebar: pricingReference
slug: /references/pricing/upsertPriceSets
sidebar_label: upsertPriceSets
---
import { TypeList } from "docs-ui"
# upsertPriceSets - Pricing Module Reference
This documentation provides a reference to the `upsertPriceSets` method. This belongs to the Pricing Module.
## upsertPriceSets(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;
This method updates existing price sets, or creates new ones if they don't exist.
### Example
```ts
const priceSets = await pricingModuleService.upsertPriceSets([
{
prices: [
{
amount: 100,
currency_code: "USD",
},
],
},
])
```
### Parameters
<TypeList types={[{"name":"data","type":"[UpsertPriceSetDTO](../../../interfaces/pricing.UpsertPriceSetDTO/page.mdx)[]","description":"The attributes to update or create for each price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"A string indicating the ID of the price set to update.\nIf not provided, a price set is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsertPriceSets"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated and created price sets.","expandable":false,"children":[{"name":"PriceSetDTO[]","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PriceSetDTO","type":"`object`","description":"A price set's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsertPriceSets"/>
## upsertPriceSets(data, sharedContext?): Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;
This method updates the price set if it exists, or creates a new ones if it doesn't.
### Example
```ts
const priceSet = await pricingModuleService.upsertPriceSets({
id: "pset_123",
prices: [{ amount: 100, currency_code: "USD" }],
})
```
### Parameters
<TypeList types={[{"name":"data","type":"[UpsertPriceSetDTO](../../../interfaces/pricing.UpsertPriceSetDTO/page.mdx)","description":"The attributes to update or create for the new price set.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"A string indicating the ID of the price set to update.\nIf not provided, a price set is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreatePricesDTO](../../../interfaces/pricing.CreatePricesDTO/page.mdx)[]","description":"The prices to create and add to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/pricing.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/pricing.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsertPriceSets"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The updated or created price set.","expandable":false,"children":[{"name":"PriceSetDTO","type":"[PriceSetDTO](../../../interfaces/pricing.PriceSetDTO/page.mdx)","optional":false,"defaultValue":"","description":"A price set's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"calculated_price","type":"[CalculatedPriceSet](../../../interfaces/pricing.CalculatedPriceSet/page.mdx)","description":"The calculated price based on the context.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_amount","type":"`null` \\| [BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The amount of the calculated price, or `null` if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_amount","type":"`null` \\| [BigNumberValue](../../../types/pricing.BigNumberValue/page.mdx)","description":"The amount of the original price, or `null` if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The currency code of the calculated price, or null if there isn't a calculated price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_calculated_price_price_list","type":"`boolean`","description":"Whether the calculated price is associated with a price list. During the calculation process, if no valid price list is found,\nthe calculated price is set to the original price, which doesn't belong to a price list. In that case, the value of this property is `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_original_price_price_list","type":"`boolean`","description":"Whether the original price is associated with a price list. During the calculation process, if the price list of the calculated price is of type override,\nthe original price will be the same as the calculated price. In that case, the value of this property is `true`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_price","type":"`object`","description":"The details of the calculated price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_price","type":"`object`","description":"The details of the original price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="upsertPriceSets"/>