LineItemService
constructor
Parameters
__namedParameters
InjectedDependenciesRequiredProperties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>featureFlagRouter_
FlagRouterRequiredmanager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
atomicPhase_
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>Requiredthe 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
Returns
Promise
Promise<TResult>Requiredthe result of the transactional work
cloneTo
Parameters
ids
string | string[]RequiredDefault: {}
options
objectRequiredoptions.setOriginalLineItemId
booleanReturns
create
Create a line item
Type Parameters
T
objectRequiredTResult
objectRequiredParameters
data
TRequiredthe line item object to create
Returns
Promise
Promise<TResult>Requiredthe created line item
createReturnLines
Creates return line items for a given cart based on the return items in a return.
Parameters
returnId
stringRequiredthe id to generate return items from.
cartId
stringRequiredthe cart to assign the return line items to.
Returns
the created line items
createTaxLine
Create a line item tax line.
Parameters
tax line partial passed to the repo create method
Returns
LineItemTaxLine
objectRequiredA Line Item Tax Line represents the taxes applied on a line item.
delete
Deletes a line item.
Parameters
id
stringRequiredthe id of the line item to delete
Returns
the result of the delete operation