ShippingOptionService
Provides layer to manipulate profiles.
constructor
Parameters
__namedParameters
InjectedDependenciesRequiredProperties
manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequired__container__
anyRequiredfeatureFlagRouter_
FlagRouterRequired__configModule__
Record<string, unknown>__moduleDeclaration__
Record<string, unknown>Accessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
withTransaction
Parameters
transactionManager
EntityManagerReturns
this
thisRequiredshouldRetryTransaction_
Parameters
err
Record<string, unknown> | objectRequiredReturns
boolean
booleanRequiredatomicPhase_
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
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
Promise<TResult>RequiredvalidateRequirement_
Validates a requirement
Parameters
requirement
ValidateRequirementTypeInputRequiredoptionId
undefined | stringRequiredDefault: undefined
Returns
list
Parameters
Default: {}
Returns
listAndCount
Parameters
Default: {}
Returns
retrieve
Gets a profile by id. Throws in case of DB Error and if profile was not found.
Parameters
optionId
anyRequiredDefault: {}
Returns
updateShippingMethod
Updates a shipping method's associations. Useful when a cart is completed and its methods should be copied to an order/swap entity.
Parameters
id
stringRequiredupdate
ShippingMethodUpdateRequiredReturns
deleteShippingMethods
Removes a given shipping method
Parameters
Returns
createShippingMethod
Creates a shipping method for a given cart.
Parameters
optionId
stringRequireddata
Record<string, unknown>Requiredconfig
CreateShippingMethodDtoRequiredReturns
validateCartOption
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.