chore(docs): Generated References (#5516)

Generated the following references:
- `js-client`
- `pricing`
- `services`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2023-11-02 09:16:47 +00:00
1 parent 80fe362f33
commit aa2bb7a31b
271 files changed
+38146 -9809

No files matched your search

@@ -1,4 +1,4 @@
# Class: AnalyticsConfigService
# AnalyticsConfigService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new AnalyticsConfigService**(`«destructured»`)
**new AnalyticsConfigService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L21)
[medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L21)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### analyticsConfigRepository\_
• `Protected` `Readonly` **analyticsConfigRepository\_**: `Repository`<`AnalyticsConfig`\>
`Protected` `Readonly` **analyticsConfigRepository\_**: `Repository`<`AnalyticsConfig`\>
#### Defined in
[medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L18)
[medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L18)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -90,13 +90,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -104,57 +104,57 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### userService\_
• `Protected` `Readonly` **userService\_**: [`UserService`](UserService.md)
`Protected` `Readonly` **userService\_**: [`UserService`](UserService.md)
#### Defined in
[medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L19)
[medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L19)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -163,7 +163,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -171,20 +171,20 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`userId`, `data`): `Promise`<`AnalyticsConfig`\>
**create**(`userId`, `data`): `Promise`<`AnalyticsConfig`\>
Creates an analytics config.
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `userId` | `string` |
| `data` | `CreateAnalyticsConfig` |
@@ -192,88 +192,98 @@ Creates an analytics config.
`Promise`<`AnalyticsConfig`\>
-`Promise`:
-`AnalyticsConfig`:
#### Defined in
[medusa/src/services/analytics-config.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L50)
[medusa/src/services/analytics-config.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L50)
___
### delete
▸ **delete**(`userId`): `Promise`<`void`\>
**delete**(`userId`): `Promise`<`void`\>
Deletes an analytics config.
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `userId` | `string` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/analytics-config.ts:94](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L94)
[medusa/src/services/analytics-config.ts:94](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L94)
___
### retrieve
▸ **retrieve**(`userId`): `Promise`<`AnalyticsConfig`\>
**retrieve**(`userId`): `Promise`<`AnalyticsConfig`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `userId` | `string` |
#### Returns
`Promise`<`AnalyticsConfig`\>
-`Promise`:
-`AnalyticsConfig`:
#### Defined in
[medusa/src/services/analytics-config.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L28)
[medusa/src/services/analytics-config.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L28)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`userId`, `update`): `Promise`<`AnalyticsConfig`\>
**update**(`userId`, `update`): `Promise`<`AnalyticsConfig`\>
Updates an analytics config. If the config does not exist, it will be created instead.
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `userId` | `string` |
| `update` | `UpdateAnalyticsConfig` |
@@ -281,30 +291,35 @@ Updates an analytics config. If the config does not exist, it will be created in
`Promise`<`AnalyticsConfig`\>
-`Promise`:
-`AnalyticsConfig`:
#### Defined in
[medusa/src/services/analytics-config.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L65)
[medusa/src/services/analytics-config.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L65)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`AnalyticsConfigService`](AnalyticsConfigService.md)
**withTransaction**(`transactionManager?`): [`AnalyticsConfigService`](AnalyticsConfigService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`AnalyticsConfigService`](AnalyticsConfigService.md)
-`AnalyticsConfigService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: AuthService
# AuthService
Can authenticate a user based on email password combination
@@ -12,12 +12,12 @@ Can authenticate a user based on email password combination
### constructor
• **new AuthService**(`«destructured»`)
**new AuthService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L22)
[medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L22)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### customerService\_
• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md)
`Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md)
#### Defined in
[medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L20)
[medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L20)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -92,13 +92,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -106,57 +106,57 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### userService\_
• `Protected` `Readonly` **userService\_**: [`UserService`](UserService.md)
`Protected` `Readonly` **userService\_**: [`UserService`](UserService.md)
#### Defined in
[medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L19)
[medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L19)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -165,7 +165,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -173,21 +173,21 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### authenticate
▸ **authenticate**(`email`, `password`): `Promise`<`AuthenticateResult`\>
**authenticate**(`email`, `password`): `Promise`<`AuthenticateResult`\>
Authenticates a given user based on an email, password combination. Uses
scrypt to match password with hashed value.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `email` | `string` | the email of the user |
| `password` | `string` | the password of the user |
@@ -195,53 +195,53 @@ scrypt to match password with hashed value.
`Promise`<`AuthenticateResult`\>
success: whether authentication succeeded
-`Promise`: success: whether authentication succeeded
user: the user document if authentication succeeded
error: a string with the error message
#### Defined in
[medusa/src/services/auth.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L81)
[medusa/src/services/auth.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L81)
___
### authenticateAPIToken
▸ **authenticateAPIToken**(`token`): `Promise`<`AuthenticateResult`\>
**authenticateAPIToken**(`token`): `Promise`<`AuthenticateResult`\>
Authenticates a given user with an API token
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `token` | `string` | the api_token of the user to authenticate |
#### Returns
`Promise`<`AuthenticateResult`\>
success: whether authentication succeeded
-`Promise`: success: whether authentication succeeded
user: the user document if authentication succeeded
error: a string with the error message
#### Defined in
[medusa/src/services/auth.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L52)
[medusa/src/services/auth.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L52)
___
### authenticateCustomer
▸ **authenticateCustomer**(`email`, `password`): `Promise`<`AuthenticateResult`\>
**authenticateCustomer**(`email`, `password`): `Promise`<`AuthenticateResult`\>
Authenticates a customer based on an email, password combination. Uses
scrypt to match password with hashed value.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `email` | `string` | the email of the user |
| `password` | `string` | the password of the user |
@@ -249,26 +249,26 @@ scrypt to match password with hashed value.
`Promise`<`AuthenticateResult`\>
success: whether authentication succeeded
-`Promise`: success: whether authentication succeeded
customer: the customer document if authentication succeded
error: a string with the error message
#### Defined in
[medusa/src/services/auth.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L130)
[medusa/src/services/auth.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L130)
___
### comparePassword\_
▸ `Protected` **comparePassword_**(`password`, `hash`): `Promise`<`boolean`\>
`Protected` **comparePassword_**(`password`, `hash`): `Promise`<`boolean`\>
Verifies if a password is valid given the provided password hash
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `password` | `string` | the raw password to check |
| `hash` | `string` | the hash to compare against |
@@ -276,56 +276,61 @@ Verifies if a password is valid given the provided password hash
`Promise`<`boolean`\>
the result of the comparison
-`Promise`: the result of the comparison
-`boolean`: (optional)
#### Defined in
[medusa/src/services/auth.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L36)
[medusa/src/services/auth.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L36)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`AuthService`](AuthService.md)
**withTransaction**(`transactionManager?`): [`AuthService`](AuthService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`AuthService`](AuthService.md)
-`AuthService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: BatchJobService
# BatchJobService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new BatchJobService**(`«destructured»`)
**new BatchJobService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/batch-job.ts:91](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L91)
[medusa/src/services/batch-job.ts:91](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L91)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### batchJobRepository\_
• `Protected` `Readonly` **batchJobRepository\_**: `Repository`<`BatchJob`\>
`Protected` `Readonly` **batchJobRepository\_**: `Repository`<`BatchJob`\>
#### Defined in
[medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L39)
[medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L39)
___
### batchJobStatusMapToProps
• `Protected` **batchJobStatusMapToProps**: `Map`<`BatchJobStatus`, { `entityColumnName`: `string` ; `eventType`: `string` }\>
`Protected` **batchJobStatusMapToProps**: `Map`<`BatchJobStatus`, { `entityColumnName`: `string` ; `eventType`: `string` }\>
#### Defined in
[medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L43)
[medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L43)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/batch-job.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L40)
[medusa/src/services/batch-job.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L40)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -110,23 +110,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### strategyResolver\_
• `Protected` `Readonly` **strategyResolver\_**: [`StrategyResolverService`](StrategyResolverService.md)
`Protected` `Readonly` **strategyResolver\_**: [`StrategyResolverService`](StrategyResolverService.md)
#### Defined in
[medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L41)
[medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L41)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -134,13 +134,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -157,47 +157,47 @@ ___
#### Defined in
[medusa/src/services/batch-job.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L28)
[medusa/src/services/batch-job.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L28)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -206,7 +206,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -214,98 +214,110 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### cancel
▸ **cancel**(`batchJobOrId`): `Promise`<`BatchJob`\>
**cancel**(`batchJobOrId`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `batchJobOrId` | `string` \| `BatchJob` |
#### Returns
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:270](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L270)
[medusa/src/services/batch-job.ts:270](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L270)
___
### complete
▸ **complete**(`batchJobOrId`): `Promise`<`BatchJob`\>
**complete**(`batchJobOrId`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `batchJobOrId` | `string` \| `BatchJob` |
#### Returns
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:252](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L252)
[medusa/src/services/batch-job.ts:252](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L252)
___
### confirm
▸ **confirm**(`batchJobOrId`): `Promise`<`BatchJob`\>
**confirm**(`batchJobOrId`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `batchJobOrId` | `string` \| `BatchJob` |
#### Returns
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:234](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L234)
[medusa/src/services/batch-job.ts:234](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L234)
___
### create
▸ **create**(`data`): `Promise`<`BatchJob`\>
**create**(`data`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `BatchJobCreateProps` |
#### Returns
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:144](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L144)
[medusa/src/services/batch-job.ts:144](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L144)
___
### listAndCount
▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`BatchJob`[], `number`]\>
**listAndCount**(`selector?`, `config?`): `Promise`<[`BatchJob`[], `number`]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `FilterableBatchJobProps` |
| `config` | `FindConfig`<`BatchJob`\> |
@@ -313,41 +325,47 @@ ___
`Promise`<[`BatchJob`[], `number`]\>
-`Promise`:
-`BatchJob[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/batch-job.ts:132](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L132)
[medusa/src/services/batch-job.ts:132](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L132)
___
### prepareBatchJobForProcessing
▸ **prepareBatchJobForProcessing**(`data`, `req`): `Promise`<`CreateBatchJobInput`\>
**prepareBatchJobForProcessing**(`data`, `req`): `Promise`<`CreateBatchJobInput`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateBatchJobInput` |
| `req` | `Request`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\> |
| `req` | `Request`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\> |
#### Returns
`Promise`<`CreateBatchJobInput`\>
-`Promise`:
#### Defined in
[medusa/src/services/batch-job.ts:367](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L367)
[medusa/src/services/batch-job.ts:367](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L367)
___
### retrieve
▸ **retrieve**(`batchJobId`, `config?`): `Promise`<`BatchJob`\>
**retrieve**(`batchJobId`, `config?`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `batchJobId` | `string` |
| `config` | `FindConfig`<`BatchJob`\> |
@@ -355,20 +373,23 @@ ___
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:104](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L104)
[medusa/src/services/batch-job.ts:104](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L104)
___
### setFailed
▸ **setFailed**(`batchJobOrId`, `error?`): `Promise`<`BatchJob`\>
**setFailed**(`batchJobOrId`, `error?`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `batchJobOrId` | `string` \| `BatchJob` |
| `error?` | `string` \| `BatchJobResultError` |
@@ -376,84 +397,95 @@ ___
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:341](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L341)
[medusa/src/services/batch-job.ts:341](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L341)
___
### setPreProcessingDone
▸ **setPreProcessingDone**(`batchJobOrId`): `Promise`<`BatchJob`\>
**setPreProcessingDone**(`batchJobOrId`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `batchJobOrId` | `string` \| `BatchJob` |
#### Returns
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:288](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L288)
[medusa/src/services/batch-job.ts:288](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L288)
___
### setProcessing
▸ **setProcessing**(`batchJobOrId`): `Promise`<`BatchJob`\>
**setProcessing**(`batchJobOrId`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `batchJobOrId` | `string` \| `BatchJob` |
#### Returns
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:321](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L321)
[medusa/src/services/batch-job.ts:321](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L321)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`batchJobOrId`, `data`): `Promise`<`BatchJob`\>
**update**(`batchJobOrId`, `data`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `batchJobOrId` | `string` \| `BatchJob` |
| `data` | `Partial`<`Pick`<`BatchJob`, ``"context"`` \| ``"result"``\>\> |
@@ -461,20 +493,23 @@ ___
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:161](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L161)
[medusa/src/services/batch-job.ts:161](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L161)
___
### updateStatus
▸ `Protected` **updateStatus**(`batchJobOrId`, `status`): `Promise`<`BatchJob`\>
`Protected` **updateStatus**(`batchJobOrId`, `status`): `Promise`<`BatchJob`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `batchJobOrId` | `string` \| `BatchJob` |
| `status` | `BatchJobStatus` |
@@ -482,30 +517,35 @@ ___
`Promise`<`BatchJob`\>
-`Promise`:
-`BatchJob`:
#### Defined in
[medusa/src/services/batch-job.ts:200](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L200)
[medusa/src/services/batch-job.ts:200](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L200)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`BatchJobService`](BatchJobService.md)
**withTransaction**(`transactionManager?`): [`BatchJobService`](BatchJobService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`BatchJobService`](BatchJobService.md)
-`BatchJobService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,4 @@
# Class: ClaimItemService
# ClaimItemService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new ClaimItemService**(`«destructured»`)
**new ClaimItemService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `Object` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/claim-item.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L26)
[medusa/src/services/claim-item.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L26)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,63 +66,63 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### claimImageRepository\_
• `Protected` `Readonly` **claimImageRepository\_**: `Repository`<`ClaimImage`\>
`Protected` `Readonly` **claimImageRepository\_**: `Repository`<`ClaimImage`\>
#### Defined in
[medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L24)
[medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L24)
___
### claimItemRepository\_
• `Protected` `Readonly` **claimItemRepository\_**: `Repository`<`ClaimItem`\>
`Protected` `Readonly` **claimItemRepository\_**: `Repository`<`ClaimItem`\>
#### Defined in
[medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L22)
[medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L22)
___
### claimTagRepository\_
• `Protected` `Readonly` **claimTagRepository\_**: `Repository`<`ClaimTag`\>
`Protected` `Readonly` **claimTagRepository\_**: `Repository`<`ClaimTag`\>
#### Defined in
[medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L23)
[medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L23)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L21)
[medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L21)
___
### lineItemService\_
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
`Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
#### Defined in
[medusa/src/services/claim-item.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L20)
[medusa/src/services/claim-item.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L20)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -130,13 +130,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -144,13 +144,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -162,47 +162,47 @@ ___
#### Defined in
[medusa/src/services/claim-item.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L14)
[medusa/src/services/claim-item.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L14)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -211,7 +211,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -219,38 +219,41 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`ClaimItem`\>
**create**(`data`): `Promise`<`ClaimItem`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateClaimItemInput` |
#### Returns
`Promise`<`ClaimItem`\>
-`Promise`:
-`ClaimItem`:
#### Defined in
[medusa/src/services/claim-item.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L43)
[medusa/src/services/claim-item.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L43)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`ClaimItem`[]\>
**list**(`selector`, `config?`): `Promise`<`ClaimItem`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`ClaimItem`\> | the query object for find |
| `config` | `FindConfig`<`ClaimItem`\> | the config object for find |
@@ -258,24 +261,26 @@ ___
`Promise`<`ClaimItem`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ClaimItem[]`:
-`ClaimItem`:
#### Defined in
[medusa/src/services/claim-item.ts:205](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L205)
[medusa/src/services/claim-item.ts:205](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L205)
___
### retrieve
▸ **retrieve**(`claimItemId`, `config?`): `Promise`<`ClaimItem`\>
**retrieve**(`claimItemId`, `config?`): `Promise`<`ClaimItem`\>
Gets a claim item by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `claimItemId` | `string` | id of ClaimItem to retrieve |
| `config` | `FindConfig`<`ClaimItem`\> | configuration for the find operation |
@@ -283,46 +288,49 @@ Gets a claim item by id.
`Promise`<`ClaimItem`\>
the ClaimItem
-`Promise`: the ClaimItem
-`ClaimItem`:
#### Defined in
[medusa/src/services/claim-item.ts:224](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L224)
[medusa/src/services/claim-item.ts:224](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L224)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`id`, `data`): `Promise`<`ClaimItem`\>
**update**(`id`, `data`): `Promise`<`ClaimItem`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `any` |
| `data` | `any` |
@@ -330,30 +338,35 @@ ___
`Promise`<`ClaimItem`\>
-`Promise`:
-`ClaimItem`:
#### Defined in
[medusa/src/services/claim-item.ts:127](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L127)
[medusa/src/services/claim-item.ts:127](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L127)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ClaimItemService`](ClaimItemService.md)
**withTransaction**(`transactionManager?`): [`ClaimItemService`](ClaimItemService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ClaimItemService`](ClaimItemService.md)
-`ClaimItemService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: ClaimService
# ClaimService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new ClaimService**(`«destructured»`)
**new ClaimService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/claim.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L86)
[medusa/src/services/claim.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L86)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,93 +66,93 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### addressRepository\_
• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\>
`Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\>
#### Defined in
[medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L68)
[medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L68)
___
### claimItemService\_
• `Protected` `Readonly` **claimItemService\_**: [`ClaimItemService`](ClaimItemService.md)
`Protected` `Readonly` **claimItemService\_**: [`ClaimItemService`](ClaimItemService.md)
#### Defined in
[medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L72)
[medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L72)
___
### claimRepository\_
• `Protected` `Readonly` **claimRepository\_**: `Repository`<`ClaimOrder`\>
`Protected` `Readonly` **claimRepository\_**: `Repository`<`ClaimOrder`\>
#### Defined in
[medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L69)
[medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L69)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L73)
[medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L73)
___
### fulfillmentProviderService\_
• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
`Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
#### Defined in
[medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L74)
[medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L74)
___
### fulfillmentService\_
• `Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md)
`Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md)
#### Defined in
[medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L75)
[medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L75)
___
### lineItemRepository\_
• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> }
`Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: Method findByReturn }
#### Defined in
[medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L71)
[medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L71)
___
### lineItemService\_
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
`Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
#### Defined in
[medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L76)
[medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L76)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -160,93 +160,93 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### paymentProviderService\_
• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
`Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
#### Defined in
[medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L77)
[medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L77)
___
### productVariantInventoryService\_
• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
`Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
#### Defined in
[medusa/src/services/claim.ts:84](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L84)
[medusa/src/services/claim.ts:84](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L84)
___
### regionService\_
• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
`Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
#### Defined in
[medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L78)
[medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L78)
___
### returnService\_
• `Protected` `Readonly` **returnService\_**: [`ReturnService`](ReturnService.md)
`Protected` `Readonly` **returnService\_**: [`ReturnService`](ReturnService.md)
#### Defined in
[medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L79)
[medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L79)
___
### shippingMethodRepository\_
• `Protected` `Readonly` **shippingMethodRepository\_**: `Repository`<`ShippingMethod`\>
`Protected` `Readonly` **shippingMethodRepository\_**: `Repository`<`ShippingMethod`\>
#### Defined in
[medusa/src/services/claim.ts:70](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L70)
[medusa/src/services/claim.ts:70](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L70)
___
### shippingOptionService\_
• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
`Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
#### Defined in
[medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L80)
[medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L80)
___
### taxProviderService\_
• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
`Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
#### Defined in
[medusa/src/services/claim.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L81)
[medusa/src/services/claim.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L81)
___
### totalsService\_
• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
`Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
#### Defined in
[medusa/src/services/claim.ts:82](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L82)
[medusa/src/services/claim.ts:82](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L82)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -254,13 +254,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -275,47 +275,47 @@ ___
#### Defined in
[medusa/src/services/claim.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L59)
[medusa/src/services/claim.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L59)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -324,7 +324,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -332,53 +332,59 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### cancel
▸ **cancel**(`id`): `Promise`<`ClaimOrder`\>
**cancel**(`id`): `Promise`<`ClaimOrder`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
#### Returns
`Promise`<`ClaimOrder`\>
-`Promise`:
-`ClaimOrder`:
#### Defined in
[medusa/src/services/claim.ts:814](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L814)
[medusa/src/services/claim.ts:814](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L814)
___
### cancelFulfillment
▸ **cancelFulfillment**(`fulfillmentId`): `Promise`<`ClaimOrder`\>
**cancelFulfillment**(`fulfillmentId`): `Promise`<`ClaimOrder`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `fulfillmentId` | `string` |
#### Returns
`Promise`<`ClaimOrder`\>
-`Promise`:
-`ClaimOrder`:
#### Defined in
[medusa/src/services/claim.ts:662](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L662)
[medusa/src/services/claim.ts:662](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L662)
___
### create
▸ **create**(`data`): `Promise`<`ClaimOrder`\>
**create**(`data`): `Promise`<`ClaimOrder`\>
Creates a Claim on an Order. Claims consists of items that are claimed and
optionally items to be sent as replacement for the claimed items. The
@@ -386,76 +392,81 @@ shipping address that the new items will be shipped to
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `CreateClaimInput` | the object containing all data required to create a claim |
#### Returns
`Promise`<`ClaimOrder`\>
created claim
-`Promise`: created claim
-`ClaimOrder`:
#### Defined in
[medusa/src/services/claim.ts:331](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L331)
[medusa/src/services/claim.ts:331](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L331)
___
### createFulfillment
▸ **createFulfillment**(`id`, `config?`): `Promise`<`ClaimOrder`\>
**createFulfillment**(`id`, `config?`): `Promise`<`ClaimOrder`\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the object containing all data required to create a claim |
| `config` | `Object` | config object |
| `config.location_id?` | `string` | - |
| `config.metadata?` | `Record`<`string`, `unknown`\> | config metadata |
| `config` | `object` | config object |
| `config.location_id?` | `string` |
| `config.metadata?` | Record<`string`, `unknown`\> | config metadata |
| `config.no_notification?` | `boolean` | config no notification |
#### Returns
`Promise`<`ClaimOrder`\>
created claim
-`Promise`: created claim
-`ClaimOrder`:
#### Defined in
[medusa/src/services/claim.ts:512](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L512)
[medusa/src/services/claim.ts:512](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L512)
___
### createShipment
▸ **createShipment**(`id`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`ClaimOrder`\>
**createShipment**(`id`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`ClaimOrder`\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `id` | `string` | `undefined` |
| `fulfillmentId` | `string` | `undefined` |
| Name | Default value |
| :------ | :------ |
| `id` | `string` |
| `fulfillmentId` | `string` |
| `trackingLinks` | { `tracking_number`: `string` }[] | `[]` |
| `config` | `Object` | `undefined` |
| `config.metadata` | `Object` | `{}` |
| `config` | `object` |
| `config.metadata` | `object` |
| `config.no_notification` | `undefined` | `undefined` |
#### Returns
`Promise`<`ClaimOrder`\>
-`Promise`:
-`ClaimOrder`:
#### Defined in
[medusa/src/services/claim.ts:734](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L734)
[medusa/src/services/claim.ts:734](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L734)
___
### getRefundTotalForClaimLinesOnOrder
▸ `Protected` **getRefundTotalForClaimLinesOnOrder**(`order`, `claimItems`): `Promise`<`number`\>
`Protected` **getRefundTotalForClaimLinesOnOrder**(`order`, `claimItems`): `Promise`<`number`\>
Finds claim line items on an order and calculates the refund amount.
There are three places too look:
@@ -466,8 +477,8 @@ Note, it will attempt to return early from each of these places to avoid having
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `Order` | the order to find claim lines on |
| `claimItems` | `CreateClaimItemInput`[] | the claim items to match against |
@@ -475,22 +486,23 @@ Note, it will attempt to return early from each of these places to avoid having
`Promise`<`number`\>
the refund amount
-`Promise`: the refund amount
-`number`: (optional)
#### Defined in
[medusa/src/services/claim.ts:273](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L273)
[medusa/src/services/claim.ts:273](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L273)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`ClaimOrder`[]\>
**list**(`selector`, `config?`): `Promise`<`ClaimOrder`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `any` | the query object for find |
| `config` | `FindConfig`<`ClaimOrder`\> | the config object containing query settings |
@@ -498,44 +510,49 @@ ___
`Promise`<`ClaimOrder`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ClaimOrder[]`:
-`ClaimOrder`:
#### Defined in
[medusa/src/services/claim.ts:870](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L870)
[medusa/src/services/claim.ts:870](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L870)
___
### processRefund
▸ **processRefund**(`id`): `Promise`<`ClaimOrder`\>
**processRefund**(`id`): `Promise`<`ClaimOrder`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
#### Returns
`Promise`<`ClaimOrder`\>
-`Promise`:
-`ClaimOrder`:
#### Defined in
[medusa/src/services/claim.ts:688](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L688)
[medusa/src/services/claim.ts:688](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L688)
___
### retrieve
▸ **retrieve**(`claimId`, `config?`): `Promise`<`ClaimOrder`\>
**retrieve**(`claimId`, `config?`): `Promise`<`ClaimOrder`\>
Gets an order by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `claimId` | `string` | id of the claim order to retrieve |
| `config` | `FindConfig`<`ClaimOrder`\> | the config object containing query settings |
@@ -543,46 +560,49 @@ Gets an order by id.
`Promise`<`ClaimOrder`\>
the order document
-`Promise`: the order document
-`ClaimOrder`:
#### Defined in
[medusa/src/services/claim.ts:889](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L889)
[medusa/src/services/claim.ts:889](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L889)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`id`, `data`): `Promise`<`ClaimOrder`\>
**update**(`id`, `data`): `Promise`<`ClaimOrder`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
| `data` | `UpdateClaimInput` |
@@ -590,50 +610,57 @@ ___
`Promise`<`ClaimOrder`\>
-`Promise`:
-`ClaimOrder`:
#### Defined in
[medusa/src/services/claim.ts:125](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L125)
[medusa/src/services/claim.ts:125](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L125)
___
### validateCreateClaimInput
▸ `Protected` **validateCreateClaimInput**(`data`): `Promise`<`void`\>
`Protected` **validateCreateClaimInput**(`data`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateClaimInput` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/claim.ts:206](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L206)
[medusa/src/services/claim.ts:206](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L206)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ClaimService`](ClaimService.md)
**withTransaction**(`transactionManager?`): [`ClaimService`](ClaimService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ClaimService`](ClaimService.md)
-`default`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: CurrencyService
# CurrencyService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new CurrencyService**(`«destructured»`)
**new CurrencyService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L29)
[medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L29)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### currencyRepository\_
• `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\>
`Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\>
#### Defined in
[medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L25)
[medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L25)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L26)
[medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L26)
___
### featureFlagRouter\_
• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/currency.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L27)
[medusa/src/services/currency.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L27)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -110,13 +110,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -124,13 +124,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -140,47 +140,47 @@ ___
#### Defined in
[medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L21)
[medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L21)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -189,7 +189,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -197,21 +197,21 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Currency`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`Currency`[], `number`]\>
Lists currencies based on the provided parameters and includes the count of
currencies that match the query.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Currency`\> | an object that defines rules to filter currencies by |
| `config` | `FindConfig`<`Currency`\> | object that defines the scope for what should be returned |
@@ -219,74 +219,79 @@ currencies that match the query.
`Promise`<[`Currency`[], `number`]\>
an array containing the currencies as
-`Promise`: an array containing the currencies as
the first element and the total count of products that matches the query
as the second element.
-`Currency[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/currency.ts:78](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L78)
[medusa/src/services/currency.ts:78](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L78)
___
### retrieveByCode
▸ **retrieveByCode**(`code`): `Promise`<`Currency`\>
**retrieveByCode**(`code`): `Promise`<`Currency`\>
Return the currency
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `code` | `string` | The code of the currency that must be retrieve |
#### Returns
`Promise`<`Currency`\>
The currency
-`Promise`: The currency
-`Currency`:
#### Defined in
[medusa/src/services/currency.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L47)
[medusa/src/services/currency.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L47)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`code`, `data`): `Promise`<`undefined` \| `Currency`\>
**update**(`code`, `data`): `Promise`<`undefined` \| `Currency`\>
Update a currency
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `code` | `string` | The code of the currency to update |
| `data` | `UpdateCurrencyInput` | The data that must be updated on the currency |
@@ -294,32 +299,35 @@ Update a currency
`Promise`<`undefined` \| `Currency`\>
The updated currency
-`Promise`: The updated currency
-`undefined \| Currency`: (optional)
#### Defined in
[medusa/src/services/currency.ts:100](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L100)
[medusa/src/services/currency.ts:100](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L100)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`CurrencyService`](CurrencyService.md)
**withTransaction**(`transactionManager?`): [`CurrencyService`](CurrencyService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`CurrencyService`](CurrencyService.md)
-`default`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: CustomShippingOptionService
# CustomShippingOptionService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new CustomShippingOptionService**(`«destructured»`)
**new CustomShippingOptionService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L18)
[medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L18)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### customShippingOptionRepository\_
• `Protected` **customShippingOptionRepository\_**: `Repository`<`CustomShippingOption`\>
`Protected` **customShippingOptionRepository\_**: `Repository`<`CustomShippingOption`\>
#### Defined in
[medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L16)
[medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L16)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -90,13 +90,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -104,47 +104,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -153,7 +153,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -161,51 +161,49 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**<`T`, `TResult`\>(`data`): `Promise`<`TResult`\>
**create**<`T`, `TResult`\>(`data`): `Promise`<`TResult`\>
Creates a custom shipping option
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | `CreateCustomShippingOptionInput` \| `CreateCustomShippingOptionInput`[] |
| `TResult` | `T` extends `CreateCustomShippingOptionInput`[] ? `CustomShippingOption`[] : `CustomShippingOption` |
| `T` | `object` |
| `TResult` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `T` | the custom shipping option to create |
#### Returns
`Promise`<`TResult`\>
resolves to the creation result
-`Promise`: resolves to the creation result
#### Defined in
[medusa/src/services/custom-shipping-option.ts:80](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L80)
[medusa/src/services/custom-shipping-option.ts:80](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L80)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`CustomShippingOption`[]\>
**list**(`selector`, `config?`): `Promise`<`CustomShippingOption`[]\>
Fetches all custom shipping options based on the given selector
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`CustomShippingOption`\> | the query object for find |
| `config` | `FindConfig`<`CustomShippingOption`\> | the configuration used to find the objects. contains relations, skip, and take. |
@@ -213,24 +211,26 @@ Fetches all custom shipping options based on the given selector
`Promise`<`CustomShippingOption`[]\>
custom shipping options matching the query
-`Promise`: custom shipping options matching the query
-`CustomShippingOption[]`:
-`CustomShippingOption`:
#### Defined in
[medusa/src/services/custom-shipping-option.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L58)
[medusa/src/services/custom-shipping-option.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L58)
___
### retrieve
▸ **retrieve**(`id`, `config?`): `Promise`<`CustomShippingOption`\>
**retrieve**(`id`, `config?`): `Promise`<`CustomShippingOption`\>
Retrieves a specific shipping option.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the id of the custom shipping option to retrieve. |
| `config` | `FindConfig`<`CustomShippingOption`\> | any options needed to query for the result. |
@@ -238,56 +238,61 @@ Retrieves a specific shipping option.
`Promise`<`CustomShippingOption`\>
the requested custom shipping option.
-`Promise`: the requested custom shipping option.
-`CustomShippingOption`:
#### Defined in
[medusa/src/services/custom-shipping-option.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L31)
[medusa/src/services/custom-shipping-option.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L31)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`CustomShippingOptionService`](CustomShippingOptionService.md)
**withTransaction**(`transactionManager?`): [`CustomShippingOptionService`](CustomShippingOptionService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`CustomShippingOptionService`](CustomShippingOptionService.md)
-`CustomShippingOptionService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: CustomerGroupService
# CustomerGroupService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new CustomerGroupService**(`«destructured»`)
**new CustomerGroupService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `CustomerGroupConstructorProps` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/customer-group.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L24)
[medusa/src/services/customer-group.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L24)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### customerGroupRepository\_
• `Protected` `Readonly` **customerGroupRepository\_**: `Repository`<`CustomerGroup`\> & { `addCustomers`: (`groupId`: `string`, `customerIds`: `string`[]) => `Promise`<`CustomerGroup`\> ; `findWithRelationsAndCount`: (`relations`: `FindOptionsRelations`<`CustomerGroup`\>, `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions`) => `Promise`<[`CustomerGroup`[], `number`]\> ; `removeCustomers`: (`groupId`: `string`, `customerIds`: `string`[]) => `Promise`<`DeleteResult`\> }
`Protected` `Readonly` **customerGroupRepository\_**: `Repository`<`CustomerGroup`\> & { `addCustomers`: Method addCustomers ; `findWithRelationsAndCount`: Method findWithRelationsAndCount ; `removeCustomers`: Method removeCustomers }
#### Defined in
[medusa/src/services/customer-group.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L21)
[medusa/src/services/customer-group.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L21)
___
### customerService\_
• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md)
`Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md)
#### Defined in
[medusa/src/services/customer-group.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L22)
[medusa/src/services/customer-group.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L22)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -100,13 +100,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -114,38 +114,40 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addCustomers
▸ **addCustomers**(`id`, `customerIds`): `Promise`<`CustomerGroup`\>
**addCustomers**(`id`, `customerIds`): `Promise`<`CustomerGroup`\>
Add a batch of customers to a customer group at once
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | id of the customer group to add customers to |
| `customerIds` | `string` \| `string`[] | customer id's to add to the group |
@@ -153,33 +155,32 @@ Add a batch of customers to a customer group at once
`Promise`<`CustomerGroup`\>
the customer group after insertion
-`Promise`: the customer group after insertion
-`CustomerGroup`:
#### Defined in
[medusa/src/services/customer-group.ts:89](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L89)
[medusa/src/services/customer-group.ts:89](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L89)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -188,7 +189,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -196,66 +197,67 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`group`): `Promise`<`CustomerGroup`\>
**create**(`group`): `Promise`<`CustomerGroup`\>
Creates a customer group with the provided data.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `group` | `DeepPartial`<`CustomerGroup`\> | the customer group to create |
#### Returns
`Promise`<`CustomerGroup`\>
the result of the create operation
-`Promise`: the result of the create operation
-`CustomerGroup`:
#### Defined in
[medusa/src/services/customer-group.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L65)
[medusa/src/services/customer-group.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L65)
___
### delete
▸ **delete**(`groupId`): `Promise`<`void`\>
**delete**(`groupId`): `Promise`<`void`\>
Remove customer group
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `groupId` | `string` | id of the customer group to delete |
#### Returns
`Promise`<`void`\>
a promise
-`Promise`: a promise
#### Defined in
[medusa/src/services/customer-group.ts:153](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L153)
[medusa/src/services/customer-group.ts:153](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L153)
___
### handleCreationFail
▸ `Private` **handleCreationFail**(`id`, `ids`, `error`): `Promise`<`never`\>
`Private` **handleCreationFail**(`id`, `ids`, `error`): `Promise`<`never`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
| `ids` | `string`[] |
| `error` | `any` |
@@ -264,22 +266,25 @@ ___
`Promise`<`never`\>
-`Promise`:
-`never`: (optional)
#### Defined in
[medusa/src/services/customer-group.ts:257](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L257)
[medusa/src/services/customer-group.ts:257](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L257)
___
### list
▸ **list**(`selector?`, `config`): `Promise`<`CustomerGroup`[]\>
**list**(`selector?`, `config`): `Promise`<`CustomerGroup`[]\>
List customer groups.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`CustomerGroup`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find |
| `config` | `FindConfig`<`CustomerGroup`\> | the config to be used for find |
@@ -287,24 +292,26 @@ List customer groups.
`Promise`<`CustomerGroup`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`CustomerGroup[]`:
-`CustomerGroup`:
#### Defined in
[medusa/src/services/customer-group.ts:176](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L176)
[medusa/src/services/customer-group.ts:176](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L176)
___
### listAndCount
▸ **listAndCount**(`selector?`, `config`): `Promise`<[`CustomerGroup`[], `number`]\>
**listAndCount**(`selector?`, `config`): `Promise`<[`CustomerGroup`[], `number`]\>
Retrieve a list of customer groups and total count of records that match the query.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`CustomerGroup`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find |
| `config` | `FindConfig`<`CustomerGroup`\> | the config to be used for find |
@@ -312,24 +319,26 @@ Retrieve a list of customer groups and total count of records that match the que
`Promise`<[`CustomerGroup`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`CustomerGroup[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/customer-group.ts:194](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L194)
[medusa/src/services/customer-group.ts:194](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L194)
___
### removeCustomer
▸ **removeCustomer**(`id`, `customerIds`): `Promise`<`CustomerGroup`\>
**removeCustomer**(`id`, `customerIds`): `Promise`<`CustomerGroup`\>
Remove list of customers from a customergroup
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | id of the customer group from which the customers are removed |
| `customerIds` | `string` \| `string`[] | id's of the customer to remove from group |
@@ -337,69 +346,75 @@ Remove list of customers from a customergroup
`Promise`<`CustomerGroup`\>
the customergroup with the provided id
-`Promise`: the customergroup with the provided id
-`CustomerGroup`:
#### Defined in
[medusa/src/services/customer-group.ts:236](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L236)
[medusa/src/services/customer-group.ts:236](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L236)
___
### retrieve
▸ **retrieve**(`customerGroupId`, `config?`): `Promise`<`CustomerGroup`\>
**retrieve**(`customerGroupId`, `config?`): `Promise`<`CustomerGroup`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `customerGroupId` | `string` |
| `config` | `Object` |
| `config` | `object` |
#### Returns
`Promise`<`CustomerGroup`\>
-`Promise`:
-`CustomerGroup`:
#### Defined in
[medusa/src/services/customer-group.ts:35](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L35)
[medusa/src/services/customer-group.ts:35](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L35)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`customerGroupId`, `update`): `Promise`<`CustomerGroup`\>
**update**(`customerGroupId`, `update`): `Promise`<`CustomerGroup`\>
Update a customer group.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `customerGroupId` | `string` | id of the customer group |
| `update` | `CustomerGroupUpdate` | customer group partial data |
@@ -407,32 +422,35 @@ Update a customer group.
`Promise`<`CustomerGroup`\>
resulting customer group
-`Promise`: resulting customer group
-`CustomerGroup`:
#### Defined in
[medusa/src/services/customer-group.ts:120](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L120)
[medusa/src/services/customer-group.ts:120](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L120)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`CustomerGroupService`](CustomerGroupService.md)
**withTransaction**(`transactionManager?`): [`CustomerGroupService`](CustomerGroupService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`CustomerGroupService`](CustomerGroupService.md)
-`CustomerGroupService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: CustomerService
# CustomerService
Provides layer to manipulate customers.
@@ -12,12 +12,12 @@ Provides layer to manipulate customers.
### constructor
• **new CustomerService**(`«destructured»`)
**new CustomerService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/customer.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L46)
[medusa/src/services/customer.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L46)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,43 +68,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### addressRepository\_
• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\>
`Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\>
#### Defined in
[medusa/src/services/customer.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L37)
[medusa/src/services/customer.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L37)
___
### customerRepository\_
• `Protected` `Readonly` **customerRepository\_**: `Repository`<`Customer`\> & { `listAndCount`: (`query`: `Object`, `q`: `undefined` \| `string`) => `Promise`<[`Customer`[], `number`]\> }
`Protected` `Readonly` **customerRepository\_**: `Repository`<`Customer`\> & { `listAndCount`: Method listAndCount }
#### Defined in
[medusa/src/services/customer.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L36)
[medusa/src/services/customer.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L36)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/customer.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L38)
[medusa/src/services/customer.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L38)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -112,13 +112,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -126,13 +126,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -144,36 +144,38 @@ ___
#### Defined in
[medusa/src/services/customer.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L40)
[medusa/src/services/customer.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L40)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addAddress
▸ **addAddress**(`customerId`, `address`): `Promise`<`Customer` \| `Address`\>
**addAddress**(`customerId`, `address`): `Promise`<`Customer` \| `Address`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `customerId` | `string` |
| `address` | `AddressCreatePayload` |
@@ -181,31 +183,32 @@ TransactionBaseService.activeManager\_
`Promise`<`Customer` \| `Address`\>
-`Promise`:
-`Customer \| Address`: (optional)
#### Defined in
[medusa/src/services/customer.ts:519](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L519)
[medusa/src/services/customer.ts:519](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L519)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -214,7 +217,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -222,13 +225,13 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### count
▸ **count**(): `Promise`<`number`\>
**count**(): `Promise`<`number`\>
Return the total number of documents in database
@@ -236,17 +239,18 @@ Return the total number of documents in database
`Promise`<`number`\>
the result of the count operation
-`Promise`: the result of the count operation
-`number`: (optional)
#### Defined in
[medusa/src/services/customer.ts:178](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L178)
[medusa/src/services/customer.ts:178](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L178)
___
### create
▸ **create**(`customer`): `Promise`<`Customer`\>
**create**(`customer`): `Promise`<`Customer`\>
Creates a customer from an email - customers can have accounts associated,
e.g. to login and view order history, etc. If a password is provided the
@@ -255,49 +259,51 @@ used to hold details of customers.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `customer` | `CreateCustomerInput` | the customer to create |
#### Returns
`Promise`<`Customer`\>
the result of create
-`Promise`: the result of create
-`Customer`:
#### Defined in
[medusa/src/services/customer.ts:306](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L306)
[medusa/src/services/customer.ts:306](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L306)
___
### delete
▸ **delete**(`customerId`): `Promise`<`void` \| `Customer`\>
**delete**(`customerId`): `Promise`<`void` \| `Customer`\>
Deletes a customer from a given customer id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `customerId` | `string` | the id of the customer to delete. Must be castable as an ObjectId |
#### Returns
`Promise`<`void` \| `Customer`\>
the result of the delete operation.
-`Promise`: the result of the delete operation.
-`void \| Customer`: (optional)
#### Defined in
[medusa/src/services/customer.ts:565](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L565)
[medusa/src/services/customer.ts:565](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L565)
___
### generateResetPasswordToken
▸ **generateResetPasswordToken**(`customerId`): `Promise`<`string`\>
**generateResetPasswordToken**(`customerId`): `Promise`<`string`\>
Generate a JSON Web token, that will be sent to a customer, that wishes to
reset password.
@@ -307,54 +313,56 @@ which is always 15 minutes.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `customerId` | `string` | the customer to reset the password for |
#### Returns
`Promise`<`string`\>
the generated JSON web token
-`Promise`: the generated JSON web token
-`string`: (optional)
#### Defined in
[medusa/src/services/customer.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L68)
[medusa/src/services/customer.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L68)
___
### hashPassword\_
▸ **hashPassword_**(`password`): `Promise`<`string`\>
**hashPassword_**(`password`): `Promise`<`string`\>
Hashes a password
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `password` | `string` | the value to hash |
#### Returns
`Promise`<`string`\>
hashed password
-`Promise`: hashed password
-`string`: (optional)
#### Defined in
[medusa/src/services/customer.ts:293](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L293)
[medusa/src/services/customer.ts:293](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L293)
___
### list
▸ **list**(`selector?`, `config?`): `Promise`<`Customer`[]\>
**list**(`selector?`, `config?`): `Promise`<`Customer`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Customer`\> & { `groups?`: `string`[] ; `q?`: `string` } | the query object for find |
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
@@ -362,22 +370,24 @@ ___
`Promise`<`Customer`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`Customer[]`:
-`Customer`:
#### Defined in
[medusa/src/services/customer.ts:111](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L111)
[medusa/src/services/customer.ts:111](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L111)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Customer`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`Customer`[], `number`]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Customer`\> & { `groups?`: `string`[] ; `q?`: `string` } | the query object for find |
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
@@ -385,22 +395,24 @@ ___
`Promise`<[`Customer`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`Customer[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/customer.ts:143](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L143)
[medusa/src/services/customer.ts:143](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L143)
___
### listByEmail
▸ **listByEmail**(`email`, `config?`): `Promise`<`Customer`[]\>
**listByEmail**(`email`, `config?`): `Promise`<`Customer`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `email` | `string` |
| `config` | `FindConfig`<`Customer`\> |
@@ -408,20 +420,24 @@ ___
`Promise`<`Customer`[]\>
-`Promise`:
-`Customer[]`:
-`Customer`:
#### Defined in
[medusa/src/services/customer.ts:249](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L249)
[medusa/src/services/customer.ts:249](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L249)
___
### removeAddress
▸ **removeAddress**(`customerId`, `addressId`): `Promise`<`void`\>
**removeAddress**(`customerId`, `addressId`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `customerId` | `string` |
| `addressId` | `string` |
@@ -429,22 +445,24 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/customer.ts:502](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L502)
[medusa/src/services/customer.ts:502](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L502)
___
### retrieve
▸ **retrieve**(`customerId`, `config?`): `Promise`<`Customer`\>
**retrieve**(`customerId`, `config?`): `Promise`<`Customer`\>
Gets a customer by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `customerId` | `string` | the id of the customer to get. |
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
@@ -452,24 +470,25 @@ Gets a customer by id.
`Promise`<`Customer`\>
the customer document.
-`Promise`: the customer document.
-`Customer`:
#### Defined in
[medusa/src/services/customer.ts:274](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L274)
[medusa/src/services/customer.ts:274](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L274)
___
### retrieveByEmail
▸ **retrieveByEmail**(`email`, `config?`): `Promise`<`Customer`\>
**retrieveByEmail**(`email`, `config?`): `Promise`<`Customer`\>
Gets a registered customer by email.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `email` | `string` | the email of the customer to get. |
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
@@ -477,26 +496,27 @@ Gets a registered customer by email.
`Promise`<`Customer`\>
the customer document.
-`Promise`: the customer document.
-`Customer`:
**`Deprecated`**
**Deprecated**
#### Defined in
[medusa/src/services/customer.ts:216](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L216)
[medusa/src/services/customer.ts:216](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L216)
___
### retrieveByPhone
▸ **retrieveByPhone**(`phone`, `config?`): `Promise`<`Customer`\>
**retrieveByPhone**(`phone`, `config?`): `Promise`<`Customer`\>
Gets a customer by phone.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `phone` | `string` | the phone of the customer to get. |
| `config` | `FindConfig`<`Customer`\> | the config object containing query settings |
@@ -504,22 +524,23 @@ Gets a customer by phone.
`Promise`<`Customer`\>
the customer document.
-`Promise`: the customer document.
-`Customer`:
#### Defined in
[medusa/src/services/customer.ts:261](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L261)
[medusa/src/services/customer.ts:261](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L261)
___
### retrieveRegisteredByEmail
▸ **retrieveRegisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\>
**retrieveRegisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `email` | `string` |
| `config` | `FindConfig`<`Customer`\> |
@@ -527,20 +548,23 @@ ___
`Promise`<`Customer`\>
-`Promise`:
-`Customer`:
#### Defined in
[medusa/src/services/customer.ts:239](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L239)
[medusa/src/services/customer.ts:239](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L239)
___
### retrieveUnregisteredByEmail
▸ **retrieveUnregisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\>
**retrieveUnregisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `email` | `string` |
| `config` | `FindConfig`<`Customer`\> |
@@ -548,20 +572,23 @@ ___
`Promise`<`Customer`\>
-`Promise`:
-`Customer`:
#### Defined in
[medusa/src/services/customer.ts:230](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L230)
[medusa/src/services/customer.ts:230](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L230)
___
### retrieve\_
▸ `Private` **retrieve_**(`selector`, `config?`): `Promise`<`Customer`\>
`Private` **retrieve_**(`selector`, `config?`): `Promise`<`Customer`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `Selector`<`Customer`\> |
| `config` | `FindConfig`<`Customer`\> |
@@ -569,46 +596,51 @@ ___
`Promise`<`Customer`\>
-`Promise`:
-`Customer`:
#### Defined in
[medusa/src/services/customer.ts:185](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L185)
[medusa/src/services/customer.ts:185](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L185)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`customerId`, `update`): `Promise`<`Customer`\>
**update**(`customerId`, `update`): `Promise`<`Customer`\>
Updates a customer.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `customerId` | `string` | the id of the variant. Must be a string that can be casted to an ObjectId |
| `update` | `UpdateCustomerInput` | an object with the update values. |
@@ -616,22 +648,23 @@ Updates a customer.
`Promise`<`Customer`\>
resolves to the update result.
-`Promise`: resolves to the update result.
-`Customer`:
#### Defined in
[medusa/src/services/customer.ts:362](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L362)
[medusa/src/services/customer.ts:362](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L362)
___
### updateAddress
▸ **updateAddress**(`customerId`, `addressId`, `address`): `Promise`<`Address`\>
**updateAddress**(`customerId`, `addressId`, `address`): `Promise`<`Address`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `customerId` | `string` |
| `addressId` | `string` |
| `address` | `StorePostCustomersCustomerAddressesAddressReq` |
@@ -640,22 +673,25 @@ ___
`Promise`<`Address`\>
-`Promise`:
-`Address`:
#### Defined in
[medusa/src/services/customer.ts:474](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L474)
[medusa/src/services/customer.ts:474](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L474)
___
### updateBillingAddress\_
▸ **updateBillingAddress_**(`customer`, `addressOrId`): `Promise`<`void`\>
**updateBillingAddress_**(`customer`, `addressOrId`): `Promise`<`void`\>
Updates the customers' billing address.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `customer` | `Customer` | the Customer to update |
| `addressOrId` | `undefined` \| `string` \| `DeepPartial`<`Address`\> | the value to set the billing address to |
@@ -663,32 +699,34 @@ Updates the customers' billing address.
`Promise`<`void`\>
the result of the update operation
-`Promise`: the result of the update operation
#### Defined in
[medusa/src/services/customer.ts:422](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L422)
[medusa/src/services/customer.ts:422](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L422)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`CustomerService`](CustomerService.md)
**withTransaction**(`transactionManager?`): [`CustomerService`](CustomerService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`CustomerService`](CustomerService.md)
-`CustomerService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,8 +1,8 @@
# Class: DiscountConditionService
# DiscountConditionService
Provides layer to manipulate discount conditions.
**`Implements`**
**Implements**
## Hierarchy
@@ -14,12 +14,12 @@ Provides layer to manipulate discount conditions.
### constructor
• **new DiscountConditionService**(`«destructured»`)
**new DiscountConditionService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -28,13 +28,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L34)
[medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L34)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -42,13 +42,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -56,13 +56,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -70,33 +70,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### discountConditionRepository\_
• `Protected` `Readonly` **discountConditionRepository\_**: `Repository`<`DiscountCondition`\> & { `addConditionResources`: (`conditionId`: `string`, `resourceIds`: (`string` \| { `id`: `string` })[], `type`: `DiscountConditionType`, `overrideExisting`: `boolean`) => `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\> ; `canApplyForCustomer`: (`discountRuleId`: `string`, `customerId`: `string`) => `Promise`<`boolean`\> ; `findOneWithDiscount`: (`conditionId`: `string`, `discountId`: `string`) => `Promise`<`undefined` \| `DiscountCondition` & { `discount`: `Discount` }\> ; `getJoinTableResourceIdentifiers`: (`type`: `string`) => { `conditionTable`: `DiscountConditionResourceType` ; `joinTable`: `string` ; `joinTableForeignKey`: `DiscountConditionJoinTableForeignKey` ; `joinTableKey`: `string` ; `relatedTable`: `string` ; `resourceKey`: `string` } ; `isValidForProduct`: (`discountRuleId`: `string`, `productId`: `string`) => `Promise`<`boolean`\> ; `queryConditionTable`: (`__namedParameters`: `Object`) => `Promise`<`number`\> ; `removeConditionResources`: (`id`: `string`, `type`: `DiscountConditionType`, `resourceIds`: (`string` \| { `id`: `string` })[]) => `Promise`<`void` \| `DeleteResult`\> }
`Protected` `Readonly` **discountConditionRepository\_**: `Repository`<`DiscountCondition`\> & { `addConditionResources`: Method addConditionResources ; `canApplyForCustomer`: Method canApplyForCustomer ; `findOneWithDiscount`: Method findOneWithDiscount ; `getJoinTableResourceIdentifiers`: Method getJoinTableResourceIdentifiers ; `isValidForProduct`: Method isValidForProduct ; `queryConditionTable`: Method queryConditionTable ; `removeConditionResources`: Method removeConditionResources }
#### Defined in
[medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L31)
[medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L31)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L32)
[medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L32)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -104,13 +104,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -118,47 +118,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -167,7 +167,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -175,58 +175,63 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### delete
▸ **delete**(`discountConditionId`): `Promise`<`void` \| `DiscountCondition`\>
**delete**(`discountConditionId`): `Promise`<`void` \| `DiscountCondition`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `discountConditionId` | `string` |
#### Returns
`Promise`<`void` \| `DiscountCondition`\>
-`Promise`:
-`void \| DiscountCondition`: (optional)
#### Defined in
[medusa/src/services/discount-condition.ts:217](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L217)
[medusa/src/services/discount-condition.ts:217](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L217)
___
### removeResources
▸ **removeResources**(`data`): `Promise`<`void`\>
**removeResources**(`data`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `Omit`<`DiscountConditionInput`, ``"id"``\> & { `id`: `string` } |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/discount-condition.ts:184](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L184)
[medusa/src/services/discount-condition.ts:184](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L184)
___
### retrieve
▸ **retrieve**(`conditionId`, `config?`): `Promise`<`DiscountCondition`\>
**retrieve**(`conditionId`, `config?`): `Promise`<`DiscountCondition`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `conditionId` | `string` |
| `config?` | `FindConfig`<`DiscountCondition`\> |
@@ -234,95 +239,108 @@ ___
`Promise`<`DiscountCondition`\>
-`Promise`:
-`DiscountCondition`:
#### Defined in
[medusa/src/services/discount-condition.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L45)
[medusa/src/services/discount-condition.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L45)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### upsertCondition
▸ **upsertCondition**(`data`, `overrideExisting?`): `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\>
**upsertCondition**(`data`, `overrideExisting?`): `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `data` | `DiscountConditionInput` | `undefined` |
| Name | Default value |
| :------ | :------ |
| `data` | `DiscountConditionInput` |
| `overrideExisting` | `boolean` | `true` |
#### Returns
`Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\>
-`Promise`:
-`(DiscountConditionProduct \| DiscountConditionProductType \| DiscountConditionProductCollection \| DiscountConditionProductTag \| DiscountConditionCustomerGroup)[]`:
-`DiscountConditionProduct \| DiscountConditionProductType \| DiscountConditionProductCollection \| DiscountConditionProductTag \| DiscountConditionCustomerGroup`: (optional)
#### Defined in
[medusa/src/services/discount-condition.ts:111](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L111)
[medusa/src/services/discount-condition.ts:111](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L111)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`DiscountConditionService`](DiscountConditionService.md)
**withTransaction**(`transactionManager?`): [`DiscountConditionService`](DiscountConditionService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`DiscountConditionService`](DiscountConditionService.md)
-`DiscountConditionService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
___
### resolveConditionType\_
▸ `Static` `Protected` **resolveConditionType_**(`data`): `undefined` \| { `resource_ids`: (`string` \| { `id`: `string` })[] ; `type`: `DiscountConditionType` }
`Static` `Protected` **resolveConditionType_**(`data`): `undefined` \| { `resource_ids`: (`string` \| { `id`: `string` })[] ; `type`: `DiscountConditionType` }
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `DiscountConditionInput` |
#### Returns
`undefined` \| { `resource_ids`: (`string` \| { `id`: `string` })[] ; `type`: `DiscountConditionType` }
-`undefined \| { `resource_ids`: (`string` \| { `id`: `string` })[] ; `type`: `DiscountConditionType` }`: (optional)
#### Defined in
[medusa/src/services/discount-condition.ts:74](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L74)
[medusa/src/services/discount-condition.ts:74](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L74)
File diff suppressed because it is too large. Load diff
@@ -1,8 +1,8 @@
# Class: DraftOrderService
# DraftOrderService
Handles draft orders
**`Implements`**
**Implements**
## Hierarchy
@@ -14,12 +14,12 @@ Handles draft orders
### constructor
• **new DraftOrderService**(`«destructured»`)
**new DraftOrderService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -28,13 +28,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/draft-order.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L67)
[medusa/src/services/draft-order.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L67)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -42,13 +42,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -56,13 +56,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -70,63 +70,63 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### cartService\_
• `Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md)
`Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md)
#### Defined in
[medusa/src/services/draft-order.ts:61](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L61)
[medusa/src/services/draft-order.ts:61](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L61)
___
### customShippingOptionService\_
• `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md)
`Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md)
#### Defined in
[medusa/src/services/draft-order.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L65)
[medusa/src/services/draft-order.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L65)
___
### draftOrderRepository\_
• `Protected` `Readonly` **draftOrderRepository\_**: `Repository`<`DraftOrder`\>
`Protected` `Readonly` **draftOrderRepository\_**: `Repository`<`DraftOrder`\>
#### Defined in
[medusa/src/services/draft-order.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L57)
[medusa/src/services/draft-order.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L57)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/draft-order.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L60)
[medusa/src/services/draft-order.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L60)
___
### lineItemService\_
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
`Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
#### Defined in
[medusa/src/services/draft-order.ts:62](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L62)
[medusa/src/services/draft-order.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L62)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -134,53 +134,53 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### orderRepository\_
• `Protected` `Readonly` **orderRepository\_**: `Repository`<`Order`\> & { `findOneWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`\> ; `findWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`[]\> }
`Protected` `Readonly` **orderRepository\_**: `Repository`<`Order`\> & { `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations }
#### Defined in
[medusa/src/services/draft-order.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L59)
[medusa/src/services/draft-order.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L59)
___
### paymentRepository\_
• `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\>
`Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\>
#### Defined in
[medusa/src/services/draft-order.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L58)
[medusa/src/services/draft-order.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L58)
___
### productVariantService\_
• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md)
`Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md)
#### Defined in
[medusa/src/services/draft-order.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L63)
[medusa/src/services/draft-order.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L63)
___
### shippingOptionService\_
• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
`Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
#### Defined in
[medusa/src/services/draft-order.ts:64](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L64)
[medusa/src/services/draft-order.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L64)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -188,13 +188,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -205,47 +205,47 @@ ___
#### Defined in
[medusa/src/services/draft-order.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L52)
[medusa/src/services/draft-order.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L52)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -254,7 +254,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -262,68 +262,70 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`DraftOrder`\>
**create**(`data`): `Promise`<`DraftOrder`\>
Creates a draft order.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `DraftOrderCreateProps` | data to create draft order from |
#### Returns
`Promise`<`DraftOrder`\>
the created draft order
-`Promise`: the created draft order
-`DraftOrder`:
#### Defined in
[medusa/src/services/draft-order.ts:260](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L260)
[medusa/src/services/draft-order.ts:260](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L260)
___
### delete
▸ **delete**(`draftOrderId`): `Promise`<`undefined` \| `DraftOrder`\>
**delete**(`draftOrderId`): `Promise`<`undefined` \| `DraftOrder`\>
Deletes draft order idempotently.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `draftOrderId` | `string` | id of draft order to delete |
#### Returns
`Promise`<`undefined` \| `DraftOrder`\>
empty promise
-`Promise`: empty promise
-`undefined \| DraftOrder`: (optional)
#### Defined in
[medusa/src/services/draft-order.ts:156](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L156)
[medusa/src/services/draft-order.ts:156](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L156)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`DraftOrder`[]\>
**list**(`selector`, `config?`): `Promise`<`DraftOrder`[]\>
Lists draft orders
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `any` | query object for find |
| `config` | `FindConfig`<`DraftOrder`\> | configurable attributes for find |
@@ -331,24 +333,26 @@ Lists draft orders
`Promise`<`DraftOrder`[]\>
list of draft orders
-`Promise`: list of draft orders
-`DraftOrder[]`:
-`DraftOrder`:
#### Defined in
[medusa/src/services/draft-order.ts:238](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L238)
[medusa/src/services/draft-order.ts:238](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L238)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`DraftOrder`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`DraftOrder`[], `number`]\>
Lists draft orders alongside the count
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `any` | query selector to filter draft orders |
| `config` | `FindConfig`<`DraftOrder`\> | query config |
@@ -356,24 +360,26 @@ Lists draft orders alongside the count
`Promise`<[`DraftOrder`[], `number`]\>
draft orders
-`Promise`: draft orders
-`DraftOrder[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/draft-order.ts:180](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L180)
[medusa/src/services/draft-order.ts:180](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L180)
___
### registerCartCompletion
▸ **registerCartCompletion**(`draftOrderId`, `orderId`): `Promise`<`UpdateResult`\>
**registerCartCompletion**(`draftOrderId`, `orderId`): `Promise`<`UpdateResult`\>
Registers a draft order as completed, when an order has been completed.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `draftOrderId` | `string` | id of draft order to complete |
| `orderId` | `string` | id of order completed from draft order cart |
@@ -381,24 +387,25 @@ Registers a draft order as completed, when an order has been completed.
`Promise`<`UpdateResult`\>
the created order
-`Promise`: the created order
-`UpdateResult`:
#### Defined in
[medusa/src/services/draft-order.ts:420](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L420)
[medusa/src/services/draft-order.ts:420](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L420)
___
### retrieve
▸ **retrieve**(`draftOrderId`, `config?`): `Promise`<`DraftOrder`\>
**retrieve**(`draftOrderId`, `config?`): `Promise`<`DraftOrder`\>
Retrieves a draft order with the given id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `draftOrderId` | `string` | id of the draft order to retrieve |
| `config` | `FindConfig`<`DraftOrder`\> | query object for findOne |
@@ -406,24 +413,25 @@ Retrieves a draft order with the given id.
`Promise`<`DraftOrder`\>
the draft order
-`Promise`: the draft order
-`DraftOrder`:
#### Defined in
[medusa/src/services/draft-order.ts:98](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L98)
[medusa/src/services/draft-order.ts:98](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L98)
___
### retrieveByCartId
▸ **retrieveByCartId**(`cartId`, `config?`): `Promise`<`DraftOrder`\>
**retrieveByCartId**(`cartId`, `config?`): `Promise`<`DraftOrder`\>
Retrieves a draft order based on its associated cart id
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cartId` | `string` | cart id that the draft orders's cart has |
| `config` | `FindConfig`<`DraftOrder`\> | query object for findOne |
@@ -431,82 +439,88 @@ Retrieves a draft order based on its associated cart id
`Promise`<`DraftOrder`\>
the draft order
-`Promise`: the draft order
-`DraftOrder`:
#### Defined in
[medusa/src/services/draft-order.ts:131](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L131)
[medusa/src/services/draft-order.ts:131](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L131)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`id`, `data`): `Promise`<`DraftOrder`\>
**update**(`id`, `data`): `Promise`<`DraftOrder`\>
Updates a draft order with the given data
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | id of the draft order |
| `data` | `Object` | values to update the order with |
| `data.no_notification_order` | `boolean` | - |
| `data` | `object` | values to update the order with |
| `data.no_notification_order` | `boolean` |
#### Returns
`Promise`<`DraftOrder`\>
the updated draft order
-`Promise`: the updated draft order
-`DraftOrder`:
#### Defined in
[medusa/src/services/draft-order.ts:449](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L449)
[medusa/src/services/draft-order.ts:449](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L449)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`DraftOrderService`](DraftOrderService.md)
**withTransaction**(`transactionManager?`): [`DraftOrderService`](DraftOrderService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`DraftOrderService`](DraftOrderService.md)
-`DraftOrderService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: EventBusService
# EventBusService
Can keep track of multiple subscribers to different events and run the
subscribers when events happen. Events will run asynchronously.
@@ -17,14 +17,14 @@ subscribers when events happen. Events will run asynchronously.
### constructor
• **new EventBusService**(`«destructured»`, `config`, `isSingleton?`)
**new EventBusService**(`«destructured»`, `config`, `isSingleton?`)
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `«destructured»` | `InjectedDependencies` | `undefined` |
| `config` | `any` | `undefined` |
| Name | Default value |
| :------ | :------ |
| `«destructured»` | `InjectedDependencies` |
| `config` | `any` |
| `isSingleton` | `boolean` | `true` |
#### Overrides
@@ -33,13 +33,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/event-bus.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L36)
[medusa/src/services/event-bus.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L36)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -47,13 +47,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -61,13 +61,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -75,53 +75,53 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### config\_
• `Protected` `Readonly` **config\_**: `ConfigModule`
`Protected` `Readonly` **config\_**: `ConfigModule`
#### Defined in
[medusa/src/services/event-bus.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L27)
[medusa/src/services/event-bus.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L27)
___
### enqueue\_
• `Protected` **enqueue\_**: `Promise`<`void`\>
`Protected` **enqueue\_**: `Promise`<`void`\>
#### Defined in
[medusa/src/services/event-bus.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L34)
[medusa/src/services/event-bus.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L34)
___
### eventBusModuleService\_
• `Protected` `Readonly` **eventBusModuleService\_**: `IEventBusModuleService`
`Protected` `Readonly` **eventBusModuleService\_**: `IEventBusModuleService`
#### Defined in
[medusa/src/services/event-bus.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L30)
[medusa/src/services/event-bus.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L30)
___
### logger\_
• `Protected` `Readonly` **logger\_**: `Logger`
`Protected` `Readonly` **logger\_**: `Logger`
#### Defined in
[medusa/src/services/event-bus.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L31)
[medusa/src/services/event-bus.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L31)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -129,33 +129,33 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### shouldEnqueuerRun
• `Protected` **shouldEnqueuerRun**: `boolean`
`Protected` **shouldEnqueuerRun**: `boolean`
#### Defined in
[medusa/src/services/event-bus.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L33)
[medusa/src/services/event-bus.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L33)
___
### stagedJobService\_
• `Protected` `Readonly` **stagedJobService\_**: [`StagedJobService`](StagedJobService.md)
`Protected` `Readonly` **stagedJobService\_**: [`StagedJobService`](StagedJobService.md)
#### Defined in
[medusa/src/services/event-bus.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L28)
[medusa/src/services/event-bus.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L28)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -163,47 +163,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -212,7 +212,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -220,33 +220,32 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### emit
▸ **emit**<`T`\>(`data`): `Promise`<`void` \| `StagedJob`[]\>
**emit**<`T`\>(`data`): `Promise`<`void` \| `StagedJob`[]\>
Calls all subscribers when an event occurs.
#### Type parameters
| Name |
| :------ |
| `T` |
| `T` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `EmitData`<`T`\>[] | The data to use to process the events |
#### Returns
`Promise`<`void` \| `StagedJob`[]\>
the jobs from our queue
-`Promise`: the jobs from our queue
-`void \| StagedJob[]`: (optional)
#### Implementation of
@@ -254,31 +253,30 @@ EventBusTypes.IEventBusService.emit
#### Defined in
[medusa/src/services/event-bus.ts:117](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L117)
[medusa/src/services/event-bus.ts:117](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L117)
▸ **emit**<`T`\>(`eventName`, `data`, `options?`): `Promise`<`void` \| `StagedJob`\>
**emit**<`T`\>(`eventName`, `data`, `options?`): `Promise`<`void` \| `StagedJob`\>
Calls all subscribers when an event occurs.
#### Type parameters
| Name |
| :------ |
| `T` |
| `T` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `eventName` | `string` | the name of the event to be process. |
| `data` | `T` | the data to send to the subscriber. |
| `options?` | `Record`<`string`, `unknown`\> | options to add the job with |
| `options?` | Record<`string`, `unknown`\> | options to add the job with |
#### Returns
`Promise`<`void` \| `StagedJob`\>
the job from our queue
-`Promise`: the job from our queue
-`void \| StagedJob`: (optional)
#### Implementation of
@@ -286,106 +284,117 @@ EventBusTypes.IEventBusService.emit
#### Defined in
[medusa/src/services/event-bus.ts:126](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L126)
[medusa/src/services/event-bus.ts:126](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L126)
___
### enqueuer\_
▸ **enqueuer_**(): `Promise`<`void`\>
**enqueuer_**(): `Promise`<`void`\>
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/event-bus.ts:190](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L190)
[medusa/src/services/event-bus.ts:190](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L190)
___
### listJobs
▸ `Protected` **listJobs**(`listConfig`): `Promise`<`never`[] \| `StagedJob`[]\>
`Protected` **listJobs**(`listConfig`): `Promise`<`never`[] \| `StagedJob`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `listConfig` | `FindConfig`<`StagedJob`\> |
#### Returns
`Promise`<`never`[] \| `StagedJob`[]\>
-`Promise`:
-`never[] \| StagedJob[]`: (optional)
#### Defined in
[medusa/src/services/event-bus.ts:220](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L220)
[medusa/src/services/event-bus.ts:220](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L220)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### startEnqueuer
▸ **startEnqueuer**(): `void`
**startEnqueuer**(): `void`
#### Returns
`void`
-`void`: (optional)
#### Defined in
[medusa/src/services/event-bus.ts:180](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L180)
[medusa/src/services/event-bus.ts:180](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L180)
___
### stopEnqueuer
▸ **stopEnqueuer**(): `Promise`<`void`\>
**stopEnqueuer**(): `Promise`<`void`\>
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/event-bus.ts:185](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L185)
[medusa/src/services/event-bus.ts:185](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L185)
___
### subscribe
▸ **subscribe**(`event`, `subscriber`, `context?`): [`EventBusService`](EventBusService.md)
**subscribe**(`event`, `subscriber`, `context?`): [`EventBusService`](EventBusService.md)
Adds a function to a list of event subscribers.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `event` | `string` \| `symbol` | the event that the subscriber will listen for. |
| `subscriber` | `Subscriber`<`unknown`\> | the function to be called when a certain event happens. Subscribers must return a Promise. |
| `context?` | `SubscriberContext` | subscriber context |
@@ -394,7 +403,7 @@ Adds a function to a list of event subscribers.
[`EventBusService`](EventBusService.md)
this
-`default`: this
#### Implementation of
@@ -402,20 +411,20 @@ EventBusTypes.IEventBusService.subscribe
#### Defined in
[medusa/src/services/event-bus.ts:83](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L83)
[medusa/src/services/event-bus.ts:83](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L83)
___
### unsubscribe
▸ **unsubscribe**(`event`, `subscriber`, `context`): [`EventBusService`](EventBusService.md)
**unsubscribe**(`event`, `subscriber`, `context`): [`EventBusService`](EventBusService.md)
Removes function from the list of event subscribers.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `event` | `string` \| `symbol` | the event of the subcriber. |
| `subscriber` | `Subscriber`<`unknown`\> | the function to be removed |
| `context` | `SubscriberContext` | subscriber context |
@@ -424,7 +433,7 @@ Removes function from the list of event subscribers.
[`EventBusService`](EventBusService.md)
this
-`default`: this
#### Implementation of
@@ -432,24 +441,26 @@ EventBusTypes.IEventBusService.unsubscribe
#### Defined in
[medusa/src/services/event-bus.ts:103](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L103)
[medusa/src/services/event-bus.ts:103](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L103)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`EventBusService`](EventBusService.md)
**withTransaction**(`transactionManager?`): [`EventBusService`](EventBusService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`EventBusService`](EventBusService.md)
-`default`:
#### Implementation of
EventBusTypes.IEventBusService.withTransaction
@@ -460,4 +471,4 @@ TransactionBaseService.withTransaction
#### Defined in
[medusa/src/services/event-bus.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L54)
[medusa/src/services/event-bus.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L54)
@@ -1,4 +1,4 @@
# Class: FulfillmentProviderService
# FulfillmentProviderService
Helps retrieve fulfillment providers
@@ -12,12 +12,12 @@ Helps retrieve fulfillment providers
### constructor
• **new FulfillmentProviderService**(`container`)
**new FulfillmentProviderService**(`container`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `container` | `FulfillmentProviderContainer` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/fulfillment-provider.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L44)
[medusa/src/services/fulfillment-provider.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L44)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,33 +68,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### container\_
• `Protected` `Readonly` **container\_**: `FulfillmentProviderContainer`
`Protected` `Readonly` **container\_**: `FulfillmentProviderContainer`
#### Defined in
[medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L40)
[medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L40)
___
### fulfillmentProviderRepository\_
• `Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\>
`Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\>
#### Defined in
[medusa/src/services/fulfillment-provider.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L42)
[medusa/src/services/fulfillment-provider.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L42)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -102,13 +102,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -116,47 +116,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -165,7 +165,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -173,80 +173,89 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### calculatePrice
▸ **calculatePrice**(`option`, `data`, `cart?`): `Promise`<`number`\>
**calculatePrice**(`option`, `data`, `cart?`): `Promise`<`number`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `option` | `ShippingOption` |
| `data` | `Record`<`string`, `unknown`\> |
| `data` | Record<`string`, `unknown`\> |
| `cart?` | `Order` \| `Cart` |
#### Returns
`Promise`<`number`\>
-`Promise`:
-`number`: (optional)
#### Defined in
[medusa/src/services/fulfillment-provider.ts:147](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L147)
[medusa/src/services/fulfillment-provider.ts:147](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L147)
___
### canCalculate
▸ **canCalculate**(`option`): `Promise`<`boolean`\>
**canCalculate**(`option`): `Promise`<`boolean`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `option` | `CalculateOptionPriceInput` |
#### Returns
`Promise`<`boolean`\>
-`Promise`:
-`boolean`: (optional)
#### Defined in
[medusa/src/services/fulfillment-provider.ts:122](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L122)
[medusa/src/services/fulfillment-provider.ts:122](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L122)
___
### cancelFulfillment
▸ **cancelFulfillment**(`fulfillment`): `Promise`<`Fulfillment`\>
**cancelFulfillment**(`fulfillment`): `Promise`<`Fulfillment`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `fulfillment` | `Fulfillment` |
#### Returns
`Promise`<`Fulfillment`\>
-`Promise`:
-`Fulfillment`:
#### Defined in
[medusa/src/services/fulfillment-provider.ts:140](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L140)
[medusa/src/services/fulfillment-provider.ts:140](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L140)
___
### createFulfillment
▸ **createFulfillment**(`method`, `items`, `order`, `fulfillment`): `Promise`<`Record`<`string`, `unknown`\>\>
**createFulfillment**(`method`, `items`, `order`, `fulfillment`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `method` | `ShippingMethod` |
| `items` | `LineItem`[] |
| `order` | `CreateFulfillmentOrder` |
@@ -254,220 +263,252 @@ ___
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/fulfillment-provider.ts:107](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L107)
[medusa/src/services/fulfillment-provider.ts:107](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L107)
___
### createReturn
▸ **createReturn**(`returnOrder`): `Promise`<`Record`<`string`, `unknown`\>\>
**createReturn**(`returnOrder`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `returnOrder` | `CreateReturnType` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/fulfillment-provider.ts:165](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L165)
[medusa/src/services/fulfillment-provider.ts:165](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L165)
___
### list
▸ **list**(): `Promise`<`FulfillmentProvider`[]\>
**list**(): `Promise`<`FulfillmentProvider`[]\>
#### Returns
`Promise`<`FulfillmentProvider`[]\>
-`Promise`:
-`FulfillmentProvider[]`:
-`FulfillmentProvider`:
#### Defined in
[medusa/src/services/fulfillment-provider.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L67)
[medusa/src/services/fulfillment-provider.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L67)
___
### listFulfillmentOptions
▸ **listFulfillmentOptions**(`providerIds`): `Promise`<`FulfillmentOptions`[]\>
**listFulfillmentOptions**(`providerIds`): `Promise`<`FulfillmentOptions`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `providerIds` | `string`[] |
#### Returns
`Promise`<`FulfillmentOptions`[]\>
-`Promise`:
-`FulfillmentOptions[]`:
#### Defined in
[medusa/src/services/fulfillment-provider.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L75)
[medusa/src/services/fulfillment-provider.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L75)
___
### registerInstalledProviders
▸ **registerInstalledProviders**(`providers`): `Promise`<`void`\>
**registerInstalledProviders**(`providers`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `providers` | `string`[] |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/fulfillment-provider.ts:53](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L53)
[medusa/src/services/fulfillment-provider.ts:53](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L53)
___
### retrieveDocuments
▸ **retrieveDocuments**(`providerId`, `fulfillmentData`, `documentType`): `Promise`<`any`\>
**retrieveDocuments**(`providerId`, `fulfillmentData`, `documentType`): `Promise`<`any`\>
Fetches documents from the fulfillment provider
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `providerId` | `string` | the id of the provider |
| `fulfillmentData` | `Record`<`string`, `unknown`\> | the data relating to the fulfillment |
| `fulfillmentData` | Record<`string`, `unknown`\> | the data relating to the fulfillment |
| `documentType` | ``"label"`` \| ``"invoice"`` | the typ of |
#### Returns
`Promise`<`any`\>
document to fetch
-`Promise`: document to fetch
-`any`: (optional)
#### Defined in
[medusa/src/services/fulfillment-provider.ts:184](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L184)
[medusa/src/services/fulfillment-provider.ts:184](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L184)
___
### retrieveProvider
▸ **retrieveProvider**(`providerId`): `any`
**retrieveProvider**(`providerId`): `any`
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `providerId` | `string` | the provider id |
#### Returns
`any`
the payment fulfillment provider
-`any`: (optional) the payment fulfillment provider
#### Defined in
[medusa/src/services/fulfillment-provider.ts:96](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L96)
[medusa/src/services/fulfillment-provider.ts:96](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L96)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### validateFulfillmentData
▸ **validateFulfillmentData**(`option`, `data`, `cart`): `Promise`<`Record`<`string`, `unknown`\>\>
**validateFulfillmentData**(`option`, `data`, `cart`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `option` | `ShippingOption` |
| `data` | `Record`<`string`, `unknown`\> |
| `cart` | `Record`<`string`, `unknown`\> \| `Cart` |
| `data` | Record<`string`, `unknown`\> |
| `cart` | Record<`string`, `unknown`\> \| `Cart` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/fulfillment-provider.ts:127](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L127)
[medusa/src/services/fulfillment-provider.ts:127](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L127)
___
### validateOption
▸ **validateOption**(`option`): `Promise`<`boolean`\>
**validateOption**(`option`): `Promise`<`boolean`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `option` | `ShippingOption` |
#### Returns
`Promise`<`boolean`\>
-`Promise`:
-`boolean`: (optional)
#### Defined in
[medusa/src/services/fulfillment-provider.ts:160](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L160)
[medusa/src/services/fulfillment-provider.ts:160](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L160)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`FulfillmentProviderService`](FulfillmentProviderService.md)
**withTransaction**(`transactionManager?`): [`FulfillmentProviderService`](FulfillmentProviderService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`FulfillmentProviderService`](FulfillmentProviderService.md)
-`FulfillmentProviderService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: FulfillmentService
# FulfillmentService
Handles Fulfillments
@@ -12,12 +12,12 @@ Handles Fulfillments
### constructor
• **new FulfillmentService**(`«destructured»`)
**new FulfillmentService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/fulfillment.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L47)
[medusa/src/services/fulfillment.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L47)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,53 +68,53 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### fulfillmentProviderService\_
• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
`Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
#### Defined in
[medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L40)
[medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L40)
___
### fulfillmentRepository\_
• `Protected` `Readonly` **fulfillmentRepository\_**: `Repository`<`Fulfillment`\>
`Protected` `Readonly` **fulfillmentRepository\_**: `Repository`<`Fulfillment`\>
#### Defined in
[medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L41)
[medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L41)
___
### lineItemRepository\_
• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> }
`Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: Method findByReturn }
#### Defined in
[medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L43)
[medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L43)
___
### lineItemService\_
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
`Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
#### Defined in
[medusa/src/services/fulfillment.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L38)
[medusa/src/services/fulfillment.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L38)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -122,53 +122,53 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### productVariantInventoryService\_
• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
`Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
#### Defined in
[medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L45)
[medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L45)
___
### shippingProfileService\_
• `Protected` `Readonly` **shippingProfileService\_**: [`ShippingProfileService`](ShippingProfileService.md)
`Protected` `Readonly` **shippingProfileService\_**: [`ShippingProfileService`](ShippingProfileService.md)
#### Defined in
[medusa/src/services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L39)
[medusa/src/services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L39)
___
### totalsService\_
• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
`Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
#### Defined in
[medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L37)
[medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L37)
___
### trackingLinkRepository\_
• `Protected` `Readonly` **trackingLinkRepository\_**: `Repository`<`TrackingLink`\>
`Protected` `Readonly` **trackingLinkRepository\_**: `Repository`<`TrackingLink`\>
#### Defined in
[medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L42)
[medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L42)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -176,47 +176,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -225,7 +225,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -233,13 +233,13 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### cancelFulfillment
▸ **cancelFulfillment**(`fulfillmentOrId`): `Promise`<`Fulfillment`\>
**cancelFulfillment**(`fulfillmentOrId`): `Promise`<`Fulfillment`\>
Cancels a fulfillment with the fulfillment provider. Will decrement the
fulfillment_quantity on the line items associated with the fulfillment.
@@ -247,25 +247,26 @@ Throws if the fulfillment has already been shipped.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `fulfillmentOrId` | `string` \| `Fulfillment` | the fulfillment object or id. |
#### Returns
`Promise`<`Fulfillment`\>
the result of the save operation
-`Promise`: the result of the save operation
-`Fulfillment`:
#### Defined in
[medusa/src/services/fulfillment.ts:260](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L260)
[medusa/src/services/fulfillment.ts:260](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L260)
___
### createFulfillment
▸ **createFulfillment**(`order`, `itemsToFulfill`, `custom?`): `Promise`<`Fulfillment`[]\>
**createFulfillment**(`order`, `itemsToFulfill`, `custom?`): `Promise`<`Fulfillment`[]\>
Creates an order fulfillment
If items needs to be fulfilled by different provider, we make
@@ -274,8 +275,8 @@ those partitions.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `CreateFulfillmentOrder` | order to create fulfillment for |
| `itemsToFulfill` | `FulFillmentItemType`[] | the items in the order to fulfill |
| `custom` | `Partial`<`Fulfillment`\> | potential custom values to add |
@@ -284,25 +285,27 @@ those partitions.
`Promise`<`Fulfillment`[]\>
the created fulfillments
-`Promise`: the created fulfillments
-`Fulfillment[]`:
-`Fulfillment`:
#### Defined in
[medusa/src/services/fulfillment.ts:205](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L205)
[medusa/src/services/fulfillment.ts:205](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L205)
___
### createShipment
▸ **createShipment**(`fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Fulfillment`\>
**createShipment**(`fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Fulfillment`\>
Creates a shipment by marking a fulfillment as shipped. Adds
tracking links and potentially more metadata.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `fulfillmentId` | `string` | the fulfillment to ship |
| `trackingLinks?` | { `tracking_number`: `string` }[] | tracking links for the shipment |
| `config` | `CreateShipmentConfig` | potential configuration settings, such as no_notification and metadata |
@@ -311,24 +314,25 @@ tracking links and potentially more metadata.
`Promise`<`Fulfillment`\>
the shipped fulfillment
-`Promise`: the shipped fulfillment
-`Fulfillment`:
#### Defined in
[medusa/src/services/fulfillment.ts:312](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L312)
[medusa/src/services/fulfillment.ts:312](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L312)
___
### getFulfillmentItems\_
▸ **getFulfillmentItems_**(`order`, `items`): `Promise`<(``null`` \| `LineItem`)[]\>
**getFulfillmentItems_**(`order`, `items`): `Promise`<(``null`` \| `LineItem`)[]\>
Retrieves the order line items, given an array of items.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `CreateFulfillmentOrder` | the order to get line items from |
| `items` | `FulFillmentItemType`[] | the items to get |
@@ -336,22 +340,24 @@ Retrieves the order line items, given an array of items.
`Promise`<(``null`` \| `LineItem`)[]\>
the line items generated by the transformer.
-`Promise`: the line items generated by the transformer.
-`(``null`` \| LineItem)[]`:
-```null`` \| LineItem`: (optional)
#### Defined in
[medusa/src/services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L109)
[medusa/src/services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L109)
___
### partitionItems\_
▸ **partitionItems_**(`shippingMethods`, `items`): `FulfillmentItemPartition`[]
**partitionItems_**(`shippingMethods`, `items`): `FulfillmentItemPartition`[]
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `shippingMethods` | `ShippingMethod`[] |
| `items` | `LineItem`[] |
@@ -359,22 +365,24 @@ ___
`FulfillmentItemPartition`[]
-`FulfillmentItemPartition[]`:
#### Defined in
[medusa/src/services/fulfillment.ts:70](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L70)
[medusa/src/services/fulfillment.ts:70](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L70)
___
### retrieve
▸ **retrieve**(`fulfillmentId`, `config?`): `Promise`<`Fulfillment`\>
**retrieve**(`fulfillmentId`, `config?`): `Promise`<`Fulfillment`\>
Retrieves a fulfillment by its id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `fulfillmentId` | `string` | the id of the fulfillment to retrieve |
| `config` | `FindConfig`<`Fulfillment`\> | optional values to include with fulfillmentRepository query |
@@ -382,41 +390,44 @@ Retrieves a fulfillment by its id.
`Promise`<`Fulfillment`\>
the fulfillment
-`Promise`: the fulfillment
-`Fulfillment`:
#### Defined in
[medusa/src/services/fulfillment.ts:167](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L167)
[medusa/src/services/fulfillment.ts:167](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L167)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### validateFulfillmentLineItem\_
▸ **validateFulfillmentLineItem_**(`item`, `quantity`): ``null`` \| `LineItem`
**validateFulfillmentLineItem_**(`item`, `quantity`): ``null`` \| `LineItem`
Checks that a given quantity of a line item can be fulfilled. Fails if the
fulfillable quantity is lower than the requested fulfillment quantity.
@@ -425,8 +436,8 @@ quantity from the quantity that was originally purchased.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `item` | `undefined` \| `LineItem` | the line item to check has sufficient fulfillable quantity. |
| `quantity` | `number` | the quantity that is requested to be fulfilled. |
@@ -434,33 +445,35 @@ quantity from the quantity that was originally purchased.
``null`` \| `LineItem`
a line item that has the requested fulfillment quantity
-```null`` \| LineItem`: (optional) a line item that has the requested fulfillment quantity
set.
#### Defined in
[medusa/src/services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L134)
[medusa/src/services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L134)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`FulfillmentService`](FulfillmentService.md)
**withTransaction**(`transactionManager?`): [`FulfillmentService`](FulfillmentService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`FulfillmentService`](FulfillmentService.md)
-`FulfillmentService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: GiftCardService
# GiftCardService
Provides layer to manipulate gift cards.
@@ -12,12 +12,12 @@ Provides layer to manipulate gift cards.
### constructor
• **new GiftCardService**(`«destructured»`)
**new GiftCardService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/gift-card.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L39)
[medusa/src/services/gift-card.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L39)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,43 +68,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/gift-card.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L33)
[medusa/src/services/gift-card.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L33)
___
### giftCardRepository\_
• `Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: (`query`: `ExtendedFindConfig`<`GiftCard`\>, `q?`: `string`) => `Promise`<[`GiftCard`[], `number`]\> }
`Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: Method listGiftCardsAndCount }
#### Defined in
[medusa/src/services/gift-card.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L29)
[medusa/src/services/gift-card.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L29)
___
### giftCardTransactionRepo\_
• `Protected` `Readonly` **giftCardTransactionRepo\_**: `Repository`<`GiftCardTransaction`\>
`Protected` `Readonly` **giftCardTransactionRepo\_**: `Repository`<`GiftCardTransaction`\>
#### Defined in
[medusa/src/services/gift-card.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L31)
[medusa/src/services/gift-card.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L31)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -112,23 +112,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### regionService\_
• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
`Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
#### Defined in
[medusa/src/services/gift-card.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L32)
[medusa/src/services/gift-card.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L32)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -136,13 +136,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -152,47 +152,47 @@ ___
#### Defined in
[medusa/src/services/gift-card.ts:35](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L35)
[medusa/src/services/gift-card.ts:35](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L35)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -201,7 +201,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -209,86 +209,91 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`giftCard`): `Promise`<`GiftCard`\>
**create**(`giftCard`): `Promise`<`GiftCard`\>
Creates a gift card with provided data given that the data is validated.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `giftCard` | `CreateGiftCardInput` | the gift card data to create |
#### Returns
`Promise`<`GiftCard`\>
the result of the create operation
-`Promise`: the result of the create operation
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:122](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L122)
[medusa/src/services/gift-card.ts:122](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L122)
___
### createTransaction
▸ **createTransaction**(`data`): `Promise`<`string`\>
**createTransaction**(`data`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateGiftCardTransactionInput` |
#### Returns
`Promise`<`string`\>
-`Promise`:
-`string`: (optional)
#### Defined in
[medusa/src/services/gift-card.ts:106](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L106)
[medusa/src/services/gift-card.ts:106](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L106)
___
### delete
▸ **delete**(`giftCardId`): `Promise`<`void` \| `GiftCard`\>
**delete**(`giftCardId`): `Promise`<`void` \| `GiftCard`\>
Deletes a gift card idempotently
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `giftCardId` | `string` | id of gift card to delete |
#### Returns
`Promise`<`void` \| `GiftCard`\>
the result of the delete operation
-`Promise`: the result of the delete operation
-`void \| GiftCard`: (optional)
#### Defined in
[medusa/src/services/gift-card.ts:295](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L295)
[medusa/src/services/gift-card.ts:295](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L295)
___
### list
▸ **list**(`selector?`, `config?`): `Promise`<`GiftCard`[]\>
**list**(`selector?`, `config?`): `Promise`<`GiftCard`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `QuerySelector`<`GiftCard`\> | the query object for find |
| `config` | `FindConfig`<`GiftCard`\> | the configuration used to find the objects. contains relations, skip, and take. |
@@ -296,22 +301,24 @@ ___
`Promise`<`GiftCard`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`GiftCard[]`:
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:98](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L98)
[medusa/src/services/gift-card.ts:98](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L98)
___
### listAndCount
▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`GiftCard`[], `number`]\>
**listAndCount**(`selector?`, `config?`): `Promise`<[`GiftCard`[], `number`]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `QuerySelector`<`GiftCard`\> | the query object for find |
| `config` | `FindConfig`<`GiftCard`\> | the configuration used to find the objects. contains relations, skip, and take. |
@@ -319,24 +326,26 @@ ___
`Promise`<[`GiftCard`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`GiftCard[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/gift-card.ts:74](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L74)
[medusa/src/services/gift-card.ts:74](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L74)
___
### retrieve
▸ **retrieve**(`giftCardId`, `config?`): `Promise`<`GiftCard`\>
**retrieve**(`giftCardId`, `config?`): `Promise`<`GiftCard`\>
Gets a gift card by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `giftCardId` | `string` | id of gift card to retrieve |
| `config` | `FindConfig`<`GiftCard`\> | optional values to include with gift card query |
@@ -344,22 +353,23 @@ Gets a gift card by id.
`Promise`<`GiftCard`\>
the gift card
-`Promise`: the gift card
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:215](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L215)
[medusa/src/services/gift-card.ts:215](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L215)
___
### retrieveByCode
▸ **retrieveByCode**(`code`, `config?`): `Promise`<`GiftCard`\>
**retrieveByCode**(`code`, `config?`): `Promise`<`GiftCard`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `code` | `string` |
| `config` | `FindConfig`<`GiftCard`\> |
@@ -367,20 +377,23 @@ ___
`Promise`<`GiftCard`\>
-`Promise`:
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:229](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L229)
[medusa/src/services/gift-card.ts:229](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L229)
___
### retrieve\_
▸ `Protected` **retrieve_**(`selector`, `config?`): `Promise`<`GiftCard`\>
`Protected` **retrieve_**(`selector`, `config?`): `Promise`<`GiftCard`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `Selector`<`GiftCard`\> |
| `config` | `FindConfig`<`GiftCard`\> |
@@ -388,46 +401,51 @@ ___
`Promise`<`GiftCard`\>
-`Promise`:
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:182](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L182)
[medusa/src/services/gift-card.ts:182](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L182)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`giftCardId`, `update`): `Promise`<`GiftCard`\>
**update**(`giftCardId`, `update`): `Promise`<`GiftCard`\>
Updates a giftCard.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `giftCardId` | `string` | giftCard id of giftCard to update |
| `update` | `UpdateGiftCardInput` | the data to update the giftCard with |
@@ -435,41 +453,44 @@ Updates a giftCard.
`Promise`<`GiftCard`\>
the result of the update operation
-`Promise`: the result of the update operation
-`GiftCard`:
#### Defined in
[medusa/src/services/gift-card.ts:249](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L249)
[medusa/src/services/gift-card.ts:249](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L249)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`GiftCardService`](GiftCardService.md)
**withTransaction**(`transactionManager?`): [`GiftCardService`](GiftCardService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`GiftCardService`](GiftCardService.md)
-`GiftCardService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
___
### generateCode
▸ `Static` **generateCode**(): `string`
`Static` **generateCode**(): `string`
Generates a 16 character gift card code
@@ -477,25 +498,25 @@ Generates a 16 character gift card code
`string`
the generated gift card code
-`string`: (optional) the generated gift card code
#### Defined in
[medusa/src/services/gift-card.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L58)
[medusa/src/services/gift-card.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L58)
___
### resolveTaxRate
▸ `Static` `Protected` **resolveTaxRate**(`giftCardTaxRate`, `region`): ``null`` \| `number`
`Static` `Protected` **resolveTaxRate**(`giftCardTaxRate`, `region`): ``null`` \| `number`
The tax_rate of the giftcard can depend on whether regions tax gift cards, an input
provided by the user or the tax rate. Based on these conditions, tax_rate changes.
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `giftCardTaxRate` | ``null`` \| `number` |
| `region` | `Region` |
@@ -503,8 +524,8 @@ provided by the user or the tax rate. Based on these conditions, tax_rate change
``null`` \| `number`
the tax rate for the gift card
-```null`` \| number`: (optional) the tax rate for the gift card
#### Defined in
[medusa/src/services/gift-card.ts:161](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L161)
[medusa/src/services/gift-card.ts:161](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L161)
@@ -1,4 +1,4 @@
# Class: IdempotencyKeyService
# IdempotencyKeyService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new IdempotencyKeyService**(`«destructured»`)
**new IdempotencyKeyService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/idempotency-key.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L25)
[medusa/src/services/idempotency-key.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L25)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### idempotencyKeyRepository\_
• `Protected` `Readonly` **idempotencyKeyRepository\_**: `Repository`<`IdempotencyKey`\>
`Protected` `Readonly` **idempotencyKeyRepository\_**: `Repository`<`IdempotencyKey`\>
#### Defined in
[medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L23)
[medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L23)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -90,13 +90,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -104,47 +104,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -153,7 +153,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -161,13 +161,13 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`payload`): `Promise`<`IdempotencyKey`\>
**create**(`payload`): `Promise`<`IdempotencyKey`\>
Creates an idempotency key for a request.
If no idempotency key is provided in request, we will create a unique
@@ -175,131 +175,137 @@ identifier.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `payload` | `CreateIdempotencyKeyInput` | payload of request to create idempotency key for |
#### Returns
`Promise`<`IdempotencyKey`\>
the created idempotency key
-`Promise`: the created idempotency key
-`IdempotencyKey`:
#### Defined in
[medusa/src/services/idempotency-key.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L68)
[medusa/src/services/idempotency-key.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L68)
___
### initializeRequest
▸ **initializeRequest**(`headerKey`, `reqMethod`, `reqParams`, `reqPath`): `Promise`<`IdempotencyKey`\>
**initializeRequest**(`headerKey`, `reqMethod`, `reqParams`, `reqPath`): `Promise`<`IdempotencyKey`\>
Execute the initial steps in a idempotent request.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `headerKey` | `string` | potential idempotency key from header |
| `reqMethod` | `string` | method of request |
| `reqParams` | `Record`<`string`, `unknown`\> | params of request |
| `reqParams` | Record<`string`, `unknown`\> | params of request |
| `reqPath` | `string` | path of request |
#### Returns
`Promise`<`IdempotencyKey`\>
the existing or created idempotency key
-`Promise`: the existing or created idempotency key
-`IdempotencyKey`:
#### Defined in
[medusa/src/services/idempotency-key.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L40)
[medusa/src/services/idempotency-key.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L40)
___
### lock
▸ **lock**(`idempotencyKey`): `Promise`<`IdempotencyKey`\>
**lock**(`idempotencyKey`): `Promise`<`IdempotencyKey`\>
Locks an idempotency.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `idempotencyKey` | `string` | key to lock |
#### Returns
`Promise`<`IdempotencyKey`\>
result of the update operation
-`Promise`: result of the update operation
-`IdempotencyKey`:
#### Defined in
[medusa/src/services/idempotency-key.ts:138](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L138)
[medusa/src/services/idempotency-key.ts:138](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L138)
___
### retrieve
▸ **retrieve**(`idempotencyKeyOrSelector`): `Promise`<`IdempotencyKey`\>
**retrieve**(`idempotencyKeyOrSelector`): `Promise`<`IdempotencyKey`\>
Retrieves an idempotency key
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `idempotencyKeyOrSelector` | `string` \| `Selector`<`IdempotencyKey`\> | key or selector to retrieve |
#### Returns
`Promise`<`IdempotencyKey`\>
idempotency key
-`Promise`: idempotency key
-`IdempotencyKey`:
#### Defined in
[medusa/src/services/idempotency-key.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L86)
[medusa/src/services/idempotency-key.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L86)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`idempotencyKey`, `update`): `Promise`<`IdempotencyKey`\>
**update**(`idempotencyKey`, `update`): `Promise`<`IdempotencyKey`\>
Locks an idempotency.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `idempotencyKey` | `string` | key to update |
| `update` | `DeepPartial`<`IdempotencyKey`\> | update object |
@@ -307,41 +313,44 @@ Locks an idempotency.
`Promise`<`IdempotencyKey`\>
result of the update operation
-`Promise`: result of the update operation
-`IdempotencyKey`:
#### Defined in
[medusa/src/services/idempotency-key.ts:167](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L167)
[medusa/src/services/idempotency-key.ts:167](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L167)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`IdempotencyKeyService`](IdempotencyKeyService.md)
**withTransaction**(`transactionManager?`): [`IdempotencyKeyService`](IdempotencyKeyService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`IdempotencyKeyService`](IdempotencyKeyService.md)
-`IdempotencyKeyService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
___
### workStage
▸ **workStage**(`idempotencyKey`, `callback`): `Promise`<`IdempotencyKey`\>
**workStage**(`idempotencyKey`, `callback`): `Promise`<`IdempotencyKey`\>
Performs an atomic work stage.
An atomic work stage contains some related functionality, that needs to be
@@ -351,8 +360,8 @@ always consist of 2 or more of these phases. The required phases are
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `idempotencyKey` | `string` | current idempotency key |
| `callback` | (`transactionManager`: `EntityManager`) => `Promise`<`IdempotencyCallbackResult`\> | functionality to execute within the phase |
@@ -360,8 +369,9 @@ always consist of 2 or more of these phases. The required phases are
`Promise`<`IdempotencyKey`\>
new updated idempotency key
-`Promise`: new updated idempotency key
-`IdempotencyKey`:
#### Defined in
[medusa/src/services/idempotency-key.ts:196](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L196)
[medusa/src/services/idempotency-key.ts:196](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L196)
@@ -1,4 +1,4 @@
# Class: LineItemAdjustmentService
# LineItemAdjustmentService
Provides layer to manipulate line item adjustments.
@@ -12,12 +12,12 @@ Provides layer to manipulate line item adjustments.
### constructor
• **new LineItemAdjustmentService**(`«destructured»`)
**new LineItemAdjustmentService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `LineItemAdjustmentServiceProps` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/line-item-adjustment.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L36)
[medusa/src/services/line-item-adjustment.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L36)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,33 +68,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### discountService
• `Private` `Readonly` **discountService**: [`DiscountService`](DiscountService.md)
`Private` `Readonly` **discountService**: [`DiscountService`](DiscountService.md)
#### Defined in
[medusa/src/services/line-item-adjustment.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L34)
[medusa/src/services/line-item-adjustment.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L34)
___
### lineItemAdjustmentRepo\_
• `Private` `Readonly` **lineItemAdjustmentRepo\_**: `Repository`<`LineItemAdjustment`\>
`Private` `Readonly` **lineItemAdjustmentRepo\_**: `Repository`<`LineItemAdjustment`\>
#### Defined in
[medusa/src/services/line-item-adjustment.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L33)
[medusa/src/services/line-item-adjustment.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L33)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -102,13 +102,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -116,47 +116,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -165,7 +165,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -173,44 +173,45 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`LineItemAdjustment`\>
**create**(`data`): `Promise`<`LineItemAdjustment`\>
Creates a line item adjustment
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `Partial`<`LineItemAdjustment`\> | the line item adjustment to create |
#### Returns
`Promise`<`LineItemAdjustment`\>
line item adjustment
-`Promise`: line item adjustment
-`LineItemAdjustment`:
#### Defined in
[medusa/src/services/line-item-adjustment.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L86)
[medusa/src/services/line-item-adjustment.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L86)
___
### createAdjustmentForLineItem
▸ **createAdjustmentForLineItem**(`cart`, `lineItem`): `Promise`<`LineItemAdjustment`[]\>
**createAdjustmentForLineItem**(`cart`, `lineItem`): `Promise`<`LineItemAdjustment`[]\>
Creates adjustment for a line item
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cart` | `Cart` | the cart object holding discounts |
| `lineItem` | `LineItem` | the line item for which a line item adjustment might be created |
@@ -218,24 +219,26 @@ Creates adjustment for a line item
`Promise`<`LineItemAdjustment`[]\>
a line item adjustment or undefined if no adjustment was created
-`Promise`: a line item adjustment or undefined if no adjustment was created
-`LineItemAdjustment[]`:
-`LineItemAdjustment`:
#### Defined in
[medusa/src/services/line-item-adjustment.ts:262](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L262)
[medusa/src/services/line-item-adjustment.ts:262](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L262)
___
### createAdjustments
▸ **createAdjustments**(`cart`, `lineItem?`): `Promise`<`LineItemAdjustment`[] \| `LineItemAdjustment`[][]\>
**createAdjustments**(`cart`, `lineItem?`): `Promise`<`LineItemAdjustment`[] \| `LineItemAdjustment`[][]\>
Creates adjustment for a line item
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cart` | `Cart` | the cart object holding discounts |
| `lineItem?` | `LineItem` | the line item for which a line item adjustment might be created |
@@ -243,49 +246,50 @@ Creates adjustment for a line item
`Promise`<`LineItemAdjustment`[] \| `LineItemAdjustment`[][]\>
if a lineItem was given, returns a line item adjustment or undefined if no adjustment was created
-`Promise`: if a lineItem was given, returns a line item adjustment or undefined if no adjustment was created
otherwise returns an array of line item adjustments for each line item in the cart
-`LineItemAdjustment[] \| LineItemAdjustment[][]`: (optional)
#### Defined in
[medusa/src/services/line-item-adjustment.ts:290](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L290)
[medusa/src/services/line-item-adjustment.ts:290](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L290)
___
### delete
▸ **delete**(`selectorOrIds`): `Promise`<`void`\>
**delete**(`selectorOrIds`): `Promise`<`void`\>
Deletes line item adjustments matching a selector
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selectorOrIds` | `string` \| `string`[] \| `FilterableLineItemAdjustmentProps` & { `discount_id?`: `FindOperator`<``null`` \| `string`\> } | the query object for find or the line item adjustment id |
#### Returns
`Promise`<`void`\>
the result of the delete operation
-`Promise`: the result of the delete operation
#### Defined in
[medusa/src/services/line-item-adjustment.ts:153](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L153)
[medusa/src/services/line-item-adjustment.ts:153](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L153)
___
### generateAdjustments
▸ **generateAdjustments**(`calculationContextData`, `generatedLineItem`, `context`): `Promise`<`GeneratedAdjustment`[]\>
**generateAdjustments**(`calculationContextData`, `generatedLineItem`, `context`): `Promise`<`GeneratedAdjustment`[]\>
Creates adjustment for a line item
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `calculationContextData` | `CalculationContextData` | the calculationContextData object holding discounts |
| `generatedLineItem` | `LineItem` | the line item for which a line item adjustment might be created |
| `context` | `AdjustmentContext` | the line item for which a line item adjustment might be created |
@@ -294,24 +298,25 @@ Creates adjustment for a line item
`Promise`<`GeneratedAdjustment`[]\>
a line item adjustment or undefined if no adjustment was created
-`Promise`: a line item adjustment or undefined if no adjustment was created
-`GeneratedAdjustment[]`:
#### Defined in
[medusa/src/services/line-item-adjustment.ts:188](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L188)
[medusa/src/services/line-item-adjustment.ts:188](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L188)
___
### list
▸ **list**(`selector?`, `config?`): `Promise`<`LineItemAdjustment`[]\>
**list**(`selector?`, `config?`): `Promise`<`LineItemAdjustment`[]\>
Lists line item adjustments
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `FilterableLineItemAdjustmentProps` | the query object for find |
| `config` | `FindConfig`<`LineItemAdjustment`\> | the config to be used for find |
@@ -319,24 +324,26 @@ Lists line item adjustments
`Promise`<`LineItemAdjustment`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`LineItemAdjustment[]`:
-`LineItemAdjustment`:
#### Defined in
[medusa/src/services/line-item-adjustment.ts:136](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L136)
[medusa/src/services/line-item-adjustment.ts:136](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L136)
___
### retrieve
▸ **retrieve**(`lineItemAdjustmentId`, `config?`): `Promise`<`LineItemAdjustment`\>
**retrieve**(`lineItemAdjustmentId`, `config?`): `Promise`<`LineItemAdjustment`\>
Retrieves a line item adjustment by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `lineItemAdjustmentId` | `string` | the id of the line item adjustment to retrieve |
| `config` | `FindConfig`<`LineItemAdjustment`\> | the config to retrieve the line item adjustment by |
@@ -344,48 +351,51 @@ Retrieves a line item adjustment by id.
`Promise`<`LineItemAdjustment`\>
the line item adjustment.
-`Promise`: the line item adjustment.
-`LineItemAdjustment`:
#### Defined in
[medusa/src/services/line-item-adjustment.ts:53](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L53)
[medusa/src/services/line-item-adjustment.ts:53](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L53)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`id`, `data`): `Promise`<`LineItemAdjustment`\>
**update**(`id`, `data`): `Promise`<`LineItemAdjustment`\>
Creates a line item adjustment
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the line item adjustment id to update |
| `data` | `Partial`<`LineItemAdjustment`\> | the line item adjustment to create |
@@ -393,32 +403,35 @@ Creates a line item adjustment
`Promise`<`LineItemAdjustment`\>
line item adjustment
-`Promise`: line item adjustment
-`LineItemAdjustment`:
#### Defined in
[medusa/src/services/line-item-adjustment.ts:104](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L104)
[medusa/src/services/line-item-adjustment.ts:104](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L104)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`LineItemAdjustmentService`](LineItemAdjustmentService.md)
**withTransaction**(`transactionManager?`): [`LineItemAdjustmentService`](LineItemAdjustmentService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`LineItemAdjustmentService`](LineItemAdjustmentService.md)
-`LineItemAdjustmentService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: LineItemService
# LineItemService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new LineItemService**(`«destructured»`)
**new LineItemService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/line-item.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L57)
[medusa/src/services/line-item.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L57)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,63 +66,63 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### cartRepository\_
• `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> & { `findOneWithRelations`: (`relations`: `FindOptionsRelations`<`Cart`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Cart`\>, ``"relations"``\>) => `Promise`<`Cart`\> ; `findWithRelations`: (`relations`: `FindOptionsRelations`<`Cart`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Cart`\>, ``"relations"``\>) => `Promise`<`Cart`[]\> }
`Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> & { `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations }
#### Defined in
[medusa/src/services/line-item.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L48)
[medusa/src/services/line-item.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L48)
___
### featureFlagRouter\_
• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/line-item.ts:53](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L53)
[medusa/src/services/line-item.ts:53](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L53)
___
### itemTaxLineRepo\_
• `Protected` `Readonly` **itemTaxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: (`cartId`: `string`) => `Promise`<`void`\> ; `upsertLines`: (`lines`: `LineItemTaxLine`[]) => `Promise`<`LineItemTaxLine`[]\> }
`Protected` `Readonly` **itemTaxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: Method deleteForCart ; `upsertLines`: Method upsertLines }
#### Defined in
[medusa/src/services/line-item.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L47)
[medusa/src/services/line-item.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L47)
___
### lineItemAdjustmentService\_
• `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md)
`Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md)
#### Defined in
[medusa/src/services/line-item.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L54)
[medusa/src/services/line-item.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L54)
___
### lineItemRepository\_
• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> }
`Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: Method findByReturn }
#### Defined in
[medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L46)
[medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L46)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -130,63 +130,63 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### pricingService\_
• `Protected` `Readonly` **pricingService\_**: [`PricingService`](PricingService.md)
`Protected` `Readonly` **pricingService\_**: [`PricingService`](PricingService.md)
#### Defined in
[medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L51)
[medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L51)
___
### productService\_
• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md)
`Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md)
#### Defined in
[medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L50)
[medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L50)
___
### productVariantService\_
• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md)
`Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md)
#### Defined in
[medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L49)
[medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L49)
___
### regionService\_
• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
`Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
#### Defined in
[medusa/src/services/line-item.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L52)
[medusa/src/services/line-item.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L52)
___
### taxProviderService\_
• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
`Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
#### Defined in
[medusa/src/services/line-item.ts:55](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L55)
[medusa/src/services/line-item.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L55)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -194,47 +194,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -243,7 +243,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -251,75 +251,77 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### cloneTo
▸ **cloneTo**(`ids`, `data?`, `options?`): `Promise`<`LineItem`[]\>
**cloneTo**(`ids`, `data?`, `options?`): `Promise`<`LineItem`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `ids` | `string` \| `string`[] |
| `data` | `DeepPartial`<`LineItem`\> |
| `options` | `Object` |
| `options` | `object` |
| `options.setOriginalLineItemId?` | `boolean` |
#### Returns
`Promise`<`LineItem`[]\>
-`Promise`:
-`LineItem[]`:
-`LineItem`:
#### Defined in
[medusa/src/services/line-item.ts:541](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L541)
[medusa/src/services/line-item.ts:541](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L541)
___
### create
▸ **create**<`T`, `TResult`\>(`data`): `Promise`<`TResult`\>
**create**<`T`, `TResult`\>(`data`): `Promise`<`TResult`\>
Create a line item
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | `LineItem` \| `LineItem`[] |
| `TResult` | `T` extends `LineItem`[] ? `LineItem`[] : `LineItem` |
| `T` | `object` |
| `TResult` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `T` | the line item object to create |
#### Returns
`Promise`<`TResult`\>
the created line item
-`Promise`: the created line item
#### Defined in
[medusa/src/services/line-item.ts:421](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L421)
[medusa/src/services/line-item.ts:421](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L421)
___
### createReturnLines
▸ **createReturnLines**(`returnId`, `cartId`): `Promise`<`LineItem`[]\>
**createReturnLines**(`returnId`, `cartId`): `Promise`<`LineItem`[]\>
Creates return line items for a given cart based on the return items in a
return.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `returnId` | `string` | the id to generate return items from. |
| `cartId` | `string` | the cart to assign the return line items to. |
@@ -327,106 +329,108 @@ return.
`Promise`<`LineItem`[]\>
the created line items
-`Promise`: the created line items
-`LineItem[]`:
-`LineItem`:
#### Defined in
[medusa/src/services/line-item.ts:131](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L131)
[medusa/src/services/line-item.ts:131](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L131)
___
### createTaxLine
▸ **createTaxLine**(`args`): `LineItemTaxLine`
**createTaxLine**(`args`): `LineItemTaxLine`
Create a line item tax line.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `args` | `DeepPartial`<`LineItemTaxLine`\> | tax line partial passed to the repo create method |
#### Returns
`LineItemTaxLine`
a new line item tax line
-`LineItemTaxLine`: a new line item tax line
#### Defined in
[medusa/src/services/line-item.ts:533](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L533)
[medusa/src/services/line-item.ts:533](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L533)
___
### delete
▸ **delete**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\>
**delete**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\>
Deletes a line item.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the id of the line item to delete |
#### Returns
`Promise`<`undefined` \| ``null`` \| `LineItem`\>
the result of the delete operation
-`Promise`: the result of the delete operation
-`undefined \| ``null`` \| LineItem`: (optional)
#### Defined in
[medusa/src/services/line-item.ts:494](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L494)
[medusa/src/services/line-item.ts:494](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L494)
___
### deleteWithTaxLines
▸ **deleteWithTaxLines**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\>
**deleteWithTaxLines**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the id of the line item to delete |
#### Returns
`Promise`<`undefined` \| ``null`` \| `LineItem`\>
the result of the delete operation
-`Promise`: the result of the delete operation
-`undefined \| ``null`` \| LineItem`: (optional)
**`Deprecated`**
**Deprecated**
no the cascade on the entity takes care of it
Deletes a line item with the tax lines.
#### Defined in
[medusa/src/services/line-item.ts:516](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L516)
[medusa/src/services/line-item.ts:516](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L516)
___
### generate
▸ **generate**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`, `context?`): `Promise`<`TResult`\>
**generate**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`, `context?`): `Promise`<`TResult`\>
Generate a single or multiple line item without persisting the data into the db
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | `string` \| `GenerateInputData` \| `GenerateInputData`[] |
| `TResult` | `T` extends `string` ? `LineItem` : `T` extends `LineItem` ? `LineItem` : `LineItem`[] |
| `T` | `object` |
| `TResult` | `object` |
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `variantIdOrData` | `T` |
| `regionIdOrContext` | `T` extends `string` ? `string` : `GenerateLineItemContext` |
| `quantity?` | `number` |
@@ -436,23 +440,25 @@ Generate a single or multiple line item without persisting the data into the db
`Promise`<`TResult`\>
-`Promise`:
#### Defined in
[medusa/src/services/line-item.ts:192](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L192)
[medusa/src/services/line-item.ts:192](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L192)
___
### generateLineItem
▸ `Protected` **generateLineItem**(`variant`, `quantity`, `context`): `Promise`<`LineItem`\>
`Protected` **generateLineItem**(`variant`, `quantity`, `context`): `Promise`<`LineItem`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `variant` | `Object` |
| Name |
| :------ |
| `variant` | `object` |
| `variant.id` | `string` |
| `variant.product` | `Object` |
| `variant.product` | `object` |
| `variant.product.discountable` | `boolean` |
| `variant.product.is_giftcard` | `boolean` |
| `variant.product.thumbnail` | ``null`` \| `string` |
@@ -466,20 +472,23 @@ ___
`Promise`<`LineItem`\>
-`Promise`:
-`LineItem`:
#### Defined in
[medusa/src/services/line-item.ts:337](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L337)
[medusa/src/services/line-item.ts:337](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L337)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`LineItem`[]\>
**list**(`selector`, `config?`): `Promise`<`LineItem`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `Selector`<`LineItem`\> |
| `config` | `FindConfig`<`LineItem`\> |
@@ -487,71 +496,78 @@ ___
`Promise`<`LineItem`[]\>
-`Promise`:
-`LineItem[]`:
-`LineItem`:
#### Defined in
[medusa/src/services/line-item.ts:84](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L84)
[medusa/src/services/line-item.ts:84](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L84)
___
### retrieve
▸ **retrieve**(`id`, `config?`): `Promise`<`LineItem`\>
**retrieve**(`id`, `config?`): `Promise`<`LineItem`\>
Retrieves a line item by its id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the id of the line item to retrieve |
| `config` | `Object` | the config to be used at query building |
| `config` | `object` | the config to be used at query building |
#### Returns
`Promise`<`LineItem`\>
the line item
-`Promise`: the line item
-`LineItem`:
#### Defined in
[medusa/src/services/line-item.ts:105](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L105)
[medusa/src/services/line-item.ts:105](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L105)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`idOrSelector`, `data`): `Promise`<`LineItem`[]\>
**update**(`idOrSelector`, `data`): `Promise`<`LineItem`[]\>
Updates a line item
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `idOrSelector` | `string` \| `Selector`<`LineItem`\> | the id or selector of the line item(s) to update |
| `data` | `Partial`<`LineItem`\> | the properties to update the line item(s) |
@@ -559,29 +575,29 @@ Updates a line item
`Promise`<`LineItem`[]\>
the updated line item(s)
-`Promise`: the updated line item(s)
-`LineItem[]`:
-`LineItem`:
#### Defined in
[medusa/src/services/line-item.ts:451](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L451)
[medusa/src/services/line-item.ts:451](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L451)
___
### validateGenerateArguments
▸ `Protected` **validateGenerateArguments**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`): `void`
#### Type parameters
`Protected` **validateGenerateArguments**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`): `void`
| Name | Type |
| :------ | :------ |
| `T` | `string` \| `GenerateInputData` \| `GenerateInputData`[] |
| `TResult` | `T` extends `string` ? `LineItem` : `T` extends `LineItem` ? `LineItem` : `LineItem`[] |
| `T` | `object` |
| `TResult` | `object` |
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `variantIdOrData` | `string` \| `T` |
| `regionIdOrContext` | `T` extends `string` ? `string` : `GenerateLineItemContext` |
| `quantity?` | `number` |
@@ -590,30 +606,34 @@ ___
`void`
-`void`: (optional)
#### Defined in
[medusa/src/services/line-item.ts:612](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L612)
[medusa/src/services/line-item.ts:612](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L612)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`LineItemService`](LineItemService.md)
**withTransaction**(`transactionManager?`): [`LineItemService`](LineItemService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`LineItemService`](LineItemService.md)
-`LineItemService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: MiddlewareService
# MiddlewareService
Orchestrates dynamic middleware registered through the Medusa Middleware API
@@ -6,134 +6,136 @@ Orchestrates dynamic middleware registered through the Medusa Middleware API
### constructor
• **new MiddlewareService**()
**new MiddlewareService**()
#### Defined in
[medusa/src/services/middleware.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L22)
[medusa/src/services/middleware.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L22)
## Properties
### postAuthentication\_
• `Protected` `Readonly` **postAuthentication\_**: `middlewareType`[]
`Protected` `Readonly` **postAuthentication\_**: `middlewareType`[]
#### Defined in
[medusa/src/services/middleware.ts:17](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L17)
[medusa/src/services/middleware.ts:17](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L17)
___
### preAuthentication\_
• `Protected` `Readonly` **preAuthentication\_**: `middlewareType`[]
`Protected` `Readonly` **preAuthentication\_**: `middlewareType`[]
#### Defined in
[medusa/src/services/middleware.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L18)
[medusa/src/services/middleware.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L18)
___
### preCartCreation\_
• `Protected` `Readonly` **preCartCreation\_**: `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>[]
`Protected` `Readonly` **preCartCreation\_**: `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\>[]
#### Defined in
[medusa/src/services/middleware.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L19)
[medusa/src/services/middleware.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L19)
___
### routers
• `Protected` `Readonly` **routers**: `Record`<`string`, `Router`[]\>
`Protected` `Readonly` **routers**: Record<`string`, `Router`[]\>
#### Defined in
[medusa/src/services/middleware.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L20)
[medusa/src/services/middleware.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L20)
## Methods
### addPostAuthentication
▸ **addPostAuthentication**(`middleware`, `options`): `void`
**addPostAuthentication**(`middleware`, `options`): `void`
Adds a middleware function to be called after authentication is completed.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `middleware` | `middlewareHandlerType` | the middleware function. Should return a middleware function. |
| `options` | `Record`<`string`, `unknown`\> | the arguments that will be passed to the middleware |
| `options` | Record<`string`, `unknown`\> | the arguments that will be passed to the middleware |
#### Returns
`void`
void
-`void`: (optional) void
#### Defined in
[medusa/src/services/middleware.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L60)
[medusa/src/services/middleware.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L60)
___
### addPreAuthentication
▸ **addPreAuthentication**(`middleware`, `options`): `void`
**addPreAuthentication**(`middleware`, `options`): `void`
Adds a middleware function to be called before authentication is completed.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `middleware` | `middlewareHandlerType` | the middleware function. Should return a middleware function. |
| `options` | `Record`<`string`, `unknown`\> | the arguments that will be passed to the middleware |
| `options` | Record<`string`, `unknown`\> | the arguments that will be passed to the middleware |
#### Returns
`void`
void
-`void`: (optional) void
#### Defined in
[medusa/src/services/middleware.ts:79](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L79)
[medusa/src/services/middleware.ts:79](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L79)
___
### addPreCartCreation
▸ **addPreCartCreation**(`middleware`): `void`
**addPreCartCreation**(`middleware`): `void`
Adds a middleware function to be called before cart creation
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `middleware` | `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\> | the middleware function. Should return a middleware function. |
| Name | Description |
| :------ | :------ |
| `middleware` | `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\> | the middleware function. Should return a middleware function. |
#### Returns
`void`
-`void`: (optional)
#### Defined in
[medusa/src/services/middleware.ts:96](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L96)
[medusa/src/services/middleware.ts:96](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L96)
___
### addRouter
▸ **addRouter**(`path`, `router`): `void`
**addRouter**(`path`, `router`): `void`
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `path` | `string` |
| `router` | `Router` |
@@ -141,108 +143,123 @@ ___
`void`
-`void`: (optional)
#### Defined in
[medusa/src/services/middleware.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L29)
[medusa/src/services/middleware.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L29)
___
### getRouters
▸ **getRouters**(`path`): `Router`[]
**getRouters**(`path`): `Router`[]
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `path` | `string` |
#### Returns
`Router`[]
-`Router[]`:
-`Router`:
#### Defined in
[medusa/src/services/middleware.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L34)
[medusa/src/services/middleware.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L34)
___
### usePostAuthentication
▸ **usePostAuthentication**(`app`): `void`
**usePostAuthentication**(`app`): `void`
Adds post authentication middleware to an express app.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `app` | `Router` | the express app to add the middleware to |
#### Returns
`void`
-`void`: (optional)
#### Defined in
[medusa/src/services/middleware.ts:106](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L106)
[medusa/src/services/middleware.ts:106](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L106)
___
### usePreAuthentication
▸ **usePreAuthentication**(`app`): `void`
**usePreAuthentication**(`app`): `void`
Adds pre authentication middleware to an express app.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `app` | `Router` | the express app to add the middleware to |
#### Returns
`void`
-`void`: (optional)
#### Defined in
[medusa/src/services/middleware.ts:117](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L117)
[medusa/src/services/middleware.ts:117](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L117)
___
### usePreCartCreation
▸ **usePreCartCreation**(): `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>[]
**usePreCartCreation**(): `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\>[]
#### Returns
`RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>[]
`RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\>[]
-`RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any\>\>[]`:
-`RequestHandler`:
-`any`: (optional)
-`any`: (optional)
-`Record`:
#### Defined in
[medusa/src/services/middleware.ts:123](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L123)
[medusa/src/services/middleware.ts:123](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L123)
___
### validateMiddleware\_
▸ **validateMiddleware_**(`fn`): `void`
**validateMiddleware_**(`fn`): `void`
Validates a middleware function, throws if fn is not of type function.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `fn` | `unknown` | the middleware function to validate. |
#### Returns
`void`
nothing if the middleware is a function
-`void`: (optional) nothing if the middleware is a function
#### Defined in
[medusa/src/services/middleware.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L43)
[medusa/src/services/middleware.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L43)
@@ -1,4 +1,4 @@
# Class: NewTotalsService
# NewTotalsService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new NewTotalsService**(`«destructured»`)
**new NewTotalsService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/new-totals.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L67)
[medusa/src/services/new-totals.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L67)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### featureFlagRouter\_
• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/new-totals.ts:64](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L64)
[medusa/src/services/new-totals.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L64)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -90,33 +90,33 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### taxCalculationStrategy\_
• `Protected` `Readonly` **taxCalculationStrategy\_**: `ITaxCalculationStrategy`
`Protected` `Readonly` **taxCalculationStrategy\_**: `ITaxCalculationStrategy`
#### Defined in
[medusa/src/services/new-totals.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L65)
[medusa/src/services/new-totals.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L65)
___
### taxProviderService\_
• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
`Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
#### Defined in
[medusa/src/services/new-totals.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L63)
[medusa/src/services/new-totals.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L63)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -124,47 +124,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -173,7 +173,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -181,22 +181,22 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### getGiftCardTotals
▸ **getGiftCardTotals**(`giftCardableAmount`, `«destructured»`): `Promise`<{ `tax_total`: `number` ; `total`: `number` }\>
**getGiftCardTotals**(`giftCardableAmount`, `«destructured»`): `Promise`<{ `tax_total`: `number` ; `total`: `number` }\>
Calculate and return the gift cards totals
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `giftCardableAmount` | `number` |
| `«destructured»` | `Object` |
| `«destructured»` | `object` |
| › `giftCardTransactions?` | `GiftCardTransaction`[] |
| › `giftCards?` | `GiftCard`[] |
| › `region` | `Region` |
@@ -205,31 +205,36 @@ Calculate and return the gift cards totals
`Promise`<{ `tax_total`: `number` ; `total`: `number` }\>
-`Promise`:
-``object``: (optional)
#### Defined in
[medusa/src/services/new-totals.ts:447](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L447)
[medusa/src/services/new-totals.ts:447](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L447)
___
### getGiftCardTransactionsTotals
▸ **getGiftCardTransactionsTotals**(`«destructured»`): `Object`
**getGiftCardTransactionsTotals**(`«destructured»`): { `tax_total`: `number` ; `total`: `number` }
Calculate and return the gift cards totals based on their transactions
#### Parameters
| Name | Type |
| :------ | :------ |
| `«destructured»` | `Object` |
| Name |
| :------ |
| `«destructured»` | `object` |
| › `giftCardTransactions` | `GiftCardTransaction`[] |
| › `region` | `Object` |
| › `region` | `object` |
| › `region.gift_cards_taxable` | `boolean` |
| › `region.tax_rate` | `number` |
#### Returns
`Object`
`object`
-``object``: (optional)
| Name | Type |
| :------ | :------ |
@@ -238,27 +243,54 @@ Calculate and return the gift cards totals based on their transactions
#### Defined in
[medusa/src/services/new-totals.ts:526](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L526)
[medusa/src/services/new-totals.ts:526](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L526)
___
### getGiftCardableAmount
**getGiftCardableAmount**(`«destructured»`): `number`
#### Parameters
| Name |
| :------ |
| `«destructured»` | `object` |
| › `discount_total` | `number` |
| › `gift_cards_taxable?` | `boolean` |
| › `shipping_total` | `number` |
| › `subtotal` | `number` |
| › `tax_total` | `number` |
#### Returns
`number`
-`number`: (optional)
#### Defined in
[medusa/src/services/new-totals.ts:638](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L638)
___
### getLineItemRefund
▸ **getLineItemRefund**(`lineItem`, `«destructured»`): `number`
**getLineItemRefund**(`lineItem`, `«destructured»`): `number`
Return the amount that can be refund on a line item
#### Parameters
| Name | Type |
| :------ | :------ |
| `lineItem` | `Object` |
| Name |
| :------ |
| `lineItem` | `object` |
| `lineItem.id` | `string` |
| `lineItem.includes_tax` | `boolean` |
| `lineItem.quantity` | `number` |
| `lineItem.tax_lines` | `LineItemTaxLine`[] |
| `lineItem.unit_price` | `number` |
| `«destructured»` | `Object` |
| `«destructured»` | `object` |
| › `calculationContext` | `TaxCalculationContext` |
| › `taxRate?` | ``null`` \| `number` |
@@ -266,26 +298,28 @@ Return the amount that can be refund on a line item
`number`
-`number`: (optional)
#### Defined in
[medusa/src/services/new-totals.ts:333](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L333)
[medusa/src/services/new-totals.ts:333](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L333)
___
### getLineItemRefundLegacy
▸ `Protected` **getLineItemRefundLegacy**(`lineItem`, `«destructured»`): `number`
`Protected` **getLineItemRefundLegacy**(`lineItem`, `«destructured»`): `number`
#### Parameters
| Name | Type |
| :------ | :------ |
| `lineItem` | `Object` |
| Name |
| :------ |
| `lineItem` | `object` |
| `lineItem.id` | `string` |
| `lineItem.includes_tax` | `boolean` |
| `lineItem.quantity` | `number` |
| `lineItem.unit_price` | `number` |
| `«destructured»` | `Object` |
| `«destructured»` | `object` |
| › `calculationContext` | `TaxCalculationContext` |
| › `taxRate` | `number` |
@@ -293,24 +327,26 @@ ___
`number`
-`number`: (optional)
#### Defined in
[medusa/src/services/new-totals.ts:403](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L403)
[medusa/src/services/new-totals.ts:403](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L403)
___
### getLineItemTotals
▸ **getLineItemTotals**(`items`, `«destructured»`): `Promise`<{ `[lineItemId: string]`: `LineItemTotals`; }\>
**getLineItemTotals**(`items`, `«destructured»`): `Promise`<{ `[lineItemId: string]`: `LineItemTotals`; }\>
Calculate and return the items totals for either the legacy calculation or the new calculation
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `items` | `LineItem` \| `LineItem`[] |
| `«destructured»` | `Object` |
| `«destructured»` | `object` |
| › `calculationContext` | `TaxCalculationContext` |
| › `includeTax?` | `boolean` |
| › `taxRate?` | ``null`` \| `number` |
@@ -319,26 +355,29 @@ Calculate and return the items totals for either the legacy calculation or the n
`Promise`<{ `[lineItemId: string]`: `LineItemTotals`; }\>
-`Promise`:
-``object``: (optional)
#### Defined in
[medusa/src/services/new-totals.ts:87](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L87)
[medusa/src/services/new-totals.ts:87](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L87)
___
### getLineItemTotalsLegacy
▸ `Protected` **getLineItemTotalsLegacy**(`item`, `«destructured»`): `Promise`<`LineItemTotals`\>
`Protected` **getLineItemTotalsLegacy**(`item`, `«destructured»`): `Promise`<`LineItemTotals`\>
Calculate and return the legacy calculated totals using the tax rate
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `item` | `LineItem` |
| `«destructured»` | `Object` |
| `«destructured»` | `object` |
| › `calculationContext` | `TaxCalculationContext` |
| › `lineItemAllocation` | `Object` |
| › `lineItemAllocation` | `object` |
| › `lineItemAllocation.discount?` | `DiscountAllocation` |
| › `lineItemAllocation.gift_card?` | `GiftCardAllocation` |
| › `taxRate` | `number` |
@@ -347,27 +386,29 @@ Calculate and return the legacy calculated totals using the tax rate
`Promise`<`LineItemTotals`\>
-`Promise`:
#### Defined in
[medusa/src/services/new-totals.ts:254](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L254)
[medusa/src/services/new-totals.ts:254](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L254)
___
### getLineItemTotals\_
▸ `Protected` **getLineItemTotals_**(`item`, `«destructured»`): `Promise`<`LineItemTotals`\>
`Protected` **getLineItemTotals_**(`item`, `«destructured»`): `Promise`<`LineItemTotals`\>
Calculate and return the totals for an item
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `item` | `LineItem` |
| `«destructured»` | `Object` |
| `«destructured»` | `object` |
| › `calculationContext` | `TaxCalculationContext` |
| › `includeTax?` | `boolean` |
| › `lineItemAllocation` | `Object` |
| › `lineItemAllocation` | `object` |
| › `lineItemAllocation.discount?` | `DiscountAllocation` |
| › `lineItemAllocation.gift_card?` | `GiftCardAllocation` |
| › `taxLines?` | `LineItemTaxLine`[] |
@@ -376,24 +417,26 @@ Calculate and return the totals for an item
`Promise`<`LineItemTotals`\>
-`Promise`:
#### Defined in
[medusa/src/services/new-totals.ts:147](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L147)
[medusa/src/services/new-totals.ts:147](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L147)
___
### getShippingMethodTotals
▸ **getShippingMethodTotals**(`shippingMethods`, `«destructured»`): `Promise`<{ `[shippingMethodId: string]`: `ShippingMethodTotals`; }\>
**getShippingMethodTotals**(`shippingMethods`, `«destructured»`): `Promise`<{ `[shippingMethodId: string]`: `ShippingMethodTotals`; }\>
Calculate and return the shipping methods totals for either the legacy calculation or the new calculation
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `shippingMethods` | `ShippingMethod` \| `ShippingMethod`[] |
| `«destructured»` | `Object` |
| `«destructured»` | `object` |
| › `calculationContext` | `TaxCalculationContext` |
| › `discounts?` | `Discount`[] |
| › `includeTax?` | `boolean` |
@@ -403,24 +446,27 @@ Calculate and return the shipping methods totals for either the legacy calculati
`Promise`<{ `[shippingMethodId: string]`: `ShippingMethodTotals`; }\>
-`Promise`:
-``object``: (optional)
#### Defined in
[medusa/src/services/new-totals.ts:572](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L572)
[medusa/src/services/new-totals.ts:572](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L572)
___
### getShippingMethodTotalsLegacy
▸ `Protected` **getShippingMethodTotalsLegacy**(`shippingMethod`, `«destructured»`): `Promise`<`ShippingMethodTotals`\>
`Protected` **getShippingMethodTotalsLegacy**(`shippingMethod`, `«destructured»`): `Promise`<`ShippingMethodTotals`\>
Calculate and return the shipping method totals legacy using the tax rate
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `shippingMethod` | `ShippingMethod` |
| `«destructured»` | `Object` |
| `«destructured»` | `object` |
| › `calculationContext` | `TaxCalculationContext` |
| › `discounts?` | `Discount`[] |
| › `taxRate` | `number` |
@@ -429,24 +475,26 @@ Calculate and return the shipping method totals legacy using the tax rate
`Promise`<`ShippingMethodTotals`\>
-`Promise`:
#### Defined in
[medusa/src/services/new-totals.ts:729](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L729)
[medusa/src/services/new-totals.ts:749](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L749)
___
### getShippingMethodTotals\_
▸ `Protected` **getShippingMethodTotals_**(`shippingMethod`, `«destructured»`): `Promise`<`ShippingMethodTotals`\>
`Protected` **getShippingMethodTotals_**(`shippingMethod`, `«destructured»`): `Promise`<`ShippingMethodTotals`\>
Calculate and return the shipping method totals
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `shippingMethod` | `ShippingMethod` |
| `«destructured»` | `Object` |
| `«destructured»` | `object` |
| › `calculationContext` | `TaxCalculationContext` |
| › `discounts?` | `Discount`[] |
| › `includeTax?` | `boolean` |
@@ -456,54 +504,60 @@ Calculate and return the shipping method totals
`Promise`<`ShippingMethodTotals`\>
-`Promise`:
#### Defined in
[medusa/src/services/new-totals.ts:646](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L646)
[medusa/src/services/new-totals.ts:666](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L666)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`NewTotalsService`](NewTotalsService.md)
**withTransaction**(`transactionManager?`): [`NewTotalsService`](NewTotalsService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`NewTotalsService`](NewTotalsService.md)
-`default`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: NoteService
# NoteService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new NoteService**(`«destructured»`)
**new NoteService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/note.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L28)
[medusa/src/services/note.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L28)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/note.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L26)
[medusa/src/services/note.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L26)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -90,23 +90,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### noteRepository\_
• `Protected` `Readonly` **noteRepository\_**: `Repository`<`Note`\>
`Protected` `Readonly` **noteRepository\_**: `Repository`<`Note`\>
#### Defined in
[medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L25)
[medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L25)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -114,13 +114,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -132,47 +132,47 @@ ___
#### Defined in
[medusa/src/services/note.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L19)
[medusa/src/services/note.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L19)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -181,7 +181,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -189,68 +189,71 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`, `config?`): `Promise`<`Note`\>
**create**(`data`, `config?`): `Promise`<`Note`\>
Creates a note associated with a given author
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `CreateNoteInput` | the note to create |
| `config` | `Object` | any configurations if needed, including meta data |
| `config.metadata` | `Record`<`string`, `unknown`\> | - |
| `config` | `object` | any configurations if needed, including meta data |
| `config.metadata` | Record<`string`, `unknown`\> |
#### Returns
`Promise`<`Note`\>
resolves to the creation result
-`Promise`: resolves to the creation result
-`Note`:
#### Defined in
[medusa/src/services/note.ts:119](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L119)
[medusa/src/services/note.ts:119](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L119)
___
### delete
▸ **delete**(`noteId`): `Promise`<`void`\>
**delete**(`noteId`): `Promise`<`void`\>
Deletes a given note
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `noteId` | `string` | id of the note to delete |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/note.ts:177](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L177)
[medusa/src/services/note.ts:177](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L177)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`Note`[]\>
**list**(`selector`, `config?`): `Promise`<`Note`[]\>
Fetches all notes related to the given selector
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Note`\> | the query object for find |
| `config` | `FindConfig`<`Note`\> | the configuration used to find the objects. contains relations, skip, and take. |
@@ -258,24 +261,26 @@ Fetches all notes related to the given selector
`Promise`<`Note`[]\>
notes related to the given search.
-`Promise`: notes related to the given search.
-`Note[]`:
-`Note`:
#### Defined in
[medusa/src/services/note.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L77)
[medusa/src/services/note.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L77)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Note`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`Note`[], `number`]\>
Fetches all notes related to the given selector
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Note`\> | the query object for find |
| `config` | `FindConfig`<`Note`\> | the configuration used to find the objects. contains relations, skip, and take. |
@@ -283,24 +288,26 @@ Fetches all notes related to the given selector
`Promise`<[`Note`[], `number`]\>
notes related to the given search.
-`Promise`: notes related to the given search.
-`Note[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/note.ts:98](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L98)
[medusa/src/services/note.ts:98](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L98)
___
### retrieve
▸ **retrieve**(`noteId`, `config?`): `Promise`<`Note`\>
**retrieve**(`noteId`, `config?`): `Promise`<`Note`\>
Retrieves a specific note.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `noteId` | `string` | the id of the note to retrieve. |
| `config` | `FindConfig`<`Note`\> | any options needed to query for the result. |
@@ -308,48 +315,51 @@ Retrieves a specific note.
`Promise`<`Note`\>
which resolves to the requested note.
-`Promise`: which resolves to the requested note.
-`Note`:
#### Defined in
[medusa/src/services/note.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L42)
[medusa/src/services/note.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L42)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`noteId`, `value`): `Promise`<`Note`\>
**update**(`noteId`, `value`): `Promise`<`Note`\>
Updates a given note with a new value
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `noteId` | `string` | the id of the note to update |
| `value` | `string` | the new value |
@@ -357,32 +367,35 @@ Updates a given note with a new value
`Promise`<`Note`\>
resolves to the updated element
-`Promise`: resolves to the updated element
-`Note`:
#### Defined in
[medusa/src/services/note.ts:155](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L155)
[medusa/src/services/note.ts:155](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L155)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`NoteService`](NoteService.md)
**withTransaction**(`transactionManager?`): [`NoteService`](NoteService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`NoteService`](NoteService.md)
-`NoteService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: NotificationService
# NotificationService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new NotificationService**(`container`)
**new NotificationService**(`container`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `container` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/notification.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L34)
[medusa/src/services/notification.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L34)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### attachmentGenerator\_
• `Protected` **attachmentGenerator\_**: `unknown` = `null`
`Protected` **attachmentGenerator\_**: `unknown` = `null`
#### Defined in
[medusa/src/services/notification.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L25)
[medusa/src/services/notification.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L25)
___
### container\_
• `Protected` `Readonly` **container\_**: `InjectedDependencies` & {}
`Protected` `Readonly` **container\_**: `InjectedDependencies` & {}
#### Defined in
[medusa/src/services/notification.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L26)
[medusa/src/services/notification.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L26)
___
### logger\_
• `Protected` `Readonly` **logger\_**: `Logger`
`Protected` `Readonly` **logger\_**: `Logger`
#### Defined in
[medusa/src/services/notification.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L29)
[medusa/src/services/notification.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L29)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -110,43 +110,43 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### notificationProviderRepository\_
• `Protected` `Readonly` **notificationProviderRepository\_**: `Repository`<`NotificationProvider`\>
`Protected` `Readonly` **notificationProviderRepository\_**: `Repository`<`NotificationProvider`\>
#### Defined in
[medusa/src/services/notification.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L32)
[medusa/src/services/notification.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L32)
___
### notificationRepository\_
• `Protected` `Readonly` **notificationRepository\_**: `Repository`<`Notification`\>
`Protected` `Readonly` **notificationRepository\_**: `Repository`<`Notification`\>
#### Defined in
[medusa/src/services/notification.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L30)
[medusa/src/services/notification.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L30)
___
### subscribers\_
• `Protected` **subscribers\_**: `Object` = `{}`
`Protected` **subscribers\_**: `object` = `{}`
#### Defined in
[medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L24)
[medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L24)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -154,47 +154,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -203,7 +203,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -211,13 +211,13 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### handleEvent
▸ **handleEvent**(`eventName`, `data`): `Promise`<`undefined` \| `void` \| `Notification`[]\>
**handleEvent**(`eventName`, `data`): `Promise`<`undefined` \| `void` \| `Notification`[]\>
Handles an event by relaying the event data to the subscribing providers.
The result of the notification send will be persisted in the database in
@@ -225,33 +225,34 @@ order to allow for resends. Will log any errors that are encountered.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `eventName` | `string` | the event to handle |
| `data` | `Record`<`string`, `unknown`\> | the data the event was sent with |
| `data` | Record<`string`, `unknown`\> | the data the event was sent with |
#### Returns
`Promise`<`undefined` \| `void` \| `Notification`[]\>
the result of notification subscribed
-`Promise`: the result of notification subscribed
-`undefined \| void \| Notification[]`: (optional)
#### Defined in
[medusa/src/services/notification.ts:185](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L185)
[medusa/src/services/notification.ts:185](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L185)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`Notification`[]\>
**list**(`selector`, `config?`): `Promise`<`Notification`[]\>
Retrieves a list of notifications.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Notification`\> | the params to select the notifications by. |
| `config` | `FindConfig`<`Notification`\> | the configuration to apply to the query |
@@ -259,24 +260,26 @@ Retrieves a list of notifications.
`Promise`<`Notification`[]\>
the notifications that satisfy the query.
-`Promise`: the notifications that satisfy the query.
-`Notification[]`:
-`Notification`:
#### Defined in
[medusa/src/services/notification.ts:78](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L78)
[medusa/src/services/notification.ts:78](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L78)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Notification`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`Notification`[], `number`]\>
Retrieves a list of notifications and total count.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Notification`\> | the params to select the notifications by. |
| `config` | `FindConfig`<`Notification`\> | the configuration to apply to the query |
@@ -284,70 +287,76 @@ Retrieves a list of notifications and total count.
`Promise`<[`Notification`[], `number`]\>
the notifications that satisfy the query as well as the count.
-`Promise`: the notifications that satisfy the query as well as the count.
-`Notification[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/notification.ts:97](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L97)
[medusa/src/services/notification.ts:97](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L97)
___
### registerAttachmentGenerator
▸ **registerAttachmentGenerator**(`service`): `void`
**registerAttachmentGenerator**(`service`): `void`
Registers an attachment generator to the service. The generator can be
used to generate on demand invoices or other documents.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `service` | `unknown` | the service to assign to the attachmentGenerator |
#### Returns
`void`
-`void`: (optional)
#### Defined in
[medusa/src/services/notification.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L52)
[medusa/src/services/notification.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L52)
___
### registerInstalledProviders
▸ **registerInstalledProviders**(`providerIds`): `Promise`<`void`\>
**registerInstalledProviders**(`providerIds`): `Promise`<`void`\>
Takes a list of notification provider ids and persists them in the database.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `providerIds` | `string`[] | a list of provider ids |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/notification.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L60)
[medusa/src/services/notification.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L60)
___
### resend
▸ **resend**(`id`, `config?`): `Promise`<`Notification`\>
**resend**(`id`, `config?`): `Promise`<`Notification`\>
Resends a notification by retrieving a prior notification and calling the
underlying provider's resendNotification method.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the id of the notification |
| `config` | `FindConfig`<`Notification`\> | any configuration that might override the previous send |
@@ -355,24 +364,25 @@ underlying provider's resendNotification method.
`Promise`<`Notification`\>
the newly created notification
-`Promise`: the newly created notification
-`Notification`:
#### Defined in
[medusa/src/services/notification.ts:265](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L265)
[medusa/src/services/notification.ts:265](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L265)
___
### retrieve
▸ **retrieve**(`id`, `config?`): `Promise`<`Notification`\>
**retrieve**(`id`, `config?`): `Promise`<`Notification`\>
Retrieves a notification with a given id
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the id of the notification |
| `config` | `FindConfig`<`Notification`\> | the configuration to apply to the query |
@@ -380,100 +390,104 @@ Retrieves a notification with a given id
`Promise`<`Notification`\>
the notification
-`Promise`: the notification
-`Notification`:
#### Defined in
[medusa/src/services/notification.ts:118](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L118)
[medusa/src/services/notification.ts:118](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L118)
___
### retrieveProvider\_
▸ `Protected` **retrieveProvider_**(`id`): `AbstractNotificationService`
`Protected` **retrieveProvider_**(`id`): `AbstractNotificationService`
Finds a provider with a given id. Will throw a NOT_FOUND error if the
resolution fails.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the id of the provider |
#### Returns
`AbstractNotificationService`
the notification provider
-`AbstractNotificationService`: the notification provider
#### Defined in
[medusa/src/services/notification.ts:166](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L166)
[medusa/src/services/notification.ts:166](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L166)
___
### send
▸ **send**(`event`, `eventData`, `providerId`): `Promise`<`undefined` \| `Notification`\>
**send**(`event`, `eventData`, `providerId`): `Promise`<`undefined` \| `Notification`\>
Sends a notification, by calling the given provider's sendNotification
method. Persists the Notification in the database.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `event` | `string` | the name of the event |
| `eventData` | `Record`<`string`, `unknown`\> | the data the event was sent with |
| `eventData` | Record<`string`, `unknown`\> | the data the event was sent with |
| `providerId` | `string` | the provider that should handle the event. |
#### Returns
`Promise`<`undefined` \| `Notification`\>
the created notification
-`Promise`: the created notification
-`undefined \| Notification`: (optional)
#### Defined in
[medusa/src/services/notification.ts:217](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L217)
[medusa/src/services/notification.ts:217](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L217)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### subscribe
▸ **subscribe**(`eventName`, `providerId`): `void`
**subscribe**(`eventName`, `providerId`): `void`
Subscribes a given provider to an event.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `eventName` | `string` | the event to subscribe to |
| `providerId` | `string` | the provider that the event will be sent to |
@@ -481,30 +495,34 @@ Subscribes a given provider to an event.
`void`
-`void`: (optional)
#### Defined in
[medusa/src/services/notification.ts:145](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L145)
[medusa/src/services/notification.ts:145](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L145)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`NotificationService`](NotificationService.md)
**withTransaction**(`transactionManager?`): [`NotificationService`](NotificationService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`NotificationService`](NotificationService.md)
-`NotificationService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: OauthService
# OauthService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new OauthService**(`cradle`)
**new OauthService**(`cradle`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `cradle` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L28)
[medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L28)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### container\_
• `Protected` **container\_**: `InjectedDependencies`
`Protected` **container\_**: `InjectedDependencies`
#### Defined in
[medusa/src/services/oauth.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L24)
[medusa/src/services/oauth.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L24)
___
### eventBus\_
• `Protected` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L26)
[medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L26)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -100,23 +100,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### oauthRepository\_
• `Protected` **oauthRepository\_**: `Repository`<`Oauth`\>
`Protected` **oauthRepository\_**: `Repository`<`Oauth`\>
#### Defined in
[medusa/src/services/oauth.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L25)
[medusa/src/services/oauth.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L25)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -124,13 +124,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -141,47 +141,47 @@ ___
#### Defined in
[medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L19)
[medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L19)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -190,7 +190,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -198,38 +198,41 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`Oauth`\>
**create**(`data`): `Promise`<`Oauth`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateOauthInput` |
#### Returns
`Promise`<`Oauth`\>
-`Promise`:
-`Oauth`:
#### Defined in
[medusa/src/services/oauth.ts:87](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L87)
[medusa/src/services/oauth.ts:87](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L87)
___
### generateToken
▸ **generateToken**(`appName`, `code`, `state`): `Promise`<`Oauth`\>
**generateToken**(`appName`, `code`, `state`): `Promise`<`Oauth`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `appName` | `string` |
| `code` | `string` |
| `state` | `string` |
@@ -238,144 +241,165 @@ ___
`Promise`<`Oauth`\>
-`Promise`:
-`Oauth`:
#### Defined in
[medusa/src/services/oauth.ts:121](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L121)
[medusa/src/services/oauth.ts:121](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L121)
___
### list
▸ **list**(`selector`): `Promise`<`Oauth`[]\>
**list**(`selector`): `Promise`<`Oauth`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `Selector`<`Oauth`\> |
#### Returns
`Promise`<`Oauth`[]\>
-`Promise`:
-`Oauth[]`:
-`Oauth`:
#### Defined in
[medusa/src/services/oauth.ts:79](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L79)
[medusa/src/services/oauth.ts:79](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L79)
___
### refreshToken
▸ **refreshToken**(`appName`): `Promise`<`Oauth`\>
**refreshToken**(`appName`): `Promise`<`Oauth`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `appName` | `string` |
#### Returns
`Promise`<`Oauth`\>
-`Promise`:
-`Oauth`:
#### Defined in
[medusa/src/services/oauth.ts:155](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L155)
[medusa/src/services/oauth.ts:155](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L155)
___
### registerOauthApp
▸ **registerOauthApp**(`appDetails`): `Promise`<`Oauth`\>
**registerOauthApp**(`appDetails`): `Promise`<`Oauth`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `appDetails` | `CreateOauthInput` |
#### Returns
`Promise`<`Oauth`\>
-`Promise`:
-`Oauth`:
#### Defined in
[medusa/src/services/oauth.ts:111](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L111)
[medusa/src/services/oauth.ts:111](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L111)
___
### retrieve
▸ **retrieve**(`oauthId`): `Promise`<`Oauth`\>
**retrieve**(`oauthId`): `Promise`<`Oauth`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `oauthId` | `string` |
#### Returns
`Promise`<`Oauth`\>
-`Promise`:
-`Oauth`:
#### Defined in
[medusa/src/services/oauth.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L54)
[medusa/src/services/oauth.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L54)
___
### retrieveByName
▸ **retrieveByName**(`appName`): `Promise`<`Oauth`\>
**retrieveByName**(`appName`): `Promise`<`Oauth`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `appName` | `string` |
#### Returns
`Promise`<`Oauth`\>
-`Promise`:
-`Oauth`:
#### Defined in
[medusa/src/services/oauth.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L36)
[medusa/src/services/oauth.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L36)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`id`, `update`): `Promise`<`Oauth`\>
**update**(`id`, `update`): `Promise`<`Oauth`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
| `update` | `UpdateOauthInput` |
@@ -383,30 +407,35 @@ ___
`Promise`<`Oauth`\>
-`Promise`:
-`Oauth`:
#### Defined in
[medusa/src/services/oauth.ts:100](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L100)
[medusa/src/services/oauth.ts:100](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L100)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`OauthService`](OauthService.md)
**withTransaction**(`transactionManager?`): [`OauthService`](OauthService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`OauthService`](OauthService.md)
-`Oauth`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: OrderEditItemChangeService
# OrderEditItemChangeService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new OrderEditItemChangeService**(`«destructured»`)
**new OrderEditItemChangeService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/order-edit-item-change.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L33)
[medusa/src/services/order-edit-item-change.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L33)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: `IEventBusService`
`Protected` `Readonly` **eventBus\_**: `IEventBusService`
#### Defined in
[medusa/src/services/order-edit-item-change.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L29)
[medusa/src/services/order-edit-item-change.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L29)
___
### lineItemService\_
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
`Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
#### Defined in
[medusa/src/services/order-edit-item-change.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L30)
[medusa/src/services/order-edit-item-change.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L30)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -100,33 +100,33 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### orderItemChangeRepository\_
• `Protected` `Readonly` **orderItemChangeRepository\_**: `Repository`<`OrderItemChange`\>
`Protected` `Readonly` **orderItemChangeRepository\_**: `Repository`<`OrderItemChange`\>
#### Defined in
[medusa/src/services/order-edit-item-change.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L28)
[medusa/src/services/order-edit-item-change.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L28)
___
### taxProviderService\_
• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
`Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
#### Defined in
[medusa/src/services/order-edit-item-change.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L31)
[medusa/src/services/order-edit-item-change.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L31)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -134,13 +134,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -151,47 +151,47 @@ ___
#### Defined in
[medusa/src/services/order-edit-item-change.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L22)
[medusa/src/services/order-edit-item-change.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L22)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -200,7 +200,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -208,58 +208,63 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`OrderItemChange`\>
**create**(`data`): `Promise`<`OrderItemChange`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateOrderEditItemChangeInput` |
#### Returns
`Promise`<`OrderItemChange`\>
-`Promise`:
-`OrderItemChange`:
#### Defined in
[medusa/src/services/order-edit-item-change.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L81)
[medusa/src/services/order-edit-item-change.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L81)
___
### delete
▸ **delete**(`itemChangeIds`): `Promise`<`void`\>
**delete**(`itemChangeIds`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `itemChangeIds` | `string` \| `string`[] |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/order-edit-item-change.ts:97](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L97)
[medusa/src/services/order-edit-item-change.ts:97](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L97)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`OrderItemChange`[]\>
**list**(`selector`, `config?`): `Promise`<`OrderItemChange`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `Selector`<`OrderItemChange`\> |
| `config` | `FindConfig`<`OrderItemChange`\> |
@@ -267,20 +272,24 @@ ___
`Promise`<`OrderItemChange`[]\>
-`Promise`:
-`OrderItemChange[]`:
-`OrderItemChange`:
#### Defined in
[medusa/src/services/order-edit-item-change.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L69)
[medusa/src/services/order-edit-item-change.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L69)
___
### retrieve
▸ **retrieve**(`id`, `config?`): `Promise`<`OrderItemChange`\>
**retrieve**(`id`, `config?`): `Promise`<`OrderItemChange`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
| `config` | `FindConfig`<`OrderItemChange`\> |
@@ -288,54 +297,61 @@ ___
`Promise`<`OrderItemChange`\>
-`Promise`:
-`OrderItemChange`:
#### Defined in
[medusa/src/services/order-edit-item-change.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L48)
[medusa/src/services/order-edit-item-change.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L48)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`OrderEditItemChangeService`](OrderEditItemChangeService.md)
**withTransaction**(`transactionManager?`): [`OrderEditItemChangeService`](OrderEditItemChangeService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`OrderEditItemChangeService`](OrderEditItemChangeService.md)
-`default`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: OrderEditService
# OrderEditService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new OrderEditService**(`«destructured»`)
**new OrderEditService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/order-edit.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L75)
[medusa/src/services/order-edit.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L75)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,53 +66,53 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/order-edit.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L69)
[medusa/src/services/order-edit.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L69)
___
### inventoryService\_
• `Protected` `Readonly` **inventoryService\_**: `undefined` \| `IInventoryService`
`Protected` `Readonly` **inventoryService\_**: `undefined` \| `IInventoryService`
#### Defined in
[medusa/src/services/order-edit.ts:73](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L73)
[medusa/src/services/order-edit.ts:73](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L73)
___
### lineItemAdjustmentService\_
• `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md)
`Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md)
#### Defined in
[medusa/src/services/order-edit.ts:71](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L71)
[medusa/src/services/order-edit.ts:71](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L71)
___
### lineItemService\_
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
`Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
#### Defined in
[medusa/src/services/order-edit.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L68)
[medusa/src/services/order-edit.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L68)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -120,73 +120,73 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### newTotalsService\_
• `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md)
`Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md)
#### Defined in
[medusa/src/services/order-edit.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L67)
[medusa/src/services/order-edit.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L67)
___
### orderEditItemChangeService\_
• `Protected` `Readonly` **orderEditItemChangeService\_**: [`OrderEditItemChangeService`](OrderEditItemChangeService.md)
`Protected` `Readonly` **orderEditItemChangeService\_**: [`OrderEditItemChangeService`](OrderEditItemChangeService.md)
#### Defined in
[medusa/src/services/order-edit.ts:72](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L72)
[medusa/src/services/order-edit.ts:72](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L72)
___
### orderEditRepository\_
• `Protected` `Readonly` **orderEditRepository\_**: `Repository`<`OrderEdit`\>
`Protected` `Readonly` **orderEditRepository\_**: `Repository`<`OrderEdit`\>
#### Defined in
[medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L63)
[medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L63)
___
### orderService\_
• `Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md)
`Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md)
#### Defined in
[medusa/src/services/order-edit.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L65)
[medusa/src/services/order-edit.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L65)
___
### taxProviderService\_
• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
`Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
#### Defined in
[medusa/src/services/order-edit.ts:70](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L70)
[medusa/src/services/order-edit.ts:70](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L70)
___
### totalsService\_
• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
`Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
#### Defined in
[medusa/src/services/order-edit.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L66)
[medusa/src/services/order-edit.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L66)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -194,13 +194,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -215,36 +215,38 @@ ___
#### Defined in
[medusa/src/services/order-edit.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L54)
[medusa/src/services/order-edit.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L54)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addLineItem
▸ **addLineItem**(`orderEditId`, `data`): `Promise`<`void`\>
**addLineItem**(`orderEditId`, `data`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `data` | `AddOrderEditLineItemInput` |
@@ -252,31 +254,31 @@ TransactionBaseService.activeManager\_
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/order-edit.ts:541](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L541)
[medusa/src/services/order-edit.ts:541](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L541)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -285,7 +287,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -293,86 +295,95 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### cancel
▸ **cancel**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\>
**cancel**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `context` | `Object` |
| `context` | `object` |
| `context.canceledBy?` | `string` |
#### Returns
`Promise`<`OrderEdit`\>
-`Promise`:
-`OrderEdit`:
#### Defined in
[medusa/src/services/order-edit.ts:687](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L687)
[medusa/src/services/order-edit.ts:687](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L687)
___
### confirm
▸ **confirm**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\>
**confirm**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `context` | `Object` |
| `context` | `object` |
| `context.confirmedBy?` | `string` |
#### Returns
`Promise`<`OrderEdit`\>
-`Promise`:
-`OrderEdit`:
#### Defined in
[medusa/src/services/order-edit.ts:726](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L726)
[medusa/src/services/order-edit.ts:726](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L726)
___
### create
▸ **create**(`data`, `context`): `Promise`<`OrderEdit`\>
**create**(`data`, `context`): `Promise`<`OrderEdit`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateOrderEditInput` |
| `context` | `Object` |
| `context` | `object` |
| `context.createdBy` | `string` |
#### Returns
`Promise`<`OrderEdit`\>
-`Promise`:
-`OrderEdit`:
#### Defined in
[medusa/src/services/order-edit.ts:162](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L162)
[medusa/src/services/order-edit.ts:162](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L162)
___
### decline
▸ **decline**(`orderEditId`, `context`): `Promise`<`OrderEdit`\>
**decline**(`orderEditId`, `context`): `Promise`<`OrderEdit`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `context` | `Object` |
| `context` | `object` |
| `context.declinedBy?` | `string` |
| `context.declinedReason?` | `string` |
@@ -380,80 +391,90 @@ ___
`Promise`<`OrderEdit`\>
-`Promise`:
-`OrderEdit`:
#### Defined in
[medusa/src/services/order-edit.ts:260](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L260)
[medusa/src/services/order-edit.ts:260](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L260)
___
### decorateTotals
▸ **decorateTotals**(`orderEdit`): `Promise`<`OrderEdit`\>
**decorateTotals**(`orderEdit`): `Promise`<`OrderEdit`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEdit` | `OrderEdit` |
#### Returns
`Promise`<`OrderEdit`\>
-`Promise`:
-`OrderEdit`:
#### Defined in
[medusa/src/services/order-edit.ts:490](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L490)
[medusa/src/services/order-edit.ts:490](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L490)
___
### delete
▸ **delete**(`id`): `Promise`<`void`\>
**delete**(`id`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/order-edit.ts:238](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L238)
[medusa/src/services/order-edit.ts:238](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L238)
___
### deleteClonedItems
▸ `Protected` **deleteClonedItems**(`orderEditId`): `Promise`<`void`\>
`Protected` **deleteClonedItems**(`orderEditId`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/order-edit.ts:808](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L808)
[medusa/src/services/order-edit.ts:808](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L808)
___
### deleteItemChange
▸ **deleteItemChange**(`orderEditId`, `itemChangeId`): `Promise`<`void`\>
**deleteItemChange**(`orderEditId`, `itemChangeId`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `itemChangeId` | `string` |
@@ -461,20 +482,22 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/order-edit.ts:613](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L613)
[medusa/src/services/order-edit.ts:613](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L613)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`OrderEdit`[]\>
**list**(`selector`, `config?`): `Promise`<`OrderEdit`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `Selector`<`OrderEdit`\> |
| `config?` | `FindConfig`<`OrderEdit`\> |
@@ -482,20 +505,24 @@ ___
`Promise`<`OrderEdit`[]\>
-`Promise`:
-`OrderEdit[]`:
-`OrderEdit`:
#### Defined in
[medusa/src/services/order-edit.ts:154](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L154)
[medusa/src/services/order-edit.ts:154](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L154)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`OrderEdit`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`OrderEdit`[], `number`]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `Selector`<`OrderEdit`\> & { `q?`: `string` } |
| `config?` | `FindConfig`<`OrderEdit`\> |
@@ -503,42 +530,48 @@ ___
`Promise`<[`OrderEdit`[], `number`]\>
-`Promise`:
-`OrderEdit[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/order-edit.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L130)
[medusa/src/services/order-edit.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L130)
___
### refreshAdjustments
▸ **refreshAdjustments**(`orderEditId`, `config?`): `Promise`<`void`\>
**refreshAdjustments**(`orderEditId`, `config?`): `Promise`<`void`\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `orderEditId` | `string` | `undefined` |
| `config` | `Object` | `undefined` |
| Name | Default value |
| :------ | :------ |
| `orderEditId` | `string` |
| `config` | `object` |
| `config.preserveCustomAdjustments` | `boolean` | `false` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/order-edit.ts:439](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L439)
[medusa/src/services/order-edit.ts:439](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L439)
___
### removeLineItem
▸ **removeLineItem**(`orderEditId`, `lineItemId`): `Promise`<`void`\>
**removeLineItem**(`orderEditId`, `lineItemId`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `lineItemId` | `string` |
@@ -546,42 +579,47 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/order-edit.ts:382](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L382)
[medusa/src/services/order-edit.ts:382](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L382)
___
### requestConfirmation
▸ **requestConfirmation**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\>
**requestConfirmation**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `context` | `Object` |
| `context` | `object` |
| `context.requestedBy?` | `string` |
#### Returns
`Promise`<`OrderEdit`\>
-`Promise`:
-`OrderEdit`:
#### Defined in
[medusa/src/services/order-edit.ts:645](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L645)
[medusa/src/services/order-edit.ts:645](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L645)
___
### retrieve
▸ **retrieve**(`orderEditId`, `config?`): `Promise`<`OrderEdit`\>
**retrieve**(`orderEditId`, `config?`): `Promise`<`OrderEdit`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `config` | `FindConfig`<`OrderEdit`\> |
@@ -589,20 +627,23 @@ ___
`Promise`<`OrderEdit`\>
-`Promise`:
-`OrderEdit`:
#### Defined in
[medusa/src/services/order-edit.ts:102](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L102)
[medusa/src/services/order-edit.ts:102](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L102)
___
### retrieveActive
▸ `Protected` **retrieveActive**(`orderId`, `config?`): `Promise`<`undefined` \| ``null`` \| `OrderEdit`\>
`Protected` **retrieveActive**(`orderId`, `config?`): `Promise`<`undefined` \| ``null`` \| `OrderEdit`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderId` | `string` |
| `config` | `FindConfig`<`OrderEdit`\> |
@@ -610,44 +651,49 @@ ___
`Promise`<`undefined` \| ``null`` \| `OrderEdit`\>
-`Promise`:
-`undefined \| ``null`` \| OrderEdit`: (optional)
#### Defined in
[medusa/src/services/order-edit.ts:788](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L788)
[medusa/src/services/order-edit.ts:788](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L788)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`orderEditId`, `data`): `Promise`<`OrderEdit`\>
**update**(`orderEditId`, `data`): `Promise`<`OrderEdit`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `data` | `DeepPartial`<`OrderEdit`\> |
@@ -655,15 +701,18 @@ ___
`Promise`<`OrderEdit`\>
-`Promise`:
-`OrderEdit`:
#### Defined in
[medusa/src/services/order-edit.ts:211](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L211)
[medusa/src/services/order-edit.ts:211](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L211)
___
### updateLineItem
▸ **updateLineItem**(`orderEditId`, `itemId`, `data`): `Promise`<`void`\>
**updateLineItem**(`orderEditId`, `itemId`, `data`): `Promise`<`void`\>
Create or update order edit item change line item and apply the quantity
- If the item change already exists then update the quantity of the line item as well as the line adjustments
@@ -671,61 +720,67 @@ Create or update order edit item change line item and apply the quantity
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEditId` | `string` |
| `itemId` | `string` |
| `data` | `Object` |
| `data` | `object` |
| `data.quantity` | `number` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/order-edit.ts:309](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L309)
[medusa/src/services/order-edit.ts:309](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L309)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`OrderEditService`](OrderEditService.md)
**withTransaction**(`transactionManager?`): [`OrderEditService`](OrderEditService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`OrderEditService`](OrderEditService.md)
-`default`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
___
### isOrderEditActive
▸ `Static` `Private` **isOrderEditActive**(`orderEdit`): `boolean`
`Static` `Private` **isOrderEditActive**(`orderEdit`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `orderEdit` | `OrderEdit` |
#### Returns
`boolean`
-`boolean`: (optional)
#### Defined in
[medusa/src/services/order-edit.ts:860](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L860)
[medusa/src/services/order-edit.ts:860](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L860)
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,4 @@
# Class: PaymentCollectionService
# PaymentCollectionService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new PaymentCollectionService**(`«destructured»`)
**new PaymentCollectionService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L46)
[medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L46)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### customerService\_
• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md)
`Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md)
#### Defined in
[medusa/src/services/payment-collection.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L42)
[medusa/src/services/payment-collection.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L42)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/payment-collection.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L40)
[medusa/src/services/payment-collection.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L40)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -100,33 +100,33 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### paymentCollectionRepository\_
• `Protected` `Readonly` **paymentCollectionRepository\_**: `Repository`<`PaymentCollection`\> & { `getPaymentCollectionIdByPaymentId`: (`paymentId`: `string`, `config`: `FindManyOptions`<`PaymentCollection`\>) => `Promise`<`PaymentCollection`\> ; `getPaymentCollectionIdBySessionId`: (`sessionId`: `string`, `config`: `FindManyOptions`<`PaymentCollection`\>) => `Promise`<`PaymentCollection`\> }
`Protected` `Readonly` **paymentCollectionRepository\_**: `Repository`<`PaymentCollection`\> & { `getPaymentCollectionIdByPaymentId`: Method getPaymentCollectionIdByPaymentId ; `getPaymentCollectionIdBySessionId`: Method getPaymentCollectionIdBySessionId }
#### Defined in
[medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L44)
[medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L44)
___
### paymentProviderService\_
• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
`Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
#### Defined in
[medusa/src/services/payment-collection.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L41)
[medusa/src/services/payment-collection.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L41)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -134,13 +134,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -153,47 +153,47 @@ ___
#### Defined in
[medusa/src/services/payment-collection.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L33)
[medusa/src/services/payment-collection.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L33)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -202,7 +202,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -210,92 +210,95 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### authorizePaymentSessions
▸ **authorizePaymentSessions**(`paymentCollectionId`, `sessionIds`, `context?`): `Promise`<`PaymentCollection`\>
**authorizePaymentSessions**(`paymentCollectionId`, `sessionIds`, `context?`): `Promise`<`PaymentCollection`\>
Authorizes the payment sessions of a payment collection.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentCollectionId` | `string` | the id of the payment collection |
| `sessionIds` | `string`[] | array of payment session ids to be authorized |
| `context` | `Record`<`string`, `unknown`\> | additional data required by payment providers |
| `context` | Record<`string`, `unknown`\> | additional data required by payment providers |
#### Returns
`Promise`<`PaymentCollection`\>
the payment collection and its payment session.
-`Promise`: the payment collection and its payment session.
-`PaymentCollection`:
#### Defined in
[medusa/src/services/payment-collection.ts:528](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L528)
[medusa/src/services/payment-collection.ts:528](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L528)
___
### create
▸ **create**(`data`): `Promise`<`PaymentCollection`\>
**create**(`data`): `Promise`<`PaymentCollection`\>
Creates a new payment collection.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `CreatePaymentCollectionInput` | info to create the payment collection |
#### Returns
`Promise`<`PaymentCollection`\>
the payment collection created.
-`Promise`: the payment collection created.
-`PaymentCollection`:
#### Defined in
[medusa/src/services/payment-collection.ts:103](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L103)
[medusa/src/services/payment-collection.ts:103](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L103)
___
### delete
▸ **delete**(`paymentCollectionId`): `Promise`<`undefined` \| `PaymentCollection`\>
**delete**(`paymentCollectionId`): `Promise`<`undefined` \| `PaymentCollection`\>
Deletes a payment collection.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentCollectionId` | `string` | the id of the payment collection to be removed |
#### Returns
`Promise`<`undefined` \| `PaymentCollection`\>
the payment collection removed.
-`Promise`: the payment collection removed.
-`undefined \| PaymentCollection`: (optional)
#### Defined in
[medusa/src/services/payment-collection.ts:172](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L172)
[medusa/src/services/payment-collection.ts:172](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L172)
___
### isValidTotalAmount
▸ `Private` **isValidTotalAmount**(`total`, `sessionsInput`): `boolean`
`Private` **isValidTotalAmount**(`total`, `sessionsInput`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `total` | `number` |
| `sessionsInput` | `PaymentCollectionsSessionsBatchInput`[] |
@@ -303,46 +306,49 @@ ___
`boolean`
-`boolean`: (optional)
#### Defined in
[medusa/src/services/payment-collection.ts:210](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L210)
[medusa/src/services/payment-collection.ts:210](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L210)
___
### markAsAuthorized
▸ **markAsAuthorized**(`paymentCollectionId`): `Promise`<`PaymentCollection`\>
**markAsAuthorized**(`paymentCollectionId`): `Promise`<`PaymentCollection`\>
Marks a payment collection as authorized bypassing the payment flow.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentCollectionId` | `string` | the id of the payment collection |
#### Returns
`Promise`<`PaymentCollection`\>
the payment session authorized.
-`Promise`: the payment session authorized.
-`PaymentCollection`:
#### Defined in
[medusa/src/services/payment-collection.ts:499](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L499)
[medusa/src/services/payment-collection.ts:499](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L499)
___
### refreshPaymentSession
▸ **refreshPaymentSession**(`paymentCollectionId`, `sessionId`, `customerId`): `Promise`<`PaymentSession`\>
**refreshPaymentSession**(`paymentCollectionId`, `sessionId`, `customerId`): `Promise`<`PaymentSession`\>
Removes and recreate a payment session of a payment collection.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentCollectionId` | `string` | the id of the payment collection |
| `sessionId` | `string` | the id of the payment session to be replaced |
| `customerId` | `string` | the id of the customer |
@@ -351,24 +357,25 @@ Removes and recreate a payment session of a payment collection.
`Promise`<`PaymentSession`\>
the new payment session created.
-`Promise`: the new payment session created.
-`PaymentSession`:
#### Defined in
[medusa/src/services/payment-collection.ts:406](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L406)
[medusa/src/services/payment-collection.ts:406](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L406)
___
### retrieve
▸ **retrieve**(`paymentCollectionId`, `config?`): `Promise`<`PaymentCollection`\>
**retrieve**(`paymentCollectionId`, `config?`): `Promise`<`PaymentCollection`\>
Retrieves a payment collection by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentCollectionId` | `string` | the id of the payment collection |
| `config` | `FindConfig`<`PaymentCollection`\> | the config to retrieve the payment collection |
@@ -376,24 +383,25 @@ Retrieves a payment collection by id.
`Promise`<`PaymentCollection`\>
the payment collection.
-`Promise`: the payment collection.
-`PaymentCollection`:
#### Defined in
[medusa/src/services/payment-collection.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L67)
[medusa/src/services/payment-collection.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L67)
___
### setPaymentSession
▸ **setPaymentSession**(`paymentCollectionId`, `sessionInput`, `customerId`): `Promise`<`PaymentCollection`\>
**setPaymentSession**(`paymentCollectionId`, `sessionInput`, `customerId`): `Promise`<`PaymentCollection`\>
Manages a single payment sessions of a payment collection.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentCollectionId` | `string` | the id of the payment collection |
| `sessionInput` | `PaymentCollectionsSessionsInput` | object containing payment session info |
| `customerId` | `string` | the id of the customer |
@@ -402,24 +410,25 @@ Manages a single payment sessions of a payment collection.
`Promise`<`PaymentCollection`\>
the payment collection and its payment session.
-`Promise`: the payment collection and its payment session.
-`PaymentCollection`:
#### Defined in
[medusa/src/services/payment-collection.ts:360](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L360)
[medusa/src/services/payment-collection.ts:360](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L360)
___
### setPaymentSessionsBatch
▸ **setPaymentSessionsBatch**(`paymentCollectionOrId`, `sessionsInput`, `customerId`): `Promise`<`PaymentCollection`\>
**setPaymentSessionsBatch**(`paymentCollectionOrId`, `sessionsInput`, `customerId`): `Promise`<`PaymentCollection`\>
Manages multiple payment sessions of a payment collection.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentCollectionOrId` | `string` \| `PaymentCollection` | the id of the payment collection |
| `sessionsInput` | `PaymentCollectionsSessionsBatchInput`[] | array containing payment session info |
| `customerId` | `string` | the id of the customer |
@@ -428,48 +437,51 @@ Manages multiple payment sessions of a payment collection.
`Promise`<`PaymentCollection`\>
the payment collection and its payment sessions.
-`Promise`: the payment collection and its payment sessions.
-`PaymentCollection`:
#### Defined in
[medusa/src/services/payment-collection.ts:225](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L225)
[medusa/src/services/payment-collection.ts:225](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L225)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`paymentCollectionId`, `data`): `Promise`<`PaymentCollection`\>
**update**(`paymentCollectionId`, `data`): `Promise`<`PaymentCollection`\>
Updates a payment collection.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentCollectionId` | `string` | the id of the payment collection to update |
| `data` | `DeepPartial`<`PaymentCollection`\> | info to be updated |
@@ -477,32 +489,35 @@ Updates a payment collection.
`Promise`<`PaymentCollection`\>
the payment collection updated.
-`Promise`: the payment collection updated.
-`PaymentCollection`:
#### Defined in
[medusa/src/services/payment-collection.ts:138](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L138)
[medusa/src/services/payment-collection.ts:138](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L138)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`PaymentCollectionService`](PaymentCollectionService.md)
**withTransaction**(`transactionManager?`): [`PaymentCollectionService`](PaymentCollectionService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`PaymentCollectionService`](PaymentCollectionService.md)
-`default`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,4 @@
# Class: PaymentService
# PaymentService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new PaymentService**(`«destructured»`)
**new PaymentService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/payment.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L39)
[medusa/src/services/payment.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L39)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L27)
[medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L27)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -90,33 +90,33 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### paymentProviderService\_
• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
`Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
#### Defined in
[medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L28)
[medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L28)
___
### paymentRepository\_
• `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\>
`Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\>
#### Defined in
[medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L29)
[medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L29)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -124,13 +124,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -145,47 +145,47 @@ ___
#### Defined in
[medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L30)
[medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L30)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -194,7 +194,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -202,68 +202,70 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### capture
▸ **capture**(`paymentOrId`): `Promise`<`Payment`\>
**capture**(`paymentOrId`): `Promise`<`Payment`\>
Captures a payment.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentOrId` | `string` \| `Payment` | the id or the class instance of the payment |
#### Returns
`Promise`<`Payment`\>
the payment captured.
-`Promise`: the payment captured.
-`Payment`:
#### Defined in
[medusa/src/services/payment.ts:153](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L153)
[medusa/src/services/payment.ts:153](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L153)
___
### create
▸ **create**(`paymentInput`): `Promise`<`Payment`\>
**create**(`paymentInput`): `Promise`<`Payment`\>
Created a new payment.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentInput` | `PaymentDataInput` | info to create the payment |
#### Returns
`Promise`<`Payment`\>
the payment created.
-`Promise`: the payment created.
-`Payment`:
#### Defined in
[medusa/src/services/payment.ts:92](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L92)
[medusa/src/services/payment.ts:92](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L92)
___
### refund
▸ **refund**(`paymentOrId`, `amount`, `reason`, `note?`): `Promise`<`Refund`\>
**refund**(`paymentOrId`, `amount`, `reason`, `note?`): `Promise`<`Refund`\>
refunds a payment.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentOrId` | `string` \| `Payment` | the id or the class instance of the payment |
| `amount` | `number` | the amount to be refunded from the payment |
| `reason` | `string` | the refund reason |
@@ -273,24 +275,25 @@ refunds a payment.
`Promise`<`Refund`\>
the refund created.
-`Promise`: the refund created.
-`Refund`:
#### Defined in
[medusa/src/services/payment.ts:202](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L202)
[medusa/src/services/payment.ts:202](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L202)
___
### retrieve
▸ **retrieve**(`paymentId`, `config?`): `Promise`<`Payment`\>
**retrieve**(`paymentId`, `config?`): `Promise`<`Payment`\>
Retrieves a payment by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentId` | `string` | the id of the payment |
| `config` | `FindConfig`<`Payment`\> | the config to retrieve the payment |
@@ -298,83 +301,89 @@ Retrieves a payment by id.
`Promise`<`Payment`\>
the payment.
-`Promise`: the payment.
-`Payment`:
#### Defined in
[medusa/src/services/payment.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L58)
[medusa/src/services/payment.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L58)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`paymentId`, `data`): `Promise`<`Payment`\>
**update**(`paymentId`, `data`): `Promise`<`Payment`\>
Updates a payment in order to link it to an order or a swap.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `paymentId` | `string` | the id of the payment |
| `data` | `Object` | order_id or swap_id to link the payment |
| `data.order_id?` | `string` | - |
| `data.swap_id?` | `string` | - |
| `data` | `object` | order_id or swap_id to link the payment |
| `data.order_id?` | `string` |
| `data.swap_id?` | `string` |
#### Returns
`Promise`<`Payment`\>
the payment updated.
-`Promise`: the payment updated.
-`Payment`:
#### Defined in
[medusa/src/services/payment.ts:121](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L121)
[medusa/src/services/payment.ts:121](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L121)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`PaymentService`](PaymentService.md)
**withTransaction**(`transactionManager?`): [`PaymentService`](PaymentService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`PaymentService`](PaymentService.md)
-`default`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: PriceListService
# PriceListService
Provides layer to manipulate product tags.
@@ -12,12 +12,12 @@ Provides layer to manipulate product tags.
### constructor
• **new PriceListService**(`«destructured»`)
**new PriceListService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `PriceListConstructorProps` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L52)
[medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L52)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,33 +68,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### customerGroupService\_
• `Protected` `Readonly` **customerGroupService\_**: [`CustomerGroupService`](CustomerGroupService.md)
`Protected` `Readonly` **customerGroupService\_**: [`CustomerGroupService`](CustomerGroupService.md)
#### Defined in
[medusa/src/services/price-list.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L43)
[medusa/src/services/price-list.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L43)
___
### featureFlagRouter\_
• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L50)
[medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L50)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -102,63 +102,63 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### moneyAmountRepo\_
• `Protected` `Readonly` **moneyAmountRepo\_**: `Repository`<`MoneyAmount`\> & { `addPriceListPrices`: (`priceListId`: `string`, `prices`: `PriceListPriceCreateInput`[], `overrideExisting`: `boolean`) => `Promise`<`MoneyAmount`[]\> ; `createProductVariantMoneyAmounts`: (`toCreate`: { `money_amount_id`: `string` ; `variant_id`: `string` }[]) => `Promise`<`InsertResult`\> ; `deletePriceListPrices`: (`priceListId`: `string`, `moneyAmountIds`: `string`[]) => `Promise`<`void`\> ; `deleteVariantPricesNotIn`: (`variantIdOrData`: `string` \| { `prices`: `ProductVariantPrice`[] ; `variantId`: `string` }[], `prices?`: `Price`[]) => `Promise`<`void`\> ; `findCurrencyMoneyAmounts`: (`where`: { `currency_code`: `string` ; `variant_id`: `string` }[]) => `Promise`<{ `amount`: `number` ; `created_at`: `Date` ; `currency?`: `Currency` ; `currency_code`: `string` ; `deleted_at`: ``null`` \| `Date` ; `id`: `string` ; `max_quantity`: ``null`` \| `number` ; `min_quantity`: ``null`` \| `number` ; `price_list`: ``null`` \| `PriceList` ; `price_list_id`: ``null`` \| `string` ; `region?`: `Region` ; `region_id`: `string` ; `updated_at`: `Date` ; `variant`: `ProductVariant` ; `variant_id`: `any` ; `variants`: `ProductVariant`[] }[]\> ; `findManyForVariantInPriceList`: (`variant_id`: `string`, `price_list_id`: `string`, `requiresPriceList`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findManyForVariantInRegion`: (`variant_id`: `string`, `region_id?`: `string`, `currency_code?`: `string`, `customer_id?`: `string`, `include_discount_prices?`: `boolean`, `include_tax_inclusive_pricing`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findManyForVariantsInRegion`: (`variant_ids`: `string` \| `string`[], `region_id?`: `string`, `currency_code?`: `string`, `customer_id?`: `string`, `include_discount_prices?`: `boolean`, `include_tax_inclusive_pricing`: `boolean`) => `Promise`<[`Record`<`string`, `MoneyAmount`[]\>, `number`]\> ; `findRegionMoneyAmounts`: (`where`: { `region_id`: `string` ; `variant_id`: `string` }[]) => `Promise`<{ `amount`: `number` ; `created_at`: `Date` ; `currency?`: `Currency` ; `currency_code`: `string` ; `deleted_at`: ``null`` \| `Date` ; `id`: `string` ; `max_quantity`: ``null`` \| `number` ; `min_quantity`: ``null`` \| `number` ; `price_list`: ``null`` \| `PriceList` ; `price_list_id`: ``null`` \| `string` ; `region?`: `Region` ; `region_id`: `string` ; `updated_at`: `Date` ; `variant`: `ProductVariant` ; `variant_id`: `any` ; `variants`: `ProductVariant`[] }[]\> ; `findVariantPricesNotIn`: (`variantId`: `string`, `prices`: `Price`[]) => `Promise`<`MoneyAmount`[]\> ; `getPricesForVariantInRegion`: (`variantId`: `string`, `regionId`: `undefined` \| `string`) => `Promise`<`MoneyAmount`[]\> ; `insertBulk`: (`data`: `_QueryDeepPartialEntity`<`MoneyAmount`\>[]) => `Promise`<`MoneyAmount`[]\> ; `updatePriceListPrices`: (`priceListId`: `string`, `updates`: `PriceListPriceUpdateInput`[]) => `Promise`<`MoneyAmount`[]\> ; `upsertVariantCurrencyPrice`: (`variantId`: `string`, `price`: `Price`) => `Promise`<`MoneyAmount`\> }
`Protected` `Readonly` **moneyAmountRepo\_**: `Repository`<`MoneyAmount`\> & { `addPriceListPrices`: Method addPriceListPrices ; `createProductVariantMoneyAmounts`: Method createProductVariantMoneyAmounts ; `deletePriceListPrices`: Method deletePriceListPrices ; `deleteVariantPricesNotIn`: Method deleteVariantPricesNotIn ; `findCurrencyMoneyAmounts`: Method findCurrencyMoneyAmounts ; `findManyForVariantInPriceList`: Method findManyForVariantInPriceList ; `findManyForVariantInRegion`: Method findManyForVariantInRegion ; `findManyForVariantsInRegion`: Method findManyForVariantsInRegion ; `findRegionMoneyAmounts`: Method findRegionMoneyAmounts ; `findVariantPricesNotIn`: Method findVariantPricesNotIn ; `getPricesForVariantInRegion`: Method getPricesForVariantInRegion ; `insertBulk`: Method insertBulk ; `updatePriceListPrices`: Method updatePriceListPrices ; `upsertVariantCurrencyPrice`: Method upsertVariantCurrencyPrice }
#### Defined in
[medusa/src/services/price-list.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L48)
[medusa/src/services/price-list.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L48)
___
### priceListRepo\_
• `Protected` `Readonly` **priceListRepo\_**: `Repository`<`PriceList`\> & { `listAndCount`: (`query`: `ExtendedFindConfig`<`PriceList`\>, `q?`: `string`) => `Promise`<[`PriceList`[], `number`]\> ; `listPriceListsVariantIdsMap`: (`priceListIds`: `string` \| `string`[]) => `Promise`<{ `[priceListId: string]`: `string`[]; }\> }
`Protected` `Readonly` **priceListRepo\_**: `Repository`<`PriceList`\> & { `listAndCount`: Method listAndCount ; `listPriceListsVariantIdsMap`: Method listPriceListsVariantIdsMap }
#### Defined in
[medusa/src/services/price-list.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L47)
[medusa/src/services/price-list.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L47)
___
### productService\_
• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md)
`Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md)
#### Defined in
[medusa/src/services/price-list.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L45)
[medusa/src/services/price-list.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L45)
___
### productVariantRepo\_
• `Protected` `Readonly` **productVariantRepo\_**: `Repository`<`ProductVariant`\>
`Protected` `Readonly` **productVariantRepo\_**: `Repository`<`ProductVariant`\>
#### Defined in
[medusa/src/services/price-list.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L49)
[medusa/src/services/price-list.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L49)
___
### regionService\_
• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
`Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
#### Defined in
[medusa/src/services/price-list.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L44)
[medusa/src/services/price-list.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L44)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -166,113 +166,113 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### variantService\_
• `Protected` `Readonly` **variantService\_**: [`ProductVariantService`](ProductVariantService.md)
`Protected` `Readonly` **variantService\_**: [`ProductVariantService`](ProductVariantService.md)
#### Defined in
[medusa/src/services/price-list.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L46)
[medusa/src/services/price-list.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L46)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addCurrencyFromRegion
▸ `Protected` **addCurrencyFromRegion**<`T`\>(`prices`): `Promise`<`T`[]\>
`Protected` **addCurrencyFromRegion**<`T`\>(`prices`): `Promise`<`T`[]\>
Add `currency_code` to an MA record if `region_id`is passed.
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends `PriceListPriceUpdateInput` \| `PriceListPriceCreateInput` |
| `T` | `PriceListPriceUpdateInput` \| `PriceListPriceCreateInput` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `prices` | `T`[] | a list of PriceListPrice(Create/Update)Input records |
#### Returns
`Promise`<`T`[]\>
updated `prices` list
-`Promise`: updated `prices` list
-`T[]`:
#### Defined in
[medusa/src/services/price-list.ts:524](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L524)
[medusa/src/services/price-list.ts:524](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L524)
___
### addPrices
▸ **addPrices**(`id`, `prices`, `replace?`): `Promise`<`PriceList`\>
**addPrices**(`id`, `prices`, `replace?`): `Promise`<`PriceList`\>
Adds prices to a price list in bulk, optionally replacing all existing prices
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `id` | `string` | `undefined` | id of the price list |
| `prices` | `PriceListPriceCreateInput`[] | `undefined` | prices to add |
| Name | Default value | Description |
| :------ | :------ | :------ |
| `id` | `string` | id of the price list |
| `prices` | `PriceListPriceCreateInput`[] | prices to add |
| `replace` | `boolean` | `false` | whether to replace existing prices |
#### Returns
`Promise`<`PriceList`\>
updated Price List
-`Promise`: updated Price List
-`PriceList`:
#### Defined in
[medusa/src/services/price-list.ts:242](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L242)
[medusa/src/services/price-list.ts:242](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L242)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -281,7 +281,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -289,93 +289,94 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### clearPrices
▸ **clearPrices**(`id`): `Promise`<`void`\>
**clearPrices**(`id`): `Promise`<`void`\>
Removes all prices from a price list and deletes the removed prices in bulk
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | id of the price list |
#### Returns
`Promise`<`void`\>
updated Price List
-`Promise`: updated Price List
#### Defined in
[medusa/src/services/price-list.ts:282](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L282)
[medusa/src/services/price-list.ts:282](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L282)
___
### create
▸ **create**(`priceListObject`): `Promise`<`PriceList`\>
**create**(`priceListObject`): `Promise`<`PriceList`\>
Creates a Price List
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `priceListObject` | `CreatePriceListInput` | the Price List to create |
#### Returns
`Promise`<`PriceList`\>
created Price List
-`Promise`: created Price List
-`PriceList`:
#### Defined in
[medusa/src/services/price-list.ts:143](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L143)
[medusa/src/services/price-list.ts:143](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L143)
___
### delete
▸ **delete**(`id`): `Promise`<`void`\>
**delete**(`id`): `Promise`<`void`\>
Deletes a Price List
Will never fail due to delete being idempotent.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | id of the price list |
#### Returns
`Promise`<`void`\>
empty promise
-`Promise`: empty promise
#### Defined in
[medusa/src/services/price-list.ts:296](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L296)
[medusa/src/services/price-list.ts:296](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L296)
___
### deletePrices
▸ **deletePrices**(`id`, `priceIds`): `Promise`<`void`\>
**deletePrices**(`id`, `priceIds`): `Promise`<`void`\>
Removes prices from a price list and deletes the removed prices in bulk
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | id of the price list |
| `priceIds` | `string`[] | ids of the prices to delete |
@@ -383,22 +384,22 @@ Removes prices from a price list and deletes the removed prices in bulk
`Promise`<`void`\>
updated Price List
-`Promise`: updated Price List
#### Defined in
[medusa/src/services/price-list.ts:267](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L267)
[medusa/src/services/price-list.ts:267](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L267)
___
### deleteProductPrices
▸ **deleteProductPrices**(`priceListId`, `productIds`): `Promise`<[`string`[], `number`]\>
**deleteProductPrices**(`priceListId`, `productIds`): `Promise`<[`string`[], `number`]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `priceListId` | `string` |
| `productIds` | `string`[] |
@@ -406,20 +407,24 @@ ___
`Promise`<[`string`[], `number`]\>
-`Promise`:
-`string[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/price-list.ts:451](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L451)
[medusa/src/services/price-list.ts:451](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L451)
___
### deleteVariantPrices
▸ **deleteVariantPrices**(`priceListId`, `variantIds`): `Promise`<[`string`[], `number`]\>
**deleteVariantPrices**(`priceListId`, `variantIds`): `Promise`<[`string`[], `number`]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `priceListId` | `string` |
| `variantIds` | `string`[] |
@@ -427,22 +432,26 @@ ___
`Promise`<[`string`[], `number`]\>
-`Promise`:
-`string[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/price-list.ts:488](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L488)
[medusa/src/services/price-list.ts:488](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L488)
___
### list
▸ **list**(`selector?`, `config?`): `Promise`<`PriceList`[]\>
**list**(`selector?`, `config?`): `Promise`<`PriceList`[]\>
Lists Price Lists
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `FilterablePriceListProps` | the query object for find |
| `config` | `FindConfig`<`PriceList`\> | the config to be used for find |
@@ -450,24 +459,26 @@ Lists Price Lists
`Promise`<`PriceList`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`PriceList[]`:
-`PriceList`:
#### Defined in
[medusa/src/services/price-list.ts:316](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L316)
[medusa/src/services/price-list.ts:316](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L316)
___
### listAndCount
▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`PriceList`[], `number`]\>
**listAndCount**(`selector?`, `config?`): `Promise`<[`PriceList`[], `number`]\>
Lists Price Lists and adds count
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `FilterablePriceListProps` | the query object for find |
| `config` | `FindConfig`<`PriceList`\> | the config to be used for find |
@@ -475,90 +486,103 @@ Lists Price Lists and adds count
`Promise`<[`PriceList`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`PriceList[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/price-list.ts:330](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L330)
[medusa/src/services/price-list.ts:330](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L330)
___
### listPriceListsVariantIdsMap
▸ **listPriceListsVariantIdsMap**(`priceListIds`): `Promise`<{ `[priceListId: string]`: `string`[]; }\>
**listPriceListsVariantIdsMap**(`priceListIds`): `Promise`<{ `[priceListId: string]`: `string`[]; }\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `priceListIds` | `string` \| `string`[] |
#### Returns
`Promise`<{ `[priceListId: string]`: `string`[]; }\>
-`Promise`:
-``object``: (optional)
#### Defined in
[medusa/src/services/price-list.ts:109](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L109)
[medusa/src/services/price-list.ts:109](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L109)
___
### listProducts
▸ **listProducts**(`priceListId`, `selector?`, `config?`, `requiresPriceList?`): `Promise`<[`Product`[], `number`]\>
**listProducts**(`priceListId`, `selector?`, `config?`, `requiresPriceList?`): `Promise`<[`Product`[], `number`]\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `priceListId` | `string` | `undefined` |
| `selector` | `FilterableProductProps` \| `Selector`<`Product`\> | `{}` |
| `config` | `FindConfig`<`Product`\> | `undefined` |
| Name | Default value |
| :------ | :------ |
| `priceListId` | `string` |
| `selector` | `FilterableProductProps` \| `Selector`<`Product`\> |
| `config` | `FindConfig`<`Product`\> |
| `requiresPriceList` | `boolean` | `false` |
#### Returns
`Promise`<[`Product`[], `number`]\>
-`Promise`:
-`Product[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/price-list.ts:367](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L367)
[medusa/src/services/price-list.ts:367](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L367)
___
### listVariants
▸ **listVariants**(`priceListId`, `selector?`, `config?`, `requiresPriceList?`): `Promise`<[`ProductVariant`[], `number`]\>
**listVariants**(`priceListId`, `selector?`, `config?`, `requiresPriceList?`): `Promise`<[`ProductVariant`[], `number`]\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `priceListId` | `string` | `undefined` |
| `selector` | `FilterableProductVariantProps` | `{}` |
| `config` | `FindConfig`<`ProductVariant`\> | `undefined` |
| Name | Default value |
| :------ | :------ |
| `priceListId` | `string` |
| `selector` | `FilterableProductVariantProps` |
| `config` | `FindConfig`<`ProductVariant`\> |
| `requiresPriceList` | `boolean` | `false` |
#### Returns
`Promise`<[`ProductVariant`[], `number`]\>
-`Promise`:
-`ProductVariant[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/price-list.ts:417](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L417)
[medusa/src/services/price-list.ts:417](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L417)
___
### retrieve
▸ **retrieve**(`priceListId`, `config?`): `Promise`<`PriceList`\>
**retrieve**(`priceListId`, `config?`): `Promise`<`PriceList`\>
Retrieves a product tag by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `priceListId` | `string` | the id of the product tag to retrieve |
| `config` | `FindConfig`<`PriceList`\> | the config to retrieve the tag by |
@@ -566,48 +590,51 @@ Retrieves a product tag by id.
`Promise`<`PriceList`\>
the collection.
-`Promise`: the collection.
-`PriceList`:
#### Defined in
[medusa/src/services/price-list.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L81)
[medusa/src/services/price-list.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L81)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`id`, `update`): `Promise`<`PriceList`\>
**update**(`id`, `update`): `Promise`<`PriceList`\>
Updates a Price List
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the id of the Product List to update |
| `update` | `UpdatePriceListInput` | the update to apply |
@@ -615,22 +642,23 @@ Updates a Price List
`Promise`<`PriceList`\>
updated Price List
-`Promise`: updated Price List
-`PriceList`:
#### Defined in
[medusa/src/services/price-list.ts:191](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L191)
[medusa/src/services/price-list.ts:191](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L191)
___
### upsertCustomerGroups\_
▸ `Protected` **upsertCustomerGroups_**(`priceListId`, `customerGroups`): `Promise`<`void`\>
`Protected` **upsertCustomerGroups_**(`priceListId`, `customerGroups`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `priceListId` | `string` |
| `customerGroups` | { `id`: `string` }[] |
@@ -638,30 +666,34 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/price-list.ts:346](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L346)
[medusa/src/services/price-list.ts:346](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L346)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`PriceListService`](PriceListService.md)
**withTransaction**(`transactionManager?`): [`PriceListService`](PriceListService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`PriceListService`](PriceListService.md)
-`PriceListService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: PricingService
# PricingService
Allows retrieval of prices.
@@ -12,12 +12,12 @@ Allows retrieval of prices.
### constructor
• **new PricingService**(`«destructured»`)
**new PricingService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/pricing.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L42)
[medusa/src/services/pricing.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L62)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### featureFlagRouter
• `Protected` `Readonly` **featureFlagRouter**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter**: `FlagRouter`
#### Defined in
[medusa/src/services/pricing.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L40)
[medusa/src/services/pricing.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L58)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -92,53 +92,73 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### priceSelectionStrategy
• `Protected` `Readonly` **priceSelectionStrategy**: `IPriceSelectionStrategy`
`Protected` `Readonly` **priceSelectionStrategy**: `IPriceSelectionStrategy`
#### Defined in
[medusa/src/services/pricing.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L38)
[medusa/src/services/pricing.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L56)
___
### pricingModuleService
`Protected` `Readonly` **pricingModuleService**: `IPricingModuleService`
#### Defined in
[medusa/src/services/pricing.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L59)
___
### productVariantService
• `Protected` `Readonly` **productVariantService**: [`ProductVariantService`](ProductVariantService.md)
`Protected` `Readonly` **productVariantService**: [`ProductVariantService`](ProductVariantService.md)
#### Defined in
[medusa/src/services/pricing.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L39)
[medusa/src/services/pricing.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L57)
___
### regionService
• `Protected` `Readonly` **regionService**: [`RegionService`](RegionService.md)
`Protected` `Readonly` **regionService**: [`RegionService`](RegionService.md)
#### Defined in
[medusa/src/services/pricing.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L36)
[medusa/src/services/pricing.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L54)
___
### remoteQuery
`Protected` `Readonly` **remoteQuery**: `RemoteQueryFunction`
#### Defined in
[medusa/src/services/pricing.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L60)
___
### taxProviderService
• `Protected` `Readonly` **taxProviderService**: [`TaxProviderService`](TaxProviderService.md)
`Protected` `Readonly` **taxProviderService**: [`TaxProviderService`](TaxProviderService.md)
#### Defined in
[medusa/src/services/pricing.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L37)
[medusa/src/services/pricing.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L55)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -146,47 +166,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -195,7 +215,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -203,20 +223,20 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### calculateTaxes
▸ **calculateTaxes**(`variantPricing`, `productRates`): `TaxedPricing`
**calculateTaxes**(`variantPricing`, `productRates`): `TaxedPricing`
Gets the prices for a product variant
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `variantPricing` | `ProductVariantPricing` | the prices retrieved from a variant |
| `productRates` | `TaxServiceRate`[] | the tax rates that the product has applied |
@@ -224,146 +244,178 @@ Gets the prices for a product variant
`TaxedPricing`
The tax related variant prices.
#### Defined in
[medusa/src/services/pricing.ts:101](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L101)
[medusa/src/services/pricing.ts:125](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L125)
___
### collectPricingContext
▸ **collectPricingContext**(`context`): `Promise`<`PricingContext`\>
**collectPricingContext**(`context`): `Promise`<`PricingContext`\>
Collects additional information necessary for completing the price
selection.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `context` | `PriceSelectionContext` | the price selection context to use |
#### Returns
`Promise`<`PricingContext`\>
The pricing context
-`Promise`: The pricing context
#### Defined in
[medusa/src/services/pricing.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L65)
[medusa/src/services/pricing.ts:89](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L89)
___
### getPricingModuleVariantMoneyAmounts
`Private` **getPricingModuleVariantMoneyAmounts**(`variantIds`): `Promise`<`Map`<`string`, `MoneyAmount`[]\>\>
#### Parameters
| Name |
| :------ |
| `variantIds` | `string`[] |
#### Returns
`Promise`<`Map`<`string`, `MoneyAmount`[]\>\>
-`Promise`:
-`Map`:
-`string`: (optional)
-`MoneyAmount[]`:
#### Defined in
[medusa/src/services/pricing.ts:640](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L640)
___
### getProductPricing
▸ **getProductPricing**(`product`, `context`): `Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
**getProductPricing**(`product`, `context`): `Promise`<Record<`string`, `ProductVariantPricing`\>\>
Gets all the variant prices for a product. All the product's variants will
be fetched.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `product` | `Pick`<`Product`, ``"id"`` \| ``"variants"``\> | the product to get pricing for. |
| `context` | `PriceSelectionContext` | the price selection context to use |
#### Returns
`Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
`Promise`<Record<`string`, `ProductVariantPricing`\>\>
A map of variant ids to their corresponding prices
-`Promise`: A map of variant ids to their corresponding prices
-`Record`:
-`string`: (optional)
#### Defined in
[medusa/src/services/pricing.ts:419](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L419)
[medusa/src/services/pricing.ts:538](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L538)
___
### getProductPricingById
▸ **getProductPricingById**(`productId`, `context`): `Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
**getProductPricingById**(`productId`, `context`): `Promise`<Record<`string`, `ProductVariantPricing`\>\>
Gets all the variant prices for a product by the product id
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `productId` | `string` | the id of the product to get prices for |
| `context` | `PriceSelectionContext` | the price selection context to use |
#### Returns
`Promise`<`Record`<`string`, `ProductVariantPricing`\>\>
`Promise`<Record<`string`, `ProductVariantPricing`\>\>
A map of variant ids to their corresponding prices
-`Promise`: A map of variant ids to their corresponding prices
-`Record`:
-`string`: (optional)
#### Defined in
[medusa/src/services/pricing.ts:437](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L437)
[medusa/src/services/pricing.ts:556](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L556)
___
### getProductPricing\_
▸ `Private` **getProductPricing_**(`data`, `context`): `Promise`<`Map`<`string`, `Record`<`string`, `ProductVariantPricing`\>\>\>
`Private` **getProductPricing_**(`data`, `context`): `Promise`<`Map`<`string`, Record<`string`, `ProductVariantPricing`\>\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | { `productId`: `string` ; `variants`: `ProductVariant`[] }[] |
| `context` | `PricingContext` |
#### Returns
`Promise`<`Map`<`string`, `Record`<`string`, `ProductVariantPricing`\>\>\>
`Promise`<`Map`<`string`, Record<`string`, `ProductVariantPricing`\>\>\>
-`Promise`:
-`Map`:
-`string`: (optional)
-`Record`:
#### Defined in
[medusa/src/services/pricing.ts:362](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L362)
[medusa/src/services/pricing.ts:481](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L481)
___
### getProductVariantPricing
▸ **getProductVariantPricing**(`variant`, `context`): `Promise`<`ProductVariantPricing`\>
**getProductVariantPricing**(`variant`, `context`): `Promise`<`ProductVariantPricing`\>
Gets the prices for a product variant.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `variant` | `Pick`<`ProductVariant`, ``"id"`` \| ``"product_id"``\> | |
| Name | Description |
| :------ | :------ |
| `variant` | `Pick`<`ProductVariant`, ``"id"`` \| ``"product_id"``\> |
| `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use |
#### Returns
`Promise`<`ProductVariantPricing`\>
The product variant prices
-`Promise`: The product variant prices
#### Defined in
[medusa/src/services/pricing.ts:216](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L216)
[medusa/src/services/pricing.ts:335](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L335)
___
### getProductVariantPricingById
▸ **getProductVariantPricingById**(`variantId`, `context`): `Promise`<`ProductVariantPricing`\>
**getProductVariantPricingById**(`variantId`, `context`): `Promise`<`ProductVariantPricing`\>
Gets the prices for a product variant by a variant id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `variantId` | `string` | the id of the variant to get prices for |
| `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use |
@@ -371,26 +423,52 @@ Gets the prices for a product variant by a variant id.
`Promise`<`ProductVariantPricing`\>
The product variant prices
-`Promise`: The product variant prices
**`Deprecated`**
**Deprecated**
Use [getProductVariantsPricing](PricingService.md#getproductvariantspricing) instead.
#### Defined in
[medusa/src/services/pricing.ts:265](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L265)
[medusa/src/services/pricing.ts:384](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L384)
___
### getProductVariantPricingModulePricing\_
`Private` **getProductVariantPricingModulePricing_**(`variantPriceData`, `context`): `Promise`<`Map`<`any`, `any`\>\>
#### Parameters
| Name |
| :------ |
| `variantPriceData` | { `quantity?`: `number` ; `variantId`: `string` }[] |
| `context` | `PricingContext` |
#### Returns
`Promise`<`Map`<`any`, `any`\>\>
-`Promise`:
-`Map`:
-`any`: (optional)
-`any`: (optional)
#### Defined in
[medusa/src/services/pricing.ts:187](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L187)
___
### getProductVariantPricing\_
▸ `Private` **getProductVariantPricing_**(`data`, `context`): `Promise`<`Map`<`string`, `ProductVariantPricing`\>\>
`Private` **getProductVariantPricing_**(`data`, `context`): `Promise`<`Map`<`string`, `ProductVariantPricing`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | { `quantity?`: `number` ; `variantId`: `string` }[] |
| `context` | `PricingContext` |
@@ -398,47 +476,52 @@ ___
`Promise`<`Map`<`string`, `ProductVariantPricing`\>\>
-`Promise`:
-`Map`:
-`string`: (optional)
#### Defined in
[medusa/src/services/pricing.ts:163](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L163)
[medusa/src/services/pricing.ts:271](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L271)
___
### getProductVariantsPricing
▸ **getProductVariantsPricing**(`data`, `context`): `Promise`<{ `[variant_id: string]`: `ProductVariantPricing`; }\>
**getProductVariantsPricing**(`data`, `context`): `Promise`<{ `[variant_id: string]`: `ProductVariantPricing`; }\>
Gets the prices for a collection of variants.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `data` | { `quantity?`: `number` ; `variantId`: `string` }[] | |
| Name | Description |
| :------ | :------ |
| `data` | { `quantity?`: `number` ; `variantId`: `string` }[] |
| `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use |
#### Returns
`Promise`<{ `[variant_id: string]`: `ProductVariantPricing`; }\>
The product variant prices
-`Promise`: The product variant prices
-``object``: (optional)
#### Defined in
[medusa/src/services/pricing.ts:310](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L310)
[medusa/src/services/pricing.ts:429](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L429)
___
### getShippingOptionPricing
▸ **getShippingOptionPricing**(`shippingOption`, `context`): `Promise`<`PricedShippingOption`\>
**getShippingOptionPricing**(`shippingOption`, `context`): `Promise`<`PricedShippingOption`\>
Gets the prices for a shipping option.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `shippingOption` | `ShippingOption` | the shipping option to get prices for |
| `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use |
@@ -446,24 +529,72 @@ Gets the prices for a shipping option.
`Promise`<`PricedShippingOption`\>
The shipping option prices
-`Promise`: The shipping option prices
#### Defined in
[medusa/src/services/pricing.ts:526](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L526)
[medusa/src/services/pricing.ts:807](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L807)
___
### setAdminProductPricing
**setAdminProductPricing**(`products`): `Promise`<(`Product` \| `PricedProduct`)[]\>
#### Parameters
| Name |
| :------ |
| `products` | `Product`[] |
#### Returns
`Promise`<(`Product` \| `PricedProduct`)[]\>
-`Promise`:
-`(Product \| PricedProduct)[]`:
-`Product \| PricedProduct`: (optional)
#### Defined in
[medusa/src/services/pricing.ts:754](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L754)
___
### setAdminVariantPricing
**setAdminVariantPricing**(`variants`, `context?`): `Promise`<`PricedVariant`[]\>
#### Parameters
| Name |
| :------ |
| `variants` | `ProductVariant`[] |
| `context` | `PriceSelectionContext` |
#### Returns
`Promise`<`PricedVariant`[]\>
-`Promise`:
-`PricedVariant[]`:
#### Defined in
[medusa/src/services/pricing.ts:717](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L717)
___
### setProductPrices
▸ **setProductPrices**(`products`, `context?`): `Promise`<(`Product` \| `PricedProduct`)[]\>
**setProductPrices**(`products`, `context?`): `Promise`<(`Product` \| `PricedProduct`)[]\>
Set additional prices on a list of products.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `products` | `Product`[] | list of products on which to set additional prices |
| `context` | `PriceSelectionContext` | the price selection context to use |
@@ -471,24 +602,26 @@ Set additional prices on a list of products.
`Promise`<(`Product` \| `PricedProduct`)[]\>
A list of products with variants decorated with prices
-`Promise`: A list of products with variants decorated with prices
-`(Product \| PricedProduct)[]`:
-`Product \| PricedProduct`: (optional)
#### Defined in
[medusa/src/services/pricing.ts:486](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L486)
[medusa/src/services/pricing.ts:605](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L605)
___
### setShippingOptionPrices
▸ **setShippingOptionPrices**(`shippingOptions`, `context?`): `Promise`<`PricedShippingOption`[]\>
**setShippingOptionPrices**(`shippingOptions`, `context?`): `Promise`<`PricedShippingOption`[]\>
Set additional prices on a list of shipping options.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `shippingOptions` | `ShippingOption`[] | list of shipping options on which to set additional prices |
| `context` | `Omit`<`PriceSelectionContext`, ``"region_id"``\> | the price selection context to use |
@@ -496,81 +629,87 @@ Set additional prices on a list of shipping options.
`Promise`<`PricedShippingOption`[]\>
A list of shipping options with prices
-`Promise`: A list of shipping options with prices
-`PricedShippingOption[]`:
#### Defined in
[medusa/src/services/pricing.ts:588](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L588)
[medusa/src/services/pricing.ts:869](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L869)
___
### setVariantPrices
▸ **setVariantPrices**(`variants`, `context?`): `Promise`<`PricedVariant`[]\>
**setVariantPrices**(`variants`, `context?`): `Promise`<`PricedVariant`[]\>
Set additional prices on a list of product variants.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `variants` | `ProductVariant`[] | |
| Name | Description |
| :------ | :------ |
| `variants` | `ProductVariant`[] |
| `context` | `PriceSelectionContext` | the price selection context to use |
#### Returns
`Promise`<`PricedVariant`[]\>
A list of products with variants decorated with prices
-`Promise`: A list of products with variants decorated with prices
-`PricedVariant[]`:
#### Defined in
[medusa/src/services/pricing.ts:459](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L459)
[medusa/src/services/pricing.ts:578](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L578)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`PricingService`](PricingService.md)
**withTransaction**(`transactionManager?`): [`PricingService`](PricingService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`PricingService`](PricingService.md)
-`PricingService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: ProductCategoryService
# ProductCategoryService
Provides layer to manipulate product categories.
@@ -12,12 +12,12 @@ Provides layer to manipulate product categories.
### constructor
• **new ProductCategoryService**(`«destructured»`)
**new ProductCategoryService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/product-category.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L40)
[medusa/src/services/product-category.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L40)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/product-category.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L32)
[medusa/src/services/product-category.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L32)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -92,23 +92,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### productCategoryRepo\_
• `Protected` `Readonly` **productCategoryRepo\_**: `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> }
`Protected` `Readonly` **productCategoryRepo\_**: `TreeRepository`<`ProductCategory`\> & { `addProducts`: Method addProducts ; `findOneWithDescendants`: Method findOneWithDescendants ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `removeProducts`: Method removeProducts }
#### Defined in
[medusa/src/services/product-category.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L31)
[medusa/src/services/product-category.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L31)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -116,13 +116,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -134,38 +134,40 @@ ___
#### Defined in
[medusa/src/services/product-category.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L34)
[medusa/src/services/product-category.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L34)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addProducts
▸ **addProducts**(`productCategoryId`, `productIds`): `Promise`<`void`\>
**addProducts**(`productCategoryId`, `productIds`): `Promise`<`void`\>
Add a batch of product to a product category
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `productCategoryId` | `string` | The id of the product category on which to add the products |
| `productIds` | `string`[] | The products ids to attach to the product category |
@@ -173,33 +175,31 @@ Add a batch of product to a product category
`Promise`<`void`\>
the product category on which the products have been added
-`Promise`: the product category on which the products have been added
#### Defined in
[medusa/src/services/product-category.ts:314](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L314)
[medusa/src/services/product-category.ts:314](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L314)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -208,7 +208,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -216,68 +216,69 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`productCategoryInput`): `Promise`<`ProductCategory`\>
**create**(`productCategoryInput`): `Promise`<`ProductCategory`\>
Creates a product category
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `productCategoryInput` | `CreateProductCategoryInput` | parameters to create a product category |
#### Returns
`Promise`<`ProductCategory`\>
created product category
-`Promise`: created product category
-`ProductCategory`:
#### Defined in
[medusa/src/services/product-category.ts:187](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L187)
[medusa/src/services/product-category.ts:187](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L187)
___
### delete
▸ **delete**(`productCategoryId`): `Promise`<`void`\>
**delete**(`productCategoryId`): `Promise`<`void`\>
Deletes a product category
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `productCategoryId` | `string` | is the id of the product category to delete |
#### Returns
`Promise`<`void`\>
a promise
-`Promise`: a promise
#### Defined in
[medusa/src/services/product-category.ts:268](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L268)
[medusa/src/services/product-category.ts:268](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L268)
___
### fetchReorderConditions
▸ `Protected` **fetchReorderConditions**(`productCategory`, `input`, `shouldDeleteElement?`): `ReorderConditions`
`Protected` **fetchReorderConditions**(`productCategory`, `input`, `shouldDeleteElement?`): `ReorderConditions`
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `productCategory` | `ProductCategory` | `undefined` |
| `input` | `UpdateProductCategoryInput` | `undefined` |
| Name | Default value |
| :------ | :------ |
| `productCategory` | `ProductCategory` |
| `input` | `UpdateProductCategoryInput` |
| `shouldDeleteElement` | `boolean` | `false` |
#### Returns
@@ -286,21 +287,21 @@ ___
#### Defined in
[medusa/src/services/product-category.ts:349](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L349)
[medusa/src/services/product-category.ts:349](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L349)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`, `treeSelector?`): `Promise`<[`ProductCategory`[], `number`]\>
**listAndCount**(`selector`, `config?`, `treeSelector?`): `Promise`<[`ProductCategory`[], `number`]\>
Lists product category based on the provided parameters and includes the count of
product category that match the query.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `TreeQuerySelector`<`ProductCategory`\> | Filter options for product category. |
| `config` | `FindConfig`<`ProductCategory`\> | Configuration for query. |
| `treeSelector` | `QuerySelector`<`ProductCategory`\> | Filter options for product category tree relations |
@@ -309,47 +310,51 @@ product category that match the query.
`Promise`<[`ProductCategory`[], `number`]\>
an array containing the product category as
-`Promise`: an array containing the product category as
the first element and the total count of product category that matches the query
as the second element.
-`ProductCategory[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/product-category.ts:61](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L61)
[medusa/src/services/product-category.ts:61](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L61)
___
### performReordering
▸ `Protected` **performReordering**(`repository`, `conditions`): `Promise`<`void`\>
`Protected` **performReordering**(`repository`, `conditions`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } |
| Name |
| :------ |
| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: Method addProducts ; `findOneWithDescendants`: Method findOneWithDescendants ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `removeProducts`: Method removeProducts } |
| `conditions` | `ReorderConditions` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/product-category.ts:377](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L377)
[medusa/src/services/product-category.ts:377](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L377)
___
### removeProducts
▸ **removeProducts**(`productCategoryId`, `productIds`): `Promise`<`void`\>
**removeProducts**(`productCategoryId`, `productIds`): `Promise`<`void`\>
Remove a batch of product from a product category
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `productCategoryId` | `string` | The id of the product category on which to remove the products |
| `productIds` | `string`[] | The products ids to remove from the product category |
@@ -357,174 +362,182 @@ Remove a batch of product from a product category
`Promise`<`void`\>
the product category on which the products have been removed
-`Promise`: the product category on which the products have been removed
#### Defined in
[medusa/src/services/product-category.ts:333](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L333)
[medusa/src/services/product-category.ts:333](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L333)
___
### retrieve
▸ **retrieve**(`productCategoryId`, `config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\>
**retrieve**(`productCategoryId`, `config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\>
Retrieves a product category by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `productCategoryId` | `string` | the id of the product category to retrieve. |
| `config` | `FindConfig`<`ProductCategory`\> | the config of the product category to retrieve. |
| `selector` | `Selector`<`ProductCategory`\> | |
| `treeSelector` | `QuerySelector`<`ProductCategory`\> | |
| `selector` | `Selector`<`ProductCategory`\> |
| `treeSelector` | `QuerySelector`<`ProductCategory`\> |
#### Returns
`Promise`<`ProductCategory`\>
the product category.
-`Promise`: the product category.
-`ProductCategory`:
#### Defined in
[medusa/src/services/product-category.ts:139](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L139)
[medusa/src/services/product-category.ts:139](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L139)
___
### retrieveByHandle
▸ **retrieveByHandle**(`handle`, `config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\>
**retrieveByHandle**(`handle`, `config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\>
Retrieves a product category by handle.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `handle` | `string` | the handle of the category |
| `config` | `FindConfig`<`ProductCategory`\> | the config of the product category to retrieve. |
| `selector` | `Selector`<`ProductCategory`\> | |
| `treeSelector` | `QuerySelector`<`ProductCategory`\> | |
| `selector` | `Selector`<`ProductCategory`\> |
| `treeSelector` | `QuerySelector`<`ProductCategory`\> |
#### Returns
`Promise`<`ProductCategory`\>
the product category.
-`Promise`: the product category.
-`ProductCategory`:
#### Defined in
[medusa/src/services/product-category.ts:165](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L165)
[medusa/src/services/product-category.ts:165](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L165)
___
### retrieve\_
▸ `Protected` **retrieve_**(`config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\>
`Protected` **retrieve_**(`config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\>
A generic retrieve for fining product categories by different attributes.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `config` | `FindConfig`<`ProductCategory`\> | the config of the product category to retrieve. |
| `selector` | `Selector`<`ProductCategory`\> | |
| `treeSelector` | `QuerySelector`<`ProductCategory`\> | |
| `selector` | `Selector`<`ProductCategory`\> |
| `treeSelector` | `QuerySelector`<`ProductCategory`\> |
#### Returns
`Promise`<`ProductCategory`\>
the product category.
-`Promise`: the product category.
-`ProductCategory`:
#### Defined in
[medusa/src/services/product-category.ts:102](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L102)
[medusa/src/services/product-category.ts:102](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L102)
___
### shiftSiblings
▸ `Protected` **shiftSiblings**(`repository`, `conditions`): `Promise`<`void`\>
`Protected` **shiftSiblings**(`repository`, `conditions`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } |
| Name |
| :------ |
| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: Method addProducts ; `findOneWithDescendants`: Method findOneWithDescendants ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `removeProducts`: Method removeProducts } |
| `conditions` | `ReorderConditions` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/product-category.ts:415](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L415)
[medusa/src/services/product-category.ts:415](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L415)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### transformParentIdToEntity
▸ `Protected` **transformParentIdToEntity**(`productCategoryInput`): `Promise`<`CreateProductCategoryInput` \| `UpdateProductCategoryInput`\>
`Protected` **transformParentIdToEntity**(`productCategoryInput`): `Promise`<`CreateProductCategoryInput` \| `UpdateProductCategoryInput`\>
Accepts an input object and transforms product_category_id
into product_category entity.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `productCategoryInput` | `CreateProductCategoryInput` \| `UpdateProductCategoryInput` | params used to create/update |
#### Returns
`Promise`<`CreateProductCategoryInput` \| `UpdateProductCategoryInput`\>
transformed productCategoryInput
-`Promise`: transformed productCategoryInput
-`CreateProductCategoryInput \| UpdateProductCategoryInput`: (optional)
#### Defined in
[medusa/src/services/product-category.ts:513](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L513)
[medusa/src/services/product-category.ts:513](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L513)
___
### update
▸ **update**(`productCategoryId`, `productCategoryInput`): `Promise`<`ProductCategory`\>
**update**(`productCategoryId`, `productCategoryInput`): `Promise`<`ProductCategory`\>
Updates a product category
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `productCategoryId` | `string` | id of product category to update |
| `productCategoryInput` | `UpdateProductCategoryInput` | parameters to update in product category |
@@ -532,32 +545,35 @@ Updates a product category
`Promise`<`ProductCategory`\>
updated product category
-`Promise`: updated product category
-`ProductCategory`:
#### Defined in
[medusa/src/services/product-category.ts:221](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L221)
[medusa/src/services/product-category.ts:221](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L221)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ProductCategoryService`](ProductCategoryService.md)
**withTransaction**(`transactionManager?`): [`ProductCategoryService`](ProductCategoryService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ProductCategoryService`](ProductCategoryService.md)
-`ProductCategoryService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: ProductCollectionService
# ProductCollectionService
Provides layer to manipulate product collections.
@@ -12,12 +12,12 @@ Provides layer to manipulate product collections.
### constructor
• **new ProductCollectionService**(`«destructured»`)
**new ProductCollectionService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/product-collection.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L49)
[medusa/src/services/product-collection.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L49)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/product-collection.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L36)
[medusa/src/services/product-collection.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L36)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -92,33 +92,33 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### productCollectionRepository\_
• `Protected` `Readonly` **productCollectionRepository\_**: `Repository`<`ProductCollection`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductCollection`\>) => `Promise`<[`ProductCollection`[], `number`]\> }
`Protected` `Readonly` **productCollectionRepository\_**: `Repository`<`ProductCollection`\> & { `findAndCountByDiscountConditionId`: Method findAndCountByDiscountConditionId }
#### Defined in
[medusa/src/services/product-collection.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L38)
[medusa/src/services/product-collection.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L38)
___
### productRepository\_
• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: (`qb`: `SelectQueryBuilder`<`Product`\>, `__namedParameters`: `Object`) => `SelectQueryBuilder`<`Product`\> ; `_findWithRelations`: (`__namedParameters`: { `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions` ; `relations`: `string`[] ; `shouldCount`: `boolean` ; `withDeleted`: `boolean` }) => `Promise`<[`Product`[], `number`]\> ; `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findOneWithRelations`: (`relations`: `string`[], `optionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<`Product`\> ; `findWithRelations`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions`, `withDeleted`: `boolean`) => `Promise`<`Product`[]\> ; `findWithRelationsAndCount`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<[`Product`[], `number`]\> ; `getCategoryIdsFromInput`: (`categoryId?`: `CategoryQueryParams`, `includeCategoryChildren`: `boolean`) => `Promise`<`string`[]\> ; `getCategoryIdsRecursively`: (`productCategory`: `ProductCategory`) => `string`[] ; `getFreeTextSearchResultsAndCount`: (`q`: `string`, `options`: `FindWithoutRelationsOptions`, `relations`: `string`[]) => `Promise`<[`Product`[], `number`]\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `queryProducts`: (`optionsWithoutRelations`: `FindWithoutRelationsOptions`, `shouldCount`: `boolean`) => `Promise`<[`Product`[], `number`]\> ; `queryProductsWithIds`: (`__namedParameters`: { `entityIds`: `string`[] ; `groupedRelations`: { `[toplevel: string]`: `string`[]; } ; `order?`: { `[column: string]`: ``"ASC"`` \| ``"DESC"``; } ; `select?`: keyof `Product`[] ; `where?`: `FindOptionsWhere`<`Product`\> ; `withDeleted?`: `boolean` }) => `Promise`<`Product`[]\> }
`Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: Method \_applyCategoriesQuery ; `_findWithRelations`: Method \_findWithRelations ; `bulkAddToCollection`: Method bulkAddToCollection ; `bulkRemoveFromCollection`: Method bulkRemoveFromCollection ; `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations ; `findWithRelationsAndCount`: Method findWithRelationsAndCount ; `getCategoryIdsFromInput`: Method getCategoryIdsFromInput ; `getCategoryIdsRecursively`: Method getCategoryIdsRecursively ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `isProductInSalesChannels`: Method isProductInSalesChannels ; `queryProducts`: Method queryProducts ; `queryProductsWithIds`: Method queryProductsWithIds }
#### Defined in
[medusa/src/services/product-collection.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L39)
[medusa/src/services/product-collection.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L39)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -126,13 +126,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` `Readonly` **Events**: `Object`
`Static` `Readonly` **Events**: `Object`
#### Type declaration
@@ -146,36 +146,38 @@ ___
#### Defined in
[medusa/src/services/product-collection.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L41)
[medusa/src/services/product-collection.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L41)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addProducts
▸ **addProducts**(`collectionId`, `productIds`): `Promise`<`ProductCollection`\>
**addProducts**(`collectionId`, `productIds`): `Promise`<`ProductCollection`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `collectionId` | `string` |
| `productIds` | `string`[] |
@@ -183,31 +185,32 @@ TransactionBaseService.activeManager\_
`Promise`<`ProductCollection`\>
-`Promise`:
-`ProductCollection`:
#### Defined in
[medusa/src/services/product-collection.ts:216](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L216)
[medusa/src/services/product-collection.ts:216](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L216)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -216,7 +219,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -224,95 +227,98 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`collection`): `Promise`<`ProductCollection`\>
**create**(`collection`): `Promise`<`ProductCollection`\>
Creates a product collection
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `collection` | `CreateProductCollection` | the collection to create |
#### Returns
`Promise`<`ProductCollection`\>
created collection
-`Promise`: created collection
-`ProductCollection`:
#### Defined in
[medusa/src/services/product-collection.ts:128](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L128)
[medusa/src/services/product-collection.ts:128](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L128)
___
### delete
▸ **delete**(`collectionId`): `Promise`<`void`\>
**delete**(`collectionId`): `Promise`<`void`\>
Deletes a product collection idempotently
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `collectionId` | `string` | id of collection to delete |
#### Returns
`Promise`<`void`\>
empty promise
-`Promise`: empty promise
#### Defined in
[medusa/src/services/product-collection.ts:192](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L192)
[medusa/src/services/product-collection.ts:192](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L192)
___
### list
▸ **list**(`selector?`, `config?`): `Promise`<`ProductCollection`[]\>
**list**(`selector?`, `config?`): `Promise`<`ProductCollection`[]\>
Lists product collections
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `selector` | `Selector`<`ProductCollection`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | `{}` | the query object for find |
| `config` | `Object` | `undefined` | the config to be used for find |
| `config.skip` | `number` | `0` | - |
| `config.take` | `number` | `20` | - |
| Name | Default value | Description |
| :------ | :------ | :------ |
| `selector` | `Selector`<`ProductCollection`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find |
| `config` | `object` | the config to be used for find |
| `config.skip` | `number` | `0` |
| `config.take` | `number` | `20` |
#### Returns
`Promise`<`ProductCollection`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ProductCollection[]`:
-`ProductCollection`:
#### Defined in
[medusa/src/services/product-collection.ts:274](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L274)
[medusa/src/services/product-collection.ts:274](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L274)
___
### listAndCount
▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`ProductCollection`[], `number`]\>
**listAndCount**(`selector?`, `config?`): `Promise`<[`ProductCollection`[], `number`]\>
Lists product collections and add count.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `ListAndCountSelector` | the query object for find |
| `config` | `FindConfig`<`ProductCollection`\> | the config to be used for find |
@@ -320,22 +326,24 @@ Lists product collections and add count.
`Promise`<[`ProductCollection`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ProductCollection[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/product-collection.ts:291](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L291)
[medusa/src/services/product-collection.ts:291](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L291)
___
### removeProducts
▸ **removeProducts**(`collectionId`, `productIds`): `Promise`<`void`\>
**removeProducts**(`collectionId`, `productIds`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `collectionId` | `string` |
| `productIds` | `string`[] |
@@ -343,22 +351,24 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/product-collection.ts:242](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L242)
[medusa/src/services/product-collection.ts:242](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L242)
___
### retrieve
▸ **retrieve**(`collectionId`, `config?`): `Promise`<`ProductCollection`\>
**retrieve**(`collectionId`, `config?`): `Promise`<`ProductCollection`\>
Retrieves a product collection by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `collectionId` | `string` | the id of the collection to retrieve. |
| `config` | `FindConfig`<`ProductCollection`\> | the config of the collection to retrieve. |
@@ -366,24 +376,25 @@ Retrieves a product collection by id.
`Promise`<`ProductCollection`\>
the collection.
-`Promise`: the collection.
-`ProductCollection`:
#### Defined in
[medusa/src/services/product-collection.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L68)
[medusa/src/services/product-collection.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L68)
___
### retrieveByHandle
▸ **retrieveByHandle**(`collectionHandle`, `config?`): `Promise`<`ProductCollection`\>
**retrieveByHandle**(`collectionHandle`, `config?`): `Promise`<`ProductCollection`\>
Retrieves a product collection by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `collectionHandle` | `string` | the handle of the collection to retrieve. |
| `config` | `FindConfig`<`ProductCollection`\> | query config for request |
@@ -391,48 +402,51 @@ Retrieves a product collection by id.
`Promise`<`ProductCollection`\>
the collection.
-`Promise`: the collection.
-`ProductCollection`:
#### Defined in
[medusa/src/services/product-collection.ts:102](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L102)
[medusa/src/services/product-collection.ts:102](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L102)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`collectionId`, `update`): `Promise`<`ProductCollection`\>
**update**(`collectionId`, `update`): `Promise`<`ProductCollection`\>
Updates a product collection
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `collectionId` | `string` | id of collection to update |
| `update` | `UpdateProductCollection` | update object |
@@ -440,32 +454,35 @@ Updates a product collection
`Promise`<`ProductCollection`\>
update collection
-`Promise`: update collection
-`ProductCollection`:
#### Defined in
[medusa/src/services/product-collection.ts:154](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L154)
[medusa/src/services/product-collection.ts:154](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L154)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ProductCollectionService`](ProductCollectionService.md)
**withTransaction**(`transactionManager?`): [`ProductCollectionService`](ProductCollectionService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ProductCollectionService`](ProductCollectionService.md)
-`ProductCollectionService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,4 @@
# Class: ProductTypeService
# ProductTypeService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new ProductTypeService**(`«destructured»`)
**new ProductTypeService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `Object` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/product-type.ts:12](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L12)
[medusa/src/services/product-type.ts:12](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L12)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,13 +66,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -80,13 +80,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -94,57 +94,57 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### typeRepository\_
• `Protected` `Readonly` **typeRepository\_**: `Repository`<`ProductType`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductType`\>) => `Promise`<[`ProductType`[], `number`]\> ; `upsertType`: (`type?`: `UpsertTypeInput`) => `Promise`<``null`` \| `ProductType`\> }
`Protected` `Readonly` **typeRepository\_**: `Repository`<`ProductType`\> & { `findAndCountByDiscountConditionId`: Method findAndCountByDiscountConditionId ; `upsertType`: Method upsertType }
#### Defined in
[medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L10)
[medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L10)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -153,7 +153,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -161,20 +161,20 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### list
▸ **list**(`selector?`, `config?`): `Promise`<`ProductType`[]\>
**list**(`selector?`, `config?`): `Promise`<`ProductType`[]\>
Lists product types
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`ProductType`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find |
| `config` | `FindConfig`<`ProductType`\> | the config to be used for find |
@@ -182,24 +182,26 @@ Lists product types
`Promise`<`ProductType`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ProductType[]`:
-`ProductType`:
#### Defined in
[medusa/src/services/product-type.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L52)
[medusa/src/services/product-type.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L52)
___
### listAndCount
▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`ProductType`[], `number`]\>
**listAndCount**(`selector?`, `config?`): `Promise`<[`ProductType`[], `number`]\>
Lists product types and adds count.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`ProductType`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find |
| `config` | `FindConfig`<`ProductType`\> | the config to be used for find |
@@ -207,25 +209,27 @@ Lists product types and adds count.
`Promise`<[`ProductType`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ProductType[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/product-type.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L69)
[medusa/src/services/product-type.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L69)
___
### retrieve
▸ **retrieve**(`id`, `config?`): `Promise`<`ProductType`\>
**retrieve**(`id`, `config?`): `Promise`<`ProductType`\>
Gets a product type by id.
Throws in case of DB Error and if product was not found.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | id of the product to get. |
| `config` | `FindConfig`<`ProductType`\> | object that defines what should be included in the query response |
@@ -233,56 +237,61 @@ Throws in case of DB Error and if product was not found.
`Promise`<`ProductType`\>
the result of the find one operation.
-`Promise`: the result of the find one operation.
-`ProductType`:
#### Defined in
[medusa/src/services/product-type.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L27)
[medusa/src/services/product-type.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L27)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ProductTypeService`](ProductTypeService.md)
**withTransaction**(`transactionManager?`): [`ProductTypeService`](ProductTypeService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ProductTypeService`](ProductTypeService.md)
-`ProductTypeService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: ProductVariantInventoryService
# ProductVariantInventoryService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new ProductVariantInventoryService**(`«destructured»`)
**new ProductVariantInventoryService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/product-variant-inventory.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L50)
[medusa/src/services/product-variant-inventory.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L50)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### cacheService\_
• `Protected` `Readonly` **cacheService\_**: `ICacheService`
`Protected` `Readonly` **cacheService\_**: `ICacheService`
#### Defined in
[medusa/src/services/product-variant-inventory.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L48)
[medusa/src/services/product-variant-inventory.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L48)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: `IEventBusService`
`Protected` `Readonly` **eventBusService\_**: `IEventBusService`
#### Defined in
[medusa/src/services/product-variant-inventory.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L47)
[medusa/src/services/product-variant-inventory.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L47)
___
### inventoryService\_
• `Protected` `Readonly` **inventoryService\_**: `IInventoryService`
`Protected` `Readonly` **inventoryService\_**: `IInventoryService`
#### Defined in
[medusa/src/services/product-variant-inventory.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L46)
[medusa/src/services/product-variant-inventory.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L46)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Overrides
@@ -110,53 +110,53 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/services/product-variant-inventory.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L39)
[medusa/src/services/product-variant-inventory.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L39)
___
### productVariantService\_
• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md)
`Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md)
#### Defined in
[medusa/src/services/product-variant-inventory.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L44)
[medusa/src/services/product-variant-inventory.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L44)
___
### salesChannelInventoryService\_
• `Protected` `Readonly` **salesChannelInventoryService\_**: [`SalesChannelInventoryService`](SalesChannelInventoryService.md)
`Protected` `Readonly` **salesChannelInventoryService\_**: [`SalesChannelInventoryService`](SalesChannelInventoryService.md)
#### Defined in
[medusa/src/services/product-variant-inventory.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L43)
[medusa/src/services/product-variant-inventory.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L43)
___
### salesChannelLocationService\_
• `Protected` `Readonly` **salesChannelLocationService\_**: [`SalesChannelLocationService`](SalesChannelLocationService.md)
`Protected` `Readonly` **salesChannelLocationService\_**: [`SalesChannelLocationService`](SalesChannelLocationService.md)
#### Defined in
[medusa/src/services/product-variant-inventory.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L42)
[medusa/src/services/product-variant-inventory.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L42)
___
### stockLocationService\_
• `Protected` `Readonly` **stockLocationService\_**: `IStockLocationService`
`Protected` `Readonly` **stockLocationService\_**: `IStockLocationService`
#### Defined in
[medusa/src/services/product-variant-inventory.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L45)
[medusa/src/services/product-variant-inventory.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L45)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Overrides
@@ -164,38 +164,40 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/services/product-variant-inventory.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L40)
[medusa/src/services/product-variant-inventory.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L40)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### adjustInventory
▸ **adjustInventory**(`variantId`, `locationId`, `quantity`): `Promise`<`void`\>
**adjustInventory**(`variantId`, `locationId`, `quantity`): `Promise`<`void`\>
Adjusts inventory of a variant on a location
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `variantId` | `string` | variant id |
| `locationId` | `string` | location id |
| `quantity` | `number` | quantity to adjust |
@@ -204,22 +206,24 @@ Adjusts inventory of a variant on a location
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:740](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L740)
[medusa/src/services/product-variant-inventory.ts:740](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L740)
___
### adjustReservationsQuantityByLineItem
▸ **adjustReservationsQuantityByLineItem**(`lineItemId`, `variantId`, `locationId`, `quantity`): `Promise`<`void`\>
**adjustReservationsQuantityByLineItem**(`lineItemId`, `variantId`, `locationId`, `quantity`): `Promise`<`void`\>
Adjusts the quantity of reservations for a line item by a given amount.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `lineItemId` | `string` | The ID of the line item |
| `variantId` | `string` | The ID of the variant |
| `locationId` | `string` | The ID of the location to prefer adjusting quantities at |
@@ -229,31 +233,31 @@ Adjusts the quantity of reservations for a line item by a given amount.
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:530](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L530)
[medusa/src/services/product-variant-inventory.ts:530](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L530)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -262,7 +266,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -270,38 +274,40 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### attachInventoryItem
▸ **attachInventoryItem**(`attachments`): `Promise`<`ProductVariantInventoryItem`[]\>
**attachInventoryItem**(`attachments`): `Promise`<`ProductVariantInventoryItem`[]\>
Attach a variant to an inventory item
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `attachments` | { `inventoryItemId`: `string` ; `requiredQuantity?`: `number` ; `variantId`: `string` }[] |
#### Returns
`Promise`<`ProductVariantInventoryItem`[]\>
the variant inventory item
-`Promise`: the variant inventory item
-`ProductVariantInventoryItem[]`:
-`ProductVariantInventoryItem`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:257](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L257)
[medusa/src/services/product-variant-inventory.ts:257](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L257)
▸ **attachInventoryItem**(`variantId`, `inventoryItemId`, `requiredQuantity?`): `Promise`<`ProductVariantInventoryItem`[]\>
**attachInventoryItem**(`variantId`, `inventoryItemId`, `requiredQuantity?`): `Promise`<`ProductVariantInventoryItem`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `variantId` | `string` |
| `inventoryItemId` | `string` |
| `requiredQuantity?` | `number` |
@@ -310,49 +316,53 @@ the variant inventory item
`Promise`<`ProductVariantInventoryItem`[]\>
-`Promise`:
-`ProductVariantInventoryItem[]`:
-`ProductVariantInventoryItem`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:264](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L264)
[medusa/src/services/product-variant-inventory.ts:264](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L264)
___
### confirmInventory
▸ **confirmInventory**(`variantId`, `quantity`, `context?`): `Promise`<`Boolean`\>
**confirmInventory**(`variantId`, `quantity`, `context?`): `Promise`<`Boolean`\>
confirms if requested inventory is available
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `variantId` | `string` | id of the variant to confirm inventory for |
| `quantity` | `number` | quantity of inventory to confirm is available |
| `context` | `Object` | optionally include a sales channel if applicable |
| `context.salesChannelId?` | ``null`` \| `string` | - |
| `context` | `object` | optionally include a sales channel if applicable |
| `context.salesChannelId?` | ``null`` \| `string` |
#### Returns
`Promise`<`Boolean`\>
boolean indicating if inventory is available
-`Promise`: boolean indicating if inventory is available
#### Defined in
[medusa/src/services/product-variant-inventory.ts:76](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L76)
[medusa/src/services/product-variant-inventory.ts:76](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L76)
___
### deleteReservationsByLineItem
▸ **deleteReservationsByLineItem**(`lineItemId`, `variantId`, `quantity`): `Promise`<`void`\>
**deleteReservationsByLineItem**(`lineItemId`, `variantId`, `quantity`): `Promise`<`void`\>
delete a reservation of variant quantity
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `lineItemId` | `string` \| `string`[] | line item id |
| `variantId` | `string` | variant id |
| `quantity` | `number` | quantity to release |
@@ -361,22 +371,24 @@ delete a reservation of variant quantity
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:705](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L705)
[medusa/src/services/product-variant-inventory.ts:705](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L705)
___
### detachInventoryItem
▸ **detachInventoryItem**(`inventoryItemId`, `variantId?`): `Promise`<`void`\>
**detachInventoryItem**(`inventoryItemId`, `variantId?`): `Promise`<`void`\>
Remove a variant from an inventory item
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `inventoryItemId` | `string` | inventory item id |
| `variantId?` | `string` | variant id or undefined if all the variants will be affected |
@@ -384,20 +396,22 @@ Remove a variant from an inventory item
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:409](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L409)
[medusa/src/services/product-variant-inventory.ts:409](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L409)
___
### getAvailabilityContext
▸ `Private` **getAvailabilityContext**(`variants`, `salesChannelId`, `existingContext?`): `Promise`<`Required`<`AvailabilityContext`\>\>
`Private` **getAvailabilityContext**(`variants`, `salesChannelId`, `existingContext?`): `Promise`<`Required`<`AvailabilityContext`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `variants` | `string`[] |
| `salesChannelId` | `undefined` \| `string` \| `string`[] |
| `existingContext` | `AvailabilityContext` |
@@ -406,15 +420,18 @@ ___
`Promise`<`Required`<`AvailabilityContext`\>\>
-`Promise`:
-`Required`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:843](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L843)
[medusa/src/services/product-variant-inventory.ts:843](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L843)
___
### getVariantQuantityFromVariantInventoryItems
▸ **getVariantQuantityFromVariantInventoryItems**(`variantInventoryItems`, `channelId`): `Promise`<`number`\>
**getVariantQuantityFromVariantInventoryItems**(`variantInventoryItems`, `channelId`): `Promise`<`number`\>
Get the quantity of a variant from a list of variantInventoryItems
The inventory quantity of the variant should be equal to the inventory
@@ -423,8 +440,8 @@ the given variant.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `variantInventoryItems` | `ProductVariantInventoryItem`[] | List of inventoryItems for a given variant, These must all be for the same variant |
| `channelId` | `string` | Sales channel id to fetch availability for |
@@ -432,120 +449,128 @@ the given variant.
`Promise`<`number`\>
The available quantity of the variant from the inventoryItems
-`Promise`: The available quantity of the variant from the inventoryItems
-`number`: (optional)
#### Defined in
[medusa/src/services/product-variant-inventory.ts:954](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L954)
[medusa/src/services/product-variant-inventory.ts:954](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L954)
___
### listByItem
▸ **listByItem**(`itemIds`): `Promise`<`ProductVariantInventoryItem`[]\>
**listByItem**(`itemIds`): `Promise`<`ProductVariantInventoryItem`[]\>
list registered inventory items
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `itemIds` | `string`[] | list inventory item ids |
#### Returns
`Promise`<`ProductVariantInventoryItem`[]\>
list of inventory items
-`Promise`: list of inventory items
-`ProductVariantInventoryItem[]`:
-`ProductVariantInventoryItem`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:179](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L179)
[medusa/src/services/product-variant-inventory.ts:179](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L179)
___
### listByVariant
▸ **listByVariant**(`variantId`): `Promise`<`ProductVariantInventoryItem`[]\>
**listByVariant**(`variantId`): `Promise`<`ProductVariantInventoryItem`[]\>
List inventory items for a specific variant
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `variantId` | `string` \| `string`[] | variant id |
#### Returns
`Promise`<`ProductVariantInventoryItem`[]\>
variant inventory items for the variant id
-`Promise`: variant inventory items for the variant id
-`ProductVariantInventoryItem[]`:
-`ProductVariantInventoryItem`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:196](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L196)
[medusa/src/services/product-variant-inventory.ts:196](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L196)
___
### listInventoryItemsByVariant
▸ **listInventoryItemsByVariant**(`variantId`): `Promise`<`InventoryItemDTO`[]\>
**listInventoryItemsByVariant**(`variantId`): `Promise`<`InventoryItemDTO`[]\>
lists inventory items for a given variant
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `variantId` | `string` | variant id |
#### Returns
`Promise`<`InventoryItemDTO`[]\>
lidt of inventory items for the variant
-`Promise`: lidt of inventory items for the variant
-`InventoryItemDTO[]`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:235](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L235)
[medusa/src/services/product-variant-inventory.ts:235](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L235)
___
### listVariantsByItem
▸ **listVariantsByItem**(`itemId`): `Promise`<`ProductVariant`[]\>
**listVariantsByItem**(`itemId`): `Promise`<`ProductVariant`[]\>
lists variant by inventory item id
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `itemId` | `string` | item id |
#### Returns
`Promise`<`ProductVariant`[]\>
a list of product variants that are associated with the item id
-`Promise`: a list of product variants that are associated with the item id
-`ProductVariant[]`:
-`ProductVariant`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:217](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L217)
[medusa/src/services/product-variant-inventory.ts:217](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L217)
___
### reserveQuantity
▸ **reserveQuantity**(`variantId`, `quantity`, `context?`): `Promise`<`void` \| `ReservationItemDTO`[]\>
**reserveQuantity**(`variantId`, `quantity`, `context?`): `Promise`<`void` \| `ReservationItemDTO`[]\>
Reserves a quantity of a variant
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `variantId` | `string` | variant id |
| `quantity` | `number` | quantity to reserve |
| `context` | `ReserveQuantityContext` | optional parameters |
@@ -554,22 +579,25 @@ Reserves a quantity of a variant
`Promise`<`void` \| `ReservationItemDTO`[]\>
-`Promise`:
-`void \| ReservationItemDTO[]`: (optional)
#### Defined in
[medusa/src/services/product-variant-inventory.ts:439](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L439)
[medusa/src/services/product-variant-inventory.ts:439](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L439)
___
### retrieve
▸ **retrieve**(`inventoryItemId`, `variantId`): `Promise`<`ProductVariantInventoryItem`\>
**retrieve**(`inventoryItemId`, `variantId`): `Promise`<`ProductVariantInventoryItem`\>
Retrieves a product variant inventory item by its inventory item ID and variant ID.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `inventoryItemId` | `string` | The ID of the inventory item to retrieve. |
| `variantId` | `string` | The ID of the variant to retrieve. |
@@ -577,22 +605,23 @@ Retrieves a product variant inventory item by its inventory item ID and variant
`Promise`<`ProductVariantInventoryItem`\>
A promise that resolves with the product variant inventory item.
-`Promise`: A promise that resolves with the product variant inventory item.
-`ProductVariantInventoryItem`:
#### Defined in
[medusa/src/services/product-variant-inventory.ts:152](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L152)
[medusa/src/services/product-variant-inventory.ts:152](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L152)
___
### setProductAvailability
▸ **setProductAvailability**(`products`, `salesChannelId`): `Promise`<(`Product` \| `PricedProduct`)[]\>
**setProductAvailability**(`products`, `salesChannelId`): `Promise`<(`Product` \| `PricedProduct`)[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `products` | (`Product` \| `PricedProduct`)[] |
| `salesChannelId` | `undefined` \| `string` \| `string`[] |
@@ -600,20 +629,24 @@ ___
`Promise`<(`Product` \| `PricedProduct`)[]\>
-`Promise`:
-`(Product \| PricedProduct)[]`:
-`Product \| PricedProduct`: (optional)
#### Defined in
[medusa/src/services/product-variant-inventory.ts:910](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L910)
[medusa/src/services/product-variant-inventory.ts:910](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L910)
___
### setVariantAvailability
▸ **setVariantAvailability**(`variants`, `salesChannelId`, `availabilityContext?`): `Promise`<`ProductVariant`[] \| `PricedVariant`[]\>
**setVariantAvailability**(`variants`, `salesChannelId`, `availabilityContext?`): `Promise`<`ProductVariant`[] \| `PricedVariant`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `variants` | `ProductVariant`[] \| `PricedVariant`[] |
| `salesChannelId` | `undefined` \| `string` \| `string`[] |
| `availabilityContext` | `AvailabilityContext` |
@@ -622,46 +655,51 @@ ___
`Promise`<`ProductVariant`[] \| `PricedVariant`[]\>
-`Promise`:
-`ProductVariant[] \| PricedVariant[]`: (optional)
#### Defined in
[medusa/src/services/product-variant-inventory.ts:784](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L784)
[medusa/src/services/product-variant-inventory.ts:784](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L784)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### validateInventoryAtLocation
▸ **validateInventoryAtLocation**(`items`, `locationId`): `Promise`<`void`\>
**validateInventoryAtLocation**(`items`, `locationId`): `Promise`<`void`\>
Validate stock at a location for fulfillment items
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `items` | `Omit`<`LineItem`, ``"beforeInsert"``\>[] | Fulfillment Line items to validate quantities for |
| `locationId` | `string` | Location to validate stock at |
@@ -669,32 +707,34 @@ Validate stock at a location for fulfillment items
`Promise`<`void`\>
nothing if successful, throws error if not
-`Promise`: nothing if successful, throws error if not
#### Defined in
[medusa/src/services/product-variant-inventory.ts:640](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L640)
[medusa/src/services/product-variant-inventory.ts:640](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L640)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
**withTransaction**(`transactionManager?`): [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ProductVariantInventoryService`](ProductVariantInventoryService.md)
-`ProductVariantInventoryService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,4 @@
# Class: RegionService
# RegionService
Provides layer to manipulate regions.
@@ -12,12 +12,12 @@ Provides layer to manipulate regions.
### constructor
• **new RegionService**(`«destructured»`)
**new RegionService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/region.ts:64](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L64)
[medusa/src/services/region.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L64)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,73 +68,73 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### countryRepository\_
• `Protected` `Readonly` **countryRepository\_**: `Repository`<`Country`\>
`Protected` `Readonly` **countryRepository\_**: `Repository`<`Country`\>
#### Defined in
[medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L56)
[medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L56)
___
### currencyRepository\_
• `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\>
`Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\>
#### Defined in
[medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L57)
[medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L57)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/region.ts:51](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L51)
[medusa/src/services/region.ts:51](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L51)
___
### featureFlagRouter\_
• `Protected` **featureFlagRouter\_**: `FlagRouter`
`Protected` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/region.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L49)
[medusa/src/services/region.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L49)
___
### fulfillmentProviderRepository\_
• `Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\>
`Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\>
#### Defined in
[medusa/src/services/region.ts:61](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L61)
[medusa/src/services/region.ts:61](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L61)
___
### fulfillmentProviderService\_
• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
`Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
#### Defined in
[medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L54)
[medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L54)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -142,63 +142,63 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### paymentProviderRepository\_
• `Protected` `Readonly` **paymentProviderRepository\_**: `Repository`<`PaymentProvider`\>
`Protected` `Readonly` **paymentProviderRepository\_**: `Repository`<`PaymentProvider`\>
#### Defined in
[medusa/src/services/region.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L59)
[medusa/src/services/region.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L59)
___
### paymentProviderService\_
• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
`Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
#### Defined in
[medusa/src/services/region.ts:53](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L53)
[medusa/src/services/region.ts:53](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L53)
___
### regionRepository\_
• `Protected` `Readonly` **regionRepository\_**: `Repository`<`Region`\>
`Protected` `Readonly` **regionRepository\_**: `Repository`<`Region`\>
#### Defined in
[medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L55)
[medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L55)
___
### storeService\_
• `Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md)
`Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md)
#### Defined in
[medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L52)
[medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L52)
___
### taxProviderRepository\_
• `Protected` `Readonly` **taxProviderRepository\_**: `Repository`<`TaxProvider`\>
`Protected` `Readonly` **taxProviderRepository\_**: `Repository`<`TaxProvider`\>
#### Defined in
[medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L62)
[medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L62)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -206,13 +206,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -224,38 +224,40 @@ ___
#### Defined in
[medusa/src/services/region.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L43)
[medusa/src/services/region.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L43)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addCountry
▸ **addCountry**(`regionId`, `code`): `Promise`<`Region`\>
**addCountry**(`regionId`, `code`): `Promise`<`Region`\>
Adds a country to the region.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionId` | `string` | the region to add a country to |
| `code` | `string` | a 2 digit alphanumeric ISO country code. |
@@ -263,25 +265,26 @@ Adds a country to the region.
`Promise`<`Region`\>
the updated Region
-`Promise`: the updated Region
-`Region`:
#### Defined in
[medusa/src/services/region.ts:577](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L577)
[medusa/src/services/region.ts:577](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L577)
___
### addFulfillmentProvider
▸ **addFulfillmentProvider**(`regionId`, `providerId`): `Promise`<`Region`\>
**addFulfillmentProvider**(`regionId`, `providerId`): `Promise`<`Region`\>
Adds a fulfillment provider that is available in the region. Fails if the
provider doesn't exist.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionId` | `string` | the region to add the provider to |
| `providerId` | `string` | the provider to add to the region |
@@ -289,25 +292,26 @@ provider doesn't exist.
`Promise`<`Region`\>
the updated Region
-`Promise`: the updated Region
-`Region`:
#### Defined in
[medusa/src/services/region.ts:705](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L705)
[medusa/src/services/region.ts:705](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L705)
___
### addPaymentProvider
▸ **addPaymentProvider**(`regionId`, `providerId`): `Promise`<`Region`\>
**addPaymentProvider**(`regionId`, `providerId`): `Promise`<`Region`\>
Adds a payment provider that is available in the region. Fails if the
provider doesn't exist.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionId` | `string` | the region to add the provider to |
| `providerId` | `string` | the provider to add to the region |
@@ -315,33 +319,32 @@ provider doesn't exist.
`Promise`<`Region`\>
the updated Region
-`Promise`: the updated Region
-`Region`:
#### Defined in
[medusa/src/services/region.ts:656](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L656)
[medusa/src/services/region.ts:656](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L656)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -350,7 +353,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -358,68 +361,69 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`Region`\>
**create**(`data`): `Promise`<`Region`\>
Creates a region.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `CreateRegionInput` | the unvalidated region |
#### Returns
`Promise`<`Region`\>
the newly created region
-`Promise`: the newly created region
-`Region`:
#### Defined in
[medusa/src/services/region.ts:100](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L100)
[medusa/src/services/region.ts:100](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L100)
___
### delete
▸ **delete**(`regionId`): `Promise`<`void`\>
**delete**(`regionId`): `Promise`<`void`\>
Deletes a region.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionId` | `string` | the region to delete |
#### Returns
`Promise`<`void`\>
the result of the delete operation
-`Promise`: the result of the delete operation
#### Defined in
[medusa/src/services/region.ts:546](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L546)
[medusa/src/services/region.ts:546](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L546)
___
### list
▸ **list**(`selector?`, `config?`): `Promise`<`Region`[]\>
**list**(`selector?`, `config?`): `Promise`<`Region`[]\>
Lists all regions based on a query
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Region`\> | query object for find |
| `config` | `FindConfig`<`Region`\> | configuration settings |
@@ -427,24 +431,26 @@ Lists all regions based on a query
`Promise`<`Region`[]\>
result of the find operation
-`Promise`: result of the find operation
-`Region[]`:
-`Region`:
#### Defined in
[medusa/src/services/region.ts:505](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L505)
[medusa/src/services/region.ts:505](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L505)
___
### listAndCount
▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`Region`[], `number`]\>
**listAndCount**(`selector?`, `config?`): `Promise`<[`Region`[], `number`]\>
Lists all regions based on a query and returns them along with count
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Region`\> | query object for find |
| `config` | `FindConfig`<`Region`\> | configuration settings |
@@ -452,24 +458,26 @@ Lists all regions based on a query and returns them along with count
`Promise`<[`Region`[], `number`]\>
result of the find operation
-`Promise`: result of the find operation
-`Region[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/region.ts:524](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L524)
[medusa/src/services/region.ts:524](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L524)
___
### removeCountry
▸ **removeCountry**(`regionId`, `code`): `Promise`<`Region`\>
**removeCountry**(`regionId`, `code`): `Promise`<`Region`\>
Removes a country from a Region.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionId` | `string` | the region to remove from |
| `code` | `string` | a 2 digit alphanumeric ISO country code to remove |
@@ -477,24 +485,25 @@ Removes a country from a Region.
`Promise`<`Region`\>
the updated Region
-`Promise`: the updated Region
-`Region`:
#### Defined in
[medusa/src/services/region.ts:615](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L615)
[medusa/src/services/region.ts:615](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L615)
___
### removeFulfillmentProvider
▸ **removeFulfillmentProvider**(`regionId`, `providerId`): `Promise`<`Region`\>
**removeFulfillmentProvider**(`regionId`, `providerId`): `Promise`<`Region`\>
Removes a fulfillment provider from a region. Is idempotent.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionId` | `string` | the region to remove the provider from |
| `providerId` | `string` | the provider to remove from the region |
@@ -502,24 +511,25 @@ Removes a fulfillment provider from a region. Is idempotent.
`Promise`<`Region`\>
the updated Region
-`Promise`: the updated Region
-`Region`:
#### Defined in
[medusa/src/services/region.ts:791](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L791)
[medusa/src/services/region.ts:791](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L791)
___
### removePaymentProvider
▸ **removePaymentProvider**(`regionId`, `providerId`): `Promise`<`Region`\>
**removePaymentProvider**(`regionId`, `providerId`): `Promise`<`Region`\>
Removes a payment provider from a region. Is idempotent.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionId` | `string` | the region to remove the provider from |
| `providerId` | `string` | the provider to remove from the region |
@@ -527,24 +537,25 @@ Removes a payment provider from a region. Is idempotent.
`Promise`<`Region`\>
the updated Region
-`Promise`: the updated Region
-`Region`:
#### Defined in
[medusa/src/services/region.ts:752](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L752)
[medusa/src/services/region.ts:752](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L752)
___
### retrieve
▸ **retrieve**(`regionId`, `config?`): `Promise`<`Region`\>
**retrieve**(`regionId`, `config?`): `Promise`<`Region`\>
Retrieves a region by its id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionId` | `string` | the id of the region to retrieve |
| `config` | `FindConfig`<`Region`\> | configuration settings |
@@ -552,24 +563,25 @@ Retrieves a region by its id.
`Promise`<`Region`\>
the region
-`Promise`: the region
-`Region`:
#### Defined in
[medusa/src/services/region.ts:470](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L470)
[medusa/src/services/region.ts:470](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L470)
___
### retrieveByCountryCode
▸ **retrieveByCountryCode**(`code`, `config?`): `Promise`<`Region`\>
**retrieveByCountryCode**(`code`, `config?`): `Promise`<`Region`\>
Retrieve a region by country code.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `code` | `string` | a 2 digit alphanumeric ISO country code |
| `config` | `FindConfig`<`Region`\> | region find config |
@@ -577,72 +589,76 @@ Retrieve a region by country code.
`Promise`<`Region`\>
a Region with country code
-`Promise`: a Region with country code
-`Region`:
#### Defined in
[medusa/src/services/region.ts:416](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L416)
[medusa/src/services/region.ts:416](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L416)
___
### retrieveByName
▸ **retrieveByName**(`name`): `Promise`<`Region`\>
**retrieveByName**(`name`): `Promise`<`Region`\>
Retrieves a region by name.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `name` | `string` | the name of the region to retrieve |
#### Returns
`Promise`<`Region`\>
region with the matching name
-`Promise`: region with the matching name
-`Region`:
#### Defined in
[medusa/src/services/region.ts:450](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L450)
[medusa/src/services/region.ts:450](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L450)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`regionId`, `update`): `Promise`<`Region`\>
**update**(`regionId`, `update`): `Promise`<`Region`\>
Updates a region
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionId` | `string` | the region to update |
| `update` | `UpdateRegionInput` | the data to update the region with |
@@ -650,25 +666,26 @@ Updates a region
`Promise`<`Region`\>
the result of the update operation
-`Promise`: the result of the update operation
-`Region`:
#### Defined in
[medusa/src/services/region.ts:171](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L171)
[medusa/src/services/region.ts:171](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L171)
___
### validateCountry
▸ `Protected` **validateCountry**(`code`, `regionId`): `Promise`<`Country`\>
`Protected` **validateCountry**(`code`, `regionId`): `Promise`<`Country`\>
Validates a country code. Will normalize the code before checking for
existence.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `code` | `string` | a 2 digit alphanumeric ISO country code |
| `regionId` | `string` | the id of the current region to check against |
@@ -676,59 +693,58 @@ existence.
`Promise`<`Country`\>
the validated Country
-`Promise`: the validated Country
-`Country`:
#### Defined in
[medusa/src/services/region.ts:367](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L367)
[medusa/src/services/region.ts:367](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L367)
___
### validateCurrency
▸ `Protected` **validateCurrency**(`currencyCode`): `Promise`<`void`\>
`Protected` **validateCurrency**(`currencyCode`): `Promise`<`void`\>
Validates a currency code. Will throw if the currency code doesn't exist.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `currencyCode` | `string` | an ISO currency code |
#### Returns
`Promise`<`void`\>
void
-`Promise`: void
**`Throws`**
**Throws**
if the provided currency code is invalid
#### Defined in
[medusa/src/services/region.ts:342](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L342)
[medusa/src/services/region.ts:342](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L342)
___
### validateFields
▸ `Protected` **validateFields**<`T`\>(`regionData`, `id?`): `Promise`<`DeepPartial`<`Region`\>\>
`Protected` **validateFields**<`T`\>(`regionData`, `id?`): `Promise`<`DeepPartial`<`Region`\>\>
Validates fields for creation and updates. If the region already exists
the id can be passed to check that country updates are allowed.
#### Type parameters
| Name | Type |
| :------ | :------ |
| `T` | extends `UpdateRegionInput` \| `CreateRegionInput` |
| `T` | `UpdateRegionInput` \| `CreateRegionInput` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `regionData` | `Omit`<`T`, ``"metadata"`` \| ``"currency_code"``\> | the region data to validate |
| `id?` | `T` extends `UpdateRegionInput` ? `string` : `undefined` | optional id of the region to check against |
@@ -736,60 +752,64 @@ the id can be passed to check that country updates are allowed.
`Promise`<`DeepPartial`<`Region`\>\>
the validated region data
-`Promise`: the validated region data
-`DeepPartial`:
-`Region`:
#### Defined in
[medusa/src/services/region.ts:240](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L240)
[medusa/src/services/region.ts:240](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L240)
___
### validateTaxRate
▸ `Protected` **validateTaxRate**(`taxRate`): `void`
`Protected` **validateTaxRate**(`taxRate`): `void`
Validates a tax rate. Will throw if the tax rate is not between 0 and 1.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `taxRate` | `number` | a number representing the tax rate of the region |
#### Returns
`void`
void
-`void`: (optional) void
**`Throws`**
**Throws**
if the tax rate isn't number between 0-100
#### Defined in
[medusa/src/services/region.ts:326](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L326)
[medusa/src/services/region.ts:326](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L326)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`RegionService`](RegionService.md)
**withTransaction**(`transactionManager?`): [`RegionService`](RegionService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`RegionService`](RegionService.md)
-`RegionService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: ReturnReasonService
# ReturnReasonService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new ReturnReasonService**(`«destructured»`)
**new ReturnReasonService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L18)
[medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L18)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,13 +66,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -80,23 +80,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### retReasonRepo\_
• `Protected` `Readonly` **retReasonRepo\_**: `Repository`<`ReturnReason`\>
`Protected` `Readonly` **retReasonRepo\_**: `Repository`<`ReturnReason`\>
#### Defined in
[medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L16)
[medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L16)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -104,47 +104,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -153,7 +153,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -161,58 +161,63 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`ReturnReason`\>
**create**(`data`): `Promise`<`ReturnReason`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateReturnReason` |
#### Returns
`Promise`<`ReturnReason`\>
-`Promise`:
-`ReturnReason`:
#### Defined in
[medusa/src/services/return-reason.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L25)
[medusa/src/services/return-reason.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L25)
___
### delete
▸ **delete**(`returnReasonId`): `Promise`<`void`\>
**delete**(`returnReasonId`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `returnReasonId` | `string` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/return-reason.ts:113](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L113)
[medusa/src/services/return-reason.ts:113](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L113)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`ReturnReason`[]\>
**list**(`selector`, `config?`): `Promise`<`ReturnReason`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`ReturnReason`\> | the query object for find |
| `config` | `FindConfig`<`ReturnReason`\> | config object |
@@ -220,24 +225,26 @@ ___
`Promise`<`ReturnReason`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ReturnReason[]`:
-`ReturnReason`:
#### Defined in
[medusa/src/services/return-reason.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L68)
[medusa/src/services/return-reason.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L68)
___
### retrieve
▸ **retrieve**(`returnReasonId`, `config?`): `Promise`<`ReturnReason`\>
**retrieve**(`returnReasonId`, `config?`): `Promise`<`ReturnReason`\>
Gets an order by id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `returnReasonId` | `string` | id of order to retrieve |
| `config` | `FindConfig`<`ReturnReason`\> | config object |
@@ -245,46 +252,49 @@ Gets an order by id.
`Promise`<`ReturnReason`\>
the order document
-`Promise`: the order document
-`ReturnReason`:
#### Defined in
[medusa/src/services/return-reason.ts:87](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L87)
[medusa/src/services/return-reason.ts:87](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L87)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`id`, `data`): `Promise`<`ReturnReason`\>
**update**(`id`, `data`): `Promise`<`ReturnReason`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
| `data` | `UpdateReturnReason` |
@@ -292,30 +302,35 @@ ___
`Promise`<`ReturnReason`\>
-`Promise`:
-`ReturnReason`:
#### Defined in
[medusa/src/services/return-reason.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L46)
[medusa/src/services/return-reason.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L46)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ReturnReasonService`](ReturnReasonService.md)
**withTransaction**(`transactionManager?`): [`ReturnReasonService`](ReturnReasonService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ReturnReasonService`](ReturnReasonService.md)
-`ReturnReasonService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: ReturnService
# ReturnService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new ReturnService**(`«destructured»`)
**new ReturnService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/return.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L68)
[medusa/src/services/return.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L68)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### featureFlagRouter\_
• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/return.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L66)
[medusa/src/services/return.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L66)
___
### fulfillmentProviderService\_
• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
`Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
#### Defined in
[medusa/src/services/return.ts:61](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L61)
[medusa/src/services/return.ts:61](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L61)
___
### lineItemService\_
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
`Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
#### Defined in
[medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L58)
[medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L58)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -110,93 +110,93 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### orderService\_
• `Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md)
`Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md)
#### Defined in
[medusa/src/services/return.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L63)
[medusa/src/services/return.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L63)
___
### productVariantInventoryService\_
• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
`Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
#### Defined in
[medusa/src/services/return.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L65)
[medusa/src/services/return.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L65)
___
### returnItemRepository\_
• `Protected` `Readonly` **returnItemRepository\_**: `Repository`<`ReturnItem`\>
`Protected` `Readonly` **returnItemRepository\_**: `Repository`<`ReturnItem`\>
#### Defined in
[medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L57)
[medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L57)
___
### returnReasonService\_
• `Protected` `Readonly` **returnReasonService\_**: [`ReturnReasonService`](ReturnReasonService.md)
`Protected` `Readonly` **returnReasonService\_**: [`ReturnReasonService`](ReturnReasonService.md)
#### Defined in
[medusa/src/services/return.ts:62](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L62)
[medusa/src/services/return.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L62)
___
### returnRepository\_
• `Protected` `Readonly` **returnRepository\_**: `Repository`<`Return`\>
`Protected` `Readonly` **returnRepository\_**: `Repository`<`Return`\>
#### Defined in
[medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L56)
[medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L56)
___
### shippingOptionService\_
• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
`Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
#### Defined in
[medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L60)
[medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L60)
___
### taxProviderService\_
• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
`Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
#### Defined in
[medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L59)
[medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L59)
___
### totalsService\_
• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
`Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
#### Defined in
[medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L55)
[medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L55)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -204,47 +204,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -253,7 +253,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -261,37 +261,38 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### cancel
▸ **cancel**(`returnId`): `Promise`<`Return`\>
**cancel**(`returnId`): `Promise`<`Return`\>
Cancels a return if possible. Returns can be canceled if it has not been received.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `returnId` | `string` | the id of the return to cancel. |
#### Returns
`Promise`<`Return`\>
the updated Return
-`Promise`: the updated Return
-`Return`:
#### Defined in
[medusa/src/services/return.ts:184](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L184)
[medusa/src/services/return.ts:184](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L184)
___
### create
▸ **create**(`data`): `Promise`<`Return`\>
**create**(`data`): `Promise`<`Return`\>
Creates a return request for an order, with given items, and a shipping
method. If no refund amount is provided the refund amount is calculated from
@@ -299,52 +300,56 @@ the return lines and the shipping cost.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `CreateReturnInput` | data to use for the return e.g. shipping_method, items or refund_amount |
#### Returns
`Promise`<`Return`\>
the created return
-`Promise`: the created return
-`Return`:
#### Defined in
[medusa/src/services/return.ts:369](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L369)
[medusa/src/services/return.ts:369](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L369)
___
### fulfill
▸ **fulfill**(`returnId`): `Promise`<`Return`\>
**fulfill**(`returnId`): `Promise`<`Return`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `returnId` | `string` |
#### Returns
`Promise`<`Return`\>
-`Promise`:
-`Return`:
#### Defined in
[medusa/src/services/return.ts:535](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L535)
[medusa/src/services/return.ts:535](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L535)
___
### getFulfillmentItems
▸ `Protected` **getFulfillmentItems**(`order`, `items`, `transformer`): `Promise`<`LineItem` & { `note?`: `string` ; `reason_id?`: `string` }[]\>
`Protected` **getFulfillmentItems**(`order`, `items`, `transformer`): `Promise`<`LineItem` & { `note?`: `string` ; `reason_id?`: `string` }[]\>
Retrieves the order line items, given an array of items
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `Order` | the order to get line items from |
| `items` | `OrdersReturnItem`[] | the items to get |
| `transformer` | `Transformer` | a function to apply to each of the items retrieved from the order, should return a line item. If the transformer returns an undefined value the line item will be filtered from the returned array. |
@@ -353,22 +358,24 @@ Retrieves the order line items, given an array of items
`Promise`<`LineItem` & { `note?`: `string` ; `reason_id?`: `string` }[]\>
the line items generated by the transformer.
-`Promise`: the line items generated by the transformer.
-``LineItem` & { `note?`: `string` ; `reason_id?`: `string` }[]`:
-``LineItem` & { `note?`: `string` ; `reason_id?`: `string` }`: (optional)
#### Defined in
[medusa/src/services/return.ts:107](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L107)
[medusa/src/services/return.ts:107](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L107)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`Return`[]\>
**list**(`selector`, `config?`): `Promise`<`Return`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Return`\> | the query object for find |
| `config` | `FindConfig`<`Return`\> | the config object for find |
@@ -376,22 +383,24 @@ ___
`Promise`<`Return`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`Return[]`:
-`Return`:
#### Defined in
[medusa/src/services/return.ts:147](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L147)
[medusa/src/services/return.ts:147](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L147)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Return`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`Return`[], `number`]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Return`\> | the query object for find |
| `config` | `FindConfig`<`Return`\> | the config object for find |
@@ -399,17 +408,19 @@ ___
`Promise`<[`Return`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`Return[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/return.ts:164](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L164)
[medusa/src/services/return.ts:164](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L164)
___
### receive
▸ **receive**(`returnId`, `receivedItems`, `refundAmount?`, `allowMismatch?`, `context?`): `Promise`<`Return`\>
**receive**(`returnId`, `receivedItems`, `refundAmount?`, `allowMismatch?`, `context?`): `Promise`<`Return`\>
Registers a previously requested return as received. This will create a
refund to the customer. If the returned items don't match the requested
@@ -421,37 +432,38 @@ mismatches.
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `returnId` | `string` | `undefined` | the orderId to return to |
| `receivedItems` | `OrdersReturnItem`[] | `undefined` | the items received after return. |
| `refundAmount?` | `number` | `undefined` | the amount to return |
| Name | Default value | Description |
| :------ | :------ | :------ |
| `returnId` | `string` | the orderId to return to |
| `receivedItems` | `OrdersReturnItem`[] | the items received after return. |
| `refundAmount?` | `number` | the amount to return |
| `allowMismatch` | `boolean` | `false` | whether to ignore return/received product mismatch |
| `context` | `Object` | `{}` | - |
| `context.locationId?` | `string` | `undefined` | - |
| `context` | `object` |
| `context.locationId?` | `string` |
#### Returns
`Promise`<`Return`\>
the result of the update operation
-`Promise`: the result of the update operation
-`Return`:
#### Defined in
[medusa/src/services/return.ts:608](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L608)
[medusa/src/services/return.ts:608](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L608)
___
### retrieve
▸ **retrieve**(`returnId`, `config?`): `Promise`<`Return`\>
**retrieve**(`returnId`, `config?`): `Promise`<`Return`\>
Retrieves a return by its id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `returnId` | `string` | the id of the return to retrieve |
| `config` | `FindConfig`<`Return`\> | the config object |
@@ -459,67 +471,73 @@ Retrieves a return by its id.
`Promise`<`Return`\>
the return
-`Promise`: the return
-`Return`:
#### Defined in
[medusa/src/services/return.ts:282](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L282)
[medusa/src/services/return.ts:282](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L282)
___
### retrieveBySwap
▸ **retrieveBySwap**(`swapId`, `relations?`): `Promise`<`Return`\>
**retrieveBySwap**(`swapId`, `relations?`): `Promise`<`Return`\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `swapId` | `string` | `undefined` |
| Name | Default value |
| :------ | :------ |
| `swapId` | `string` |
| `relations` | `string`[] | `[]` |
#### Returns
`Promise`<`Return`\>
-`Promise`:
-`Return`:
#### Defined in
[medusa/src/services/return.ts:310](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L310)
[medusa/src/services/return.ts:310](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L310)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`returnId`, `update`): `Promise`<`Return`\>
**update**(`returnId`, `update`): `Promise`<`Return`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `returnId` | `string` |
| `update` | `UpdateReturnInput` |
@@ -527,15 +545,18 @@ ___
`Promise`<`Return`\>
-`Promise`:
-`Return`:
#### Defined in
[medusa/src/services/return.ts:335](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L335)
[medusa/src/services/return.ts:335](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L335)
___
### validateReturnLineItem
▸ `Protected` **validateReturnLineItem**(`item?`, `quantity?`, `additional?`): `DeepPartial`<`LineItem`\>
`Protected` **validateReturnLineItem**(`item?`, `quantity?`, `additional?`): `DeepPartial`<`LineItem`\>
Checks that a given quantity of a line item can be returned. Fails if the
item is undefined or if the returnable quantity of the item is lower, than
@@ -543,30 +564,31 @@ the quantity that is requested to be returned.
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `item?` | `LineItem` | `undefined` | the line item to check has sufficient returnable quantity. |
| Name | Default value | Description |
| :------ | :------ | :------ |
| `item?` | `LineItem` | the line item to check has sufficient returnable quantity. |
| `quantity` | `number` | `0` | the quantity that is requested to be returned. |
| `additional` | `Object` | `{}` | the quantity that is requested to be returned. |
| `additional.note?` | `string` | `undefined` | - |
| `additional.reason_id?` | `string` | `undefined` | - |
| `additional` | `object` | the quantity that is requested to be returned. |
| `additional.note?` | `string` |
| `additional.reason_id?` | `string` |
#### Returns
`DeepPartial`<`LineItem`\>
a line item where the quantity is set to the requested
-`DeepPartial`: a line item where the quantity is set to the requested
return quantity.
-`LineItem`:
#### Defined in
[medusa/src/services/return.ts:240](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L240)
[medusa/src/services/return.ts:240](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L240)
___
### validateReturnStatuses
▸ `Protected` **validateReturnStatuses**(`order`): `void`
`Protected` **validateReturnStatuses**(`order`): `void`
Checks that an order has the statuses necessary to complete a return.
fulfillment_status cannot be not_fulfilled or returned.
@@ -574,42 +596,46 @@ payment_status must be captured.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `Order` | the order to check statuses on |
#### Returns
`void`
**`Throws`**
-`void`: (optional)
**Throws**
when statuses are not sufficient for returns.
#### Defined in
[medusa/src/services/return.ts:210](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L210)
[medusa/src/services/return.ts:210](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L210)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ReturnService`](ReturnService.md)
**withTransaction**(`transactionManager?`): [`ReturnService`](ReturnService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ReturnService`](ReturnService.md)
-`ReturnService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: SalesChannelInventoryService
# SalesChannelInventoryService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new SalesChannelInventoryService**(`«destructured»`)
**new SalesChannelInventoryService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/sales-channel-inventory.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L18)
[medusa/src/services/sales-channel-inventory.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L18)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: `IEventBusService`
`Protected` `Readonly` **eventBusService\_**: `IEventBusService`
#### Defined in
[medusa/src/services/sales-channel-inventory.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L15)
[medusa/src/services/sales-channel-inventory.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L15)
___
### inventoryService\_
• `Protected` `Readonly` **inventoryService\_**: `IInventoryService`
`Protected` `Readonly` **inventoryService\_**: `IInventoryService`
#### Defined in
[medusa/src/services/sales-channel-inventory.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L16)
[medusa/src/services/sales-channel-inventory.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L16)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -100,23 +100,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### salesChannelLocationService\_
• `Protected` `Readonly` **salesChannelLocationService\_**: [`SalesChannelLocationService`](SalesChannelLocationService.md)
`Protected` `Readonly` **salesChannelLocationService\_**: [`SalesChannelLocationService`](SalesChannelLocationService.md)
#### Defined in
[medusa/src/services/sales-channel-inventory.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L14)
[medusa/src/services/sales-channel-inventory.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L14)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -124,47 +124,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -173,7 +173,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -181,20 +181,20 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### retrieveAvailableItemQuantity
▸ **retrieveAvailableItemQuantity**(`salesChannelId`, `inventoryItemId`): `Promise`<`number`\>
**retrieveAvailableItemQuantity**(`salesChannelId`, `inventoryItemId`): `Promise`<`number`\>
Retrieves the available quantity of an item across all sales channel locations
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `salesChannelId` | `string` | Sales channel id |
| `inventoryItemId` | `string` | Item id |
@@ -202,56 +202,61 @@ Retrieves the available quantity of an item across all sales channel locations
`Promise`<`number`\>
available quantity of item across all sales channel locations
-`Promise`: available quantity of item across all sales channel locations
-`number`: (optional)
#### Defined in
[medusa/src/services/sales-channel-inventory.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L37)
[medusa/src/services/sales-channel-inventory.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L37)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`SalesChannelInventoryService`](SalesChannelInventoryService.md)
**withTransaction**(`transactionManager?`): [`SalesChannelInventoryService`](SalesChannelInventoryService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`SalesChannelInventoryService`](SalesChannelInventoryService.md)
-`SalesChannelInventoryService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: SalesChannelLocationService
# SalesChannelLocationService
Service for managing the stock locations of sales channels
@@ -12,12 +12,12 @@ Service for managing the stock locations of sales channels
### constructor
• **new SalesChannelLocationService**(`«destructured»`)
**new SalesChannelLocationService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/sales-channel-location.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L24)
[medusa/src/services/sales-channel-location.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L24)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: `IEventBusService`
`Protected` `Readonly` **eventBusService\_**: `IEventBusService`
#### Defined in
[medusa/src/services/sales-channel-location.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L21)
[medusa/src/services/sales-channel-location.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L21)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -92,33 +92,33 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### salesChannelService\_
• `Protected` `Readonly` **salesChannelService\_**: [`SalesChannelService`](SalesChannelService.md)
`Protected` `Readonly` **salesChannelService\_**: [`SalesChannelService`](SalesChannelService.md)
#### Defined in
[medusa/src/services/sales-channel-location.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L20)
[medusa/src/services/sales-channel-location.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L20)
___
### stockLocationService\_
• `Protected` `Readonly` **stockLocationService\_**: `IStockLocationService`
`Protected` `Readonly` **stockLocationService\_**: `IStockLocationService`
#### Defined in
[medusa/src/services/sales-channel-location.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L22)
[medusa/src/services/sales-channel-location.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L22)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -126,38 +126,40 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### associateLocation
▸ **associateLocation**(`salesChannelId`, `locationId`): `Promise`<`void`\>
**associateLocation**(`salesChannelId`, `locationId`): `Promise`<`void`\>
Associates a sales channel with a stock location.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `salesChannelId` | `string` | The ID of the sales channel. |
| `locationId` | `string` | The ID of the stock location. |
@@ -165,33 +167,31 @@ Associates a sales channel with a stock location.
`Promise`<`void`\>
A promise that resolves when the association has been created.
-`Promise`: A promise that resolves when the association has been created.
#### Defined in
[medusa/src/services/sales-channel-location.ts:72](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L72)
[medusa/src/services/sales-channel-location.ts:72](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L72)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -200,7 +200,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -208,68 +208,72 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### listLocationIds
▸ **listLocationIds**(`salesChannelId`): `Promise`<`string`[]\>
**listLocationIds**(`salesChannelId`): `Promise`<`string`[]\>
Lists the stock locations associated with a sales channel.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `salesChannelId` | `string` \| `string`[] | The ID of the sales channel. |
#### Returns
`Promise`<`string`[]\>
A promise that resolves with an array of location IDs.
-`Promise`: A promise that resolves with an array of location IDs.
-`string[]`:
-`string`: (optional)
#### Defined in
[medusa/src/services/sales-channel-location.ts:103](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L103)
[medusa/src/services/sales-channel-location.ts:103](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L103)
___
### listSalesChannelIds
▸ **listSalesChannelIds**(`locationId`): `Promise`<`string`[]\>
**listSalesChannelIds**(`locationId`): `Promise`<`string`[]\>
Lists the sales channels associated with a stock location.
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `locationId` | `string` |
#### Returns
`Promise`<`string`[]\>
A promise that resolves with an array of sales channel IDs.
-`Promise`: A promise that resolves with an array of sales channel IDs.
-`string[]`:
-`string`: (optional)
#### Defined in
[medusa/src/services/sales-channel-location.ts:132](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L132)
[medusa/src/services/sales-channel-location.ts:132](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L132)
___
### removeLocation
▸ **removeLocation**(`locationId`, `salesChannelId?`): `Promise`<`void`\>
**removeLocation**(`locationId`, `salesChannelId?`): `Promise`<`void`\>
Removes an association between a sales channel and a stock location.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `locationId` | `string` | The ID of the stock location. |
| `salesChannelId?` | `string` | The ID of the sales channel or undefined if all the sales channel will be affected. |
@@ -277,56 +281,60 @@ Removes an association between a sales channel and a stock location.
`Promise`<`void`\>
A promise that resolves when the association has been removed.
-`Promise`: A promise that resolves when the association has been removed.
#### Defined in
[medusa/src/services/sales-channel-location.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L43)
[medusa/src/services/sales-channel-location.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L43)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`SalesChannelLocationService`](SalesChannelLocationService.md)
**withTransaction**(`transactionManager?`): [`SalesChannelLocationService`](SalesChannelLocationService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`SalesChannelLocationService`](SalesChannelLocationService.md)
-`SalesChannelLocationService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: SalesChannelService
# SalesChannelService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new SalesChannelService**(`«destructured»`)
**new SalesChannelService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L34)
[medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L34)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### eventBusService\_
• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L31)
[medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L31)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -90,33 +90,33 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### salesChannelRepository\_
• `Protected` `Readonly` **salesChannelRepository\_**: `Repository`<`SalesChannel`\> & { `addProducts`: (`salesChannelId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `getFreeTextSearchResultsAndCount`: (`q`: `string`, `options`: `ExtendedFindConfig`<`SalesChannel`\>) => `Promise`<[`SalesChannel`[], `number`]\> ; `listProductIdsBySalesChannelIds`: (`salesChannelIds`: `string` \| `string`[]) => `Promise`<{ `[salesChannelId: string]`: `string`[]; }\> ; `removeProducts`: (`salesChannelId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> }
`Protected` `Readonly` **salesChannelRepository\_**: `Repository`<`SalesChannel`\> & { `addProducts`: Method addProducts ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `listProductIdsBySalesChannelIds`: Method listProductIdsBySalesChannelIds ; `removeProducts`: Method removeProducts }
#### Defined in
[medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L30)
[medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L30)
___
### storeService\_
• `Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md)
`Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md)
#### Defined in
[medusa/src/services/sales-channel.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L32)
[medusa/src/services/sales-channel.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L32)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -124,13 +124,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -142,38 +142,40 @@ ___
#### Defined in
[medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L24)
[medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L24)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addProducts
▸ **addProducts**(`salesChannelId`, `productIds`): `Promise`<`SalesChannel`\>
**addProducts**(`salesChannelId`, `productIds`): `Promise`<`SalesChannel`\>
Add a batch of product to a sales channel
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `salesChannelId` | `string` | The id of the sales channel on which to add the products |
| `productIds` | `string`[] | The products ids to attach to the sales channel |
@@ -181,33 +183,32 @@ Add a batch of product to a sales channel
`Promise`<`SalesChannel`\>
the sales channel on which the products have been added
-`Promise`: the sales channel on which the products have been added
-`SalesChannel`:
#### Defined in
[medusa/src/services/sales-channel.ts:348](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L348)
[medusa/src/services/sales-channel.ts:348](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L348)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -216,7 +217,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -224,13 +225,13 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`SalesChannel`\>
**create**(`data`): `Promise`<`SalesChannel`\>
Creates a SalesChannel
@@ -239,25 +240,26 @@ To use this feature please enable the corresponding feature flag in your medusa
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateSalesChannelInput` |
#### Returns
`Promise`<`SalesChannel`\>
the created channel
-`Promise`: the created channel
-`SalesChannel`:
#### Defined in
[medusa/src/services/sales-channel.ts:168](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L168)
[medusa/src/services/sales-channel.ts:168](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L168)
___
### createDefault
▸ **createDefault**(): `Promise`<`SalesChannel`\>
**createDefault**(): `Promise`<`SalesChannel`\>
Creates a default sales channel, if this does not already exist.
@@ -265,17 +267,18 @@ Creates a default sales channel, if this does not already exist.
`Promise`<`SalesChannel`\>
the sales channel
-`Promise`: the sales channel
-`SalesChannel`:
#### Defined in
[medusa/src/services/sales-channel.ts:258](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L258)
[medusa/src/services/sales-channel.ts:258](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L258)
___
### delete
▸ **delete**(`salesChannelId`): `Promise`<`void`\>
**delete**(`salesChannelId`): `Promise`<`void`\>
Deletes a sales channel from
This feature is under development and may change in the future.
@@ -283,31 +286,33 @@ To use this feature please enable the corresponding feature flag in your medusa
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `salesChannelId` | `string` | the id of the sales channel to delete |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/sales-channel.ts:219](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L219)
[medusa/src/services/sales-channel.ts:219](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L219)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`SalesChannel`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`SalesChannel`[], `number`]\>
Lists sales channels based on the provided parameters and includes the count of
sales channels that match the query.
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `QuerySelector`<`SalesChannel`\> |
| `config` | `FindConfig`<`SalesChannel`\> |
@@ -315,48 +320,53 @@ sales channels that match the query.
`Promise`<[`SalesChannel`[], `number`]\>
an array containing the sales channels as
-`Promise`: an array containing the sales channels as
the first element and the total count of sales channels that matches the query
as the second element.
-`SalesChannel[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/sales-channel.ts:134](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L134)
[medusa/src/services/sales-channel.ts:134](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L134)
___
### listProductIdsBySalesChannelIds
▸ **listProductIdsBySalesChannelIds**(`salesChannelIds`): `Promise`<{ `[salesChannelId: string]`: `string`[]; }\>
**listProductIdsBySalesChannelIds**(`salesChannelIds`): `Promise`<{ `[salesChannelId: string]`: `string`[]; }\>
List all product ids that belongs to the sales channels ids
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `salesChannelIds` | `string` \| `string`[] |
#### Returns
`Promise`<{ `[salesChannelId: string]`: `string`[]; }\>
-`Promise`:
-``object``: (optional)
#### Defined in
[medusa/src/services/sales-channel.ts:310](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L310)
[medusa/src/services/sales-channel.ts:310](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L310)
___
### removeProducts
▸ **removeProducts**(`salesChannelId`, `productIds`): `Promise`<`SalesChannel`\>
**removeProducts**(`salesChannelId`, `productIds`): `Promise`<`SalesChannel`\>
Remove a batch of product from a sales channel
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `salesChannelId` | `string` | The id of the sales channel on which to remove the products |
| `productIds` | `string`[] | The products ids to remove from the sales channel |
@@ -364,24 +374,25 @@ Remove a batch of product from a sales channel
`Promise`<`SalesChannel`\>
the sales channel on which the products have been removed
-`Promise`: the sales channel on which the products have been removed
-`SalesChannel`:
#### Defined in
[medusa/src/services/sales-channel.ts:327](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L327)
[medusa/src/services/sales-channel.ts:327](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L327)
___
### retrieve
▸ **retrieve**(`salesChannelId`, `config?`): `Promise`<`SalesChannel`\>
**retrieve**(`salesChannelId`, `config?`): `Promise`<`SalesChannel`\>
Retrieve a SalesChannel by id
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `salesChannelId` | `string` | id of the channel to retrieve |
| `config` | `FindConfig`<`SalesChannel`\> | SC config This feature is under development and may change in the future. To use this feature please enable the corresponding feature flag in your medusa backend project. |
@@ -389,24 +400,25 @@ Retrieve a SalesChannel by id
`Promise`<`SalesChannel`\>
a sales channel
-`Promise`: a sales channel
-`SalesChannel`:
#### Defined in
[medusa/src/services/sales-channel.ts:92](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L92)
[medusa/src/services/sales-channel.ts:92](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L92)
___
### retrieveByName
▸ **retrieveByName**(`name`, `config?`): `Promise`<`unknown`\>
**retrieveByName**(`name`, `config?`): `Promise`<`unknown`\>
Find a sales channel by name.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `name` | `string` | of the sales channel |
| `config` | `FindConfig`<`SalesChannel`\> | find config |
@@ -414,17 +426,18 @@ Find a sales channel by name.
`Promise`<`unknown`\>
a sales channel with matching name
-`Promise`: a sales channel with matching name
-`unknown`: (optional)
#### Defined in
[medusa/src/services/sales-channel.ts:113](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L113)
[medusa/src/services/sales-channel.ts:113](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L113)
___
### retrieveDefault
▸ **retrieveDefault**(): `Promise`<`SalesChannel`\>
**retrieveDefault**(): `Promise`<`SalesChannel`\>
Retrieves the default sales channel.
@@ -432,24 +445,25 @@ Retrieves the default sales channel.
`Promise`<`SalesChannel`\>
the sales channel
-`Promise`: the sales channel
-`SalesChannel`:
#### Defined in
[medusa/src/services/sales-channel.ts:288](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L288)
[medusa/src/services/sales-channel.ts:288](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L288)
___
### retrieve\_
▸ `Protected` **retrieve_**(`selector`, `config?`): `Promise`<`SalesChannel`\>
`Protected` **retrieve_**(`selector`, `config?`): `Promise`<`SalesChannel`\>
A generic retrieve used to find a sales channel by different attributes.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`SalesChannel`\> | SC selector |
| `config` | `FindConfig`<`SalesChannel`\> | find config |
@@ -457,46 +471,49 @@ A generic retrieve used to find a sales channel by different attributes.
`Promise`<`SalesChannel`\>
a single SC matching the query or throws
-`Promise`: a single SC matching the query or throws
-`SalesChannel`:
#### Defined in
[medusa/src/services/sales-channel.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L54)
[medusa/src/services/sales-channel.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L54)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`salesChannelId`, `data`): `Promise`<`SalesChannel`\>
**update**(`salesChannelId`, `data`): `Promise`<`SalesChannel`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `salesChannelId` | `string` |
| `data` | `Partial`<`CreateSalesChannelInput`\> |
@@ -504,30 +521,35 @@ ___
`Promise`<`SalesChannel`\>
-`Promise`:
-`SalesChannel`:
#### Defined in
[medusa/src/services/sales-channel.ts:185](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L185)
[medusa/src/services/sales-channel.ts:185](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L185)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`SalesChannelService`](SalesChannelService.md)
**withTransaction**(`transactionManager?`): [`SalesChannelService`](SalesChannelService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`SalesChannelService`](SalesChannelService.md)
-`SalesChannelService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: SearchService
# SearchService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new SearchService**(`«destructured»`, `options`)
**new SearchService**(`«destructured»`, `options`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
| `options` | `any` |
@@ -25,13 +25,13 @@ AbstractSearchService.constructor
#### Defined in
[medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L16)
[medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L16)
## Properties
### isDefault
• **isDefault**: `boolean` = `true`
**isDefault**: `boolean` = `true`
#### Overrides
@@ -39,23 +39,23 @@ AbstractSearchService.isDefault
#### Defined in
[medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L11)
[medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L11)
___
### logger\_
• `Protected` `Readonly` **logger\_**: `Logger`
`Protected` `Readonly` **logger\_**: `Logger`
#### Defined in
[medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L13)
[medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L13)
___
### options\_
• `Protected` `Readonly` **options\_**: `Record`<`string`, `unknown`\>
`Protected` `Readonly` **options\_**: Record<`string`, `unknown`\>
#### Overrides
@@ -63,17 +63,21 @@ AbstractSearchService.options\_
#### Defined in
[medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L14)
[medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L14)
## Accessors
### options
• `get` **options**(): `Record`<`string`, `unknown`\>
`get` **options**(): Record<`string`, `unknown`\>
#### Returns
`Record`<`string`, `unknown`\>
Record<`string`, `unknown`\>
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Inherited from
@@ -87,12 +91,12 @@ utils/dist/search/abstract-service.d.ts:5
### addDocuments
▸ **addDocuments**(`indexName`, `documents`, `type`): `Promise`<`void`\>
**addDocuments**(`indexName`, `documents`, `type`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `indexName` | `string` |
| `documents` | `unknown` |
| `type` | `string` |
@@ -101,24 +105,26 @@ utils/dist/search/abstract-service.d.ts:5
`Promise`<`void`\>
-`Promise`:
#### Overrides
AbstractSearchService.addDocuments
#### Defined in
[medusa/src/services/search.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L40)
[medusa/src/services/search.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L40)
___
### createIndex
▸ **createIndex**(`indexName`, `options`): `Promise`<`void`\>
**createIndex**(`indexName`, `options`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `indexName` | `string` |
| `options` | `unknown` |
@@ -126,48 +132,52 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Overrides
AbstractSearchService.createIndex
#### Defined in
[medusa/src/services/search.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L28)
[medusa/src/services/search.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L28)
___
### deleteAllDocuments
▸ **deleteAllDocuments**(`indexName`): `Promise`<`void`\>
**deleteAllDocuments**(`indexName`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `indexName` | `string` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Overrides
AbstractSearchService.deleteAllDocuments
#### Defined in
[medusa/src/services/search.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L69)
[medusa/src/services/search.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L69)
___
### deleteDocument
▸ **deleteDocument**(`indexName`, `document_id`): `Promise`<`void`\>
**deleteDocument**(`indexName`, `document_id`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `indexName` | `string` |
| `document_id` | `string` \| `number` |
@@ -175,48 +185,52 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Overrides
AbstractSearchService.deleteDocument
#### Defined in
[medusa/src/services/search.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L60)
[medusa/src/services/search.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L60)
___
### getIndex
▸ **getIndex**(`indexName`): `Promise`<`void`\>
**getIndex**(`indexName`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `indexName` | `string` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Overrides
AbstractSearchService.getIndex
#### Defined in
[medusa/src/services/search.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L34)
[medusa/src/services/search.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L34)
___
### replaceDocuments
▸ **replaceDocuments**(`indexName`, `documents`, `type`): `Promise`<`void`\>
**replaceDocuments**(`indexName`, `documents`, `type`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `indexName` | `string` |
| `documents` | `unknown` |
| `type` | `string` |
@@ -225,24 +239,26 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Overrides
AbstractSearchService.replaceDocuments
#### Defined in
[medusa/src/services/search.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L50)
[medusa/src/services/search.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L50)
___
### search
▸ **search**(`indexName`, `query`, `options`): `Promise`<{ `hits`: `unknown`[] }\>
**search**(`indexName`, `query`, `options`): `Promise`<{ `hits`: `unknown`[] }\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `indexName` | `string` |
| `query` | `unknown` |
| `options` | `unknown` |
@@ -251,24 +267,27 @@ ___
`Promise`<{ `hits`: `unknown`[] }\>
-`Promise`:
-``object``: (optional)
#### Overrides
AbstractSearchService.search
#### Defined in
[medusa/src/services/search.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L75)
[medusa/src/services/search.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L75)
___
### updateSettings
▸ **updateSettings**(`indexName`, `settings`): `Promise`<`void`\>
**updateSettings**(`indexName`, `settings`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `indexName` | `string` |
| `settings` | `unknown` |
@@ -276,10 +295,12 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Overrides
AbstractSearchService.updateSettings
#### Defined in
[medusa/src/services/search.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L86)
[medusa/src/services/search.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L86)
@@ -1,4 +1,4 @@
# Class: ShippingOptionService
# ShippingOptionService
Provides layer to manipulate profiles.
@@ -12,12 +12,12 @@ Provides layer to manipulate profiles.
### constructor
• **new ShippingOptionService**(`«destructured»`)
**new ShippingOptionService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L52)
[medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L52)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### featureFlagRouter\_
• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/shipping-option.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L50)
[medusa/src/services/shipping-option.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L50)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -92,63 +92,63 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### methodRepository\_
• `Protected` `Readonly` **methodRepository\_**: `Repository`<`ShippingMethod`\>
`Protected` `Readonly` **methodRepository\_**: `Repository`<`ShippingMethod`\>
#### Defined in
[medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L49)
[medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L49)
___
### optionRepository\_
• `Protected` `Readonly` **optionRepository\_**: `Repository`<`ShippingOption`\> & { `upsertShippingProfile`: (`shippingOptionIds`: `string`[], `shippingProfileId`: `string`) => `Promise`<`ShippingOption`[]\> }
`Protected` `Readonly` **optionRepository\_**: `Repository`<`ShippingOption`\> & { `upsertShippingProfile`: Method upsertShippingProfile }
#### Defined in
[medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L48)
[medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L48)
___
### providerService\_
• `Protected` `Readonly` **providerService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
`Protected` `Readonly` **providerService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md)
#### Defined in
[medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L44)
[medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L44)
___
### regionService\_
• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
`Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md)
#### Defined in
[medusa/src/services/shipping-option.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L45)
[medusa/src/services/shipping-option.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L45)
___
### requirementRepository\_
• `Protected` `Readonly` **requirementRepository\_**: `Repository`<`ShippingOptionRequirement`\>
`Protected` `Readonly` **requirementRepository\_**: `Repository`<`ShippingOptionRequirement`\>
#### Defined in
[medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L47)
[medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L47)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -156,39 +156,41 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addRequirement
▸ **addRequirement**(`optionId`, `requirement`): `Promise`<`ShippingOption`\>
**addRequirement**(`optionId`, `requirement`): `Promise`<`ShippingOption`\>
Adds a requirement to a shipping option. Only 1 requirement of each type
is allowed.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `optionId` | `string` | the option to add the requirement to. |
| `requirement` | `ShippingOptionRequirement` | the requirement for the option. |
@@ -196,33 +198,32 @@ is allowed.
`Promise`<`ShippingOption`\>
the result of update
-`Promise`: the result of update
-`ShippingOption`:
#### Defined in
[medusa/src/services/shipping-option.ts:693](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L693)
[medusa/src/services/shipping-option.ts:693](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L693)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -231,7 +232,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -239,13 +240,13 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`ShippingOption`\>
**create**(`data`): `Promise`<`ShippingOption`\>
Creates a new shipping option. Used both for outbound and inbound shipping
options. The difference is registered by the `is_return` field which
@@ -253,99 +254,104 @@ defaults to false.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `CreateShippingOptionInput` | the data to create shipping options |
#### Returns
`Promise`<`ShippingOption`\>
the result of the create operation
-`Promise`: the result of the create operation
-`ShippingOption`:
#### Defined in
[medusa/src/services/shipping-option.ts:431](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L431)
[medusa/src/services/shipping-option.ts:431](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L431)
___
### createShippingMethod
▸ **createShippingMethod**(`optionId`, `data`, `config`): `Promise`<`ShippingMethod`\>
**createShippingMethod**(`optionId`, `data`, `config`): `Promise`<`ShippingMethod`\>
Creates a shipping method for a given cart.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `optionId` | `string` | the id of the option to use for the method. |
| `data` | `Record`<`string`, `unknown`\> | the optional provider data to use. |
| `data` | Record<`string`, `unknown`\> | the optional provider data to use. |
| `config` | `CreateShippingMethodDto` | the cart to create the shipping method for. |
#### Returns
`Promise`<`ShippingMethod`\>
the resulting shipping method.
-`Promise`: the resulting shipping method.
-`ShippingMethod`:
#### Defined in
[medusa/src/services/shipping-option.ts:258](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L258)
[medusa/src/services/shipping-option.ts:258](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L258)
___
### delete
▸ **delete**(`optionId`): `Promise`<`void` \| `ShippingOption`\>
**delete**(`optionId`): `Promise`<`void` \| `ShippingOption`\>
Deletes a profile with a given profile id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `optionId` | `string` | the id of the profile to delete. Must be castable as an ObjectId |
#### Returns
`Promise`<`void` \| `ShippingOption`\>
the result of the delete operation.
-`Promise`: the result of the delete operation.
-`void \| ShippingOption`: (optional)
#### Defined in
[medusa/src/services/shipping-option.ts:671](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L671)
[medusa/src/services/shipping-option.ts:671](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L671)
___
### deleteShippingMethods
▸ **deleteShippingMethods**(`shippingMethods`): `Promise`<`ShippingMethod`[]\>
**deleteShippingMethods**(`shippingMethods`): `Promise`<`ShippingMethod`[]\>
Removes a given shipping method
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `shippingMethods` | `ShippingMethod` \| `ShippingMethod`[] | the shipping method to remove |
#### Returns
`Promise`<`ShippingMethod`[]\>
removed shipping methods
-`Promise`: removed shipping methods
-`ShippingMethod[]`:
-`ShippingMethod`:
#### Defined in
[medusa/src/services/shipping-option.ts:238](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L238)
[medusa/src/services/shipping-option.ts:238](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L238)
___
### getPrice\_
▸ **getPrice_**(`option`, `data`, `cart`): `Promise`<`number`\>
**getPrice_**(`option`, `data`, `cart`): `Promise`<`number`\>
Returns the amount to be paid for a shipping method. Will ask the
fulfillment provider to calculate the price if the shipping option has the
@@ -353,32 +359,33 @@ price type "calculated".
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `option` | `ShippingOption` | the shipping option to retrieve the price for. |
| `data` | `Record`<`string`, `unknown`\> | the shipping data to retrieve the price. |
| `data` | Record<`string`, `unknown`\> | the shipping data to retrieve the price. |
| `cart` | `undefined` \| `Order` \| `Cart` | the context in which the price should be retrieved. |
#### Returns
`Promise`<`number`\>
the price of the shipping option.
-`Promise`: the price of the shipping option.
-`number`: (optional)
#### Defined in
[medusa/src/services/shipping-option.ts:771](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L771)
[medusa/src/services/shipping-option.ts:771](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L771)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`ShippingOption`[]\>
**list**(`selector`, `config?`): `Promise`<`ShippingOption`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`ShippingOption`\> | the query object for find |
| `config` | `FindConfig`<`ShippingOption`\> | config object |
@@ -386,22 +393,24 @@ ___
`Promise`<`ShippingOption`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ShippingOption[]`:
-`ShippingOption`:
#### Defined in
[medusa/src/services/shipping-option.ts:145](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L145)
[medusa/src/services/shipping-option.ts:145](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L145)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`ShippingOption`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`ShippingOption`[], `number`]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`ShippingOption`\> | the query object for find |
| `config` | `FindConfig`<`ShippingOption`\> | config object |
@@ -409,49 +418,52 @@ ___
`Promise`<[`ShippingOption`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ShippingOption[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/shipping-option.ts:160](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L160)
[medusa/src/services/shipping-option.ts:160](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L160)
___
### removeRequirement
▸ **removeRequirement**(`requirementId`): `Promise`<`void` \| `ShippingOptionRequirement`\>
**removeRequirement**(`requirementId`): `Promise`<`void` \| `ShippingOptionRequirement`\>
Removes a requirement from a shipping option
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `requirementId` | `any` | the id of the requirement to remove |
#### Returns
`Promise`<`void` \| `ShippingOptionRequirement`\>
the result of update
-`Promise`: the result of update
-`void \| ShippingOptionRequirement`: (optional)
#### Defined in
[medusa/src/services/shipping-option.ts:722](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L722)
[medusa/src/services/shipping-option.ts:722](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L722)
___
### retrieve
▸ **retrieve**(`optionId`, `options?`): `Promise`<`ShippingOption`\>
**retrieve**(`optionId`, `options?`): `Promise`<`ShippingOption`\>
Gets a profile by id.
Throws in case of DB Error and if profile was not found.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `optionId` | `any` | the id of the profile to get. |
| `options` | `FindConfig`<`ShippingOption`\> | the options to get a profile |
@@ -459,41 +471,44 @@ Throws in case of DB Error and if profile was not found.
`Promise`<`ShippingOption`\>
the profile document.
-`Promise`: the profile document.
-`ShippingOption`:
#### Defined in
[medusa/src/services/shipping-option.ts:177](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L177)
[medusa/src/services/shipping-option.ts:177](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L177)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`optionId`, `update`): `Promise`<`ShippingOption`\>
**update**(`optionId`, `update`): `Promise`<`ShippingOption`\>
Updates a profile. Metadata updates and product updates should use
dedicated methods, e.g. `setMetadata`, etc. The function
@@ -501,8 +516,8 @@ will throw errors if metadata or product updates are attempted.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `optionId` | `string` | the id of the option. Must be a string that can be casted to an ObjectId |
| `update` | `UpdateShippingOptionInput` | an object with the update values. |
@@ -510,25 +525,26 @@ will throw errors if metadata or product updates are attempted.
`Promise`<`ShippingOption`\>
resolves to the update result.
-`Promise`: resolves to the update result.
-`ShippingOption`:
#### Defined in
[medusa/src/services/shipping-option.ts:559](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L559)
[medusa/src/services/shipping-option.ts:559](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L559)
___
### updateShippingMethod
▸ **updateShippingMethod**(`id`, `update`): `Promise`<`undefined` \| `ShippingMethod`\>
**updateShippingMethod**(`id`, `update`): `Promise`<`undefined` \| `ShippingMethod`\>
Updates a shipping method's associations. Useful when a cart is completed
and its methods should be copied to an order/swap entity.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the id of the shipping method to update |
| `update` | `ShippingMethodUpdate` | the values to update the method with |
@@ -536,22 +552,23 @@ and its methods should be copied to an order/swap entity.
`Promise`<`undefined` \| `ShippingMethod`\>
the resulting shipping method
-`Promise`: the resulting shipping method
-`undefined \| ShippingMethod`: (optional)
#### Defined in
[medusa/src/services/shipping-option.ts:211](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L211)
[medusa/src/services/shipping-option.ts:211](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L211)
___
### updateShippingProfile
▸ **updateShippingProfile**(`optionIds`, `profileId`): `Promise`<`ShippingOption`[]\>
**updateShippingProfile**(`optionIds`, `profileId`): `Promise`<`ShippingOption`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `optionIds` | `string` \| `string`[] | ID or IDs of the shipping options to update |
| `profileId` | `string` | Shipping profile ID to update the shipping options with |
@@ -559,22 +576,24 @@ ___
`Promise`<`ShippingOption`[]\>
updated shipping options
-`Promise`: updated shipping options
-`ShippingOption[]`:
-`ShippingOption`:
#### Defined in
[medusa/src/services/shipping-option.ts:747](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L747)
[medusa/src/services/shipping-option.ts:747](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L747)
___
### validateAndMutatePrice
▸ `Private` **validateAndMutatePrice**(`option`, `priceInput`): `Promise`<`CreateShippingOptionInput` \| `Omit`<`ShippingOption`, ``"beforeInsert"``\>\>
`Private` **validateAndMutatePrice**(`option`, `priceInput`): `Promise`<`CreateShippingOptionInput` \| `Omit`<`ShippingOption`, ``"beforeInsert"``\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `option` | `ShippingOption` \| `CreateShippingOptionInput` |
| `priceInput` | `ValidatePriceTypeAndAmountInput` |
@@ -582,15 +601,18 @@ ___
`Promise`<`CreateShippingOptionInput` \| `Omit`<`ShippingOption`, ``"beforeInsert"``\>\>
-`Promise`:
-`CreateShippingOptionInput \| Omit<ShippingOption, ``"beforeInsert"``\>`: (optional)
#### Defined in
[medusa/src/services/shipping-option.ts:388](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L388)
[medusa/src/services/shipping-option.ts:388](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L388)
___
### validateCartOption
▸ **validateCartOption**(`option`, `cart`): `Promise`<``null`` \| `ShippingOption`\>
**validateCartOption**(`option`, `cart`): `Promise`<``null`` \| `ShippingOption`\>
Checks if a given option id is a valid option for a cart. If it is the
option is returned with the correct price. Throws when region_ids do not
@@ -598,8 +620,8 @@ match, or when the shipping option requirements are not satisfied.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `option` | `ShippingOption` | the option object to check |
| `cart` | `Cart` | the cart object to check against |
@@ -607,24 +629,25 @@ match, or when the shipping option requirements are not satisfied.
`Promise`<``null`` \| `ShippingOption`\>
the validated shipping option
-`Promise`: the validated shipping option
-```null`` \| ShippingOption`: (optional)
#### Defined in
[medusa/src/services/shipping-option.ts:346](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L346)
[medusa/src/services/shipping-option.ts:346](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L346)
___
### validatePriceType\_
▸ **validatePriceType_**(`priceType`, `option`): `Promise`<`ShippingOptionPriceType`\>
**validatePriceType_**(`priceType`, `option`): `Promise`<`ShippingOptionPriceType`\>
Validates a shipping option price
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `priceType` | `ShippingOptionPriceType` | the price to validate |
| `option` | `ShippingOption` | the option to validate against |
@@ -632,57 +655,60 @@ Validates a shipping option price
`Promise`<`ShippingOptionPriceType`\>
the validated price
-`Promise`: the validated price
#### Defined in
[medusa/src/services/shipping-option.ts:519](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L519)
[medusa/src/services/shipping-option.ts:519](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L519)
___
### validateRequirement\_
▸ **validateRequirement_**(`requirement`, `optionId?`): `Promise`<`ShippingOptionRequirement`\>
**validateRequirement_**(`requirement`, `optionId?`): `Promise`<`ShippingOptionRequirement`\>
Validates a requirement
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `requirement` | `ShippingOptionRequirement` | `undefined` | the requirement to validate |
| Name | Default value | Description |
| :------ | :------ | :------ |
| `requirement` | `ShippingOptionRequirement` | the requirement to validate |
| `optionId` | `undefined` \| `string` | `undefined` | the id to validate the requirement |
#### Returns
`Promise`<`ShippingOptionRequirement`\>
a validated shipping requirement
-`Promise`: a validated shipping requirement
-`ShippingOptionRequirement`:
#### Defined in
[medusa/src/services/shipping-option.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L77)
[medusa/src/services/shipping-option.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L77)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ShippingOptionService`](ShippingOptionService.md)
**withTransaction**(`transactionManager?`): [`ShippingOptionService`](ShippingOptionService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ShippingOptionService`](ShippingOptionService.md)
-`ShippingOptionService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,8 +1,8 @@
# Class: ShippingProfileService
# ShippingProfileService
Provides layer to manipulate profiles.
**`Implements`**
**Implements**
## Hierarchy
@@ -14,12 +14,12 @@ Provides layer to manipulate profiles.
### constructor
• **new ShippingProfileService**(`«destructured»`)
**new ShippingProfileService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -28,13 +28,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/shipping-profile.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L49)
[medusa/src/services/shipping-profile.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L49)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -42,13 +42,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -56,13 +56,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -70,33 +70,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### customShippingOptionService\_
• `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md)
`Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md)
#### Defined in
[medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L43)
[medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L43)
___
### featureFlagRouter\_
• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/shipping-profile.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L47)
[medusa/src/services/shipping-profile.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L47)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -104,53 +104,53 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### productRepository\_
• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: (`qb`: `SelectQueryBuilder`<`Product`\>, `__namedParameters`: `Object`) => `SelectQueryBuilder`<`Product`\> ; `_findWithRelations`: (`__namedParameters`: { `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions` ; `relations`: `string`[] ; `shouldCount`: `boolean` ; `withDeleted`: `boolean` }) => `Promise`<[`Product`[], `number`]\> ; `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findOneWithRelations`: (`relations`: `string`[], `optionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<`Product`\> ; `findWithRelations`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions`, `withDeleted`: `boolean`) => `Promise`<`Product`[]\> ; `findWithRelationsAndCount`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<[`Product`[], `number`]\> ; `getCategoryIdsFromInput`: (`categoryId?`: `CategoryQueryParams`, `includeCategoryChildren`: `boolean`) => `Promise`<`string`[]\> ; `getCategoryIdsRecursively`: (`productCategory`: `ProductCategory`) => `string`[] ; `getFreeTextSearchResultsAndCount`: (`q`: `string`, `options`: `FindWithoutRelationsOptions`, `relations`: `string`[]) => `Promise`<[`Product`[], `number`]\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `queryProducts`: (`optionsWithoutRelations`: `FindWithoutRelationsOptions`, `shouldCount`: `boolean`) => `Promise`<[`Product`[], `number`]\> ; `queryProductsWithIds`: (`__namedParameters`: { `entityIds`: `string`[] ; `groupedRelations`: { `[toplevel: string]`: `string`[]; } ; `order?`: { `[column: string]`: ``"ASC"`` \| ``"DESC"``; } ; `select?`: keyof `Product`[] ; `where?`: `FindOptionsWhere`<`Product`\> ; `withDeleted?`: `boolean` }) => `Promise`<`Product`[]\> }
`Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: Method \_applyCategoriesQuery ; `_findWithRelations`: Method \_findWithRelations ; `bulkAddToCollection`: Method bulkAddToCollection ; `bulkRemoveFromCollection`: Method bulkRemoveFromCollection ; `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations ; `findWithRelationsAndCount`: Method findWithRelationsAndCount ; `getCategoryIdsFromInput`: Method getCategoryIdsFromInput ; `getCategoryIdsRecursively`: Method getCategoryIdsRecursively ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `isProductInSalesChannels`: Method isProductInSalesChannels ; `queryProducts`: Method queryProducts ; `queryProductsWithIds`: Method queryProductsWithIds }
#### Defined in
[medusa/src/services/shipping-profile.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L46)
[medusa/src/services/shipping-profile.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L46)
___
### productService\_
• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md)
`Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md)
#### Defined in
[medusa/src/services/shipping-profile.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L41)
[medusa/src/services/shipping-profile.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L41)
___
### shippingOptionService\_
• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
`Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
#### Defined in
[medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L42)
[medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L42)
___
### shippingProfileRepository\_
• `Protected` `Readonly` **shippingProfileRepository\_**: `Repository`<`ShippingProfile`\> & { `findByProducts`: (`productIds`: `string` \| `string`[]) => `Promise`<{ `[product_id: string]`: `ShippingProfile`[]; }\> }
`Protected` `Readonly` **shippingProfileRepository\_**: `Repository`<`ShippingProfile`\> & { `findByProducts`: Method findByProducts }
#### Defined in
[medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L45)
[medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L45)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -158,36 +158,38 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addProduct
▸ **addProduct**(`profileId`, `productId`): `Promise`<`ShippingProfile`\>
**addProduct**(`profileId`, `productId`): `Promise`<`ShippingProfile`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `profileId` | `string` |
| `productId` | `string` \| `string`[] |
@@ -195,26 +197,29 @@ TransactionBaseService.activeManager\_
`Promise`<`ShippingProfile`\>
**`Deprecated`**
-`Promise`:
-`ShippingProfile`:
**Deprecated**
use [addProducts](ShippingProfileService.md#addproducts) instead
#### Defined in
[medusa/src/services/shipping-profile.ts:371](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L371)
[medusa/src/services/shipping-profile.ts:371](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L371)
___
### addProducts
▸ **addProducts**(`profileId`, `productId`): `Promise`<`ShippingProfile`\>
**addProducts**(`profileId`, `productId`): `Promise`<`ShippingProfile`\>
Adds a product or an array of products to the profile.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `profileId` | `string` | the profile to add the products to. |
| `productId` | `string` \| `string`[] | the ID of the product or multiple products to add. |
@@ -222,25 +227,26 @@ Adds a product or an array of products to the profile.
`Promise`<`ShippingProfile`\>
the result of update
-`Promise`: the result of update
-`ShippingProfile`:
#### Defined in
[medusa/src/services/shipping-profile.ts:384](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L384)
[medusa/src/services/shipping-profile.ts:384](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L384)
___
### addShippingOption
▸ **addShippingOption**(`profileId`, `optionId`): `Promise`<`ShippingProfile`\>
**addShippingOption**(`profileId`, `optionId`): `Promise`<`ShippingProfile`\>
Adds a shipping option to the profile. The shipping option can be used to
fulfill the products in the products field.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `profileId` | `string` | the profile to apply the shipping option to |
| `optionId` | `string` \| `string`[] | the ID of the option or multiple options to add to the profile |
@@ -248,33 +254,32 @@ fulfill the products in the products field.
`Promise`<`ShippingProfile`\>
the result of the model update operation
-`Promise`: the result of the model update operation
-`ShippingProfile`:
#### Defined in
[medusa/src/services/shipping-profile.ts:427](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L427)
[medusa/src/services/shipping-profile.ts:427](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L427)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -283,7 +288,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -291,37 +296,38 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`profile`): `Promise`<`ShippingProfile`\>
**create**(`profile`): `Promise`<`ShippingProfile`\>
Creates a new shipping profile.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `profile` | `CreateShippingProfile` | the shipping profile to create from |
#### Returns
`Promise`<`ShippingProfile`\>
the result of the create operation
-`Promise`: the result of the create operation
-`ShippingProfile`:
#### Defined in
[medusa/src/services/shipping-profile.ts:275](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L275)
[medusa/src/services/shipping-profile.ts:275](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L275)
___
### createDefault
▸ **createDefault**(): `Promise`<`ShippingProfile`\>
**createDefault**(): `Promise`<`ShippingProfile`\>
Creates a default shipping profile, if this does not already exist.
@@ -329,17 +335,18 @@ Creates a default shipping profile, if this does not already exist.
`Promise`<`ShippingProfile`\>
the shipping profile
-`Promise`: the shipping profile
-`ShippingProfile`:
#### Defined in
[medusa/src/services/shipping-profile.ts:205](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L205)
[medusa/src/services/shipping-profile.ts:205](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L205)
___
### createGiftCardDefault
▸ **createGiftCardDefault**(): `Promise`<`ShippingProfile`\>
**createGiftCardDefault**(): `Promise`<`ShippingProfile`\>
Creates a default shipping profile, for gift cards if unless it already
exists.
@@ -348,115 +355,125 @@ exists.
`Promise`<`ShippingProfile`\>
the shipping profile
-`Promise`: the shipping profile
-`ShippingProfile`:
#### Defined in
[medusa/src/services/shipping-profile.ts:249](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L249)
[medusa/src/services/shipping-profile.ts:249](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L249)
___
### delete
▸ **delete**(`profileId`): `Promise`<`void`\>
**delete**(`profileId`): `Promise`<`void`\>
Deletes a profile with a given profile id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `profileId` | `string` | the id of the profile to delete. Must be castable as an ObjectId |
#### Returns
`Promise`<`void`\>
the result of the delete operation.
-`Promise`: the result of the delete operation.
#### Defined in
[medusa/src/services/shipping-profile.ts:349](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L349)
[medusa/src/services/shipping-profile.ts:349](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L349)
___
### fetchCartOptions
▸ **fetchCartOptions**(`cart`): `Promise`<`ShippingOption`[]\>
**fetchCartOptions**(`cart`): `Promise`<`ShippingOption`[]\>
Finds all the shipping profiles that cover the products in a cart, and
validates all options that are available for the cart.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cart` | `any` | the cart object to find shipping options for |
#### Returns
`Promise`<`ShippingOption`[]\>
a list of the available shipping options
-`Promise`: a list of the available shipping options
-`ShippingOption[]`:
-`ShippingOption`:
#### Defined in
[medusa/src/services/shipping-profile.ts:452](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L452)
[medusa/src/services/shipping-profile.ts:452](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L452)
___
### getMapProfileIdsByProductIds
▸ **getMapProfileIdsByProductIds**(`productIds`): `Promise`<`Map`<`string`, `string`\>\>
**getMapProfileIdsByProductIds**(`productIds`): `Promise`<`Map`<`string`, `string`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `productIds` | `string`[] |
#### Returns
`Promise`<`Map`<`string`, `string`\>\>
-`Promise`:
-`Map`:
-`string`: (optional)
-`string`: (optional)
#### Defined in
[medusa/src/services/shipping-profile.ts:88](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L88)
[medusa/src/services/shipping-profile.ts:88](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L88)
___
### getProfilesInCart
▸ `Protected` **getProfilesInCart**(`cart`): `Promise`<`string`[]\>
`Protected` **getProfilesInCart**(`cart`): `Promise`<`string`[]\>
Returns a list of all the productIds in the cart.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cart` | `Cart` | the cart to extract products from |
#### Returns
`Promise`<`string`[]\>
a list of product ids
-`Promise`: a list of product ids
-`string[]`:
-`string`: (optional)
#### Defined in
[medusa/src/services/shipping-profile.ts:518](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L518)
[medusa/src/services/shipping-profile.ts:518](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L518)
___
### list
▸ **list**(`selector?`, `config?`): `Promise`<`ShippingProfile`[]\>
**list**(`selector?`, `config?`): `Promise`<`ShippingProfile`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`ShippingProfile`\> | the query object for find |
| `config` | `FindConfig`<`ShippingProfile`\> | the config object for find |
@@ -464,24 +481,26 @@ ___
`Promise`<`ShippingProfile`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`ShippingProfile[]`:
-`ShippingProfile`:
#### Defined in
[medusa/src/services/shipping-profile.ts:73](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L73)
[medusa/src/services/shipping-profile.ts:73](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L73)
___
### removeProducts
▸ **removeProducts**(`profileId`, `productId`): `Promise`<`void` \| `ShippingProfile`\>
**removeProducts**(`profileId`, `productId`): `Promise`<`void` \| `ShippingProfile`\>
Removes a product or an array of products from the profile.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `profileId` | ``null`` \| `string` | the profile to add the products to. |
| `productId` | `string` \| `string`[] | the ID of the product or multiple products to add. |
@@ -489,25 +508,26 @@ Removes a product or an array of products from the profile.
`Promise`<`void` \| `ShippingProfile`\>
the result of update
-`Promise`: the result of update
-`void \| ShippingProfile`: (optional)
#### Defined in
[medusa/src/services/shipping-profile.ts:406](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L406)
[medusa/src/services/shipping-profile.ts:406](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L406)
___
### retrieve
▸ **retrieve**(`profileId`, `options?`): `Promise`<`ShippingProfile`\>
**retrieve**(`profileId`, `options?`): `Promise`<`ShippingProfile`\>
Gets a profile by id.
Throws in case of DB Error and if profile was not found.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `profileId` | `string` | the id of the profile to get. |
| `options` | `FindConfig`<`ShippingProfile`\> | options opf the query. |
@@ -515,51 +535,58 @@ Throws in case of DB Error and if profile was not found.
`Promise`<`ShippingProfile`\>
the profile document.
-`Promise`: the profile document.
-`ShippingProfile`:
#### Defined in
[medusa/src/services/shipping-profile.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L130)
[medusa/src/services/shipping-profile.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L130)
___
### retrieveDefault
▸ **retrieveDefault**(): `Promise`<``null`` \| `ShippingProfile`\>
**retrieveDefault**(): `Promise`<``null`` \| `ShippingProfile`\>
#### Returns
`Promise`<``null`` \| `ShippingProfile`\>
-`Promise`:
-```null`` \| ShippingProfile`: (optional)
#### Defined in
[medusa/src/services/shipping-profile.ts:189](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L189)
[medusa/src/services/shipping-profile.ts:189](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L189)
___
### retrieveForProducts
▸ **retrieveForProducts**(`productIds`): `Promise`<{ `[product_id: string]`: `ShippingProfile`[]; }\>
**retrieveForProducts**(`productIds`): `Promise`<{ `[product_id: string]`: `ShippingProfile`[]; }\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `productIds` | `string` \| `string`[] |
#### Returns
`Promise`<{ `[product_id: string]`: `ShippingProfile`[]; }\>
-`Promise`:
-``object``: (optional)
#### Defined in
[medusa/src/services/shipping-profile.ts:159](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L159)
[medusa/src/services/shipping-profile.ts:159](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L159)
___
### retrieveGiftCardDefault
▸ **retrieveGiftCardDefault**(): `Promise`<``null`` \| `ShippingProfile`\>
**retrieveGiftCardDefault**(): `Promise`<``null`` \| `ShippingProfile`\>
Retrieves the default gift card profile
@@ -567,41 +594,44 @@ Retrieves the default gift card profile
`Promise`<``null`` \| `ShippingProfile`\>
the shipping profile for gift cards
-`Promise`: the shipping profile for gift cards
-```null`` \| ShippingProfile`: (optional)
#### Defined in
[medusa/src/services/shipping-profile.ts:232](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L232)
[medusa/src/services/shipping-profile.ts:232](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L232)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`profileId`, `update`): `Promise`<`ShippingProfile`\>
**update**(`profileId`, `update`): `Promise`<`ShippingProfile`\>
Updates a profile. Metadata updates and product updates should use
dedicated methods, e.g. `setMetadata`, `addProduct`, etc. The function
@@ -609,8 +639,8 @@ will throw errors if metadata or product updates are attempted.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `profileId` | `string` | the id of the profile. Must be a string that can be casted to an ObjectId |
| `update` | `UpdateShippingProfile` | an object with the update values. |
@@ -618,32 +648,35 @@ will throw errors if metadata or product updates are attempted.
`Promise`<`ShippingProfile`\>
resolves to the update result.
-`Promise`: resolves to the update result.
-`ShippingProfile`:
#### Defined in
[medusa/src/services/shipping-profile.ts:310](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L310)
[medusa/src/services/shipping-profile.ts:310](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L310)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`ShippingProfileService`](ShippingProfileService.md)
**withTransaction**(`transactionManager?`): [`ShippingProfileService`](ShippingProfileService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`ShippingProfileService`](ShippingProfileService.md)
-`ShippingProfileService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: StagedJobService
# StagedJobService
Provides layer to manipulate users.
@@ -12,12 +12,12 @@ Provides layer to manipulate users.
### constructor
• **new StagedJobService**(`«destructured»`)
**new StagedJobService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `StagedJobServiceProps` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/staged-job.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L22)
[medusa/src/services/staged-job.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L22)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,13 +68,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -82,23 +82,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### stagedJobRepository\_
• `Protected` **stagedJobRepository\_**: `Repository`<`StagedJob`\> & { `insertBulk`: (`jobToCreates`: `_QueryDeepPartialEntity`<`StagedJob`\>[]) => `Promise`<`StagedJob`[]\> }
`Protected` **stagedJobRepository\_**: `Repository`<`StagedJob`\> & { `insertBulk`: Method insertBulk }
#### Defined in
[medusa/src/services/staged-job.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L20)
[medusa/src/services/staged-job.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L20)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -106,47 +106,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -155,7 +155,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -163,112 +163,126 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`StagedJob`[]\>
**create**(`data`): `Promise`<`StagedJob`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `EmitData`<`unknown`\> \| `EmitData`<`unknown`\>[] |
#### Returns
`Promise`<`StagedJob`[]\>
-`Promise`:
-`StagedJob[]`:
-`StagedJob`:
#### Defined in
[medusa/src/services/staged-job.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L45)
[medusa/src/services/staged-job.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L45)
___
### delete
▸ **delete**(`stagedJobIds`): `Promise`<`void`\>
**delete**(`stagedJobIds`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `stagedJobIds` | `string` \| `string`[] |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/staged-job.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L37)
[medusa/src/services/staged-job.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L37)
___
### list
▸ **list**(`config`): `Promise`<`StagedJob`[]\>
**list**(`config`): `Promise`<`StagedJob`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `config` | `FindConfig`<`StagedJob`\> |
#### Returns
`Promise`<`StagedJob`[]\>
-`Promise`:
-`StagedJob[]`:
-`StagedJob`:
#### Defined in
[medusa/src/services/staged-job.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L29)
[medusa/src/services/staged-job.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L29)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`StagedJobService`](StagedJobService.md)
**withTransaction**(`transactionManager?`): [`StagedJobService`](StagedJobService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`StagedJobService`](StagedJobService.md)
-`StagedJobService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: StoreService
# StoreService
Provides layer to manipulate store settings.
@@ -12,12 +12,12 @@ Provides layer to manipulate store settings.
### constructor
• **new StoreService**(`«destructured»`)
**new StoreService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L28)
[medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L28)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,33 +68,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### currencyRepository\_
• `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\>
`Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\>
#### Defined in
[medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L25)
[medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L25)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/store.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L26)
[medusa/src/services/store.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L26)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -102,23 +102,23 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### storeRepository\_
• `Protected` `Readonly` **storeRepository\_**: `Repository`<`Store`\>
`Protected` `Readonly` **storeRepository\_**: `Repository`<`Store`\>
#### Defined in
[medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L24)
[medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L24)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -126,71 +126,72 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addCurrency
▸ **addCurrency**(`code`): `Promise`<`Store`\>
**addCurrency**(`code`): `Promise`<`Store`\>
Add a currency to the store
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `code` | `string` | 3 character ISO currency code |
#### Returns
`Promise`<`Store`\>
result after update
-`Promise`: result after update
-`Store`:
#### Defined in
[medusa/src/services/store.ts:208](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L208)
[medusa/src/services/store.ts:208](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L208)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -199,7 +200,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -207,13 +208,13 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(): `Promise`<`Store`\>
**create**(): `Promise`<`Store`\>
Creates a store if it doesn't already exist.
@@ -221,148 +222,159 @@ Creates a store if it doesn't already exist.
`Promise`<`Store`\>
The store.
-`Promise`: The store.
-`Store`:
#### Defined in
[medusa/src/services/store.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L45)
[medusa/src/services/store.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L45)
___
### getDefaultCurrency\_
▸ `Protected` **getDefaultCurrency_**(`code`): `Partial`<`Currency`\>
`Protected` **getDefaultCurrency_**(`code`): `Partial`<`Currency`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `code` | `string` |
#### Returns
`Partial`<`Currency`\>
-`Partial`:
-`Currency`:
#### Defined in
[medusa/src/services/store.ts:100](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L100)
[medusa/src/services/store.ts:100](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L100)
___
### removeCurrency
▸ **removeCurrency**(`code`): `Promise`<`any`\>
**removeCurrency**(`code`): `Promise`<`any`\>
Removes a currency from the store
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `code` | `string` | 3 character ISO currency code |
#### Returns
`Promise`<`any`\>
result after update
-`Promise`: result after update
-`any`: (optional)
#### Defined in
[medusa/src/services/store.ts:252](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L252)
[medusa/src/services/store.ts:252](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L252)
___
### retrieve
▸ **retrieve**(`config?`): `Promise`<`Store`\>
**retrieve**(`config?`): `Promise`<`Store`\>
Retrieve the store settings. There is always a maximum of one store.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `config` | `FindConfig`<`Store`\> | The config object from which the query will be built |
#### Returns
`Promise`<`Store`\>
the store
-`Promise`: the store
-`Store`:
#### Defined in
[medusa/src/services/store.ts:83](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L83)
[medusa/src/services/store.ts:83](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L83)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`data`): `Promise`<`Store`\>
**update**(`data`): `Promise`<`Store`\>
Updates a store
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `data` | `UpdateStoreInput` | an object with the update values. |
#### Returns
`Promise`<`Store`\>
resolves to the update result.
-`Promise`: resolves to the update result.
-`Store`:
#### Defined in
[medusa/src/services/store.ts:116](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L116)
[medusa/src/services/store.ts:116](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L116)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`StoreService`](StoreService.md)
**withTransaction**(`transactionManager?`): [`StoreService`](StoreService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`StoreService`](StoreService.md)
-`StoreService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: StrategyResolverService
# StrategyResolverService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new StrategyResolverService**(`container`)
**new StrategyResolverService**(`container`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `container` | `InjectedDependencies` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/strategy-resolver.ts#L11)
[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/strategy-resolver.ts#L11)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### container
• `Protected` `Readonly` **container**: `InjectedDependencies`
`Protected` `Readonly` **container**: `InjectedDependencies`
#### Defined in
[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/strategy-resolver.ts#L11)
[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/strategy-resolver.ts#L11)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -90,13 +90,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -104,47 +104,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -153,7 +153,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -161,72 +161,78 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### resolveBatchJobByType
▸ **resolveBatchJobByType**(`type`): `AbstractBatchJobStrategy`
**resolveBatchJobByType**(`type`): `AbstractBatchJobStrategy`
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `type` | `string` |
#### Returns
`AbstractBatchJobStrategy`
-`AbstractBatchJobStrategy`:
#### Defined in
[medusa/src/services/strategy-resolver.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/strategy-resolver.ts#L15)
[medusa/src/services/strategy-resolver.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/strategy-resolver.ts#L15)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`StrategyResolverService`](StrategyResolverService.md)
**withTransaction**(`transactionManager?`): [`StrategyResolverService`](StrategyResolverService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`StrategyResolverService`](StrategyResolverService.md)
-`default`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: SwapService
# SwapService
Handles swaps
@@ -12,12 +12,12 @@ Handles swaps
### constructor
• **new SwapService**(`«destructured»`)
**new SwapService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedProps` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/swap.ts:91](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L91)
[medusa/src/services/swap.ts:91](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L91)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,73 +68,73 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### cartService\_
• `Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md)
`Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md)
#### Defined in
[medusa/src/services/swap.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L77)
[medusa/src/services/swap.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L77)
___
### customShippingOptionService\_
• `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md)
`Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md)
#### Defined in
[medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L87)
[medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L87)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L78)
[medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L78)
___
### fulfillmentService\_
• `Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md)
`Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md)
#### Defined in
[medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L83)
[medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L83)
___
### lineItemAdjustmentService\_
• `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md)
`Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md)
#### Defined in
[medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L86)
[medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L86)
___
### lineItemService\_
• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
`Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md)
#### Defined in
[medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L82)
[medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L82)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -142,83 +142,83 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### orderService\_
• `Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md)
`Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md)
#### Defined in
[medusa/src/services/swap.ts:79](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L79)
[medusa/src/services/swap.ts:79](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L79)
___
### paymentProviderService\_
• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
`Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md)
#### Defined in
[medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L85)
[medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L85)
___
### productVariantInventoryService\_
• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
`Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md)
#### Defined in
[medusa/src/services/swap.ts:89](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L89)
[medusa/src/services/swap.ts:89](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L89)
___
### returnService\_
• `Protected` `Readonly` **returnService\_**: [`ReturnService`](ReturnService.md)
`Protected` `Readonly` **returnService\_**: [`ReturnService`](ReturnService.md)
#### Defined in
[medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L80)
[medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L80)
___
### shippingOptionService\_
• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
`Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
#### Defined in
[medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L84)
[medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L84)
___
### swapRepository\_
• `Protected` `Readonly` **swapRepository\_**: `Repository`<`Swap`\>
`Protected` `Readonly` **swapRepository\_**: `Repository`<`Swap`\>
#### Defined in
[medusa/src/services/swap.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L75)
[medusa/src/services/swap.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L75)
___
### totalsService\_
• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
`Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md)
#### Defined in
[medusa/src/services/swap.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L81)
[medusa/src/services/swap.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L81)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -226,13 +226,13 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### Events
▪ `Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -250,67 +250,70 @@ ___
#### Defined in
[medusa/src/services/swap.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L63)
[medusa/src/services/swap.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L63)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### areReturnItemsValid
▸ `Protected` **areReturnItemsValid**(`returnItems`): `Promise`<`boolean`\>
`Protected` **areReturnItemsValid**(`returnItems`): `Promise`<`boolean`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `returnItems` | `WithRequiredProperty`<`Partial`<`ReturnItem`\>, ``"item_id"``\>[] |
#### Returns
`Promise`<`boolean`\>
-`Promise`:
-`boolean`: (optional)
#### Defined in
[medusa/src/services/swap.ts:1240](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1240)
[medusa/src/services/swap.ts:1240](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1240)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -319,7 +322,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -327,13 +330,13 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### cancel
▸ **cancel**(`swapId`): `Promise`<`Swap`\>
**cancel**(`swapId`): `Promise`<`Swap`\>
Cancels a given swap if possible. A swap can only be canceled if all
related returns, fulfillments, and payments have been canceled. If a swap
@@ -341,84 +344,87 @@ is associated with a refund, it cannot be canceled.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `swapId` | `string` | the id of the swap to cancel. |
#### Returns
`Promise`<`Swap`\>
the canceled swap.
-`Promise`: the canceled swap.
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:857](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L857)
[medusa/src/services/swap.ts:857](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L857)
___
### cancelFulfillment
▸ **cancelFulfillment**(`fulfillmentId`): `Promise`<`Swap`\>
**cancelFulfillment**(`fulfillmentId`): `Promise`<`Swap`\>
Cancels a fulfillment (if related to a swap)
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `fulfillmentId` | `string` | the ID of the fulfillment to cancel |
#### Returns
`Promise`<`Swap`\>
updated swap
-`Promise`: updated swap
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:1059](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1059)
[medusa/src/services/swap.ts:1059](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1059)
___
### create
▸ **create**(`order`, `returnItems`, `additionalItems?`, `returnShipping?`, `custom?`): `Promise`<`Swap`\>
**create**(`order`, `returnItems`, `additionalItems?`, `returnShipping?`, `custom?`): `Promise`<`Swap`\>
Creates a swap from an order, with given return items, additional items
and an optional return shipping method.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `Order` | the order to base the swap off |
| `returnItems` | `WithRequiredProperty`<`Partial`<`ReturnItem`\>, ``"item_id"``\>[] | the items to return in the swap |
| `additionalItems?` | `Pick`<`LineItem`, ``"variant_id"`` \| ``"quantity"``\>[] | the items to send to the customer |
| `returnShipping?` | `Object` | an optional shipping method for returning the returnItems |
| `returnShipping.option_id` | `string` | - |
| `returnShipping.price?` | `number` | - |
| `custom` | `Object` | contains relevant custom information. This object may include no_notification which will disable sending notification when creating swap. If set, it overrules the attribute inherited from the order |
| `custom.allow_backorder?` | `boolean` | - |
| `custom.idempotency_key?` | `string` | - |
| `custom.location_id?` | `string` | - |
| `custom.no_notification?` | `boolean` | - |
| `returnShipping?` | `object` | an optional shipping method for returning the returnItems |
| `returnShipping.option_id` | `string` |
| `returnShipping.price?` | `number` |
| `custom` | `object` | contains relevant custom information. This object may include no_notification which will disable sending notification when creating swap. If set, it overrules the attribute inherited from the order |
| `custom.allow_backorder?` | `boolean` |
| `custom.idempotency_key?` | `string` |
| `custom.location_id?` | `string` |
| `custom.no_notification?` | `boolean` |
#### Returns
`Promise`<`Swap`\>
the newly created swap
-`Promise`: the newly created swap
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:321](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L321)
[medusa/src/services/swap.ts:321](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L321)
___
### createCart
▸ **createCart**(`swapId`, `customShippingOptions?`, `context?`): `Promise`<`Swap`\>
**createCart**(`swapId`, `customShippingOptions?`, `context?`): `Promise`<`Swap`\>
Creates a cart from the given swap. The cart can be used to pay
for differences associated with the swap. The swap represented by the
@@ -427,36 +433,37 @@ swap.
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `swapId` | `string` | `undefined` | the id of the swap to create the cart from |
| Name | Default value | Description |
| :------ | :------ | :------ |
| `swapId` | `string` | the id of the swap to create the cart from |
| `customShippingOptions` | { `option_id`: `string` ; `price`: `number` }[] | `[]` | the shipping options |
| `context` | `Object` | `{}` | - |
| `context.sales_channel_id?` | `string` | `undefined` | - |
| `context` | `object` |
| `context.sales_channel_id?` | `string` |
#### Returns
`Promise`<`Swap`\>
the swap with its cart_id prop set to the id of the new cart.
-`Promise`: the swap with its cart_id prop set to the id of the new cart.
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:577](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L577)
[medusa/src/services/swap.ts:577](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L577)
___
### createFulfillment
▸ **createFulfillment**(`swapId`, `config?`): `Promise`<`Swap`\>
**createFulfillment**(`swapId`, `config?`): `Promise`<`Swap`\>
Fulfills the additional items associated with the swap. Will call the
fulfillment providers associated with the shipping methods.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `swapId` | `string` | the id of the swap to fulfill, |
| `config` | `CreateShipmentConfig` | optional configurations, includes optional metadata to attach to the shipment, and a no_notification flag. |
@@ -464,24 +471,25 @@ fulfillment providers associated with the shipping methods.
`Promise`<`Swap`\>
the updated swap with new status and fulfillments.
-`Promise`: the updated swap with new status and fulfillments.
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:919](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L919)
[medusa/src/services/swap.ts:919](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L919)
___
### createShipment
▸ **createShipment**(`swapId`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Swap`\>
**createShipment**(`swapId`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Swap`\>
Marks a fulfillment as shipped and attaches tracking numbers.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `swapId` | `string` | the id of the swap that has been shipped. |
| `fulfillmentId` | `string` | the id of the specific fulfillment that has been shipped |
| `trackingLinks?` | { `tracking_number`: `string` }[] | the tracking numbers associated with the shipment |
@@ -491,24 +499,25 @@ Marks a fulfillment as shipped and attaches tracking numbers.
`Promise`<`Swap`\>
the updated swap with new fulfillments and status.
-`Promise`: the updated swap with new fulfillments and status.
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:1090](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1090)
[medusa/src/services/swap.ts:1090](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1090)
___
### deleteMetadata
▸ **deleteMetadata**(`swapId`, `key`): `Promise`<`Swap`\>
**deleteMetadata**(`swapId`, `key`): `Promise`<`Swap`\>
Dedicated method to delete metadata for a swap.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `swapId` | `string` | the order to delete metadata from. |
| `key` | `string` | key for metadata field |
@@ -516,24 +525,25 @@ Dedicated method to delete metadata for a swap.
`Promise`<`Swap`\>
resolves to the updated result.
-`Promise`: resolves to the updated result.
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:1168](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1168)
[medusa/src/services/swap.ts:1168](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1168)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`Swap`[]\>
**list**(`selector`, `config?`): `Promise`<`Swap`[]\>
List swaps.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Swap`\> | the query object for find |
| `config` | `FindConfig`<`Swap`\> | the configuration used to find the objects. contains relations, skip, and take. |
@@ -541,24 +551,26 @@ List swaps.
`Promise`<`Swap`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`Swap[]`:
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:273](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L273)
[medusa/src/services/swap.ts:273](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L273)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Swap`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`Swap`[], `number`]\>
List swaps.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `Selector`<`Swap`\> | the query object for find |
| `config` | `FindConfig`<`Swap`\> | the configuration used to find the objects. contains relations, skip, and take. |
@@ -566,97 +578,102 @@ List swaps.
`Promise`<[`Swap`[], `number`]\>
the result of the find operation
-`Promise`: the result of the find operation
-`Swap[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/swap.ts:293](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L293)
[medusa/src/services/swap.ts:293](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L293)
___
### processDifference
▸ **processDifference**(`swapId`): `Promise`<`Swap`\>
**processDifference**(`swapId`): `Promise`<`Swap`\>
Process difference for the requested swap.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `swapId` | `string` | id of a swap being processed |
#### Returns
`Promise`<`Swap`\>
processed swap
-`Promise`: processed swap
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:421](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L421)
[medusa/src/services/swap.ts:421](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L421)
___
### registerCartCompletion
▸ **registerCartCompletion**(`swapId`): `Promise`<`Swap`\>
**registerCartCompletion**(`swapId`): `Promise`<`Swap`\>
Register a cart completion
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `swapId` | `string` | The id of the swap |
#### Returns
`Promise`<`Swap`\>
swap related to the cart
-`Promise`: swap related to the cart
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:724](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L724)
[medusa/src/services/swap.ts:724](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L724)
___
### registerReceived
▸ **registerReceived**(`id`): `Promise`<`Swap`\>
**registerReceived**(`id`): `Promise`<`Swap`\>
Registers the swap return items as received so that they cannot be used
as a part of other swaps/returns.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `any` | the id of the order with the swap. |
#### Returns
`Promise`<`Swap`\>
the resulting order
-`Promise`: the resulting order
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:1206](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1206)
[medusa/src/services/swap.ts:1206](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1206)
___
### retrieve
▸ **retrieve**(`swapId`, `config?`): `Promise`<`Swap`\>
**retrieve**(`swapId`, `config?`): `Promise`<`Swap`\>
Retrieves a swap with the given id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `swapId` | `string` | the id of the swap to retrieve |
| `config` | `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } | the configuration to retrieve the swap |
@@ -664,97 +681,101 @@ Retrieves a swap with the given id.
`Promise`<`Swap`\>
the swap
-`Promise`: the swap
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:203](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L203)
[medusa/src/services/swap.ts:203](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L203)
___
### retrieveByCartId
▸ **retrieveByCartId**(`cartId`, `relations?`): `Promise`<`Swap`\>
**retrieveByCartId**(`cartId`, `relations?`): `Promise`<`Swap`\>
Retrieves a swap based on its associated cart id
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `cartId` | `string` | `undefined` | the cart id that the swap's cart has |
| Name | Default value | Description |
| :------ | :------ | :------ |
| `cartId` | `string` | the cart id that the swap's cart has |
| `relations` | `undefined` \| `string`[] | `[]` | the relations to retrieve swap |
#### Returns
`Promise`<`Swap`\>
the swap
-`Promise`: the swap
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:246](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L246)
[medusa/src/services/swap.ts:246](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L246)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### transformQueryForCart
▸ `Protected` **transformQueryForCart**(`config`): `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } & { `cartRelations`: `undefined` \| `string`[] ; `cartSelects`: `undefined` \| keyof `Cart`[] }
`Protected` **transformQueryForCart**(`config`): `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } & { `cartRelations`: `undefined` \| `string`[] ; `cartSelects`: `undefined` \| keyof `Cart`[] }
Transform find config object for retrieval.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `config` | `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } | parsed swap find config |
#### Returns
`Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } & { `cartRelations`: `undefined` \| `string`[] ; `cartSelects`: `undefined` \| keyof `Cart`[] }
transformed find swap config
-``Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } & { `cartRelations`: `undefined` \| `string`[] ; `cartSelects`: `undefined` \| keyof `Cart`[] }`: (optional) transformed find swap config
#### Defined in
[medusa/src/services/swap.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L130)
[medusa/src/services/swap.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L130)
___
### update
▸ **update**(`swapId`, `update`): `Promise`<`Swap`\>
**update**(`swapId`, `update`): `Promise`<`Swap`\>
Update the swap record.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `swapId` | `string` | id of a swap to update |
| `update` | `Partial`<`Swap`\> | new data |
@@ -762,32 +783,35 @@ Update the swap record.
`Promise`<`Swap`\>
updated swap record
-`Promise`: updated swap record
-`Swap`:
#### Defined in
[medusa/src/services/swap.ts:544](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L544)
[medusa/src/services/swap.ts:544](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L544)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`SwapService`](SwapService.md)
**withTransaction**(`transactionManager?`): [`SwapService`](SwapService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`SwapService`](SwapService.md)
-`SwapService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: SystemPaymentProviderService
# SystemPaymentProviderService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new SystemPaymentProviderService**(`_`)
**new SystemPaymentProviderService**(`_`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L6)
[medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L6)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,13 +66,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -80,13 +80,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -94,57 +94,57 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### identifier
▪ `Static` **identifier**: `string` = `"system"`
`Static` **identifier**: `string` = `"system"`
#### Defined in
[medusa/src/services/system-payment-provider.ts:4](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L4)
[medusa/src/services/system-payment-provider.ts:4](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L4)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -153,7 +153,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -161,252 +161,304 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### authorizePayment
▸ **authorizePayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\>
**authorizePayment**(`_`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L22)
[medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L22)
___
### cancelPayment
▸ **cancelPayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\>
**cancelPayment**(`_`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L46)
[medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L46)
___
### capturePayment
▸ **capturePayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\>
**capturePayment**(`_`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L38)
[medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L38)
___
### createPayment
▸ **createPayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\>
**createPayment**(`_`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:10](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L10)
[medusa/src/services/system-payment-provider.ts:10](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L10)
___
### deletePayment
▸ **deletePayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\>
**deletePayment**(`_`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L34)
[medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L34)
___
### getPaymentData
▸ **getPaymentData**(`_`): `Promise`<`Record`<`string`, `unknown`\>\>
**getPaymentData**(`_`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L18)
[medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L18)
___
### getStatus
▸ **getStatus**(`_`): `Promise`<`string`\>
**getStatus**(`_`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`string`\>
-`Promise`:
-`string`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L14)
[medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L14)
___
### refundPayment
▸ **refundPayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\>
**refundPayment**(`_`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L42)
[medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L42)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### updatePayment
▸ **updatePayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\>
**updatePayment**(`_`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L30)
[medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L30)
___
### updatePaymentData
▸ **updatePaymentData**(`_`): `Promise`<`Record`<`string`, `unknown`\>\>
**updatePaymentData**(`_`): `Promise`<Record<`string`, `unknown`\>\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `_` | `any` |
#### Returns
`Promise`<`Record`<`string`, `unknown`\>\>
`Promise`<Record<`string`, `unknown`\>\>
-`Promise`:
-`Record`:
-`string`: (optional)
-`unknown`: (optional)
#### Defined in
[medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L26)
[medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L26)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`SystemPaymentProviderService`](SystemPaymentProviderService.md)
**withTransaction**(`transactionManager?`): [`SystemPaymentProviderService`](SystemPaymentProviderService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`SystemPaymentProviderService`](SystemPaymentProviderService.md)
-`SystemProviderService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: TaxProviderService
# TaxProviderService
Finds tax providers and assists in tax related operations.
@@ -12,12 +12,12 @@ Finds tax providers and assists in tax related operations.
### constructor
• **new TaxProviderService**(`container`)
**new TaxProviderService**(`container`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `container` | `AwilixContainer`<`any`\> |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L45)
[medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L45)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,43 +68,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### cacheService\_
• `Protected` `Readonly` **cacheService\_**: `ICacheService`
`Protected` `Readonly` **cacheService\_**: `ICacheService`
#### Defined in
[medusa/src/services/tax-provider.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L38)
[medusa/src/services/tax-provider.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L38)
___
### container\_
• `Protected` `Readonly` **container\_**: `AwilixContainer`<`any`\>
`Protected` `Readonly` **container\_**: `AwilixContainer`<`any`\>
#### Defined in
[medusa/src/services/tax-provider.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L37)
[medusa/src/services/tax-provider.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L37)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: `IEventBusService`
`Protected` `Readonly` **eventBus\_**: `IEventBusService`
#### Defined in
[medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L43)
[medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L43)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -112,53 +112,53 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### smTaxLineRepo\_
• `Protected` `Readonly` **smTaxLineRepo\_**: `Repository`<`ShippingMethodTaxLine`\> & { `deleteForCart`: (`cartId`: `string`) => `Promise`<`void`\> ; `upsertLines`: (`lines`: `ShippingMethodTaxLine`[]) => `Promise`<`ShippingMethodTaxLine`[]\> }
`Protected` `Readonly` **smTaxLineRepo\_**: `Repository`<`ShippingMethodTaxLine`\> & { `deleteForCart`: Method deleteForCart ; `upsertLines`: Method upsertLines }
#### Defined in
[medusa/src/services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L41)
[medusa/src/services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L41)
___
### taxLineRepo\_
• `Protected` `Readonly` **taxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: (`cartId`: `string`) => `Promise`<`void`\> ; `upsertLines`: (`lines`: `LineItemTaxLine`[]) => `Promise`<`LineItemTaxLine`[]\> }
`Protected` `Readonly` **taxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: Method deleteForCart ; `upsertLines`: Method upsertLines }
#### Defined in
[medusa/src/services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L40)
[medusa/src/services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L40)
___
### taxProviderRepo\_
• `Protected` `Readonly` **taxProviderRepo\_**: `Repository`<`TaxProvider`\>
`Protected` `Readonly` **taxProviderRepo\_**: `Repository`<`TaxProvider`\>
#### Defined in
[medusa/src/services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L42)
[medusa/src/services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L42)
___
### taxRateService\_
• `Protected` `Readonly` **taxRateService\_**: [`TaxRateService`](TaxRateService.md)
`Protected` `Readonly` **taxRateService\_**: [`TaxRateService`](TaxRateService.md)
#### Defined in
[medusa/src/services/tax-provider.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L39)
[medusa/src/services/tax-provider.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L39)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -166,47 +166,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -215,7 +215,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -223,61 +223,65 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### clearLineItemsTaxLines
▸ **clearLineItemsTaxLines**(`itemIds`): `Promise`<`void`\>
**clearLineItemsTaxLines**(`itemIds`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `itemIds` | `string`[] |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/tax-provider.ts:89](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L89)
[medusa/src/services/tax-provider.ts:89](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L89)
___
### clearTaxLines
▸ **clearTaxLines**(`cartId`): `Promise`<`void`\>
**clearTaxLines**(`cartId`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `cartId` | `string` |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/tax-provider.ts:97](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L97)
[medusa/src/services/tax-provider.ts:97](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L97)
___
### createShippingTaxLines
▸ **createShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
**createShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
Persists the tax lines relevant for a shipping method to the database. Used
for return shipping methods.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `shippingMethod` | `ShippingMethod` | the shipping method to create tax lines for |
| `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by |
@@ -285,24 +289,26 @@ for return shipping methods.
`Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
the newly created tax lines
-`Promise`: the newly created tax lines
-`(LineItemTaxLine \| ShippingMethodTaxLine)[]`:
-`LineItemTaxLine \| ShippingMethodTaxLine`: (optional)
#### Defined in
[medusa/src/services/tax-provider.ts:171](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L171)
[medusa/src/services/tax-provider.ts:171](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L171)
___
### createTaxLines
▸ **createTaxLines**(`cartOrLineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
**createTaxLines**(`cartOrLineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
Persists the tax lines relevant for an order to the database.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cartOrLineItems` | `LineItem`[] \| `Cart` | the cart or line items to create tax lines for |
| `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by |
@@ -310,24 +316,26 @@ Persists the tax lines relevant for an order to the database.
`Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
the newly created tax lines
-`Promise`: the newly created tax lines
-`(LineItemTaxLine \| ShippingMethodTaxLine)[]`:
-`LineItemTaxLine \| ShippingMethodTaxLine`: (optional)
#### Defined in
[medusa/src/services/tax-provider.ts:117](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L117)
[medusa/src/services/tax-provider.ts:117](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L117)
___
### getCacheKey
▸ `Private` **getCacheKey**(`id`, `regionId`): `string`
`Private` **getCacheKey**(`id`, `regionId`): `string`
The cache key to get cache hits by.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `id` | `string` | the entity id to cache |
| `regionId` | `string` | the region id to cache |
@@ -335,51 +343,54 @@ The cache key to get cache hits by.
`string`
the cache key to use for the id set
-`string`: (optional) the cache key to use for the id set
#### Defined in
[medusa/src/services/tax-provider.ts:492](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L492)
[medusa/src/services/tax-provider.ts:492](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L492)
___
### getRegionRatesForProduct
▸ **getRegionRatesForProduct**(`productIds`, `region`): `Promise`<`Map`<`string`, `TaxServiceRate`[]\>\>
**getRegionRatesForProduct**(`productIds`, `region`): `Promise`<`Map`<`string`, `TaxServiceRate`[]\>\>
Gets the tax rates configured for a product. The rates are cached between
calls.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `productIds` | `string` \| `string`[] | |
| Name | Description |
| :------ | :------ |
| `productIds` | `string` \| `string`[] |
| `region` | `RegionDetails` | the region to get configured rates for. |
#### Returns
`Promise`<`Map`<`string`, `TaxServiceRate`[]\>\>
the tax rates configured for the shipping option. A map by product id
-`Promise`: the tax rates configured for the shipping option. A map by product id
-`Map`:
-`string`: (optional)
-`TaxServiceRate[]`:
#### Defined in
[medusa/src/services/tax-provider.ts:427](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L427)
[medusa/src/services/tax-provider.ts:427](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L427)
___
### getRegionRatesForShipping
▸ **getRegionRatesForShipping**(`optionId`, `regionDetails`): `Promise`<`TaxServiceRate`[]\>
**getRegionRatesForShipping**(`optionId`, `regionDetails`): `Promise`<`TaxServiceRate`[]\>
Gets the tax rates configured for a shipping option. The rates are cached
between calls.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `optionId` | `string` | the option id of the shipping method. |
| `regionDetails` | `RegionDetails` | the region to get configured rates for. |
@@ -387,17 +398,18 @@ between calls.
`Promise`<`TaxServiceRate`[]\>
the tax rates configured for the shipping option.
-`Promise`: the tax rates configured for the shipping option.
-`TaxServiceRate[]`:
#### Defined in
[medusa/src/services/tax-provider.ts:380](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L380)
[medusa/src/services/tax-provider.ts:380](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L380)
___
### getShippingTaxLines
▸ **getShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<`ShippingMethodTaxLine`[]\>
**getShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<`ShippingMethodTaxLine`[]\>
Gets the relevant tax lines for a shipping method. Note: this method
doesn't persist the tax lines. Use createShippingTaxLines if you wish to
@@ -405,8 +417,8 @@ persist the tax lines to the DB layer.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `shippingMethod` | `ShippingMethod` | the shipping method to get tax lines for |
| `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by |
@@ -414,17 +426,19 @@ persist the tax lines to the DB layer.
`Promise`<`ShippingMethodTaxLine`[]\>
the computed tax lines
-`Promise`: the computed tax lines
-`ShippingMethodTaxLine[]`:
-`ShippingMethodTaxLine`:
#### Defined in
[medusa/src/services/tax-provider.ts:192](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L192)
[medusa/src/services/tax-provider.ts:192](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L192)
___
### getTaxLines
▸ **getTaxLines**(`lineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
**getTaxLines**(`lineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
Gets the relevant tax lines for an order or cart. If an order is provided
the order's tax lines will be returned. If a cart is provided the tax lines
@@ -434,8 +448,8 @@ wish to persist the tax lines to the DB layer.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `lineItems` | `LineItem`[] | the cart or order to get tax lines for |
| `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by |
@@ -443,24 +457,26 @@ wish to persist the tax lines to the DB layer.
`Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\>
the computed tax lines
-`Promise`: the computed tax lines
-`(LineItemTaxLine \| ShippingMethodTaxLine)[]`:
-`LineItemTaxLine \| ShippingMethodTaxLine`: (optional)
#### Defined in
[medusa/src/services/tax-provider.ts:246](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L246)
[medusa/src/services/tax-provider.ts:246](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L246)
___
### getTaxLinesMap
▸ `Protected` **getTaxLinesMap**(`items`, `calculationContext`): `Promise`<`TaxLinesMaps`\>
`Protected` **getTaxLinesMap**(`items`, `calculationContext`): `Promise`<`TaxLinesMaps`\>
Return a map of tax lines for line items and shipping methods
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `items` | `LineItem`[] |
| `calculationContext` | `TaxCalculationContext` |
@@ -468,112 +484,122 @@ Return a map of tax lines for line items and shipping methods
`Promise`<`TaxLinesMaps`\>
-`Promise`:
#### Defined in
[medusa/src/services/tax-provider.ts:343](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L343)
[medusa/src/services/tax-provider.ts:343](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L343)
___
### list
▸ **list**(): `Promise`<`TaxProvider`[]\>
**list**(): `Promise`<`TaxProvider`[]\>
#### Returns
`Promise`<`TaxProvider`[]\>
-`Promise`:
-`TaxProvider[]`:
-`TaxProvider`:
#### Defined in
[medusa/src/services/tax-provider.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L57)
[medusa/src/services/tax-provider.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L57)
___
### registerInstalledProviders
▸ **registerInstalledProviders**(`providers`): `Promise`<`void`\>
**registerInstalledProviders**(`providers`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `providers` | `string`[] |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/tax-provider.ts:496](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L496)
[medusa/src/services/tax-provider.ts:496](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L496)
___
### retrieveProvider
▸ **retrieveProvider**(`region`): `ITaxService`
**retrieveProvider**(`region`): `ITaxService`
Retrieves the relevant tax provider for the given region.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `region` | `Region` | the region to get tax provider for. |
#### Returns
`ITaxService`
the region specific tax provider
#### Defined in
[medusa/src/services/tax-provider.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L67)
[medusa/src/services/tax-provider.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L67)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`TaxProviderService`](TaxProviderService.md)
**withTransaction**(`transactionManager?`): [`TaxProviderService`](TaxProviderService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`TaxProviderService`](TaxProviderService.md)
-`TaxProviderService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: TaxRateService
# TaxRateService
## Hierarchy
@@ -10,12 +10,12 @@
### constructor
• **new TaxRateService**(`«destructured»`)
**new TaxRateService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `Object` |
#### Overrides
@@ -24,13 +24,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L29)
[medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L29)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -66,13 +66,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -80,53 +80,53 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### productService\_
• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md)
`Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md)
#### Defined in
[medusa/src/services/tax-rate.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L24)
[medusa/src/services/tax-rate.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L24)
___
### productTypeService\_
• `Protected` `Readonly` **productTypeService\_**: [`ProductTypeService`](ProductTypeService.md)
`Protected` `Readonly` **productTypeService\_**: [`ProductTypeService`](ProductTypeService.md)
#### Defined in
[medusa/src/services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L25)
[medusa/src/services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L25)
___
### shippingOptionService\_
• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
`Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md)
#### Defined in
[medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L26)
[medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L26)
___
### taxRateRepository\_
• `Protected` `Readonly` **taxRateRepository\_**: `Repository`<`TaxRate`\> & { `addToProduct`: (`id`: `string`, `productIds`: `string`[], `overrideExisting`: `boolean`) => `Promise`<`ProductTaxRate`[]\> ; `addToProductType`: (`id`: `string`, `productTypeIds`: `string`[], `overrideExisting`: `boolean`) => `Promise`<`ProductTypeTaxRate`[]\> ; `addToShippingOption`: (`id`: `string`, `optionIds`: `string`[], `overrideExisting`: `boolean`) => `Promise`<`ShippingTaxRate`[]\> ; `applyResolutionsToQueryBuilder`: (`qb`: `SelectQueryBuilder`<`TaxRate`\>, `resolverFields`: `string`[]) => `SelectQueryBuilder`<`TaxRate`\> ; `findAndCountWithResolution`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `Promise`<[`TaxRate`[], `number`]\> ; `findOneWithResolution`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `Promise`<``null`` \| `TaxRate`\> ; `findWithResolution`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `Promise`<`TaxRate`[]\> ; `getFindQueryBuilder`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `SelectQueryBuilder`<`TaxRate`\> ; `listByProduct`: (`productId`: `string`, `config`: `TaxRateListByConfig`) => `Promise`<`TaxRate`[]\> ; `listByShippingOption`: (`optionId`: `string`) => `Promise`<`TaxRate`[]\> ; `removeFromProduct`: (`id`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> ; `removeFromProductType`: (`id`: `string`, `productTypeIds`: `string`[]) => `Promise`<`DeleteResult`\> ; `removeFromShippingOption`: (`id`: `string`, `optionIds`: `string`[]) => `Promise`<`DeleteResult`\> }
`Protected` `Readonly` **taxRateRepository\_**: `Repository`<`TaxRate`\> & { `addToProduct`: Method addToProduct ; `addToProductType`: Method addToProductType ; `addToShippingOption`: Method addToShippingOption ; `applyResolutionsToQueryBuilder`: Method applyResolutionsToQueryBuilder ; `findAndCountWithResolution`: Method findAndCountWithResolution ; `findOneWithResolution`: Method findOneWithResolution ; `findWithResolution`: Method findWithResolution ; `getFindQueryBuilder`: Method getFindQueryBuilder ; `listByProduct`: Method listByProduct ; `listByShippingOption`: Method listByShippingOption ; `removeFromProduct`: Method removeFromProduct ; `removeFromProductType`: Method removeFromProductType ; `removeFromShippingOption`: Method removeFromShippingOption }
#### Defined in
[medusa/src/services/tax-rate.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L27)
[medusa/src/services/tax-rate.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L27)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -134,113 +134,124 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### addToProduct
▸ **addToProduct**(`id`, `productIds`, `replace?`): `Promise`<`ProductTaxRate` \| `ProductTaxRate`[]\>
**addToProduct**(`id`, `productIds`, `replace?`): `Promise`<`ProductTaxRate` \| `ProductTaxRate`[]\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `id` | `string` | `undefined` |
| `productIds` | `string` \| `string`[] | `undefined` |
| Name | Default value |
| :------ | :------ |
| `id` | `string` |
| `productIds` | `string` \| `string`[] |
| `replace` | `boolean` | `false` |
#### Returns
`Promise`<`ProductTaxRate` \| `ProductTaxRate`[]\>
-`Promise`:
-`ProductTaxRate \| ProductTaxRate[]`: (optional)
#### Defined in
[medusa/src/services/tax-rate.ts:190](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L190)
[medusa/src/services/tax-rate.ts:190](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L190)
___
### addToProductType
▸ **addToProductType**(`id`, `productTypeIds`, `replace?`): `Promise`<`ProductTypeTaxRate`[]\>
**addToProductType**(`id`, `productTypeIds`, `replace?`): `Promise`<`ProductTypeTaxRate`[]\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `id` | `string` | `undefined` |
| `productTypeIds` | `string` \| `string`[] | `undefined` |
| Name | Default value |
| :------ | :------ |
| `id` | `string` |
| `productTypeIds` | `string` \| `string`[] |
| `replace` | `boolean` | `false` |
#### Returns
`Promise`<`ProductTypeTaxRate`[]\>
-`Promise`:
-`ProductTypeTaxRate[]`:
-`ProductTypeTaxRate`:
#### Defined in
[medusa/src/services/tax-rate.ts:226](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L226)
[medusa/src/services/tax-rate.ts:226](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L226)
___
### addToShippingOption
▸ **addToShippingOption**(`id`, `optionIds`, `replace?`): `Promise`<`ShippingTaxRate`[]\>
**addToShippingOption**(`id`, `optionIds`, `replace?`): `Promise`<`ShippingTaxRate`[]\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
| `id` | `string` | `undefined` |
| `optionIds` | `string` \| `string`[] | `undefined` |
| Name | Default value |
| :------ | :------ |
| `id` | `string` |
| `optionIds` | `string` \| `string`[] |
| `replace` | `boolean` | `false` |
#### Returns
`Promise`<`ShippingTaxRate`[]\>
-`Promise`:
-`ShippingTaxRate[]`:
-`ShippingTaxRate`:
#### Defined in
[medusa/src/services/tax-rate.ts:266](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L266)
[medusa/src/services/tax-rate.ts:266](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L266)
___
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -249,7 +260,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -257,58 +268,63 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`data`): `Promise`<`TaxRate`\>
**create**(`data`): `Promise`<`TaxRate`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `CreateTaxRateInput` |
#### Returns
`Promise`<`TaxRate`\>
-`Promise`:
-`TaxRate`:
#### Defined in
[medusa/src/services/tax-rate.ts:93](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L93)
[medusa/src/services/tax-rate.ts:93](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L93)
___
### delete
▸ **delete**(`id`): `Promise`<`void`\>
**delete**(`id`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` \| `string`[] |
#### Returns
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/tax-rate.ts:124](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L124)
[medusa/src/services/tax-rate.ts:124](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L124)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`TaxRate`[]\>
**list**(`selector`, `config?`): `Promise`<`TaxRate`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `FilterableTaxRateProps` |
| `config` | `FindConfig`<`TaxRate`\> |
@@ -316,20 +332,24 @@ ___
`Promise`<`TaxRate`[]\>
-`Promise`:
-`TaxRate[]`:
-`TaxRate`:
#### Defined in
[medusa/src/services/tax-rate.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L44)
[medusa/src/services/tax-rate.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L44)
___
### listAndCount
▸ **listAndCount**(`selector`, `config?`): `Promise`<[`TaxRate`[], `number`]\>
**listAndCount**(`selector`, `config?`): `Promise`<[`TaxRate`[], `number`]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `selector` | `FilterableTaxRateProps` |
| `config` | `FindConfig`<`TaxRate`\> |
@@ -337,20 +357,24 @@ ___
`Promise`<[`TaxRate`[], `number`]\>
-`Promise`:
-`TaxRate[]`:
-`number`: (optional)
#### Defined in
[medusa/src/services/tax-rate.ts:55](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L55)
[medusa/src/services/tax-rate.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L55)
___
### listByProduct
▸ **listByProduct**(`productId`, `config`): `Promise`<`TaxRate`[]\>
**listByProduct**(`productId`, `config`): `Promise`<`TaxRate`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `productId` | `string` |
| `config` | `TaxRateListByConfig` |
@@ -358,40 +382,48 @@ ___
`Promise`<`TaxRate`[]\>
-`Promise`:
-`TaxRate[]`:
-`TaxRate`:
#### Defined in
[medusa/src/services/tax-rate.ts:314](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L314)
[medusa/src/services/tax-rate.ts:314](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L314)
___
### listByShippingOption
▸ **listByShippingOption**(`shippingOptionId`): `Promise`<`TaxRate`[]\>
**listByShippingOption**(`shippingOptionId`): `Promise`<`TaxRate`[]\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `shippingOptionId` | `string` |
#### Returns
`Promise`<`TaxRate`[]\>
-`Promise`:
-`TaxRate[]`:
-`TaxRate`:
#### Defined in
[medusa/src/services/tax-rate.ts:325](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L325)
[medusa/src/services/tax-rate.ts:325](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L325)
___
### removeFromProduct
▸ **removeFromProduct**(`id`, `productIds`): `Promise`<`void`\>
**removeFromProduct**(`id`, `productIds`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
| `productIds` | `string` \| `string`[] |
@@ -399,20 +431,22 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/tax-rate.ts:136](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L136)
[medusa/src/services/tax-rate.ts:136](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L136)
___
### removeFromProductType
▸ **removeFromProductType**(`id`, `typeIds`): `Promise`<`void`\>
**removeFromProductType**(`id`, `typeIds`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
| `typeIds` | `string` \| `string`[] |
@@ -420,20 +454,22 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/tax-rate.ts:154](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L154)
[medusa/src/services/tax-rate.ts:154](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L154)
___
### removeFromShippingOption
▸ **removeFromShippingOption**(`id`, `optionIds`): `Promise`<`void`\>
**removeFromShippingOption**(`id`, `optionIds`): `Promise`<`void`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
| `optionIds` | `string` \| `string`[] |
@@ -441,20 +477,22 @@ ___
`Promise`<`void`\>
-`Promise`:
#### Defined in
[medusa/src/services/tax-rate.ts:172](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L172)
[medusa/src/services/tax-rate.ts:172](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L172)
___
### retrieve
▸ **retrieve**(`taxRateId`, `config?`): `Promise`<`TaxRate`\>
**retrieve**(`taxRateId`, `config?`): `Promise`<`TaxRate`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `taxRateId` | `string` |
| `config` | `FindConfig`<`TaxRate`\> |
@@ -462,44 +500,49 @@ ___
`Promise`<`TaxRate`\>
-`Promise`:
-`TaxRate`:
#### Defined in
[medusa/src/services/tax-rate.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L66)
[medusa/src/services/tax-rate.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L66)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`id`, `data`): `Promise`<`TaxRate`\>
**update**(`id`, `data`): `Promise`<`TaxRate`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `id` | `string` |
| `data` | `UpdateTaxRateInput` |
@@ -507,30 +550,35 @@ ___
`Promise`<`TaxRate`\>
-`Promise`:
-`TaxRate`:
#### Defined in
[medusa/src/services/tax-rate.ts:109](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L109)
[medusa/src/services/tax-rate.ts:109](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L109)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`TaxRateService`](TaxRateService.md)
**withTransaction**(`transactionManager?`): [`TaxRateService`](TaxRateService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`TaxRateService`](TaxRateService.md)
-`TaxRateService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,51 +1,51 @@
# Class: TokenService
# TokenService
## Constructors
### constructor
• **new TokenService**(`«destructured»`)
**new TokenService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `InjectedDependencies` |
#### Defined in
[medusa/src/services/token.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L16)
[medusa/src/services/token.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L16)
## Properties
### configModule\_
• `Protected` `Readonly` **configModule\_**: `ConfigModule`
`Protected` `Readonly` **configModule\_**: `ConfigModule`
#### Defined in
[medusa/src/services/token.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L14)
[medusa/src/services/token.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L14)
___
### RESOLUTION\_KEY
▪ `Static` **RESOLUTION\_KEY**: `string`
`Static` **RESOLUTION\_KEY**: `string`
#### Defined in
[medusa/src/services/token.ts:12](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L12)
[medusa/src/services/token.ts:12](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L12)
## Methods
### signToken
▸ **signToken**(`data`, `options?`): `string`
**signToken**(`data`, `options?`): `string`
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `data` | `string` \| `object` \| `Buffer` |
| `options?` | `SignOptions` |
@@ -53,20 +53,22 @@ ___
`string`
-`string`: (optional)
#### Defined in
[medusa/src/services/token.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L34)
[medusa/src/services/token.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L34)
___
### verifyToken
▸ **verifyToken**(`token`, `options?`): `string` \| `Jwt` \| `JwtPayload`
**verifyToken**(`token`, `options?`): `string` \| `Jwt` \| `JwtPayload`
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `token` | `string` |
| `options?` | `VerifyOptions` |
@@ -74,6 +76,8 @@ ___
`string` \| `Jwt` \| `JwtPayload`
-`string \| Jwt \| JwtPayload`: (optional)
#### Defined in
[medusa/src/services/token.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L20)
[medusa/src/services/token.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L20)
@@ -1,8 +1,8 @@
# Class: TotalsService
# TotalsService
A service that calculates total and subtotals for orders, carts etc..
**`Implements`**
**Implements**
## Hierarchy
@@ -14,12 +14,12 @@ A service that calculates total and subtotals for orders, carts etc..
### constructor
• **new TotalsService**(`«destructured»`)
**new TotalsService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `TotalsServiceProps` |
#### Overrides
@@ -28,13 +28,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/totals.ts:112](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L112)
[medusa/src/services/totals.ts:112](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L112)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -42,13 +42,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -56,13 +56,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -70,23 +70,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### featureFlagRouter\_
• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/totals.ts:110](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L110)
[medusa/src/services/totals.ts:110](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L110)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -94,43 +94,43 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### newTotalsService\_
• `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md)
`Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md)
#### Defined in
[medusa/src/services/totals.ts:108](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L108)
[medusa/src/services/totals.ts:108](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L108)
___
### taxCalculationStrategy\_
• `Protected` `Readonly` **taxCalculationStrategy\_**: `ITaxCalculationStrategy`
`Protected` `Readonly` **taxCalculationStrategy\_**: `ITaxCalculationStrategy`
#### Defined in
[medusa/src/services/totals.ts:109](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L109)
[medusa/src/services/totals.ts:109](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L109)
___
### taxProviderService\_
• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
`Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md)
#### Defined in
[medusa/src/services/totals.ts:107](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L107)
[medusa/src/services/totals.ts:107](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L107)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -138,47 +138,47 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -187,7 +187,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -195,20 +195,20 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### calculateDiscount\_
▸ **calculateDiscount_**(`lineItem`, `variant`, `variantPrice`, `value`, `discountType`): `LineDiscount`
**calculateDiscount_**(`lineItem`, `variant`, `variantPrice`, `value`, `discountType`): `LineDiscount`
Calculates either fixed or percentage discount of a variant
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `lineItem` | `LineItem` | id of line item |
| `variant` | `string` | id of variant in line item |
| `variantPrice` | `number` | price of the variant based on region |
@@ -219,21 +219,19 @@ Calculates either fixed or percentage discount of a variant
`LineDiscount`
triples of lineitem, variant and applied discount
**`Deprecated`**
**Deprecated**
- in favour of DiscountService.calculateDiscountForLineItem
#### Defined in
[medusa/src/services/totals.ts:627](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L627)
[medusa/src/services/totals.ts:627](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L627)
___
### getAllocationItemDiscounts
▸ **getAllocationItemDiscounts**(`discount`, `cart`): `LineDiscount`[]
**getAllocationItemDiscounts**(`discount`, `cart`): `LineDiscount`[]
If the rule of a discount has allocation="item", then we need
to calculate discount on each item in the cart. Furthermore, we need to
@@ -243,8 +241,8 @@ alongside the variant on which the discount was applied.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `discount` | `Discount` | the discount to which we do the calculation |
| `cart` | `Order` \| `Cart` | the cart to calculate discounts for |
@@ -252,17 +250,17 @@ alongside the variant on which the discount was applied.
`LineDiscount`[]
array of triples of lineitem, variant and applied discount
-`LineDiscount[]`: array of triples of lineitem, variant and applied discount
#### Defined in
[medusa/src/services/totals.ts:669](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L669)
[medusa/src/services/totals.ts:669](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L669)
___
### getAllocationMap
▸ **getAllocationMap**(`orderOrCart`, `options?`): `Promise`<`LineAllocationsMap`\>
**getAllocationMap**(`orderOrCart`, `options?`): `Promise`<`LineAllocationsMap`\>
Gets a map of discounts and gift cards that apply to line items in an
order. The function calculates the amount of a discount or gift card that
@@ -270,37 +268,37 @@ applies to a specific line item.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `orderOrCart` | `Object` | the order or cart to get an allocation map for |
| `orderOrCart.claims?` | `ClaimOrder`[] | - |
| `orderOrCart.discounts?` | `Discount`[] | - |
| `orderOrCart.items` | `LineItem`[] | - |
| `orderOrCart.swaps?` | `Swap`[] | - |
| Name | Description |
| :------ | :------ |
| `orderOrCart` | `object` | the order or cart to get an allocation map for |
| `orderOrCart.claims?` | `ClaimOrder`[] |
| `orderOrCart.discounts?` | `Discount`[] |
| `orderOrCart.items` | `LineItem`[] |
| `orderOrCart.swaps?` | `Swap`[] |
| `options` | `AllocationMapOptions` | controls what should be included in allocation map |
#### Returns
`Promise`<`LineAllocationsMap`\>
the allocation map for the line items in the cart or order.
-`Promise`: the allocation map for the line items in the cart or order.
#### Defined in
[medusa/src/services/totals.ts:435](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L435)
[medusa/src/services/totals.ts:435](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L435)
___
### getCalculationContext
▸ **getCalculationContext**(`calculationContextData`, `options?`): `Promise`<`TaxCalculationContext`\>
**getCalculationContext**(`calculationContextData`, `options?`): `Promise`<`TaxCalculationContext`\>
Prepares the calculation context for a tax total calculation.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `calculationContextData` | `CalculationContextData` | the calculationContextData to get the calculation context for |
| `options` | `CalculationContextOptions` | options to gather context by |
@@ -308,147 +306,152 @@ Prepares the calculation context for a tax total calculation.
`Promise`<`TaxCalculationContext`\>
the tax calculation context
-`Promise`: the tax calculation context
#### Defined in
[medusa/src/services/totals.ts:1028](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L1028)
[medusa/src/services/totals.ts:1028](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L1028)
___
### getDiscountTotal
▸ **getDiscountTotal**(`cartOrOrder`): `Promise`<`number`\>
**getDiscountTotal**(`cartOrOrder`): `Promise`<`number`\>
Calculates the total discount amount for each of the different supported
discount types. If discounts aren't present or invalid returns 0.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cartOrOrder` | `Order` \| `Cart` | the cart or order to calculate discounts for |
#### Returns
`Promise`<`number`\>
the total discounts amount
-`Promise`: the total discounts amount
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:1006](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L1006)
[medusa/src/services/totals.ts:1006](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L1006)
___
### getGiftCardTotal
▸ **getGiftCardTotal**(`cartOrOrder`, `opts?`): `Promise`<{ `tax_total`: `number` ; `total`: `number` }\>
**getGiftCardTotal**(`cartOrOrder`, `opts?`): `Promise`<{ `tax_total`: `number` ; `total`: `number` }\>
Gets the gift card amount on a cart or order.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cartOrOrder` | `Order` \| `Cart` | the cart or order to get gift card amount for |
| `opts` | `Object` | - |
| `opts.gift_cardable?` | `number` | - |
| `opts` | `object` |
| `opts.gift_cardable?` | `number` |
#### Returns
`Promise`<{ `tax_total`: `number` ; `total`: `number` }\>
the gift card amount applied to the cart or order
-`Promise`: the gift card amount applied to the cart or order
-``object``: (optional)
#### Defined in
[medusa/src/services/totals.ts:975](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L975)
[medusa/src/services/totals.ts:975](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L975)
___
### getGiftCardableAmount
▸ **getGiftCardableAmount**(`cartOrOrder`): `Promise`<`number`\>
**getGiftCardableAmount**(`cartOrOrder`): `Promise`<`number`\>
Gets the amount that can be gift carded on a cart. In regions where gift
cards are taxable this amount should exclude taxes.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cartOrOrder` | `Order` \| `Cart` | the cart or order to get gift card amount for |
#### Returns
`Promise`<`number`\>
the gift card amount applied to the cart or order
-`Promise`: the gift card amount applied to the cart or order
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:958](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L958)
[medusa/src/services/totals.ts:958](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L958)
___
### getLineDiscounts
▸ **getLineDiscounts**(`cartOrOrder`, `discount?`): `LineDiscountAmount`[]
**getLineDiscounts**(`cartOrOrder`, `discount?`): `LineDiscountAmount`[]
Returns the discount amount allocated to the line items of an order.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cartOrOrder` | `Object` | the cart or order to get line discount allocations for |
| `cartOrOrder.claims?` | `ClaimOrder`[] | - |
| `cartOrOrder.items` | `LineItem`[] | - |
| `cartOrOrder.swaps?` | `Swap`[] | - |
| Name | Description |
| :------ | :------ |
| `cartOrOrder` | `object` | the cart or order to get line discount allocations for |
| `cartOrOrder.claims?` | `ClaimOrder`[] |
| `cartOrOrder.items` | `LineItem`[] |
| `cartOrOrder.swaps?` | `Swap`[] |
| `discount?` | `Discount` | the discount to use as context for the calculation |
#### Returns
`LineDiscountAmount`[]
the allocations that the discount has on the items in the cart or
-`LineDiscountAmount[]`: the allocations that the discount has on the items in the cart or
order
#### Defined in
[medusa/src/services/totals.ts:720](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L720)
[medusa/src/services/totals.ts:720](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L720)
___
### getLineItemAdjustmentsTotal
▸ **getLineItemAdjustmentsTotal**(`cartOrOrder`): `number`
**getLineItemAdjustmentsTotal**(`cartOrOrder`): `number`
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `cartOrOrder` | `Order` \| `Cart` |
#### Returns
`number`
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:697](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L697)
[medusa/src/services/totals.ts:697](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L697)
___
### getLineItemDiscountAdjustment
▸ **getLineItemDiscountAdjustment**(`lineItem`, `discount`): `number`
**getLineItemDiscountAdjustment**(`lineItem`, `discount`): `number`
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `lineItem` | `LineItem` |
| `discount` | `Discount` |
@@ -456,22 +459,24 @@ ___
`number`
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:682](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L682)
[medusa/src/services/totals.ts:682](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L682)
___
### getLineItemRefund
▸ **getLineItemRefund**(`order`, `lineItem`): `Promise`<`number`\>
**getLineItemRefund**(`order`, `lineItem`): `Promise`<`number`\>
The amount that can be refunded for a given line item.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `Order` | order to use as context for the calculation |
| `lineItem` | `LineItem` | the line item to calculate the refund amount for. |
@@ -479,25 +484,26 @@ The amount that can be refunded for a given line item.
`Promise`<`number`\>
the line item refund amount.
-`Promise`: the line item refund amount.
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:504](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L504)
[medusa/src/services/totals.ts:504](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L504)
___
### getLineItemTotal
▸ **getLineItemTotal**(`lineItem`, `cartOrOrder`, `options?`): `Promise`<`number`\>
**getLineItemTotal**(`lineItem`, `cartOrOrder`, `options?`): `Promise`<`number`\>
Gets a total for a line item. The total can take gift cards, discounts and
taxes into account. This can be controlled through the options.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `lineItem` | `LineItem` | the line item to calculate a total for |
| `cartOrOrder` | `Order` \| `Cart` | the cart or order to use as context for the calculation |
| `options` | `GetLineItemTotalOptions` | the options to use for the calculation |
@@ -506,17 +512,18 @@ taxes into account. This can be controlled through the options.
`Promise`<`number`\>
the line item total
-`Promise`: the line item total
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:931](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L931)
[medusa/src/services/totals.ts:931](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L931)
___
### getLineItemTotals
▸ **getLineItemTotals**(`lineItem`, `cartOrOrder`, `options?`): `Promise`<`LineItemTotals`\>
**getLineItemTotals**(`lineItem`, `cartOrOrder`, `options?`): `Promise`<`LineItemTotals`\>
Breaks down the totals related to a line item; these are the subtotal, the
amount of discount applied to the line item, the amount of a gift card
@@ -524,8 +531,8 @@ applied to a line item and the amount of tax applied to a line item.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `lineItem` | `LineItem` | the line item to calculate totals for |
| `cartOrOrder` | `Order` \| `Cart` | the cart or order to use as context for the calculation |
| `options` | `LineItemTotalsOptions` | the options to evaluate the line item totals for |
@@ -534,41 +541,41 @@ applied to a line item and the amount of tax applied to a line item.
`Promise`<`LineItemTotals`\>
the breakdown of the line item totals
-`Promise`: the breakdown of the line item totals
#### Defined in
[medusa/src/services/totals.ts:776](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L776)
[medusa/src/services/totals.ts:776](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L776)
___
### getPaidTotal
▸ **getPaidTotal**(`order`): `number`
**getPaidTotal**(`order`): `number`
Gets the total payments made on an order
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `Order` | the order to calculate paid amount for |
#### Returns
`number`
the total paid amount
-`number`: (optional) the total paid amount
#### Defined in
[medusa/src/services/totals.ts:157](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L157)
[medusa/src/services/totals.ts:157](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L157)
___
### getRefundTotal
▸ **getRefundTotal**(`order`, `lineItems`): `Promise`<`number`\>
**getRefundTotal**(`order`, `lineItems`): `Promise`<`number`\>
Calculates refund total of line items.
If any of the items to return have been discounted, we need to
@@ -576,8 +583,8 @@ apply the discount again before refunding them.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `Order` | cart or order to calculate subtotal for |
| `lineItems` | `LineItem`[] | the line items to calculate refund total for |
@@ -585,49 +592,50 @@ apply the discount again before refunding them.
`Promise`<`number`\>
the calculated subtotal
-`Promise`: the calculated subtotal
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:583](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L583)
[medusa/src/services/totals.ts:583](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L583)
___
### getRefundedTotal
▸ **getRefundedTotal**(`order`): `number`
**getRefundedTotal**(`order`): `number`
Gets the total refund amount for an order.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `Order` | the order to get total refund amount for. |
#### Returns
`number`
the total refunded amount for an order.
-`number`: (optional) the total refunded amount for an order.
#### Defined in
[medusa/src/services/totals.ts:489](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L489)
[medusa/src/services/totals.ts:489](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L489)
___
### getShippingMethodTotals
▸ **getShippingMethodTotals**(`shippingMethod`, `cartOrOrder`, `opts?`): `Promise`<`ShippingMethodTotals`\>
**getShippingMethodTotals**(`shippingMethod`, `cartOrOrder`, `opts?`): `Promise`<`ShippingMethodTotals`\>
Gets the totals breakdown for a shipping method. Fetches tax lines if not
already provided.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `shippingMethod` | `ShippingMethod` | the shipping method to get totals breakdown for. |
| `cartOrOrder` | `Order` \| `Cart` | the cart or order to use as context for the breakdown |
| `opts` | `GetShippingMethodTotalsOptions` | options for what should be included |
@@ -636,48 +644,49 @@ already provided.
`Promise`<`ShippingMethodTotals`\>
An object that breaks down the totals for the shipping method
-`Promise`: An object that breaks down the totals for the shipping method
#### Defined in
[medusa/src/services/totals.ts:191](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L191)
[medusa/src/services/totals.ts:191](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L191)
___
### getShippingTotal
▸ **getShippingTotal**(`cartOrOrder`): `Promise`<`number`\>
**getShippingTotal**(`cartOrOrder`): `Promise`<`number`\>
Calculates shipping total
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cartOrOrder` | `Order` \| `Cart` | cart or order to calculate subtotal for |
#### Returns
`Promise`<`number`\>
shipping total
-`Promise`: shipping total
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:319](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L319)
[medusa/src/services/totals.ts:319](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L319)
___
### getSubtotal
▸ **getSubtotal**(`cartOrOrder`, `opts?`): `Promise`<`number`\>
**getSubtotal**(`cartOrOrder`, `opts?`): `Promise`<`number`\>
Calculates subtotal of a given cart or order.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cartOrOrder` | `Order` \| `Cart` | cart or order to calculate subtotal for |
| `opts` | `SubtotalOptions` | options |
@@ -685,75 +694,77 @@ Calculates subtotal of a given cart or order.
`Promise`<`number`\>
the calculated subtotal
-`Promise`: the calculated subtotal
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:283](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L283)
[medusa/src/services/totals.ts:283](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L283)
___
### getSwapTotal
▸ **getSwapTotal**(`order`): `number`
**getSwapTotal**(`order`): `number`
The total paid for swaps. May be negative in case of negative swap
difference.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `order` | `Order` | the order to calculate swap total for |
#### Returns
`number`
the swap total
-`number`: (optional) the swap total
#### Defined in
[medusa/src/services/totals.ts:172](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L172)
[medusa/src/services/totals.ts:172](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L172)
___
### getTaxTotal
▸ **getTaxTotal**(`cartOrOrder`, `forceTaxes?`): `Promise`<``null`` \| `number`\>
**getTaxTotal**(`cartOrOrder`, `forceTaxes?`): `Promise`<``null`` \| `number`\>
Calculates tax total
Currently based on the Danish tax system
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `cartOrOrder` | `Order` \| `Cart` | `undefined` | cart or order to calculate tax total for |
| Name | Default value | Description |
| :------ | :------ | :------ |
| `cartOrOrder` | `Order` \| `Cart` | cart or order to calculate tax total for |
| `forceTaxes` | `boolean` | `false` | whether taxes should be calculated regardless of region settings |
#### Returns
`Promise`<``null`` \| `number`\>
tax total
-`Promise`: tax total
-```null`` \| number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:346](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L346)
[medusa/src/services/totals.ts:346](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L346)
___
### getTotal
▸ **getTotal**(`cartOrOrder`, `options?`): `Promise`<`number`\>
**getTotal**(`cartOrOrder`, `options?`): `Promise`<`number`\>
Calculates total of a given cart or order.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `cartOrOrder` | `Order` \| `Cart` | object to calculate total for |
| `options` | `GetTotalsOptions` | options to calculate by |
@@ -761,80 +772,85 @@ Calculates total of a given cart or order.
`Promise`<`number`\>
the calculated subtotal
-`Promise`: the calculated subtotal
-`number`: (optional)
#### Defined in
[medusa/src/services/totals.ts:134](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L134)
[medusa/src/services/totals.ts:134](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L134)
___
### rounded
▸ **rounded**(`value`): `number`
**rounded**(`value`): `number`
Rounds a number using Math.round.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `value` | `number` | the value to round |
#### Returns
`number`
the rounded value
-`number`: (optional) the rounded value
#### Defined in
[medusa/src/services/totals.ts:1058](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L1058)
[medusa/src/services/totals.ts:1058](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L1058)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`TotalsService`](TotalsService.md)
**withTransaction**(`transactionManager?`): [`TotalsService`](TotalsService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`TotalsService`](TotalsService.md)
-`TotalsService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
@@ -1,4 +1,4 @@
# Class: UserService
# UserService
Provides layer to manipulate users.
@@ -12,12 +12,12 @@ Provides layer to manipulate users.
### constructor
• **new UserService**(`«destructured»`)
**new UserService**(`«destructured»`)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `«destructured»` | `UserServiceProps` |
#### Overrides
@@ -26,13 +26,13 @@ TransactionBaseService.constructor
#### Defined in
[medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L45)
[medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L45)
## Properties
### \_\_configModule\_\_
• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14)
___
### \_\_container\_\_
• `Protected` `Readonly` **\_\_container\_\_**: `any`
`Protected` `Readonly` **\_\_container\_\_**: `any`
#### Inherited from
@@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13)
___
### \_\_moduleDeclaration\_\_
• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\>
`Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\>
#### Inherited from
@@ -68,43 +68,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15)
___
### analyticsConfigService\_
• `Protected` `Readonly` **analyticsConfigService\_**: [`AnalyticsConfigService`](AnalyticsConfigService.md)
`Protected` `Readonly` **analyticsConfigService\_**: [`AnalyticsConfigService`](AnalyticsConfigService.md)
#### Defined in
[medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L40)
[medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L40)
___
### eventBus\_
• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
`Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md)
#### Defined in
[medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L42)
[medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L42)
___
### featureFlagRouter\_
• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
`Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter`
#### Defined in
[medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L43)
[medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L43)
___
### manager\_
• `Protected` **manager\_**: `EntityManager`
`Protected` **manager\_**: `EntityManager`
#### Inherited from
@@ -112,13 +112,13 @@ TransactionBaseService.manager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5)
___
### transactionManager\_
• `Protected` **transactionManager\_**: `undefined` \| `EntityManager`
`Protected` **transactionManager\_**: `undefined` \| `EntityManager`
#### Inherited from
@@ -126,23 +126,23 @@ TransactionBaseService.transactionManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6)
___
### userRepository\_
• `Protected` `Readonly` **userRepository\_**: `Repository`<`User`\>
`Protected` `Readonly` **userRepository\_**: `Repository`<`User`\>
#### Defined in
[medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L41)
[medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L41)
___
### Events
▪ `Static` **Events**: `Object`
`Static` **Events**: `Object`
#### Type declaration
@@ -155,47 +155,47 @@ ___
#### Defined in
[medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L33)
[medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L33)
## Accessors
### activeManager\_
• `Protected` `get` **activeManager_**(): `EntityManager`
`Protected` `get` **activeManager_**(): `EntityManager`
#### Returns
`EntityManager`
-`EntityManager`:
#### Inherited from
TransactionBaseService.activeManager\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8)
## Methods
### atomicPhase\_
▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\>
Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.
#### Type parameters
| Name |
| :------ |
| `TResult` |
| `TError` |
| `TResult` | `object` |
| `TError` | `object` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done |
| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. |
| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler |
@@ -204,7 +204,7 @@ transaction manager is created.
`Promise`<`TResult`\>
the result of the transactional work
-`Promise`: the result of the transactional work
#### Inherited from
@@ -212,21 +212,21 @@ TransactionBaseService.atomicPhase\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56)
___
### create
▸ **create**(`user`, `password`): `Promise`<`User`\>
**create**(`user`, `password`): `Promise`<`User`\>
Creates a user with username being validated.
Fails if email is not a valid format.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `user` | `CreateUserInput` | the user to create |
| `password` | `string` | user's password to hash |
@@ -234,41 +234,42 @@ Fails if email is not a valid format.
`Promise`<`User`\>
the result of create
-`Promise`: the result of create
-`User`:
#### Defined in
[medusa/src/services/user.ts:171](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L171)
[medusa/src/services/user.ts:171](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L171)
___
### delete
▸ **delete**(`userId`): `Promise`<`void`\>
**delete**(`userId`): `Promise`<`void`\>
Deletes a user from a given user id.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `userId` | `string` | the id of the user to delete. Must be castable as an ObjectId |
#### Returns
`Promise`<`void`\>
the result of the delete operation.
-`Promise`: the result of the delete operation.
#### Defined in
[medusa/src/services/user.ts:263](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L263)
[medusa/src/services/user.ts:263](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L263)
___
### generateResetPasswordToken
▸ **generateResetPasswordToken**(`userId`): `Promise`<`string`\>
**generateResetPasswordToken**(`userId`): `Promise`<`string`\>
Generate a JSON Web token, that will be sent to a user, that wishes to
reset password.
@@ -278,80 +279,84 @@ is always 15 minutes.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `userId` | `string` | the id of the user to reset password for |
#### Returns
`Promise`<`string`\>
the generated JSON web token
-`Promise`: the generated JSON web token
-`string`: (optional)
#### Defined in
[medusa/src/services/user.ts:327](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L327)
[medusa/src/services/user.ts:327](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L327)
___
### hashPassword\_
▸ **hashPassword_**(`password`): `Promise`<`string`\>
**hashPassword_**(`password`): `Promise`<`string`\>
Hashes a password
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `password` | `string` | the value to hash |
#### Returns
`Promise`<`string`\>
hashed password
-`Promise`: hashed password
-`string`: (optional)
#### Defined in
[medusa/src/services/user.ts:159](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L159)
[medusa/src/services/user.ts:159](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L159)
___
### list
▸ **list**(`selector`, `config?`): `Promise`<`User`[]\>
**list**(`selector`, `config?`): `Promise`<`User`[]\>
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `selector` | `FilterableUserProps` | the query object for find |
| `config` | `Object` | the configuration object for the query |
| `config` | `object` | the configuration object for the query |
#### Returns
`Promise`<`User`[]\>
the result of the find operation
-`Promise`: the result of the find operation
-`User[]`:
-`User`:
#### Defined in
[medusa/src/services/user.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L65)
[medusa/src/services/user.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L65)
___
### retrieve
▸ **retrieve**(`userId`, `config?`): `Promise`<`User`\>
**retrieve**(`userId`, `config?`): `Promise`<`User`\>
Gets a user by id.
Throws in case of DB Error and if user was not found.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `userId` | `string` | the id of the user to get. |
| `config` | `FindConfig`<`User`\> | query configs |
@@ -359,51 +364,53 @@ Throws in case of DB Error and if user was not found.
`Promise`<`User`\>
the user document.
-`Promise`: the user document.
-`User`:
#### Defined in
[medusa/src/services/user.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L77)
[medusa/src/services/user.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L77)
___
### retrieveByApiToken
▸ **retrieveByApiToken**(`apiToken`, `relations?`): `Promise`<`User`\>
**retrieveByApiToken**(`apiToken`, `relations?`): `Promise`<`User`\>
Gets a user by api token.
Throws in case of DB Error and if user was not found.
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `apiToken` | `string` | `undefined` | the token of the user to get. |
| Name | Default value | Description |
| :------ | :------ | :------ |
| `apiToken` | `string` | the token of the user to get. |
| `relations` | `string`[] | `[]` | relations to include with the user. |
#### Returns
`Promise`<`User`\>
the user document.
-`Promise`: the user document.
-`User`:
#### Defined in
[medusa/src/services/user.ts:107](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L107)
[medusa/src/services/user.ts:107](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L107)
___
### retrieveByEmail
▸ **retrieveByEmail**(`email`, `config?`): `Promise`<`User`\>
**retrieveByEmail**(`email`, `config?`): `Promise`<`User`\>
Gets a user by email.
Throws in case of DB Error and if user was not found.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `email` | `string` | the email of the user to get. |
| `config` | `FindConfig`<`User`\> | query config |
@@ -411,17 +418,18 @@ Throws in case of DB Error and if user was not found.
`Promise`<`User`\>
the user document.
-`Promise`: the user document.
-`User`:
#### Defined in
[medusa/src/services/user.ts:135](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L135)
[medusa/src/services/user.ts:135](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L135)
___
### setPassword\_
▸ **setPassword_**(`userId`, `password`): `Promise`<`User`\>
**setPassword_**(`userId`, `password`): `Promise`<`User`\>
Sets a password for a user
Fails if no user exists with userId and if the hashing of the new
@@ -429,8 +437,8 @@ password does not work.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `userId` | `string` | the userId to set password for |
| `password` | `string` | the old password to set |
@@ -438,48 +446,51 @@ password does not work.
`Promise`<`User`\>
the result of the update operation
-`Promise`: the result of the update operation
-`User`:
#### Defined in
[medusa/src/services/user.ts:298](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L298)
[medusa/src/services/user.ts:298](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L298)
___
### shouldRetryTransaction\_
▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean`
`Protected` **shouldRetryTransaction_**(`err`): `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } |
| Name |
| :------ |
| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } |
#### Returns
`boolean`
-`boolean`: (optional)
#### Inherited from
TransactionBaseService.shouldRetryTransaction\_
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37)
___
### update
▸ **update**(`userId`, `update`): `Promise`<`User`\>
**update**(`userId`, `update`): `Promise`<`User`\>
Updates a user.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| Name | Description |
| :------ | :------ |
| `userId` | `string` | id of the user to update |
| `update` | `UpdateUserInput` | the values to be updated on the user |
@@ -487,32 +498,35 @@ Updates a user.
`Promise`<`User`\>
the result of create
-`Promise`: the result of create
-`User`:
#### Defined in
[medusa/src/services/user.ts:217](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L217)
[medusa/src/services/user.ts:217](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L217)
___
### withTransaction
▸ **withTransaction**(`transactionManager?`): [`UserService`](UserService.md)
**withTransaction**(`transactionManager?`): [`UserService`](UserService.md)
#### Parameters
| Name | Type |
| :------ | :------ |
| Name |
| :------ |
| `transactionManager?` | `EntityManager` |
#### Returns
[`UserService`](UserService.md)
-`UserService`:
#### Inherited from
TransactionBaseService.withTransaction
#### Defined in
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20)
[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)