docs: TSDoc + reference of fulfillment service (#5761)

This commit is contained in:
Shahed Nasser
2023-11-29 11:58:08 +00:00
committed by GitHub
parent 8f25ed8a10
commit f802e2460f
1479 changed files with 30259 additions and 16135 deletions
@@ -8,13 +8,11 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
Finds tax providers and assists in tax related operations.
## Constructors
#### constructor
## constructor
`**new TaxProviderService**(container)`
##### Parameters
### Parameters
<ParameterTypes parameters={[
{
@@ -28,6 +26,8 @@ Finds tax providers and assists in tax related operations.
}
]} />
___
## Properties
<ParameterTypes parameters={[
@@ -141,15 +141,35 @@ Finds tax providers and assists in tax related operations.
}
]} />
___
## 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
#### atomicPhase\_
### atomicPhase\_
`Protected **atomicPhase_**<TypeParameter TResult, TypeParameter TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise&#60;TResult&#62;`
@@ -157,7 +177,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={[
{
@@ -180,7 +200,7 @@ transaction manager is created.
}
]} />
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -212,7 +232,7 @@ transaction manager is created.
}
]} />
##### Returns
#### Returns
Promise&#60;TResult&#62;
@@ -230,11 +250,11 @@ Promise&#60;TResult&#62;
___
#### clearLineItemsTaxLines
### clearLineItemsTaxLines
`**clearLineItemsTaxLines**(itemIds): Promise&#60;void&#62;`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -248,7 +268,7 @@ ___
}
]} />
##### Returns
#### Returns
Promise&#60;void&#62;
@@ -266,11 +286,11 @@ Promise&#60;void&#62;
___
#### clearTaxLines
### clearTaxLines
`**clearTaxLines**(cartId): Promise&#60;void&#62;`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -284,7 +304,7 @@ ___
}
]} />
##### Returns
#### Returns
Promise&#60;void&#62;
@@ -302,14 +322,14 @@ Promise&#60;void&#62;
___
#### createShippingTaxLines
### createShippingTaxLines
`**createShippingTaxLines**(shippingMethod, calculationContext): Promise&#60;([LineItemTaxLine](LineItemTaxLine.mdx) \| [ShippingMethodTaxLine](ShippingMethodTaxLine.mdx))[]&#62;`
Persists the tax lines relevant for a shipping method to the database. Used
for return shipping methods.
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -332,7 +352,7 @@ for return shipping methods.
}
]} />
##### Returns
#### Returns
Promise&#60;([LineItemTaxLine](LineItemTaxLine.mdx) \| [ShippingMethodTaxLine](ShippingMethodTaxLine.mdx))[]&#62;
@@ -350,13 +370,13 @@ Promise&#60;([LineItemTaxLine](LineItemTaxLine.mdx) \| [ShippingMethodTaxLine](S
___
#### createTaxLines
### createTaxLines
`**createTaxLines**(cartOrLineItems, calculationContext): Promise&#60;([LineItemTaxLine](LineItemTaxLine.mdx) \| [ShippingMethodTaxLine](ShippingMethodTaxLine.mdx))[]&#62;`
Persists the tax lines relevant for an order to the database.
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -379,7 +399,7 @@ Persists the tax lines relevant for an order to the database.
}
]} />
##### Returns
#### Returns
Promise&#60;([LineItemTaxLine](LineItemTaxLine.mdx) \| [ShippingMethodTaxLine](ShippingMethodTaxLine.mdx))[]&#62;
@@ -397,13 +417,13 @@ Promise&#60;([LineItemTaxLine](LineItemTaxLine.mdx) \| [ShippingMethodTaxLine](S
___
#### getCacheKey
### getCacheKey
`Private **getCacheKey**(id, regionId): string`
The cache key to get cache hits by.
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -426,7 +446,7 @@ The cache key to get cache hits by.
}
]} />
##### Returns
#### Returns
`string`
@@ -444,14 +464,14 @@ The cache key to get cache hits by.
___
#### getRegionRatesForProduct
### getRegionRatesForProduct
`**getRegionRatesForProduct**(productIds, region): Promise&#60;Map&#60;string, [TaxServiceRate](../types/TaxServiceRate.mdx)[]&#62;&#62;`
Gets the tax rates configured for a product. The rates are cached between
calls.
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -474,7 +494,7 @@ calls.
}
]} />
##### Returns
#### Returns
Promise&#60;Map&#60;string, [TaxServiceRate](../types/TaxServiceRate.mdx)[]&#62;&#62;
@@ -492,14 +512,14 @@ Promise&#60;Map&#60;string, [TaxServiceRate](../types/TaxServiceRate.mdx)[]&#62;
___
#### getRegionRatesForShipping
### getRegionRatesForShipping
`**getRegionRatesForShipping**(optionId, regionDetails): Promise&#60;[TaxServiceRate](../types/TaxServiceRate.mdx)[]&#62;`
Gets the tax rates configured for a shipping option. The rates are cached
between calls.
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -522,7 +542,7 @@ between calls.
}
]} />
##### Returns
#### Returns
Promise&#60;[TaxServiceRate](../types/TaxServiceRate.mdx)[]&#62;
@@ -540,7 +560,7 @@ Promise&#60;[TaxServiceRate](../types/TaxServiceRate.mdx)[]&#62;
___
#### getShippingTaxLines
### getShippingTaxLines
`**getShippingTaxLines**(shippingMethod, calculationContext): Promise&#60;[ShippingMethodTaxLine](ShippingMethodTaxLine.mdx)[]&#62;`
@@ -548,7 +568,7 @@ Gets the relevant tax lines for a shipping method. Note: this method
doesn't persist the tax lines. Use createShippingTaxLines if you wish to
persist the tax lines to the DB layer.
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -571,7 +591,7 @@ persist the tax lines to the DB layer.
}
]} />
##### Returns
#### Returns
Promise&#60;[ShippingMethodTaxLine](ShippingMethodTaxLine.mdx)[]&#62;
@@ -589,7 +609,7 @@ Promise&#60;[ShippingMethodTaxLine](ShippingMethodTaxLine.mdx)[]&#62;
___
#### getTaxLines
### getTaxLines
`**getTaxLines**(lineItems, calculationContext): Promise&#60;([LineItemTaxLine](LineItemTaxLine.mdx) \| [ShippingMethodTaxLine](ShippingMethodTaxLine.mdx))[]&#62;`
@@ -599,7 +619,7 @@ will be computed from the tax rules and potentially a 3rd party tax plugin.
Note: this method doesn't persist the tax lines. Use createTaxLines if you
wish to persist the tax lines to the DB layer.
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -622,7 +642,7 @@ wish to persist the tax lines to the DB layer.
}
]} />
##### Returns
#### Returns
Promise&#60;([LineItemTaxLine](LineItemTaxLine.mdx) \| [ShippingMethodTaxLine](ShippingMethodTaxLine.mdx))[]&#62;
@@ -640,13 +660,13 @@ Promise&#60;([LineItemTaxLine](LineItemTaxLine.mdx) \| [ShippingMethodTaxLine](S
___
#### getTaxLinesMap
### getTaxLinesMap
`Protected **getTaxLinesMap**(items, calculationContext): Promise&#60;[TaxLinesMaps](../types/TaxLinesMaps.mdx)&#62;`
Return a map of tax lines for line items and shipping methods
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -669,7 +689,7 @@ Return a map of tax lines for line items and shipping methods
}
]} />
##### Returns
#### Returns
Promise&#60;[TaxLinesMaps](../types/TaxLinesMaps.mdx)&#62;
@@ -687,11 +707,11 @@ Promise&#60;[TaxLinesMaps](../types/TaxLinesMaps.mdx)&#62;
___
#### list
### list
`**list**(): Promise&#60;[TaxProvider](TaxProvider.mdx)[]&#62;`
##### Returns
#### Returns
Promise&#60;[TaxProvider](TaxProvider.mdx)[]&#62;
@@ -709,11 +729,11 @@ Promise&#60;[TaxProvider](TaxProvider.mdx)[]&#62;
___
#### registerInstalledProviders
### registerInstalledProviders
`**registerInstalledProviders**(providers): Promise&#60;void&#62;`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -727,7 +747,7 @@ ___
}
]} />
##### Returns
#### Returns
Promise&#60;void&#62;
@@ -745,13 +765,13 @@ Promise&#60;void&#62;
___
#### retrieveProvider
### retrieveProvider
`**retrieveProvider**(region): [ITaxService](../interfaces/ITaxService.mdx)`
Retrieves the relevant tax provider for the given region.
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -765,7 +785,7 @@ Retrieves the relevant tax provider for the given region.
}
]} />
##### Returns
#### Returns
[ITaxService](../interfaces/ITaxService.mdx)
@@ -783,11 +803,11 @@ Retrieves the relevant tax provider for the given region.
___
#### shouldRetryTransaction\_
### shouldRetryTransaction\_
`Protected **shouldRetryTransaction_**(err): boolean`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -801,7 +821,7 @@ ___
}
]} />
##### Returns
#### Returns
`boolean`
@@ -819,11 +839,11 @@ ___
___
#### withTransaction
### withTransaction
`**withTransaction**(transactionManager?): [TaxProviderService](TaxProviderService.mdx)`
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -837,7 +857,7 @@ ___
}
]} />
##### Returns
#### Returns
[TaxProviderService](TaxProviderService.mdx)