chore: reorganize docs apps (#7228)

* reorganize docs apps

* add README

* fix directory

* add condition for old docs
This commit is contained in:
Shahed Nasser
2024-05-03 17:36:38 +03:00
committed by GitHub
parent 224ebb2154
commit 4fe28f5a95
6187 changed files with 601447 additions and 598226 deletions
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# clearMessages
## Returns
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="clearMessages"/>
@@ -0,0 +1,15 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# getMessages
## Parameters
<TypeList types={[{"name":"format","type":"[MessageAggregatorFormat](../../../interfaces/promotion.MessageAggregatorFormat/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"groupBy","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sortBy","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="getMessages"/>
## Returns
<TypeList types={[{"name":"Record","type":"`Record<string, [Message](../../../types/promotion.Message/page.mdx)[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"Message[]","type":"[Message](../../../types/promotion.Message/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"Message","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="getMessages"/>
@@ -0,0 +1,15 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# save
## Parameters
<TypeList types={[{"name":"msg","type":"[Message](../../../types/promotion.Message/page.mdx) \\| [Message](../../../types/promotion.Message/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="save"/>
## Returns
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="save"/>
@@ -0,0 +1,15 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# saveRawMessageData
## Parameters
<TypeList types={[{"name":"messageData","type":"[MessageFormat](../../../types/promotion.MessageFormat/page.mdx)&#60;T&#62; \\| [MessageFormat](../../../types/promotion.MessageFormat/page.mdx)&#60;T&#62;[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="saveRawMessageData"/>
## Returns
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="saveRawMessageData"/>
@@ -0,0 +1,37 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/addPromotionBuyRules
sidebar_label: addPromotionBuyRules
---
import { TypeList } from "docs-ui"
# addPromotionBuyRules - Promotion Module Reference
This documentation provides a reference to the `addPromotionBuyRules` method. This belongs to the Promotion Module.
This method adds buy promotion rules to a promotion's application method.
## Example
```ts
const buyPromotionRules =
await promotionModuleService.addPromotionBuyRules(
"promo_123",
[
{
attribute: "SKU",
operator: "eq",
values: "SHIRT",
},
]
)
```
## Parameters
<TypeList types={[{"name":"promotionId","type":"`string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rulesData","type":"[CreatePromotionRuleDTO](../../../interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The promotion rules to be created and added as buy rules to the promotion's applicatio method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string` \\| `string`[]","description":"The values of the promotion rule.\nWhen provided, `PromotionRuleValue` records are\ncreated and associated with the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="addPromotionBuyRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PromotionRuleDTO](../../../interfaces/promotion.PromotionRuleDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created promotion rules.","expandable":false,"children":[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"`object`","description":"The promotion rule details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="addPromotionBuyRules"/>
@@ -0,0 +1,37 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/addPromotionRules
sidebar_label: addPromotionRules
---
import { TypeList } from "docs-ui"
# addPromotionRules - Promotion Module Reference
This documentation provides a reference to the `addPromotionRules` method. This belongs to the Promotion Module.
This method adds promotion rules to a promotion.
## Example
```ts
const promotionRules =
await promotionModuleService.addPromotionRules(
"promo_123",
[
{
attribute: "customer_group_id",
operator: "in",
values: ["VIP", "VVIP"],
},
]
)
```
## Parameters
<TypeList types={[{"name":"promotionId","type":"`string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rulesData","type":"[CreatePromotionRuleDTO](../../../interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The promotion rules to be created and added to the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string` \\| `string`[]","description":"The values of the promotion rule.\nWhen provided, `PromotionRuleValue` records are\ncreated and associated with the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="addPromotionRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PromotionRuleDTO](../../../interfaces/promotion.PromotionRuleDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The promotion rules created.","expandable":false,"children":[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"`object`","description":"The promotion rule details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="addPromotionRules"/>
@@ -0,0 +1,37 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/addPromotionTargetRules
sidebar_label: addPromotionTargetRules
---
import { TypeList } from "docs-ui"
# addPromotionTargetRules - Promotion Module Reference
This documentation provides a reference to the `addPromotionTargetRules` method. This belongs to the Promotion Module.
This method adds target promotion rules to a promotion's application method.
## Example
```ts
const targetPromotionRules =
await promotionModuleService.addPromotionTargetRules(
"promo_123",
[
{
attribute: "SKU",
operator: "eq",
values: "SHIRT",
},
]
)
```
## Parameters
<TypeList types={[{"name":"promotionId","type":"`string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rulesData","type":"[CreatePromotionRuleDTO](../../../interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The promotion rules to be created and added as target rules to the promotion's application method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string` \\| `string`[]","description":"The values of the promotion rule.\nWhen provided, `PromotionRuleValue` records are\ncreated and associated with the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="addPromotionTargetRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PromotionRuleDTO](../../../interfaces/promotion.PromotionRuleDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created promotion rules.","expandable":false,"children":[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"`object`","description":"The promotion rule details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="addPromotionTargetRules"/>
@@ -0,0 +1,51 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/computeActions
sidebar_label: computeActions
---
import { TypeList } from "docs-ui"
# computeActions - Promotion Module Reference
This documentation provides a reference to the `computeActions` method. This belongs to the Promotion Module.
This method provides the actions to perform on a cart based on the specified promotions
and context.
## Example
```ts
const actions = await promotionModuleService.computeActions(
["50OFF"],
{
items: [
{
id: "cali_123",
quantity: 2,
subtotal: 1000,
},
],
shipping_methods: [
{
id: "casm_123",
subtotal: 0,
adjustments: [
{
id: "adj_123",
code: "FREESHIPPING",
},
],
},
],
}
)
```
## Parameters
<TypeList types={[{"name":"promotionCodesToApply","type":"`string`[]","description":"The promotion codes to be applied on the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"applicationContext","type":"[ComputeActionContext](../../../interfaces/promotion.ComputeActionContext/page.mdx)","description":"The items and shipping methods of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"[ComputeActionItemLine](../../../interfaces/promotion.ComputeActionItemLine/page.mdx)[]","description":"The cart's line items.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"`number`","description":"The subtotal of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"[ComputeActionAdjustmentLine](../../../interfaces/promotion.ComputeActionAdjustmentLine/page.mdx)[]","description":"The adjustments applied before on the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"shipping_methods","type":"[ComputeActionShippingLine](../../../interfaces/promotion.ComputeActionShippingLine/page.mdx)[]","description":"The cart's shipping methods.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"`number`","description":"The subtotal of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"[ComputeActionAdjustmentLine](../../../interfaces/promotion.ComputeActionAdjustmentLine/page.mdx)[]","description":"The adjustments applied before on the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"options","type":"`Record<string, any>`","description":"Any relevant options that may change how the actions are computed.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="computeActions"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ComputeActions](../../../types/promotion.ComputeActions/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of computed actions to be applied on the cart.","expandable":false,"children":[{"name":"ComputeActions[]","type":"[ComputeActions](../../../types/promotion.ComputeActions/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ComputeActions","type":"[AddItemAdjustmentAction](../../../interfaces/promotion.AddItemAdjustmentAction/page.mdx) \\| [RemoveItemAdjustmentAction](../../../interfaces/promotion.RemoveItemAdjustmentAction/page.mdx) \\| [AddShippingMethodAdjustment](../../../interfaces/promotion.AddShippingMethodAdjustment/page.mdx) \\| [RemoveShippingMethodAdjustment](../../../interfaces/promotion.RemoveShippingMethodAdjustment/page.mdx) \\| [CampaignBudgetExceededAction](../../../interfaces/promotion.CampaignBudgetExceededAction/page.mdx)","description":"A compute action informs you what adjustment must be made to a cart item or shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="computeActions"/>
@@ -0,0 +1,70 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/createCampaigns
sidebar_label: createCampaigns
---
import { TypeList } from "docs-ui"
# createCampaigns - Promotion Module Reference
This documentation provides a reference to the `createCampaigns` method. This belongs to the Promotion Module.
## createCampaigns(data, sharedContext?): Promise&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)&#62;
This method creates a campaign.
### Example
```ts
const campaign = await promotionModuleService.createCampaigns(
{
name: "Summer discounts",
campaign_identifier: "G-123456",
starts_at: new Date("2025-06-01"),
ends_at: new Date("2025-09-01"),
budget: {
type: "usage",
limit: 10,
},
}
)
```
### Parameters
<TypeList types={[{"name":"data","type":"[CreateCampaignDTO](../../../interfaces/promotion.CreateCampaignDTO/page.mdx)","description":"The campaign to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CreateCampaignBudgetDTO](../../../interfaces/promotion.CreateCampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"Pick&#60;[PromotionDTO](../../../interfaces/promotion.PromotionDTO/page.mdx), \"id\"&#62;[]","description":"The promotions of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="createCampaigns"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created campaign.","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="createCampaigns"/>
## createCampaigns(data, sharedContext?): Promise&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)[]&#62;
This method creates campaigns.
### Example
```ts
const campaigns =
await promotionModuleService.createCampaigns([
{
name: "Summer discounts",
campaign_identifier: "G-123456",
starts_at: new Date("2025-06-01"),
ends_at: new Date("2025-09-01"),
budget: {
type: "usage",
limit: 10,
},
},
])
```
### Parameters
<TypeList types={[{"name":"data","type":"[CreateCampaignDTO](../../../interfaces/promotion.CreateCampaignDTO/page.mdx)[]","description":"The campaigns to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CreateCampaignBudgetDTO](../../../interfaces/promotion.CreateCampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"Pick&#60;[PromotionDTO](../../../interfaces/promotion.PromotionDTO/page.mdx), \"id\"&#62;[]","description":"The promotions of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="createCampaigns"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created campaigns.","expandable":false,"children":[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"`object`","description":"The campaign details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createCampaigns"/>
@@ -0,0 +1,50 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/delete
sidebar_label: delete
---
import { TypeList } from "docs-ui"
# delete - Promotion Module Reference
This documentation provides a reference to the `delete` method. This belongs to the Promotion Module.
## delete(ids, sharedContext?): Promise&#60;void&#62;
This method deletes promotions by their IDs.
### Example
```ts
await promotionModuleService.delete([
"promo_123",
"promo_321",
])
```
### Parameters
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the promotions are deleted.","expandable":false,"children":[]}]} sectionTitle="delete"/>
## delete(ids, sharedContext?): Promise&#60;void&#62;
This method deletes a promotion by its ID.
### Example
```ts
await promotionModuleService.delete("promo_123")
```
### Parameters
<TypeList types={[{"name":"ids","type":"`string`","description":"The IDs of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the promotion is deleted.","expandable":false,"children":[]}]} sectionTitle="delete"/>
@@ -0,0 +1,47 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/deleteCampaigns
sidebar_label: deleteCampaigns
---
import { TypeList } from "docs-ui"
# deleteCampaigns - Promotion Module Reference
This documentation provides a reference to the `deleteCampaigns` method. This belongs to the Promotion Module.
## deleteCampaigns(ids, sharedContext?): Promise&#60;void&#62;
This method deletes campaigns by their IDs.
### Example
```ts
await promotionModuleService.deleteCampaigns(["procamp_123"])
```
### Parameters
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the campaigns.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="deleteCampaigns"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the campaigns are deleted successfully.","expandable":false,"children":[]}]} sectionTitle="deleteCampaigns"/>
## deleteCampaigns(ids, sharedContext?): Promise&#60;void&#62;
This method deletes a campaign by its ID.
### Example
```ts
await promotionModuleService.deleteCampaigns("procamp_123")
```
### Parameters
<TypeList types={[{"name":"ids","type":"`string`","description":"The IDs of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="deleteCampaigns"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the campaign is deleted successfully.","expandable":false,"children":[]}]} sectionTitle="deleteCampaigns"/>
@@ -0,0 +1,42 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/registerUsage
sidebar_label: registerUsage
---
import { TypeList } from "docs-ui"
# registerUsage - Promotion Module Reference
This documentation provides a reference to the `registerUsage` method. This belongs to the Promotion Module.
This method adjusts the budget for each campaign associated with the promotions' specified computed actions.
It adjusts the `used` property of a `CampaignBudget` to account for the adjustment amounts in the specified associated
computed actions.
## Example
```ts
await promotionModuleService.registerUsage([
{
action: "addItemAdjustment",
item_id: "cali_123",
amount: 50,
code: "50OFF",
},
{
action: "addShippingMethodAdjustment",
shipping_method_id: "casm_123",
amount: 5000,
code: "FREESHIPPING",
},
])
```
## Parameters
<TypeList types={[{"name":"computedActions","type":"[ComputeActions](../../../types/promotion.ComputeActions/page.mdx)[]","description":"The computed actions to adjust their promotion's campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="registerUsage"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the campaign budgets have been adjusted successfully.","expandable":false,"children":[]}]} sectionTitle="registerUsage"/>
@@ -0,0 +1,30 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/removePromotionBuyRules
sidebar_label: removePromotionBuyRules
---
import { TypeList } from "docs-ui"
# removePromotionBuyRules - Promotion Module Reference
This documentation provides a reference to the `removePromotionBuyRules` method. This belongs to the Promotion Module.
This method removes buy promotion rules from a promotion's application method.
## Example
```ts
await promotionModuleService.removePromotionBuyRules(
"promo_123",
["prorul_123", "prorul_321"]
)
```
## Parameters
<TypeList types={[{"name":"promotionId","type":"`string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleIds","type":"`string`[]","description":"The buy promotion rules' IDs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="removePromotionBuyRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the buy promotion rules are deleted.","expandable":false,"children":[]}]} sectionTitle="removePromotionBuyRules"/>
@@ -0,0 +1,30 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/removePromotionRules
sidebar_label: removePromotionRules
---
import { TypeList } from "docs-ui"
# removePromotionRules - Promotion Module Reference
This documentation provides a reference to the `removePromotionRules` method. This belongs to the Promotion Module.
This method removes promotion rules from a promotion.
## Example
```ts
await promotionModuleService.removePromotionRules(
"promo_123",
["prorul_123", "prorul_321"]
)
```
## Parameters
<TypeList types={[{"name":"promotionId","type":"`string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleIds","type":"`string`[]","description":"The promotion rules' IDs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="removePromotionRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the promotion rules are deleted successfully.","expandable":false,"children":[]}]} sectionTitle="removePromotionRules"/>
@@ -0,0 +1,30 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/removePromotionTargetRules
sidebar_label: removePromotionTargetRules
---
import { TypeList } from "docs-ui"
# removePromotionTargetRules - Promotion Module Reference
This documentation provides a reference to the `removePromotionTargetRules` method. This belongs to the Promotion Module.
This method removes target promotion rules from a promotion's application method.
## Example
```ts
await promotionModuleService.removePromotionTargetRules(
"promo_123",
["prorul_123", "prorul_321"]
)
```
## Parameters
<TypeList types={[{"name":"promotionId","type":"`string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleIds","type":"`string`[]","description":"The target promotion rules' IDs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="removePromotionTargetRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the target promotion rules are deleted.","expandable":false,"children":[]}]} sectionTitle="removePromotionTargetRules"/>
@@ -0,0 +1,27 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/restore
sidebar_label: restore
---
import { TypeList } from "docs-ui"
# restore - Promotion Module Reference
This documentation provides a reference to the `restore` method. This belongs to the Promotion Module.
This method restores soft deleted promotions by their IDs.
## Example
```ts
await promotionModuleService.restore("promo_123")
```
## Parameters
<TypeList types={[{"name":"promotionIds","type":"`string` \\| `string`[]","description":"The promotions' IDs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../../interfaces/promotion.RestoreReturn/page.mdx)&#60;TReturnableLinkableKeys&#62;","description":"Configurations determining which relations to restore along with each of the promotion. You can pass to its `returnLinkableKeys`\nproperty any of the promotion's relation attribute names, such as `application_method_id`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="restore"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void \\| Record&#60;string, string[]&#62;&#62;","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored, such as the ID of associated application method.\nThe object's keys are the ID attribute names of the promotion entity's relations, such as `application_method_id`,\nand its value is an array of strings, each being the ID of the record associated with the promotion through this relation,\nsuch as the IDs of associated application method.\n\nIf there are no related records restored, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record&#60;string, string[]&#62;","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restore"/>
@@ -0,0 +1,29 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/restoreCampaigns
sidebar_label: restoreCampaigns
---
import { TypeList } from "docs-ui"
# restoreCampaigns - Promotion Module Reference
This documentation provides a reference to the `restoreCampaigns` method. This belongs to the Promotion Module.
This method restores soft deleted campaigns by their IDs.
## Example
```ts
await promotionModuleService.restoreCampaigns("procamp_123", {
returnLinkableKeys: ["budget_id"],
})
```
## Parameters
<TypeList types={[{"name":"campaignIds","type":"`string` \\| `string`[]","description":"The IDs of the campaigns","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../../interfaces/promotion.RestoreReturn/page.mdx)&#60;TReturnableLinkableKeys&#62;","description":"Configurations determining which relations to restore along with each of the campaigns. You can pass to its `returnLinkableKeys`\nproperty any of the campaign's relation attribute names, such as `budget_id`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="restoreCampaigns"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void \\| Record&#60;string, string[]&#62;&#62;","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored, such as the ID of associated campaign budget.\nThe object's keys are the ID attribute names of the campaign entity's relations, such as `budget_id`,\nand its value is an array of strings, each being the ID of the record associated with the campaign through this relation,\nsuch as the IDs of associated campaign budget.\n\nIf there are no related records restored, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record&#60;string, string[]&#62;","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restoreCampaigns"/>
@@ -0,0 +1,42 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/retrieveCampaign
sidebar_label: retrieveCampaign
---
import { TypeList } from "docs-ui"
# retrieveCampaign - Promotion Module Reference
This documentation provides a reference to the `retrieveCampaign` method. This belongs to the Promotion Module.
This method retrieves a campaigns by its ID.
## Example
A simple example that retrieves a promotion by its ID:
```ts
const campaign =
await promotionModuleService.retrieveCampaign("procamp_123")
```
To specify relations that should be retrieved:
```ts
const campaign =
await promotionModuleService.retrieveCampaign(
"procamp_123",
{
relations: ["promotions"],
}
)
```
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the campaigns.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/promotion.FindConfig/page.mdx)&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)&#62;","description":"The configurations determining how the campaign is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a campaign.","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/promotion.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/promotion.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="retrieveCampaign"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved campaigns.","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="retrieveCampaign"/>
@@ -0,0 +1,27 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/softDelete
sidebar_label: softDelete
---
import { TypeList } from "docs-ui"
# softDelete - Promotion Module Reference
This documentation provides a reference to the `softDelete` method. This belongs to the Promotion Module.
This method soft deletes a promotion by its IDs.
## Example
```ts
await promotionModuleService.softDelete("promo_123")
```
## Parameters
<TypeList types={[{"name":"promotionIds","type":"`string` \\| `string`[]","description":"The list of promotions to soft delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../../interfaces/promotion.SoftDeleteReturn/page.mdx)&#60;TReturnableLinkableKeys&#62;","description":"An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="softDelete"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void \\| Record&#60;string, string[]&#62;&#62;","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were also soft deleted, such as the ID of the associated application method.\nThe object's keys are the ID attribute names of the promotion entity's relations, such as `application_method_id`, and its value is an array of strings, each being the ID of a record associated\nwith the promotion through this relation, such as the IDs of associated application method.\n\nIf there are no related records, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record&#60;string, string[]&#62;","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDelete"/>
@@ -0,0 +1,32 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/softDeleteCampaigns
sidebar_label: softDeleteCampaigns
---
import { TypeList } from "docs-ui"
# softDeleteCampaigns - Promotion Module Reference
This documentation provides a reference to the `softDeleteCampaigns` method. This belongs to the Promotion Module.
This method soft deletes campaigns by their IDs.
## Example
```ts
await promotionModuleService.softDeleteCampaigns(
"procamp_123",
{
returnLinkableKeys: ["budget_id"],
}
)
```
## Parameters
<TypeList types={[{"name":"campaignIds","type":"`string` \\| `string`[]","description":"The IDs of the campaigns.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../../interfaces/promotion.SoftDeleteReturn/page.mdx)&#60;TReturnableLinkableKeys&#62;","description":"An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="softDeleteCampaigns"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void \\| Record&#60;string, string[]&#62;&#62;","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were also soft deleted, such as the ID of the associated campaign budget.\nThe object's keys are the ID attribute names of the campaign entity's relations, such as `budget_id`, and its value is an array of strings, each being the ID of a record associated\nwith the campaign through this relation, such as the IDs of associated campaign budget.\n\nIf there are no related records, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record&#60;string, string[]&#62;","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteCampaigns"/>
@@ -0,0 +1,57 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/updateCampaigns
sidebar_label: updateCampaigns
---
import { TypeList } from "docs-ui"
# updateCampaigns - Promotion Module Reference
This documentation provides a reference to the `updateCampaigns` method. This belongs to the Promotion Module.
## updateCampaigns(data, sharedContext?): Promise&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)[]&#62;
This method updates existing campaigns.
### Example
```ts
const campaigns =
await promotionModuleService.updateCampaigns([
{
id: "procamp_123",
name: "Summer Sales",
},
])
```
### Parameters
<TypeList types={[{"name":"data","type":"[UpdateCampaignDTO](../../../interfaces/promotion.UpdateCampaignDTO/page.mdx)[]","description":"The attributes to update in the campaigns.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"Omit&#60;[UpdateCampaignBudgetDTO](../../../interfaces/promotion.UpdateCampaignBudgetDTO/page.mdx), \"id\"&#62;","description":"The budget of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"Pick&#60;[PromotionDTO](../../../interfaces/promotion.PromotionDTO/page.mdx), \"id\"&#62;[]","description":"The promotions of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="updateCampaigns"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated campaigns.","expandable":false,"children":[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"`object`","description":"The campaign details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateCampaigns"/>
## updateCampaigns(data, sharedContext?): Promise&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)&#62;
This method updates an existing campaign.
### Example
```ts
const campaigns =
await promotionModuleService.updateCampaigns({
id: "procamp_123",
name: "Summer Sales",
})
```
### Parameters
<TypeList types={[{"name":"data","type":"[UpdateCampaignDTO](../../../interfaces/promotion.UpdateCampaignDTO/page.mdx)","description":"The attributes to update in the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"Omit&#60;[UpdateCampaignBudgetDTO](../../../interfaces/promotion.UpdateCampaignBudgetDTO/page.mdx), \"id\"&#62;","description":"The budget of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"Pick&#60;[PromotionDTO](../../../interfaces/promotion.PromotionDTO/page.mdx), \"id\"&#62;[]","description":"The promotions of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="updateCampaigns"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The updated campaign.","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} sectionTitle="updateCampaigns"/>
@@ -0,0 +1,33 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion/updatePromotionRules
sidebar_label: updatePromotionRules
---
import { TypeList } from "docs-ui"
# updatePromotionRules - Promotion Module Reference
This documentation provides a reference to the `updatePromotionRules` method. This belongs to the Promotion Module.
This method updates existing promotion rules.
## Example
```ts
const promotionRules =
await promotionModuleService.updatePromotionRules([
{
id: "prorul_123",
description: "Only allow VIP customers",
},
])
```
## Parameters
<TypeList types={[{"name":"data","type":"[UpdatePromotionRuleDTO](../../../interfaces/promotion.UpdatePromotionRuleDTO/page.mdx)[]","description":"The attributes to update in the promotion rules.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string` \\| `string`[]","description":"The values of the promotion rule.\nWhen provided, `PromotionRuleValue` records are\ncreated and associated with the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/promotion.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/promotion.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="updatePromotionRules"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PromotionRuleDTO](../../../interfaces/promotion.PromotionRuleDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated promotion rules.","expandable":false,"children":[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"`object`","description":"The promotion rule details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updatePromotionRules"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# AddItemAdjustmentAction
This action indicates that an adjustment must be made to an item. For example, removing $5 off its amount.
<TypeList types={[{"name":"action","type":"`\"addItemAdjustment\"`","description":"The type of action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_id","type":"`string`","description":"The associated item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount to remove off the item's total.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The promotion's description.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="AddItemAdjustmentAction"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# AddShippingMethodAdjustment
This action indicates that an adjustment must be made on a shipping method. For example, make the shipping method free.
<TypeList types={[{"name":"action","type":"`\"addShippingMethodAdjustment\"`","description":"The type of action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method_id","type":"`string`","description":"The associated shipping method's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount to remove off the shipping method's total.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The promotion's description.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="AddShippingMethodAdjustment"/>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,15 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# BaseFilterable
An object used to allow specifying flexible queries with and/or conditions.
## Type parameters
<TypeList types={[{"name":"T","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="BaseFilterable"/>
<TypeList types={[{"name":"$and","type":"([BaseFilterable](page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="BaseFilterable"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# CampaignBudgetDTO
The campaign budget details.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CampaignBudgetDTO"/>
@@ -0,0 +1,12 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# CampaignBudgetExceededAction
This action indicates that the promotions within a campaign can no longer be used
as the campaign budget has been exceeded.
<TypeList types={[{"name":"action","type":"`\"campaignBudgetExceeded\"`","description":"The type of action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CampaignBudgetExceededAction"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# CampaignDTO
The campaign details.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="CampaignDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ComputeActionAdjustmentLine
An action's adjustment line.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the compute action's adjustment line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ComputeActionAdjustmentLine"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ComputeActionContext
The context provided when computing actions of promotions.
<TypeList types={[{"name":"items","type":"[ComputeActionItemLine](../promotion.ComputeActionItemLine/page.mdx)[]","description":"The cart's line items.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"`number`","description":"The subtotal of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"[ComputeActionAdjustmentLine](../promotion.ComputeActionAdjustmentLine/page.mdx)[]","description":"The adjustments applied before on the line item.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the compute action's adjustment line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"shipping_methods","type":"[ComputeActionShippingLine](../promotion.ComputeActionShippingLine/page.mdx)[]","description":"The cart's shipping methods.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"`number`","description":"The subtotal of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"[ComputeActionAdjustmentLine](../promotion.ComputeActionAdjustmentLine/page.mdx)[]","description":"The adjustments applied before on the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the compute action's adjustment line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="ComputeActionContext"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ComputeActionItemLine
A cart's line item passed in the context when computing actions.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the item line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"`number`","description":"The subtotal of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"[ComputeActionAdjustmentLine](../promotion.ComputeActionAdjustmentLine/page.mdx)[]","description":"The adjustments applied before on the line item.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the compute action's adjustment line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="ComputeActionItemLine"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ComputeActionShippingLine
A cart's shipping method passed in the content when computing actions.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"`number`","description":"The subtotal of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"[ComputeActionAdjustmentLine](../promotion.ComputeActionAdjustmentLine/page.mdx)[]","description":"The adjustments applied before on the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the compute action's adjustment line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="ComputeActionShippingLine"/>
@@ -0,0 +1,15 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# Context
A context used to share resources, such as transaction manager, between the application and the module.
## Type parameters
<TypeList types={[{"name":"TManager","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Context"/>
<TypeList types={[{"name":"__type","type":"`\"MedusaContext\"`","description":"","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](../promotion.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="Context"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# CreateApplicationMethodDTO
The application method to be created.
<TypeList types={[{"name":"type","type":"[ApplicationMethodTypeValues](../../types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[CreatePromotionRuleDTO](../promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string` \\| `string`[]","description":"The values of the promotion rule.\nWhen provided, `PromotionRuleValue` records are\ncreated and associated with the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"buy_rules","type":"[CreatePromotionRuleDTO](../promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string` \\| `string`[]","description":"The values of the promotion rule.\nWhen provided, `PromotionRuleValue` records are\ncreated and associated with the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="CreateApplicationMethodDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# CreateCampaignBudgetDTO
The campaign budget to be created.
<TypeList types={[{"name":"type","type":"[CampaignBudgetTypeValues](../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateCampaignBudgetDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# CreateCampaignDTO
The campaign to be created.
<TypeList types={[{"name":"name","type":"`string`","description":"The name of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CreateCampaignBudgetDTO](../promotion.CreateCampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"Pick&#60;[PromotionDTO](../promotion.PromotionDTO/page.mdx), \"id\"&#62;[]","description":"The promotions of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="CreateCampaignDTO"/>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# CreatePromotionRuleDTO
The promotion rule to be created.
<TypeList types={[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string` \\| `string`[]","description":"The values of the promotion rule.\nWhen provided, `PromotionRuleValue` records are\ncreated and associated with the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreatePromotionRuleDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# FilterableCampaignProps
The filters to apply on the retrieved campaigns.
<TypeList types={[{"name":"$and","type":"([FilterableCampaignProps](page.mdx) \\| [BaseFilterable](../promotion.BaseFilterable/page.mdx)&#60;[FilterableCampaignProps](page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableCampaignProps](page.mdx) \\| [BaseFilterable](../promotion.BaseFilterable/page.mdx)&#60;[FilterableCampaignProps](page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`[]","description":"The IDs to filter the campaigns by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`[]","description":"Filters the campaigns by their campaign identifier.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FilterableCampaignProps"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# FilterablePromotionProps
The filters to apply on the retrieved promotions.
<TypeList types={[{"name":"$and","type":"([FilterablePromotionProps](page.mdx) \\| [BaseFilterable](../promotion.BaseFilterable/page.mdx)&#60;[FilterablePromotionProps](page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterablePromotionProps](page.mdx) \\| [BaseFilterable](../promotion.BaseFilterable/page.mdx)&#60;[FilterablePromotionProps](page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the promotions by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[] \\| [OperatorMap](../../types/promotion.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter promotions by their code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget_id","type":"`string`[] \\| [OperatorMap](../../types/promotion.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter promotions by the ID of their associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Filter promotions by whether they're applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../types/promotion.PromotionTypeValues/page.mdx)[]","description":"Filter promotions by their type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FilterablePromotionProps"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# FilterablePromotionRuleProps
The filters to apply on the retrieved promotion rules.
<TypeList types={[{"name":"$and","type":"([FilterablePromotionRuleProps](page.mdx) \\| [BaseFilterable](../promotion.BaseFilterable/page.mdx)&#60;[FilterablePromotionRuleProps](page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterablePromotionRuleProps](page.mdx) \\| [BaseFilterable](../promotion.BaseFilterable/page.mdx)&#60;[FilterablePromotionRuleProps](page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`[]","description":"The IDs to filter the promotion rules by.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FilterablePromotionRuleProps"/>
@@ -0,0 +1,16 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# FindConfig
An object that is used to configure how an entity is retrieved from the database. It accepts as a typed parameter an `Entity` class,
which provides correct typing of field names in its properties.
## Type parameters
<TypeList types={[{"name":"Entity","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FindConfig"/>
<TypeList types={[{"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":[]}]} sectionTitle="FindConfig"/>
@@ -0,0 +1,14 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# IMessageAggregator
## Methods
- [save](../../IMessageAggregator/methods/promotion.IMessageAggregator.save/page.mdx)
- [getMessages](../../IMessageAggregator/methods/promotion.IMessageAggregator.getMessages/page.mdx)
- [clearMessages](../../IMessageAggregator/methods/promotion.IMessageAggregator.clearMessages/page.mdx)
- [saveRawMessageData](../../IMessageAggregator/methods/promotion.IMessageAggregator.saveRawMessageData/page.mdx)
@@ -0,0 +1,7 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# IModuleService
@@ -0,0 +1,41 @@
---
displayed_sidebar: promotionReference
slug: /references/promotion
---
import { TypeList } from "docs-ui"
# IPromotionModuleService Reference
This section of the documentation provides a reference to the `IPromotionModuleService` interfaces methods. This is the interface developers use to use the functionalities provided by the Promotion Module.
The main service interface for the Promotion Module.
## Methods
- [registerUsage](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.registerUsage/page.mdx)
- [computeActions](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.computeActions/page.mdx)
- [create](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.create/page.mdx)
- [update](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.update/page.mdx)
- [list](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.list/page.mdx)
- [listAndCount](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.listAndCount/page.mdx)
- [retrieve](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.retrieve/page.mdx)
- [delete](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.delete/page.mdx)
- [softDelete](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.softDelete/page.mdx)
- [restore](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.restore/page.mdx)
- [addPromotionRules](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.addPromotionRules/page.mdx)
- [addPromotionTargetRules](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.addPromotionTargetRules/page.mdx)
- [addPromotionBuyRules](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.addPromotionBuyRules/page.mdx)
- [removePromotionRules](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.removePromotionRules/page.mdx)
- [removePromotionTargetRules](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.removePromotionTargetRules/page.mdx)
- [removePromotionBuyRules](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.removePromotionBuyRules/page.mdx)
- [createCampaigns](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.createCampaigns/page.mdx)
- [updateCampaigns](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.updateCampaigns/page.mdx)
- [listPromotionRules](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.listPromotionRules/page.mdx)
- [updatePromotionRules](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.updatePromotionRules/page.mdx)
- [listCampaigns](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.listCampaigns/page.mdx)
- [listAndCountCampaigns](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.listAndCountCampaigns/page.mdx)
- [retrieveCampaign](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.retrieveCampaign/page.mdx)
- [deleteCampaigns](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.deleteCampaigns/page.mdx)
- [softDeleteCampaigns](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.softDeleteCampaigns/page.mdx)
- [restoreCampaigns](../../IPromotionModuleService/methods/promotion.IPromotionModuleService.restoreCampaigns/page.mdx)
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# JoinerServiceConfig
<TypeList types={[{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"[JoinerServiceConfigAlias](../promotion.JoinerServiceConfigAlias/page.mdx) \\| [JoinerServiceConfigAlias](../promotion.JoinerServiceConfigAlias/page.mdx)[]","description":"Property name to use as entrypoint to the service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"fieldAlias","type":"`Record<string, string \\| object>`","description":"alias for deeper nested relationships (e.g. &#123; 'price': 'prices.calculated\\_price\\_set.amount' &#125;)","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[JoinerRelationship](../../types/promotion.JoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"alias","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isInternalService","type":"`boolean`","description":"If true, the relationship is an internal service from the medusa core\nTODO: Remove when there are no more \"internal\" services","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inverse","type":"`boolean`","description":"In an inverted relationship the foreign key is on the other service and the primary key is on the current service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isList","type":"`boolean`","description":"Force the relationship to return a list","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record<string, any>`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"relationship","type":"[JoinerRelationship](../../types/promotion.JoinerRelationship/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"alias","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isInternalService","type":"`boolean`","description":"If true, the relationship is an internal service from the medusa core\nTODO: Remove when there are no more \"internal\" services","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inverse","type":"`boolean`","description":"In an inverted relationship the foreign key is on the other service and the primary key is on the current service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isList","type":"`boolean`","description":"Force the relationship to return a list","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record<string, any>`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"args","type":"`Record<string, any>`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="JoinerServiceConfig"/>
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# JoinerServiceConfigAlias
<TypeList types={[{"name":"name","type":"`string` \\| `string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record<string, any>`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="JoinerServiceConfigAlias"/>
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# MessageAggregatorFormat
<TypeList types={[{"name":"groupBy","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sortBy","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="MessageAggregatorFormat"/>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# PromotionRuleDTO
The promotion rule details.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="PromotionRuleDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# PromotionRuleValueDTO
The promotion rule value details.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="PromotionRuleValueDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# RemoveItemAdjustmentAction
This action indicates that an adjustment must be removed from a line item. For example, remove the $5 discount applied before.
<TypeList types={[{"name":"action","type":"`\"removeItemAdjustment\"`","description":"The type of action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustment_id","type":"`string`","description":"The associated adjustment's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The promotion's description.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="RemoveItemAdjustmentAction"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# RemoveShippingMethodAdjustment
This action indicates that an adjustment must be removed from a shipping method. For example, remove the free shipping discount applied before.
<TypeList types={[{"name":"action","type":"`\"removeShippingMethodAdjustment\"`","description":"The type of action","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustment_id","type":"`string`","description":"The associated adjustment's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The promotion's code.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="RemoveShippingMethodAdjustment"/>
@@ -0,0 +1,15 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# RestoreReturn
An object that is used to specify an entity's related entities that should be restored when the main entity is restored.
## Type parameters
<TypeList types={[{"name":"TReturnableLinkableKeys","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="RestoreReturn"/>
<TypeList types={[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="RestoreReturn"/>
@@ -0,0 +1,15 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# SoftDeleteReturn
An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
## Type parameters
<TypeList types={[{"name":"TReturnableLinkableKeys","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="SoftDeleteReturn"/>
<TypeList types={[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="SoftDeleteReturn"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# UpdateApplicationMethodDTO
The attributes to update in the application method.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateApplicationMethodDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# UpdateCampaignBudgetDTO
The attributes to update in the campaign budget.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateCampaignBudgetDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# UpdateCampaignDTO
The attributes to update in the campaign.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"Omit&#60;[UpdateCampaignBudgetDTO](../promotion.UpdateCampaignBudgetDTO/page.mdx), \"id\"&#62;","description":"The budget of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"Pick&#60;[PromotionDTO](../promotion.PromotionDTO/page.mdx), \"id\"&#62;[]","description":"The promotions of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="UpdateCampaignDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# UpdatePromotionDTO
The attributes to update in the promotion.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[UpdateApplicationMethodDTO](../promotion.UpdateApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"campaign_id","type":"`string`","description":"The associated campaign's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdatePromotionDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# UpdatePromotionRuleDTO
The attributes to update in the promotion rule.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string` \\| `string`[]","description":"The values of the promotion rule.\nWhen provided, `PromotionRuleValue` records are\ncreated and associated with the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdatePromotionRuleDTO"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ApplicationMethodAllocationValues
**ApplicationMethodAllocationValues**: `"each"` \| `"across"`
The application method's possible allocation values.
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ApplicationMethodTargetTypeValues
**ApplicationMethodTargetTypeValues**: `"order"` \| `"shipping_methods"` \| `"items"`
The application method's possible target types.
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ApplicationMethodTypeValues
**ApplicationMethodTypeValues**: `"fixed"` \| `"percentage"`
The application method's possible types.
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# CampaignBudgetTypeValues
**CampaignBudgetTypeValues**: `"spend"` \| `"usage"`
The campaign budget's possible types.
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ComputeActions
**ComputeActions**: [AddItemAdjustmentAction](../../interfaces/promotion.AddItemAdjustmentAction/page.mdx) \| [RemoveItemAdjustmentAction](../../interfaces/promotion.RemoveItemAdjustmentAction/page.mdx) \| [AddShippingMethodAdjustment](../../interfaces/promotion.AddShippingMethodAdjustment/page.mdx) \| [RemoveShippingMethodAdjustment](../../interfaces/promotion.RemoveShippingMethodAdjustment/page.mdx) \| [CampaignBudgetExceededAction](../../interfaces/promotion.CampaignBudgetExceededAction/page.mdx)
A compute action informs you what adjustment must be made to a cart item or shipping method.
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ExpandScalar
**ExpandScalar**: `null` \| T extends `string` ? `string` \| `RegExp` : T extends `Date` ? `Date` \| `string` : T
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# FilterQuery
**FilterQuery**: Prev extends `never` ? `never` : &#123; [Key in keyof T]?: T[Key] extends boolean \| number \| string \| bigint \| symbol \| Date ? T[Key] \| OperatorMap&#60;T[Key]&#62; : T[Key] extends infer U ? U extends Object ? V extends object ? FilterQuery&#60;Partial&#60;V&#62;, PrevLimit[Prev]&#62; : never : never : never &#125;
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# FilterValue
**FilterValue**: [OperatorMap](../promotion.OperatorMap/page.mdx)&#60;[FilterValue2](../promotion.FilterValue2/page.mdx)&#60;T&#62;&#62; \| [FilterValue2](../promotion.FilterValue2/page.mdx)&#60;T&#62; \| [FilterValue2](../promotion.FilterValue2/page.mdx)&#60;T&#62;[] \| `null`
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# FilterValue2
**FilterValue2**: T \| [ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62; \| [Primary](../promotion.Primary/page.mdx)&#60;T&#62;
@@ -0,0 +1,13 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# JoinerRelationship
**JoinerRelationship**: `Object`
## Properties
<TypeList types={[{"name":"alias","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isInternalService","type":"`boolean`","description":"If true, the relationship is an internal service from the medusa core\nTODO: Remove when there are no more \"internal\" services","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inverse","type":"`boolean`","description":"In an inverted relationship the foreign key is on the other service and the primary key is on the current service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isList","type":"`boolean`","description":"Force the relationship to return a list","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record<string, any>`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="JoinerRelationship"/>
@@ -0,0 +1,13 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# Message
**Message**: `Object`
## Properties
<TypeList types={[{"name":"eventName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[MessageBody](../promotion.MessageBody/page.mdx)&#60;T&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"metadata","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Message"/>
@@ -0,0 +1,13 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# MessageBody
**MessageBody**: `Object`
## Properties
<TypeList types={[{"name":"metadata","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="MessageBody"/>
@@ -0,0 +1,13 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# MessageFormat
**MessageFormat**: `Object`
## Properties
<TypeList types={[{"name":"eventName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"T \\| T[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="MessageFormat"/>
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ModuleJoinerConfig
**ModuleJoinerConfig**: Omit&#60;[JoinerServiceConfig](../../interfaces/promotion.JoinerServiceConfig/page.mdx), "serviceName" \| "primaryKeys" \| "relationships" \| "extends"&#62; & `object`
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ModuleJoinerRelationship
**ModuleJoinerRelationship**: [JoinerRelationship](../promotion.JoinerRelationship/page.mdx) & `object`
@@ -0,0 +1,13 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# OperatorMap
**OperatorMap**: `Object`
## Properties
<TypeList types={[{"name":"$and","type":"[Query](../promotion.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../promotion.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../promotion.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../promotion.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="OperatorMap"/>
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# PrevLimit
**PrevLimit**: [`never`, `1`, `2`, `3`]
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# Primary
**Primary**: T extends `object` ? [ReadonlyPrimary](../promotion.ReadonlyPrimary/page.mdx)&#60;PK&#62; : T extends `object` ? [ReadonlyPrimary](../promotion.ReadonlyPrimary/page.mdx)&#60;PK&#62; \| `string` : T extends `object` ? [ReadonlyPrimary](../promotion.ReadonlyPrimary/page.mdx)&#60;PK&#62; : T extends `object` ? [ReadonlyPrimary](../promotion.ReadonlyPrimary/page.mdx)&#60;PK&#62; : `never`
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# PromotionRuleOperatorValues
**PromotionRuleOperatorValues**: `"gt"` \| `"lt"` \| `"eq"` \| `"ne"` \| `"in"` \| `"lte"` \| `"gte"`
The possible operators to use in a promotion rule.
@@ -0,0 +1,11 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# PromotionTypeValues
**PromotionTypeValues**: `"standard"` \| `"buyget"`
The promotion's possible types.
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# Query
**Query**: T extends `object` ? T extends [Scalar](../promotion.Scalar/page.mdx) ? `never` : [FilterQuery](../promotion.FilterQuery/page.mdx)&#60;T&#62; : [FilterValue](../promotion.FilterValue/page.mdx)&#60;T&#62;
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# ReadonlyPrimary
**ReadonlyPrimary**: T extends `any`[] ? Readonly&#60;T&#62; : T
@@ -0,0 +1,9 @@
---
displayed_sidebar: promotionReference
---
import { TypeList } from "docs-ui"
# Scalar
**Scalar**: `boolean` \| `number` \| `string` \| `bigint` \| `symbol` \| `Date` \| `RegExp` \| `Buffer` \| `object`