docs: resdesign and restructure modules references (#5372)

* docs: change format of module reference

* description fix

* update structure + comments

* added new options to README

* small text fix

* change section ordering

* change how required/optional are shown

* remove optional text

* docs: redesigned accordion
This commit is contained in:
Shahed Nasser
2023-10-16 19:51:55 +03:00
committed by GitHub
parent 3dada88c81
commit 2d74ec256f
218 changed files with 5433 additions and 7683 deletions
+17 -20
View File
@@ -3,14 +3,13 @@ import { BaseFilterable } from "../../dal"
/**
* @interface
*
* An object representing a currency.
* A currency's data.
*
* @prop code - a string indicating the code of the currency.
* @prop symbol - a string indicating the symbol of the currency.
* @prop code - The code of the currency.
* @prop symbol - The symbol of the currency.
* @prop symbol_native -
* a string indicating the symbol of the currecy in its native form.
* This is typically the symbol used when displaying a price.
* @prop name - a string indicating the name of the currency.
* The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.
* @prop name - The name of the currency.
*/
export interface CurrencyDTO {
code: string
@@ -22,14 +21,13 @@ export interface CurrencyDTO {
/**
* @interface
*
* An object that holds data to create a currency.
* A currency to create.
*
* @prop code - a string indicating the code of the currency.
* @prop symbol - a string indicating the symbol of the currency.
* @prop code - The code of the currency.
* @prop symbol - The symbol of the currency.
* @prop symbol_native -
* a string indicating the symbol of the currecy in its native form.
* This is typically the symbol used when displaying a price.
* @prop name - a string indicating the name of the currency.
* The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.
* @prop name - The name of the currency.
*/
export interface CreateCurrencyDTO {
code: string
@@ -41,14 +39,13 @@ export interface CreateCurrencyDTO {
/**
* @interface
*
* An object that holds data to update a currency. The currency code must be provided to identify which currency to update.
* The data to update in a currency. The `code` is used to identify which currency to update.
*
* @prop code - a string indicating the code of the currency to update.
* @prop symbol - a string indicating the symbol of the currency.
* @prop code - The code of the currency to update.
* @prop symbol - The symbol of the currency.
* @prop symbol_native -
* a string indicating the symbol of the currecy in its native form.
* This is typically the symbol used when displaying a price.
* @prop name - a string indicating the name of the currency.
* The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.
* @prop name - The name of the currency.
*/
export interface UpdateCurrencyDTO {
code: string
@@ -60,9 +57,9 @@ export interface UpdateCurrencyDTO {
/**
* @interface
*
* An object used to filter retrieved currencies.
* Filters to apply on a currency.
*
* @prop code - an array of strings, each being a currency code to filter the currencies.
* @prop code - The codes to filter the currencies by.
*/
export interface FilterableCurrencyProps
extends BaseFilterable<FilterableCurrencyProps> {
@@ -4,14 +4,14 @@ import { CreateCurrencyDTO, CurrencyDTO } from "./currency"
/**
* @interface
*
* An object that holds prices, which typically belong to a price set.
* A money amount's data. A money amount represents a price.
*
* @prop id - A string that indicates the ID of the money amount. A money amount represents a price.
* @prop currency_code - A string that indicates the currency code of this price.
* @prop currency - An object of type {@link CurrencyDTO} that holds the details of the price's currency. Since this is a relation, it will only be retrieved if it's passed to the `relations` array of the find-configuration options.
* @prop amount - A number indicating the amount of this price.
* @prop min_quantity - A number that indicates the minimum quantity required to be purchased for this price to be applied.
* @prop max_quantity - A number that indicates the maximum quantity required to be purchased for this price to be applied.
* @prop id - The ID of the money amount.
* @prop currency_code - The currency code of this money amount.
* @prop currency - The money amount's currency. Since this is a relation, it will only be retrieved if it's passed to the `relations` array of the find-configuration options.
* @prop amount - The price of this money amount.
* @prop min_quantity - The minimum quantity required to be purchased for this price to be applied.
* @prop max_quantity - The maximum quantity required to be purchased for this price to be applied.
*/
export interface MoneyAmountDTO {
id: string
@@ -23,16 +23,16 @@ export interface MoneyAmountDTO {
}
/**
* * @interface
* @interface
*
* An object that holds data to create a money amount.
* The money amount to create.
*
* @prop id - A string that indicates the ID of the money amount.
* @prop currency_code - A string that indicates the currency code of this money amount.
* @prop currency - An object of type {@link CurrencyDTO} that holds the details of the money amount's currency. Since this is a relation, it will only be retrieved if it's passed to the `relations` array of the find-configuration options.
* @prop amount - A number indicating the amount of this money amount.
* @prop min_quantity - A number that indicates the minimum quantity required to be purchased for this money amount to be applied.
* @prop max_quantity - A number that indicates the maximum quantity required to be purchased for this money amount to be applied.
* @prop id - The ID of the money amount.
* @prop currency_code - The currency code of this money amount.
* @prop currency - The currency of this money amount.
* @prop amount - The amount of this money amount.
* @prop min_quantity - The minimum quantity required to be purchased for this money amount to be applied.
* @prop max_quantity - The maximum quantity required to be purchased for this money amount to be applied.
*/
export interface CreateMoneyAmountDTO {
id?: string
@@ -46,14 +46,14 @@ export interface CreateMoneyAmountDTO {
/**
* * @interface
*
* An object that holds data to update a money amount.
* The data to update in a money amount. The `id` is used to identify which money amount to update.
*
* @prop id - A string that indicates the ID of the money amount to update.
* @prop currency_code - A string that indicates the currency code of the money amount.
* @prop currency - An object of type {@link CurrencyDTO} that holds the details of the money amount's currency. Since this is a relation, it will only be retrieved if it's passed to the `relations` array of the find-configuration options.
* @prop amount - A number indicating the amount of this money amount.
* @prop min_quantity - A number that indicates the minimum quantity required to be purchased for this money amount to be applied.
* @prop max_quantity - A number that indicates the maximum quantity required to be purchased for this money amount to be applied.
* @prop id - The ID of the money amount to update.
* @prop currency_code - The code of the currency to associate with the money amount.
* @prop currency - The currency to associte with the money amount.
* @prop amount - The price of this money amount.
* @prop min_quantity - The minimum quantity required to be purchased for this money amount to be applied.
* @prop max_quantity - The maximum quantity required to be purchased for this money amount to be applied.
*/
export interface UpdateMoneyAmountDTO {
id: string
@@ -66,10 +66,10 @@ export interface UpdateMoneyAmountDTO {
/**
* @interface
*
* An object that can be used to filter money amounts.
* Filters to apply on a money amount.
*
* @prop id - An array of strings, each being an ID to filter money amounts.
* @prop currency_code - A string or an array of strings, each being a currency code to filter money amounts.
* @prop id - IDs to filter money amounts by.
* @prop currency_code - Currency codes to filter money amounts by.
*/
export interface FilterableMoneyAmountProps
extends BaseFilterable<FilterableMoneyAmountProps> {
+43 -33
View File
@@ -5,18 +5,17 @@ import { RuleTypeDTO } from "./rule-type"
/**
* @interface
*
* An object that represents a price rule.
* A price rule's data.
*
* @prop id - A string indicating the ID of the price rule.
* @prop price_set_id - A string indicating the ID of the associated price set.
* @prop price_set - An object of type {@link PriceSetDTO} that holds the data of the associated price set. It may only be available if the relation `price_set` is expanded.
* @prop rule_type_id - A string indicating the ID of the associated rule type.
* @prop rule_type - An object of type {@link RuleTypeDTO} that holds the data of the associated rule type. It may only be available if the relation `rule_type` is expanded.
* @prop is_dynamic - A boolean indicating whether the price rule is dynamic.
* @prop value - A string indicating the value of the price rule.
* @prop priority - A number indicating the priority of the price rule in comparison to other applicable price rules.
* @prop price_set_money_amount_id - A string indicating the ID of the associated price set money amount.
* @prop price_list_id - A string indicating the ID of the associated price list.
* @prop id - The ID of the price rule.
* @prop price_set_id - The ID of the associated price set.
* @prop price_set - The associated price set. It may only be available if the relation `price_set` is expanded.
* @prop rule_type_id - The ID of the associated rule type.
* @prop rule_type - The associated rule type. It may only be available if the relation `rule_type` is expanded.
* @prop value - The value of the price rule.
* @prop priority - The priority of the price rule in comparison to other applicable price rules.
* @prop price_set_money_amount_id - The ID of the associated price set money amount.
* @prop price_list_id - The ID of the associated price list.
*/
export interface PriceRuleDTO {
id: string
@@ -24,6 +23,12 @@ export interface PriceRuleDTO {
price_set: PriceSetDTO
rule_type_id: string
rule_type: RuleTypeDTO
/**
* @ignore
* @privateRemark
*
* Behavior behind this property is not implemented yet.
*/
is_dynamic: boolean
value: string
priority: number
@@ -35,21 +40,26 @@ export interface PriceRuleDTO {
*
* @interface
*
* An object used to specify the necessary data to create a price rule.
* A price rule to create.
*
* @prop id - A string indicating the ID of the price rule.
* @prop price_set_id - A string indicating the ID of the associated price set.
* @prop rule_type_id - A string indicating the ID of the associated rule type.
* @prop is_dynamic - A boolean indicating whether the price rule is dynamic.
* @prop value - A string indicating the value of the price rule.
* @prop priority - A number indicating the priority of the price rule in comparison to other applicable price rules.
* @prop price_set_money_amount_id - A string indicating the ID of the associated price set money amount.
* @prop price_list_id - A string indicating the ID of the associated price list.
* @prop id - The ID of the price rule.
* @prop price_set_id - The ID of the associated price set.
* @prop rule_type_id - The ID of the associated rule type.
* @prop value - The value of the price rule.
* @prop priority - The priority of the price rule in comparison to other applicable price rules.
* @prop price_set_money_amount_id - The ID of the associated price set money amount.
* @prop price_list_id - The ID of the associated price list.
*/
export interface CreatePriceRuleDTO {
id: string
price_set_id: string
rule_type_id: string
/**
* @ignore
* @privateRemark
*
* Behavior behind this property is not implemented yet.
*/
is_dynamic?: boolean
value: string
priority?: number
@@ -61,15 +71,15 @@ export interface CreatePriceRuleDTO {
*
* @interface
*
* An object used to specify the necessary data to update a price rule.
* The data to update in a price rule. The `id` is used to identify which money amount to update.
*
* @prop id - A string indicating the ID of the price rule to update.
* @prop price_set_id - A string indicating the ID of the associated price set.
* @prop rule_type_id - A string indicating the ID of the associated rule type.
* @prop value - A string indicating the value of the price rule.
* @prop priority - A number indicating the priority of the price rule in comparison to other applicable price rules.
* @prop price_set_money_amount_id - A string indicating the ID of the associated price set money amount.
* @prop price_list_id - A string indicating the ID of the associated price list.
* @prop id - The ID of the price rule to update.
* @prop price_set_id - The ID of the associated price set.
* @prop rule_type_id - The ID of the associated rule type.
* @prop value - The value of the price rule.
* @prop priority - The priority of the price rule in comparison to other applicable price rules.
* @prop price_set_money_amount_id - The ID of the associated price set money amount.
* @prop price_list_id - The ID of the associated price list.
*/
export interface UpdatePriceRuleDTO {
id: string
@@ -91,12 +101,12 @@ export interface UpdatePriceRuleDTO {
/**
* @interface
*
* An object used to filter price rules when retrieving them.
* Filters to apply to price rules.
*
* @prop id - An array of strings, each indicating an ID to filter price rules.
* @prop name - An array of strings, each indicating a name to filter price rules.
* @prop price_set_id - An array of strings, each indicating a price set ID to filter price rules.
* @prop rule_type_id - An array of strings, each indicating a rule type ID to filter rule types.
* @prop id - The IDs to filter price rules by.
* @prop name - The names to filter price rules by.
* @prop price_set_id - The IDs to filter the price rule's associated price set.
* @prop rule_type_id - The IDs to filter the price rule's associated rule type.
*/
export interface FilterablePriceRuleProps
extends BaseFilterable<FilterablePriceRuleProps> {
@@ -5,12 +5,12 @@ import { RuleTypeDTO } from "./rule-type"
/**
* @interface
*
* An object representing a price set money amount rule, which holds data related to the association between a price set money amount and a rule.
* A price set money amount rule's data.
*
* @prop id - A string indicating the ID of the price set money amount.
* @prop price_set_money_amount - an object of type {@link PriceSetMoneyAmountDTO} holding the data of the associated price set money amount.
* @prop rule_type - an object of type {@link RuleTypeDTO} holding the data of the associated rule type.
* @prop value - a string indicating the value of the price set money amount rule.
* @prop id - The ID of the price set money amount.
* @prop price_set_money_amount - The associated price set money amount. It may only be available if the relation `price_set_money_amount` is expanded.
* @prop rule_type - The associated rule type. It may only be available if the relation `rule_type` is expanded.
* @prop value - The value of the price set money amount rule.
*/
export interface PriceSetMoneyAmountRulesDTO {
id: string
@@ -22,11 +22,11 @@ export interface PriceSetMoneyAmountRulesDTO {
/**
* @interface
*
* An object used to create a price set money amount rule, which represents an association between a price set money amount and a rule type.
* The price set money amount rule to create.
*
* @prop price_set_money_amount - A string indicating the ID of a price set money amount.
* @prop rule_type - A string indicating the ID of a rule type.
* @prop value - A string indicating the value of the price set money amount rule.
* @prop price_set_money_amount - The ID of a price set money amount.
* @prop rule_type - The ID of a rule type.
* @prop value - The value of the price set money amount rule.
*/
export interface CreatePriceSetMoneyAmountRulesDTO {
price_set_money_amount: string
@@ -37,12 +37,12 @@ export interface CreatePriceSetMoneyAmountRulesDTO {
/**
* @interface
*
* An object used to update a price set money amount rule. The price set money amount rule is identified by the provided `id`.
* The data to update in a price set money amount rule. The `id` is used to identify which money amount to update.
*
* @prop id - A string indicating the ID of the price set money amount rule to update.
* @prop price_set_money_amount - A string indicating the ID of a price set money amount.
* @prop rule_type - A string indicating the ID of a rule type.
* @prop value - A string indicating the value of the price set money amount rule.
* @prop id - The ID of the price set money amount rule to update.
* @prop price_set_money_amount - The ID of a price set money amount.
* @prop rule_type - The ID of a rule type.
* @prop value - The value of the price set money amount rule.
*/
export interface UpdatePriceSetMoneyAmountRulesDTO {
id: string
@@ -54,12 +54,12 @@ export interface UpdatePriceSetMoneyAmountRulesDTO {
/**
* @interface
*
* An object used to filter price set money amount rules when listing them.
* Filters to apply on price set money amount rules.
*
* @prop id - An array of strings, each string indicating an ID to filter the price set money amount rules.
* @prop rule_type_id - An array of strings, each string indicating the ID of a rule type to filter the price set money amount rules.
* @prop price_set_money_amount_id - an array of strings, each string indicating the ID of a price set money amount to filter the price set money amount rules.
* @prop value - an array of strings, each string indicating a value to filter the price set money amount rules.
* @prop id - The ID to filter price set money amount rules by.
* @prop rule_type_id - The IDs to filter the price set money amount rule's associated rule type.
* @prop price_set_money_amount_id - The IDs to filter the price set money amount rule's associated price set money amount.
* @prop value - The value to filter price set money amount rules by.
*/
export interface FilterablePriceSetMoneyAmountRulesProps
extends BaseFilterable<FilterablePriceSetMoneyAmountRulesProps> {
@@ -4,12 +4,12 @@ import { PriceSetDTO } from "./price-set"
/**
* @interface
*
* An object representing a price set money amount, which holds the data related to the association between a price set and a money amount.
* A price set money amount's data.
*
* @prop id - a string indicating the ID of a price set money amount.
* @prop title - a string indicating the title of the price set money amount.
* @prop price_set - an object of type {@link PriceSetDTO} holding the data of the associated price set.
* @prop money_amount - an object of type {@link MoneyAmountDTO} holding the data of the associated money amount.
* @prop id - The ID of a price set money amount.
* @prop title - The title of the price set money amount.
* @prop price_set - The price set associated with the price set money amount. It may only be available if the relation `price_set` is expanded.
* @prop money_amount - The money amount associated with the price set money amount. It may only be available if the relation `money_amount` is expanded.
*/
export interface PriceSetMoneyAmountDTO {
id: string
+31 -36
View File
@@ -9,15 +9,12 @@ import { RuleTypeDTO } from "./rule-type"
/**
* @interface
*
* Used to specify the context to calculate prices. For example, you can specify the currency code to calculate prices in.
* The context to calculate prices. For example, you can specify the currency code to calculate prices in.
*
* @prop context -
* an object whose keys are the name of the context attribute. Its value can be a string or a number. For example, you can pass the `currency_code` property with its value being the currency code to calculate the price in.
* Another 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.
*
* @example
*
* To calculate prices
*/
export interface PricingContext {
context?: Record<string, string | number>
@@ -26,9 +23,9 @@ export interface PricingContext {
/**
* @interface
*
* Used to filter prices when calculating them.
* Filters to apply on prices.
*
* @prop id - An array of strings, each being an ID of a price set.
* @prop id - IDs to filter prices.
*/
export interface PricingFilters {
id: string[]
@@ -37,11 +34,11 @@ export interface PricingFilters {
/**
* @interface
*
* An object that holds the details of a retrieved price set.
* A price set's data.
*
* @prop id - A string indicating the ID of the price set.
* @prop money_amounts - An array of objects of type {@link MoneyAmountDTO}, which holds the prices that belong to this price set.
* @prop rule_types - An array of objects of type {@link RuleTypeDTO}, which holds the rule types applied on this price set.
* @prop id - The ID of the price set.
* @prop money_amounts - The prices that belong to this price set.
* @prop rule_types - The rule types applied on this price set.
*
*/
export interface PriceSetDTO {
@@ -53,13 +50,13 @@ export interface PriceSetDTO {
/**
* @interface
*
* An object that holds the details of a calculated price set.
* A calculated price set's data.
*
* @prop id - a string indicating the ID of the price set.
* @prop amount - a number indicating the calculated amount. It can possibly be `null` if there's no price set up for the provided context.
* @prop currency_code - a string indicating the currency code of the calculated price. It can possibly be `null`.
* @prop min_quantity - a number indicaitng the minimum quantity required to be purchased for this price to apply. It's set if the `quantity` property is provided in the context. Otherwise, its value will be `null`.
* @prop max_quantity - a number indicaitng the maximum quantity required to be purchased for this price to apply. It's set if the `quantity` property is provided in the context. Otherwise, its value will be `null`.
* @prop id - The ID of the price set.
* @prop amount - The calculated amount. It can possibly be `null` if there's no price set up for the provided context.
* @prop currency_code - The currency code of the calculated price. It can possibly be `null`.
* @prop min_quantity - The minimum quantity required to be purchased for this price to apply. It's set if the `quantity` property is provided in the context. Otherwise, its value will be `null`.
* @prop max_quantity - The maximum quantity required to be purchased for this price to apply. It's set if the `quantity` property is provided in the context. Otherwise, its value will be `null`.
*/
export interface CalculatedPriceSetDTO {
id: string
@@ -72,10 +69,10 @@ export interface CalculatedPriceSetDTO {
/**
* @interface
*
* An object used to specify the rules to add to a price set.
* The rules to add to a price set.
*
* @prop priceSetId - A string indicating the ID of the price set to add the rules to.
* @prop rules - An array of objects, each object holds a property `attribute`, with its value being the `rule_attribute` of the rule to add to the price set.
* @prop priceSetId - The ID of the price set to add the rules to.
* @prop rules - The rules to add to a price set. The value of `attribute` is the value of the rule's `rule_attribute` attribute.
*/
export interface AddRulesDTO {
priceSetId: string
@@ -85,9 +82,9 @@ export interface AddRulesDTO {
/**
* @interface
*
* An object used to pass prices data when creating a price set.
* The prices to create part of a price set.
*
* @prop rules - An object whose keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.
* @prop rules - 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.
*/
export interface CreatePricesDTO extends CreateMoneyAmountDTO {
rules: Record<string, string>
@@ -96,10 +93,10 @@ export interface CreatePricesDTO extends CreateMoneyAmountDTO {
/**
* @interface
*
* An object used to specify prices to add to a price set.
* The prices to add to a price set.
*
* @prop priceSetId - A string indicating the ID of the price set to add prices to.
* @prop prices - An array of objects of type {@link CreatePricesDTO}, each being a price to add to the price set.
* @prop priceSetId - The ID of the price set to add prices to.
* @prop prices - The prices to add to the price set.
*/
export interface AddPricesDTO {
priceSetId: string
@@ -109,10 +106,10 @@ export interface AddPricesDTO {
/**
* @interface
*
* An object of expected properties when removing a price set's rules.
* The rules to remove from a price set.
*
* @prop id - A string indicating the ID of the price set.
* @prop rules - An array of strings, each string is the `rule_attribute` of a rule you want to remove.
* @prop id - The ID of the price set.
* @prop rules - The rules to remove. Each string is the `rule_attribute` of a rule to remove.
*/
export interface RemovePriceSetRulesDTO {
id: string
@@ -122,12 +119,10 @@ export interface RemovePriceSetRulesDTO {
/**
* @interface
*
* An object of expected properties when creating a price set.
* A price set to create.
*
* @prop rules -
* An array of objects, each object accepts a property `rule_attribute`, whose value is a string indicating the `rule_attribute` value of a rule type.
* This property is used to specify the rule types associated with the price set.
* @prop prices - An array of objects of type {@link CreatePricesDTO}, each being a price to associate with the price set.
* @prop rules - The rules to associate with the price set. The value of `attribute` is the value of the rule's `rule_attribute` attribute.
* @prop prices -The prices to create and add to this price set.
*/
export interface CreatePriceSetDTO {
rules?: { rule_attribute: string }[]
@@ -137,7 +132,7 @@ export interface CreatePriceSetDTO {
/**
* @interface
*
* An object of expected properties when updating a price set.
* The data to update in a price set. The `id` is used to identify which price set to update.
*
* @prop id - A string indicating the ID of the price set to update.
*/
@@ -148,10 +143,10 @@ export interface UpdatePriceSetDTO {
/**
* @interface
*
* An object that can be used to specify filters on price sets.
* Filters to apply on price sets.
*
* @prop id - An array of strings, each being an ID to filter price sets.
* @prop money_amounts - An object of type {@link FilterableMoneyAmountProps} that is used to filter the price sets by their associated money amounts.
* @prop id - IDs to filter price sets by.
* @prop money_amounts - Filters to apply on a price set's associated money amounts.
*/
export interface FilterablePriceSetProps
extends BaseFilterable<FilterablePriceSetProps> {
+19 -19
View File
@@ -3,12 +3,12 @@ import { BaseFilterable } from "../../dal"
/**
* @interface
*
* An object that holds the details of a rule type.
* A rule type's data.
*
* @prop id - A string indicating the ID of the rule type.
* @prop name - A string indicating the display name of the rule type.
* @prop rule_attribute - A string indicating a 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.
* @prop default_priority - A number indicating 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.
* @prop id - The ID of the rule type.
* @prop name - The display name of the rule type.
* @prop rule_attribute - 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.
* @prop default_priority - 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.
*/
export interface RuleTypeDTO {
id: string
@@ -20,12 +20,12 @@ export interface RuleTypeDTO {
/**
* @interface
*
* An object used when creating a rule type to specify its data.
* The rule type to create.
*
* @prop id - A string indicating the ID of the rule type.
* @prop name - A string indicating the display name of the rule type.
* @prop rule_attribute - A string indicating a 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.
* @prop default_priority - A number indicating 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.
* @prop id - The ID of the rule type.
* @prop name - The display name of the rule type.
* @prop rule_attribute - 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.
* @prop default_priority - 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.
*/
export interface CreateRuleTypeDTO {
id?: string
@@ -37,12 +37,12 @@ export interface CreateRuleTypeDTO {
/**
* @interface
*
* An object used when updating a rule type to specify the data to update.
* The data to update in a rule type. The `id` is used to identify which price set to update.
*
* @prop id - A string indicating the ID of the rule type to update.
* @prop name - A string indicating the display name of the rule type.
* @prop rule_attribute - A string indicating a 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.
* @prop default_priority - A number indicating 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.
* @prop id - The ID of the rule type to update.
* @prop name - The display name of the rule type.
* @prop rule_attribute - 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.
* @prop default_priority - 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.
*/
export interface UpdateRuleTypeDTO {
id: string
@@ -54,11 +54,11 @@ export interface UpdateRuleTypeDTO {
/**
* @interface
*
* An object used to filter retrieved rule types.
* Filters to apply on rule types.
*
* @prop id - an array of strings, each being an ID to filter rule types.
* @prop name - an array of strings, each being a name to filter rule types.
* @prop rule_attribute - an array of strings, each being a rule attribute to filter rule types.
* @prop id - The IDs to filter rule types by.
* @prop name - The names to filter rule types by.
* @prop rule_attribute - The rule attributes to filter rule types by.
*/
export interface FilterableRuleTypeProps
extends BaseFilterable<FilterableRuleTypeProps> {
+198 -158
View File
@@ -44,12 +44,17 @@ export interface IPricingModuleService {
/**
* This method is used to calculate prices based on the provided filters and context.
*
* @param {PricingContext} filters - An object of type {@link PricingFilters} used to filter the price sets.
* @param {PricingContext} context - An object of type {@link PricingContext} to select prices. For example, the pricing context can specify the currency code to calculate prices in.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CalculatedPriceSetDTO>} A promise that resolves to an object of type {@link CalculatedPriceSetDTO} which includes the calculated prices.
* @param {PricingFilters} filters - The filters to apply on prices.
* @param {PricingContext} context -
* 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
* will be retrieved.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CalculatedPriceSetDTO>} The calculated price matching the context and filters provided.
*
* @example
* When you calculate prices, you must at least specify the currency code:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
@@ -67,6 +72,53 @@ export interface IPricingModuleService {
*
* // do something with the price or return it
* }
* ```
*
* To calculate prices for specific minimum and/or maximum quantity:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
* async function calculatePrice (priceSetId: string, currencyCode: string) {
* const pricingService = await initializePricingModule()
*
* const price = await pricingService.calculatePrices(
* { id: [priceSetId] },
* {
* context: {
* currency_code: currencyCode,
* min_quantity: 4
* }
* }
* )
*
* // do something with the price or return it
* }
* ```
*
* To calculate prices for custom rule types:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
* async function calculatePrice (priceSetId: string, currencyCode: string) {
* const pricingService = await initializePricingModule()
*
* const price = await pricingService.calculatePrices(
* { id: [priceSetId] },
* {
* context: {
* currency_code: currencyCode,
* region_id: "US"
* }
* }
* )
*
* // do something with the price or return it
* }
* ```
*/
calculatePrices(
filters: PricingFilters,
@@ -77,12 +129,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieves a price set by its ID.
*
* @param {string} id - A string indicating the ID of the price set to retrieve.
* @param {string} id - The ID of the price set to retrieve.
* @param {FindConfig<PriceSetDTO>} config -
* An object of type {@link FindConfig} used to configure how the price set is retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the price set is retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price set.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO>} A promise that resolves to an object of type {@link PriceSetDTO} which is the retrieved price set.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO>} The retrieved price set.
*
* @example
* A simple example that retrieves a price set by its ID:
@@ -133,12 +185,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of price sets based on optional filters and configuration.
*
* @param {FilterablePriceSetProps} filters - An object of type {@link FilterablePriceSetProps} that is used to filter the retrieved price lists.
* @param {FilterablePriceSetProps} filters - The filters to apply on the retrieved price lists.
* @param {FindConfig<PriceSetDTO>} config -
* An object of type {@link FindConfig} used to configure how the price sets are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the price sets are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price set.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} A promise that resolves to an array of objects of type {@link PriceSetDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} The list of price sets.
*
* @example
*
@@ -253,13 +305,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of price sets along with the total count of available price sets satisfying the provided filters.
*
* @param {FilterablePriceSetProps} filters - An object of type {@link FilterablePriceSetProps} that is used to filter the retrieved price lists.
* @param {FilterablePriceSetProps} filters - The filters to apply on the retrieved price lists.
* @param {FindConfig<PriceSetDTO>} config -
* An object of type {@link FindConfig} used to configure how the price sets are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the price sets are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price set.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[PriceSetDTO[], number]>} A promise that resolves to an array having two items, the first item is an array of objects of type {@link PriceSetDTO},
* and the second item is a number indicating the total count.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[PriceSetDTO[], number]>} The list of price sets along with their total count.
*
* @example
*
@@ -374,9 +425,9 @@ export interface IPricingModuleService {
/**
* This method is used to create a new price set.
*
* @param {CreatePriceSetDTO} data - An object of type {@link CreatePriceSetDTO} that holds the attribute of the price set to create.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO>} A promise that resolves to an object of type {@link PriceSetDTO}, which is the created price set.
* @param {CreatePriceSetDTO} data - The attributes of the price set to create.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO>} The created price set.
*
* @example
* To create a default price set, don't pass any rules. For example:
@@ -466,9 +517,9 @@ export interface IPricingModuleService {
*
* This method is used to create multiple price sets.
*
* @param {CreatePriceSetDTO[]} data - An array of objects of type {@link CreatePriceSetDTO}, where each object holds the attribute of a price set to create.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} A promise that resolves to an array of objects of type {@link PriceSetDTO}, which are the created price sets.
* @param {CreatePriceSetDTO[]} data - The price sets to create.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} The list of created price sets.
*
* @example
* To create price sets with a default price, don't pass any rules and make sure to pass the `currency_code` of the price. For example:
@@ -556,9 +607,9 @@ export interface IPricingModuleService {
*
* This method is used to update existing price sets.
*
* @param {UpdatePriceSetDTO[]} data - An array of objects of type {@link UpdatePriceSetDTO}, each holding the data of the price sets to update.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} A promise that resolves to an array of objects of type {@link PriceSetDTOs}, which are the updated price sets.
* @param {UpdatePriceSetDTO[]} data - The price sets to update, each having the attributes that should be updated in a price set.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} The list of updated price sets.
*/
update(
data: UpdatePriceSetDTO[],
@@ -568,9 +619,9 @@ export interface IPricingModuleService {
/**
* This method remove rules from a price set.
*
* @param {RemovePriceSetRulesDTO[]} data - An array of objects of type {@link RemovePriceSetRulesDTO}, each specfiying which rules to remove.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} A promise that resolves when rules are successfully removed.
* @param {RemovePriceSetRulesDTO[]} data - The rules to remove per price set.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} Resolves when rules are successfully removed.
*
* @example
* import {
@@ -596,9 +647,9 @@ export interface IPricingModuleService {
/**
* This method deletes price sets by their IDs.
*
* @param {string[]} ids - An array of strings, each being the ID for a price set to delete.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} A promise that resolves when the price sets are successfully deleted.
* @param {string[]} ids - The IDs of the price sets to delete.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} Resolves when the price sets are successfully deleted.
*
* @example
* import {
@@ -616,9 +667,9 @@ export interface IPricingModuleService {
/**
* This method adds prices to a price set.
*
* @param {AddPricesDTO} data - An object of type {@link AddPricesDTO} that holds the data necessary to add the prices.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO>} A promise that resolves to an object of type {@link PriceSetDTO}, which is the price set that the prices belong to.
* @param {AddPricesDTO} data - The data defining the price set to add the prices to, along with the prices to add.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO>} The price set that the prices were added to.
*
* @example
*
@@ -696,9 +747,9 @@ export interface IPricingModuleService {
/**
* This method adds prices to multiple price sets.
*
* @param {AddPricesDTO[]} data - An array of objects of type {@link AddPricesDTO}, each holding the data necessary to add the prices to the price set.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} A promise that resolves to an array of objects of type {@link PriceSetDTO}, each being a price list that prices were added to.
* @param {AddPricesDTO[]} data - The data defining the prices to add per price set.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} The list of the price sets that prices were added to.
*
* @example
*
@@ -779,9 +830,9 @@ export interface IPricingModuleService {
/**
* This method adds rules to a price set.
*
* @param {AddRulesDTO} data - An object of type {@link AddRulesDTO} that holds the necessary data to add rules to a price set.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO>} A promise that resolves to an object of type {@link PriceSetDTO}, which is the price set that the rules belong to.
* @param {AddRulesDTO} data - The data defining the price set to add the rules to, along with the rules to add.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO>} The price set that the rules were added to.
*
* @example
* import {
@@ -806,9 +857,9 @@ export interface IPricingModuleService {
/**
* This method adds rules to multiple price sets.
*
* @param {AddRulesDTO[]} data - An array of objects of type {@link AddRulesDTO}, each holding the necessary data to add rules to a price set.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} A promise that resolves to an array of objects of type {@link PriceSetDTO}, each being the price set that rules were added to.
* @param {AddRulesDTO[]} data - The data defining the rules to add per price set.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetDTO[]>} The list of the price sets that the rules were added to.
*
* @example
* import {
@@ -835,10 +886,10 @@ export interface IPricingModuleService {
*
* @param {string} id - The ID of the money amount to retrieve.
* @param {FindConfig<MoneyAmountDTO>} config -
* An object of type {@link MoneyAmountDTO} used to configure how a money amount is retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how a money amount is retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a money amount.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<MoneyAmountDTO>} A promise that resolves to an object of type {@link MoneyAmountDTO} which is the retrieved money amount.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<MoneyAmountDTO>} The retrieved money amount.
*
* @example
* To retrieve a money amount by its ID:
@@ -889,12 +940,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of money amounts based on optional filters and configuration.
*
* @param {FilterableMoneyAmountProps} filters - An object of type {@link FilterableMoneyAmountProps} that is used to filter the retrieved money amounts.
* @param {FilterableMoneyAmountProps} filters - The filtes to apply on the retrieved money amounts.
* @param {FindConfig<MoneyAmountDTO>} config -
* An object of type {@link FindConfig} used to configure how the money amounts are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the money amounts are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a money amount.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<MoneyAmountDTO[]>} A promise that resolves to an array of objects of type {@link MoneyAmountDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<MoneyAmountDTO[]>} The list of money amounts.
*
* @example
*
@@ -1007,13 +1058,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of money amounts along with the total count of available money amounts satisfying the provided filters.
*
* @param {FilterableMoneyAmountProps} filters - An object of type {@link FilterableMoneyAmountProps} that is used to filter the retrieved money amounts.
* @param {FilterableMoneyAmountProps} filters - The filters to apply on the retrieved money amounts.
* @param {FindConfig<MoneyAmountDTO>} config -
* An object of type {@link FindConfig} used to configure how the money amounts are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the money amounts are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a money amount.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[MoneyAmountDTO[], number]>} A promise that resolves to an array having two items, the first item is an array of objects of type {@link MoneyAmountDTO},
* and the second item is a number indicating the total count.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[MoneyAmountDTO[], number]>} The list of money amounts along with their total count.
*
* @example
*
@@ -1126,9 +1176,9 @@ export interface IPricingModuleService {
/**
* This method creates money amounts.
*
* @param {CreateMoneyAmountDTO[]} data - An array of objects of type {@link CreateMoneyAmountDTO} that holds the necessary data to create the money amount.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<MoneyAmountDTO[]>} A promise that resolves to an array of objects of type {@link MoneyAmountDTO}, each being a created money amount.
* @param {CreateMoneyAmountDTO[]} data - The money amounts to create.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<MoneyAmountDTO[]>} The list of created money amounts.
*
* @example
* import {
@@ -1162,9 +1212,9 @@ export interface IPricingModuleService {
/**
* This method updates existing money amounts.
*
* @param {UpdateMoneyAmountDTO[]} data - An array of objects of type {@link UpdateMoneyAmountDTO}, each holding data to update in a money amount.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<MoneyAmountDTO[]>} A promise that resolves to an array of objects of type {@link MoneyAmountDTO}, each being a updated money amount.
* @param {UpdateMoneyAmountDTO[]} data - The money amounts to update, each having the attributes that should be updated in a money amount.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<MoneyAmountDTO[]>} The list of updated money amounts.
*
* @example
* import {
@@ -1192,9 +1242,9 @@ export interface IPricingModuleService {
/**
* This method deletes money amounts by their IDs.
*
* @param {string[]} ids - An array of strings, each being the ID of a money amount to delete.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} A promise that resolves when the money amounts are successfully deleted.
* @param {string[]} ids - The IDs of the money amounts to delete.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} Resolves when the money amounts are successfully deleted.
*
* @example
* import {
@@ -1214,12 +1264,12 @@ export interface IPricingModuleService {
/**
* This method retrieves a currency by its code and and optionally based on the provided configurations.
*
* @param {string} code - A string indicating the code of the currency to retrieve.
* @param {string} code - The code of the currency to retrieve.
* @param {FindConfig<CurrencyDTO>} config -
* An object of type {@link FindConfig} used to configure how the currency is retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the currency is retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a currency.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CurrencyDTO>} A promise that resolves to an object of type {@link CurrencyDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CurrencyDTO>} The retrieved currency.
*
* @example
* A simple example that retrieves a currency by its code:
@@ -1270,12 +1320,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of currencies based on optional filters and configuration.
*
* @param {FilterableCurrencyProps} filters - An object of type {@link FilterableCurrencyProps} that is used to filter the retrieved currencies.
* @param {FilterableCurrencyProps} filters - The filters to apply on the retrieved currencies.
* @param {FindConfig<CurrencyDTO>} config -
* An object of type {@link FindConfig} used to configure how the currencies are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the currencies are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a currency.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CurrencyDTO[]>} A promise that resolves to an array of objects of type {@link CurrencyDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CurrencyDTO[]>} The list of currencies.
*
* @example
*
@@ -1356,13 +1406,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of currencies along with the total count of available currencies satisfying the provided filters.
*
* @param {FilterableCurrencyProps} filters - An object of type {@link FilterableCurrencyProps} that is used to filter the retrieved currencies.
* @param {FilterableCurrencyProps} filters - The filters to apply on the retrieved currencies.
* @param {FindConfig<CurrencyDTO>} config -
* An object of type {@link FindConfig} used to configure how the currencies are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the currencies are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a currency.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[CurrencyDTO[], number]>} A promise that resolves to an array having two items, the first item is an array of objects of type {@link CurrencyDTO},
* and the second item is a number indicating the total count.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[CurrencyDTO[], number]>} The list of currencies along with the total count.
*
* @example
*
@@ -1443,9 +1492,9 @@ export interface IPricingModuleService {
/**
* This method is used to create new currencies.
*
* @param {CreateCurrencyDTO[]} data - An array of objects of type {@link CreateCurrencyDTO}, each object holding the data of a currency to create.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CurrencyDTO[]>} A promise that resolves to an array of objects of type {@link CurrencyDTO}, each object being a created currency.
* @param {CreateCurrencyDTO[]} data - The currencies to create.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CurrencyDTO[]>} The list of created currencies.
*
* @example
* import {
@@ -1475,9 +1524,9 @@ export interface IPricingModuleService {
/**
* This method is used to update existing currencies with the provided data. In each currency object, the currency code must be provided to identify which currency to update.
*
* @param {UpdateCurrencyDTO[]} data - An array of objects of type {@link UpdateCurrencyDTO}, each object containing data to be updated in a currency.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CurrencyDTO[]>} A promise that resolves to an array of objects of type {@link CurrencyDTO}, each object being an updated currency.
* @param {UpdateCurrencyDTO[]} data - The currencies to update, each having the attributes that should be updated in a currency.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<CurrencyDTO[]>} The list of updated currencies.
*
* @example
* import {
@@ -1505,9 +1554,9 @@ export interface IPricingModuleService {
/**
* This method is used to delete currencies based on their currency code.
*
* @param {string[]} currencyCodes - An array of strings, each being a code of a currency to delete.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} A promise that resolves once the currencies are deleted.
* @param {string[]} currencyCodes - Currency codes of the currencies to delete.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} Resolves once the currencies are deleted.
*
* @example
* import {
@@ -1531,10 +1580,10 @@ export interface IPricingModuleService {
*
* @param {string} id - The ID of the rule type to retrieve.
* @param {FindConfig<RuleTypeDTO>} config -
* An object of type {@link FindConfig} used to configure how the rule type is retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the rule type is retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a rule type.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<RuleTypeDTO>} A promise that resolves to an object of type {@link RuleTypeDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<RuleTypeDTO>} The retrieved rule type.
*
* @example
* A simple example that retrieves a rule type by its code:
@@ -1572,7 +1621,7 @@ export interface IPricingModuleService {
* ```
*/
retrieveRuleType(
code: string,
id: string,
config?: FindConfig<RuleTypeDTO>,
sharedContext?: Context
): Promise<RuleTypeDTO>
@@ -1580,12 +1629,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of rule types based on optional filters and configuration.
*
* @param {FilterableRuleTypeProps} filters - An object of type {@link FilterableRuleTypeProps} that is used to filter the retrieved rule types.
* @param {FilterableRuleTypeProps} filters - The filters to apply on the retrieved rule types.
* @param {FindConfig<RuleTypeDTO>} config -
* An object of type {@link FindConfig} used to configure how the rule types are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the rule types are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a rule type.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<RuleTypeDTO[]>} A promise that resolves to an array of objects of type {@link RuleTypeDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<RuleTypeDTO[]>} The list of rule types.
*
* @example
*
@@ -1693,13 +1742,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of rule types along with the total count of available rule types satisfying the provided filters.
*
* @param {FilterableRuleTypeProps} filters - An object of type {@link FilterableRuleTypeProps} that is used to filter the retrieved rule types.
* @param {FilterableRuleTypeProps} filters - The filters to apply on the retrieved rule types.
* @param {FindConfig<RuleTypeDTO>} config -
* An object of type {@link FindConfig} used to configure how the rule types are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the rule types are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a rule type.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[RuleTypeDTO[], number]>} A promise that resolves to an array having two items, the first item is an array of objects of type {@link RuleTypeDTO},
* and the second item is a number indicating the total count.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[RuleTypeDTO[], number]>} The list of rule types along with their total count.
*
* @example
*
@@ -1807,9 +1855,9 @@ export interface IPricingModuleService {
/**
* This method is used to create new rule types.
*
* @param {CreateRuleTypeDTO[]} data - An array of objects of type {@link CreateRuleTypeDTO}, each being the data to use to create a rule type.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<RuleTypeDTO[]>} A promise that resolves to an array of objects of type {@link RuleTypeDTO}, each being a created rule type.
* @param {CreateRuleTypeDTO[]} data - The rule types to create.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<RuleTypeDTO[]>} The list of created rule types.
*
* @example
* import {
@@ -1837,9 +1885,9 @@ export interface IPricingModuleService {
/**
* This method is used to update existing rule types with the provided data.
*
* @param {UpdateRuleTypeDTO[]} data - An array of objects of type {@link UpdateRuleTypeDTO}, each object containing data to be updated in a rule type.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<RuleTypeDTO[]>} A promise that resolves to an array of objects of type {@link RuleTypeDTO}, each being an updated rule type.
* @param {UpdateRuleTypeDTO[]} data - The rule types to update, each having the attributes that should be updated in a rule type.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<RuleTypeDTO[]>} The list of updated rule types.
*
* @example
* import {
@@ -1867,9 +1915,9 @@ export interface IPricingModuleService {
/**
* This method is used to delete rule types based on the provided IDs.
*
* @param {string[]} ruleTypeIds - An array of strings, each being the ID of a rule type to delete.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} A promise that resolves once the rule types are deleted.
* @param {string[]} ruleTypeIds - The IDs of the rule types to delete.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} Resolves once the rule types are deleted.
*
* @example
* import {
@@ -1887,12 +1935,12 @@ export interface IPricingModuleService {
/**
* This method is used to a price set money amount rule by its ID based on the provided configuration.
*
* @param {string} id - A string indicating the ID of the price set money amount rule to retrieve.
* @param {string} id - The ID of the price set money amount rule to retrieve.
* @param {FindConfig<PriceSetMoneyAmountRulesDTO>} config -
* An object of type {@link FindConfig} used to configure how the price set money amount rule is retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the price set money amount rule is retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price set money amount rule.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetMoneyAmountRulesDTO>} A promise that resolves to an object of type {@link PriceSetMoneyAmountRulesDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetMoneyAmountRulesDTO>} The retrieved price set money amount rule.
*
* @example
* A simple example that retrieves a price set money amount rule by its ID:
@@ -1938,13 +1986,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of price set money amount rules based on optional filters and configuration.
*
* @param {FilterablePriceSetMoneyAmountRulesProps} filters -
* An object of type {@link FilterablePriceSetMoneyAmountRulesProps} that is used to filter the retrieved price set money amount rules.
* @param {FilterablePriceSetMoneyAmountRulesProps} filters - The filters to apply on the retrieved price set money amount rules.
* @param {FindConfig<PriceSetMoneyAmountRulesDTO>} config -
* An object of type {@link FindConfig} used to configure how the price set money amount rules are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the price set money amount rules are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price set money amount rule.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetMoneyAmountRulesDTO[]>} A promise that resolves to an array of objects of type {@link PriceSetMoneyAmountRulesDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetMoneyAmountRulesDTO[]>} The list of price set money amount rules.
*
* @example
*
@@ -2047,14 +2094,12 @@ export interface IPricingModuleService {
* This method is used to retrieve a paginated list of price set money amount rules along with the total count of
* available price set money amount rules satisfying the provided filters.
*
* @param {FilterablePriceSetMoneyAmountRulesProps} filters -
* An object of type {@link FilterablePriceSetMoneyAmountRulesProps} that is used to filter the retrieved price set money amount rules.
* @param {FilterablePriceSetMoneyAmountRulesProps} filters - The filters to apply on the retrieved price set money amount rules.
* @param {FindConfig<PriceSetMoneyAmountRulesDTO>} config -
* An object of type {@link FindConfig} used to configure how the price set money amount rules are retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the price set money amount rules are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price set money amount rule.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[PriceSetMoneyAmountRulesDTO[], number]>} A promise that resolves to an array having two items, the first item is an array of objects of type {@link PriceSetMoneyAmountRulesDTO},
* and the second item is a number indicating the total count.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[PriceSetMoneyAmountRulesDTO[], number]>} The list of price set money amount rules and their total count.
*
* @example
*
@@ -2157,11 +2202,9 @@ export interface IPricingModuleService {
* This method is used to create new price set money amount rules. A price set money amount rule creates an association between a price set money amount and
* a rule type.
*
* @param {CreatePriceSetMoneyAmountRulesDTO[]} data -
* An array of objects of type {@link CreatePriceSetMoneyAmountRulesDTO}, each containing the data of a price set money amount rule to create.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetMoneyAmountRulesDTO[]>} A promise that resolves to an array of objects of type {@link PriceSetMoneyAmountRulesDTO}, each being
* a created price set money amount rule.
* @param {CreatePriceSetMoneyAmountRulesDTO[]} data - The price set money amount rules to create.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetMoneyAmountRulesDTO[]>} The list of created price set money amount rules.
*
* @example
* import {
@@ -2191,10 +2234,9 @@ export interface IPricingModuleService {
* This method is used to update price set money amount rules, each with their provided data.
*
* @param {UpdatePriceSetMoneyAmountRulesDTO[]} data -
* An array of objects of type {@link UpdatePriceSetMoneyAmountRulesDTO}, each containing the data to update in a price set money amount rule.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetMoneyAmountRulesDTO[]>} A promise that resolves to an array of objects of type {@link PriceSetMoneyAmountRulesDTO}, each being the
* updated price set money amount rule.
* The price set money amounts to update, each having the attributes to update in a price set money amount.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetMoneyAmountRulesDTO[]>} The list of updated price set money amount rules.
*
* @example
* import {
@@ -2222,9 +2264,9 @@ export interface IPricingModuleService {
/**
* This method is used to delete price set money amount rules based on the specified IDs.
*
* @param {string[]} ids - An array of strings, each representing the ID of a price set money amount rule to delete.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} A promise that resolves once the price set money amount rules are deleted.
* @param {string[]} ids - The IDs of the price set money amount rules to delete.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} Resolves once the price set money amount rules are deleted.
*
* @example
* import {
@@ -2247,10 +2289,10 @@ export interface IPricingModuleService {
*
* @param {string} id - The ID of the price rule to retrieve.
* @param {FindConfig<PriceRuleDTO>} config -
* An object of type {@link FindConfig} used to configure how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price rule.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO>} A promise that resolves to an object of type {@link PriceRuleDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO>} The retrieved price rule.
*
* @example
* A simple example that retrieves a price rule by its ID:
@@ -2296,13 +2338,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of price rules based on optional filters and configuration.
*
* @param {FilterablePriceRuleProps} filters -
* An object of type {@link FilterablePriceRuleProps} that is used to filter the retrieved price rules.
* @param {FilterablePriceRuleProps} filters - The filters to apply on the retrieved price rules.
* @param {FindConfig<PriceRuleDTO>} config -
* An object of type {@link FindConfig} used to configure how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price rule.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO[]>} A promise that resolves to an array of objects of type {@link PriceRuleDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO[]>} The list of price rules.
*
* @example
*
@@ -2404,13 +2445,12 @@ export interface IPricingModuleService {
/**
* This method is used to retrieve a paginated list of price rules along with the total count of available price rules satisfying the provided filters.
*
* @param {FilterablePriceRuleProps} filters -
* An object of type {@link FilterablePriceRuleProps} that is used to filter the retrieved price rules.
* @param {FilterablePriceRuleProps} filters - The filters to apply on the retrieved price rules.
* @param {FindConfig<PriceRuleDTO>} config -
* An object of type {@link FindConfig} used to configure how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the
* The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price rule.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO[]>} A promise that resolves to an array of objects of type {@link PriceRuleDTO}.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO[]>} The list of price rules along with their total count.
*
* @example
*
@@ -2512,9 +2552,9 @@ export interface IPricingModuleService {
/**
* This method is used to create new price rules based on the provided data.
*
* @param {CreatePriceRuleDTO[]} data - An array of objects of type {@link CreatePriceRuleDTO}, each containing the data necessary to create a price rule.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO[]>} A promise that resolves to an array of objects of type {@link PriceRuleDTO}, each being a created price rule.
* @param {CreatePriceRuleDTO[]} data - The price rules to create.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO[]>} The list of created price rules.
*
* @example
* import {
@@ -2553,9 +2593,9 @@ export interface IPricingModuleService {
/**
* This method is used to update price rules, each with their provided data.
*
* @param {UpdatePriceRuleDTO[]} data - An array of objects of type {@link UpdatePriceRuleDTO}, each containing the data to update in a price rule.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO[]>} A promise that resolves to an array of objects of type {@link PriceRuleDTO}, each being an updated price rule.
* @param {UpdatePriceRuleDTO[]} data - The price rules to update, each having attributes that should be updated in a price rule.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceRuleDTO[]>} The list of updated price rules.
*
* @example
* import {
@@ -2586,9 +2626,9 @@ export interface IPricingModuleService {
/**
* This method is used to delete price rules based on the specified IDs.
*
* @param {string[]} priceRuleIds - An array of strings, each being the ID of a price rule to delete.
* @param {Context} sharedContext - An object of type {@link Context} used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} A promise that resolves once the price rules are deleted.
* @param {string[]} priceRuleIds - The IDs of the price rules to delete.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<void>} Resolves once the price rules are deleted.
*
* @example
* import {