docs: TSDoc + reference of fulfillment service (#5761)
This commit is contained in:
@@ -8,13 +8,11 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
Provides layer to manipulate profiles.
|
||||
|
||||
## Constructors
|
||||
|
||||
#### constructor
|
||||
## constructor
|
||||
|
||||
`**new ShippingOptionService**(«destructured»)`
|
||||
|
||||
##### Parameters
|
||||
### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -28,6 +26,8 @@ Provides layer to manipulate profiles.
|
||||
}
|
||||
]} />
|
||||
|
||||
___
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
@@ -132,22 +132,42 @@ Provides layer to manipulate profiles.
|
||||
}
|
||||
]} />
|
||||
|
||||
___
|
||||
|
||||
## Accessors
|
||||
|
||||
#### activeManager\_
|
||||
### activeManager\_
|
||||
|
||||
`Protected` **activeManager\_**: [object Object]
|
||||
`Protected get**activeManager_**(): EntityManager`
|
||||
|
||||
#### Returns
|
||||
|
||||
EntityManager
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EntityManager",
|
||||
"type": "EntityManager",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
___
|
||||
|
||||
## Methods
|
||||
|
||||
#### addRequirement
|
||||
### addRequirement
|
||||
|
||||
`**addRequirement**(optionId, requirement): Promise<[ShippingOption](ShippingOption.mdx)>`
|
||||
|
||||
Adds a requirement to a shipping option. Only 1 requirement of each type
|
||||
is allowed.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -170,7 +190,7 @@ is allowed.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
@@ -188,7 +208,7 @@ Promise<[ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### atomicPhase\_
|
||||
### atomicPhase\_
|
||||
|
||||
`Protected **atomicPhase_**<TypeParameter TResult, TypeParameter TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise<TResult>`
|
||||
|
||||
@@ -196,7 +216,7 @@ 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
|
||||
#### Type Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -219,7 +239,7 @@ transaction manager is created.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -251,7 +271,7 @@ transaction manager is created.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<TResult>
|
||||
|
||||
@@ -269,7 +289,7 @@ Promise<TResult>
|
||||
|
||||
___
|
||||
|
||||
#### create
|
||||
### create
|
||||
|
||||
`**create**(data): Promise<[ShippingOption](ShippingOption.mdx)>`
|
||||
|
||||
@@ -277,7 +297,7 @@ Creates a new shipping option. Used both for outbound and inbound shipping
|
||||
options. The difference is registered by the `is_return` field which
|
||||
defaults to false.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -291,7 +311,7 @@ defaults to false.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
@@ -309,13 +329,13 @@ Promise<[ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### createShippingMethod
|
||||
### createShippingMethod
|
||||
|
||||
`**createShippingMethod**(optionId, data, config): Promise<[ShippingMethod](ShippingMethod.mdx)>`
|
||||
|
||||
Creates a shipping method for a given cart.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -347,7 +367,7 @@ Creates a shipping method for a given cart.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingMethod](ShippingMethod.mdx)>
|
||||
|
||||
@@ -365,13 +385,13 @@ Promise<[ShippingMethod](ShippingMethod.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### delete
|
||||
### delete
|
||||
|
||||
`**delete**(optionId): Promise<void \| [ShippingOption](ShippingOption.mdx)>`
|
||||
|
||||
Deletes a profile with a given profile id.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -385,7 +405,7 @@ Deletes a profile with a given profile id.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<void \| [ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
@@ -403,13 +423,13 @@ Promise<void \| [ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### deleteShippingMethods
|
||||
### deleteShippingMethods
|
||||
|
||||
`**deleteShippingMethods**(shippingMethods): Promise<[ShippingMethod](ShippingMethod.mdx)[]>`
|
||||
|
||||
Removes a given shipping method
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -423,7 +443,7 @@ Removes a given shipping method
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingMethod](ShippingMethod.mdx)[]>
|
||||
|
||||
@@ -441,7 +461,7 @@ Promise<[ShippingMethod](ShippingMethod.mdx)[]>
|
||||
|
||||
___
|
||||
|
||||
#### getPrice\_
|
||||
### getPrice\_
|
||||
|
||||
`**getPrice_**(option, data, cart): Promise<number>`
|
||||
|
||||
@@ -449,7 +469,7 @@ 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
|
||||
price type "calculated".
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -481,7 +501,7 @@ price type "calculated".
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<number>
|
||||
|
||||
@@ -499,11 +519,11 @@ Promise<number>
|
||||
|
||||
___
|
||||
|
||||
#### list
|
||||
### list
|
||||
|
||||
`**list**(selector, config?): Promise<[ShippingOption](ShippingOption.mdx)[]>`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -526,7 +546,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingOption](ShippingOption.mdx)[]>
|
||||
|
||||
@@ -544,11 +564,11 @@ Promise<[ShippingOption](ShippingOption.mdx)[]>
|
||||
|
||||
___
|
||||
|
||||
#### listAndCount
|
||||
### listAndCount
|
||||
|
||||
`**listAndCount**(selector, config?): Promise<[[ShippingOption](ShippingOption.mdx)[], number]>`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -571,7 +591,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[[ShippingOption](ShippingOption.mdx)[], number]>
|
||||
|
||||
@@ -589,13 +609,13 @@ Promise<[[ShippingOption](ShippingOption.mdx)[], number]>
|
||||
|
||||
___
|
||||
|
||||
#### removeRequirement
|
||||
### removeRequirement
|
||||
|
||||
`**removeRequirement**(requirementId): Promise<void \| [ShippingOptionRequirement](ShippingOptionRequirement.mdx)>`
|
||||
|
||||
Removes a requirement from a shipping option
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -609,7 +629,7 @@ Removes a requirement from a shipping option
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<void \| [ShippingOptionRequirement](ShippingOptionRequirement.mdx)>
|
||||
|
||||
@@ -627,14 +647,14 @@ Promise<void \| [ShippingOptionRequirement](ShippingOptionRequirement.mdx)&#
|
||||
|
||||
___
|
||||
|
||||
#### retrieve
|
||||
### retrieve
|
||||
|
||||
`**retrieve**(optionId, options?): Promise<[ShippingOption](ShippingOption.mdx)>`
|
||||
|
||||
Gets a profile by id.
|
||||
Throws in case of DB Error and if profile was not found.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -657,7 +677,7 @@ Throws in case of DB Error and if profile was not found.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
@@ -675,11 +695,11 @@ Promise<[ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### shouldRetryTransaction\_
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
`Protected **shouldRetryTransaction_**(err): boolean`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -693,7 +713,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
@@ -711,7 +731,7 @@ ___
|
||||
|
||||
___
|
||||
|
||||
#### update
|
||||
### update
|
||||
|
||||
`**update**(optionId, update): Promise<[ShippingOption](ShippingOption.mdx)>`
|
||||
|
||||
@@ -719,7 +739,7 @@ Updates a profile. Metadata updates and product updates should use
|
||||
dedicated methods, e.g. `setMetadata`, etc. The function
|
||||
will throw errors if metadata or product updates are attempted.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -742,7 +762,7 @@ will throw errors if metadata or product updates are attempted.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
@@ -760,14 +780,14 @@ Promise<[ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### updateShippingMethod
|
||||
### updateShippingMethod
|
||||
|
||||
`**updateShippingMethod**(id, update): Promise<undefined \| [ShippingMethod](ShippingMethod.mdx)>`
|
||||
|
||||
Updates a shipping method's associations. Useful when a cart is completed
|
||||
and its methods should be copied to an order/swap entity.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -790,7 +810,7 @@ and its methods should be copied to an order/swap entity.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<undefined \| [ShippingMethod](ShippingMethod.mdx)>
|
||||
|
||||
@@ -808,11 +828,11 @@ Promise<undefined \| [ShippingMethod](ShippingMethod.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### updateShippingProfile
|
||||
### updateShippingProfile
|
||||
|
||||
`**updateShippingProfile**(optionIds, profileId): Promise<[ShippingOption](ShippingOption.mdx)[]>`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -835,7 +855,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingOption](ShippingOption.mdx)[]>
|
||||
|
||||
@@ -853,11 +873,11 @@ Promise<[ShippingOption](ShippingOption.mdx)[]>
|
||||
|
||||
___
|
||||
|
||||
#### validateAndMutatePrice
|
||||
### validateAndMutatePrice
|
||||
|
||||
`Private **validateAndMutatePrice**(option, priceInput): Promise<[CreateShippingOptionInput](../types/CreateShippingOptionInput.mdx) \| [Omit](../types/Omit.mdx)<[ShippingOption](ShippingOption.mdx), "beforeInsert">>`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -880,7 +900,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[CreateShippingOptionInput](../types/CreateShippingOptionInput.mdx) \| [Omit](../types/Omit.mdx)<[ShippingOption](ShippingOption.mdx), "beforeInsert">>
|
||||
|
||||
@@ -898,7 +918,7 @@ Promise<[CreateShippingOptionInput](../types/CreateShippingOptionInput.mdx)
|
||||
|
||||
___
|
||||
|
||||
#### validateCartOption
|
||||
### validateCartOption
|
||||
|
||||
`**validateCartOption**(option, cart): Promise<null \| [ShippingOption](ShippingOption.mdx)>`
|
||||
|
||||
@@ -906,7 +926,7 @@ 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
|
||||
match, or when the shipping option requirements are not satisfied.
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -929,7 +949,7 @@ match, or when the shipping option requirements are not satisfied.
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<null \| [ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
@@ -947,13 +967,13 @@ Promise<null \| [ShippingOption](ShippingOption.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### validatePriceType\_
|
||||
### validatePriceType\_
|
||||
|
||||
`**validatePriceType_**(priceType, option): Promise<[ShippingOptionPriceType](../enums/ShippingOptionPriceType.mdx)>`
|
||||
|
||||
Validates a shipping option price
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -976,7 +996,7 @@ Validates a shipping option price
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingOptionPriceType](../enums/ShippingOptionPriceType.mdx)>
|
||||
|
||||
@@ -994,13 +1014,13 @@ Promise<[ShippingOptionPriceType](../enums/ShippingOptionPriceType.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### validateRequirement\_
|
||||
### validateRequirement\_
|
||||
|
||||
`**validateRequirement_**(requirement, optionId?): Promise<[ShippingOptionRequirement](ShippingOptionRequirement.mdx)>`
|
||||
|
||||
Validates a requirement
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -1023,7 +1043,7 @@ Validates a requirement
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
Promise<[ShippingOptionRequirement](ShippingOptionRequirement.mdx)>
|
||||
|
||||
@@ -1041,11 +1061,11 @@ Promise<[ShippingOptionRequirement](ShippingOptionRequirement.mdx)>
|
||||
|
||||
___
|
||||
|
||||
#### withTransaction
|
||||
### withTransaction
|
||||
|
||||
`**withTransaction**(transactionManager?): [ShippingOptionService](ShippingOptionService.mdx)`
|
||||
|
||||
##### Parameters
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
@@ -1059,7 +1079,7 @@ ___
|
||||
}
|
||||
]} />
|
||||
|
||||
##### Returns
|
||||
#### Returns
|
||||
|
||||
[ShippingOptionService](ShippingOptionService.mdx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user