Skip to main content
Skip to main content

OrderEditService

constructor

Parameters

__namedParametersInjectedDependenciesRequired

Properties

__configModule__Record<string, unknown>
__container__anyRequired
__moduleDeclaration__Record<string, unknown>
eventBusService_EventBusServiceRequired
lineItemAdjustmentService_LineItemAdjustmentServiceRequired
lineItemService_LineItemServiceRequired
manager_EntityManagerRequired
newTotalsService_NewTotalsServiceRequired
orderEditItemChangeService_OrderEditItemChangeServiceRequired
orderEditRepository_Repository<OrderEdit>Required
orderService_OrderServiceRequired
taxProviderService_TaxProviderServiceRequired
totalsService_TotalsServiceRequired
transactionManager_undefined | EntityManagerRequired
EventsobjectRequired
Events.CANCELEDstringRequired

Default: "order-edit.canceled"

Events.CONFIRMEDstringRequired

Default: "order-edit.confirmed"

Events.CREATEDstringRequired

Default: "order-edit.created"

Events.DECLINEDstringRequired

Default: "order-edit.declined"

Events.REQUESTEDstringRequired

Default: "order-edit.requested"

Events.UPDATEDstringRequired

Default: "order-edit.updated"


Accessors

activeManager_

Returns

EntityManagerEntityManagerRequired

inventoryService_

Returns

undefined \| IInventoryServiceundefined | IInventoryService

Methods

addLineItem

Parameters

orderEditIdstringRequired
dataAddOrderEditLineItemInputRequired

Returns

PromisePromise<void>Required

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

TResultobjectRequired
TErrorobjectRequired

Parameters

work(transactionManager: EntityManager) => Promise<TResult>Required
the transactional work to be done
isolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>
the isolation level to be used for the work.
maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>
Potential error handler

Returns

PromisePromise<TResult>Required
the result of the transactional work

cancel

Parameters

orderEditIdstringRequired
contextobjectRequired

Default: {}

context.canceledBystring

Returns

PromisePromise<OrderEdit>Required

confirm

Parameters

orderEditIdstringRequired
contextobjectRequired

Default: {}

context.confirmedBystring

Returns

PromisePromise<OrderEdit>Required

create

Parameters

dataCreateOrderEditInputRequired
contextobjectRequired
context.createdBystringRequired

Returns

PromisePromise<OrderEdit>Required

decline

Parameters

orderEditIdstringRequired
contextobjectRequired
context.declinedBystring
context.declinedReasonstring

Returns

PromisePromise<OrderEdit>Required

decorateTotals

Parameters

orderEditOrderEditRequired

Returns

PromisePromise<OrderEdit>Required

delete

Parameters

idstringRequired

Returns

PromisePromise<void>Required

deleteClonedItems

Parameters

orderEditIdstringRequired

Returns

PromisePromise<void>Required

deleteItemChange

Parameters

orderEditIdstringRequired
itemChangeIdstringRequired

Returns

PromisePromise<void>Required

list

Parameters

selectorSelector<OrderEdit>Required

Returns

PromisePromise<OrderEdit[]>Required

listAndCount

Parameters

selectorSelector<OrderEdit> & objectRequired

Returns

PromisePromise<[OrderEdit[], number]>Required

refreshAdjustments

Parameters

orderEditIdstringRequired
configobjectRequired
config.preserveCustomAdjustmentsbooleanRequired

Default: false

Returns

PromisePromise<void>Required

removeLineItem

Parameters

orderEditIdstringRequired
lineItemIdstringRequired

Returns

PromisePromise<void>Required

requestConfirmation

Parameters

orderEditIdstringRequired
contextobjectRequired

Default: {}

context.requestedBystring

Returns

PromisePromise<OrderEdit>Required

retrieve

Parameters

orderEditIdstringRequired
configFindConfig<OrderEdit>Required

Default: {}

Returns

PromisePromise<OrderEdit>Required

retrieveActive

Parameters

orderIdstringRequired
configFindConfig<OrderEdit>Required

Default: {}

Returns

PromisePromise<undefined | null | OrderEdit>Required

shouldRetryTransaction_

Parameters

errRecord<string, unknown> | objectRequired

Returns

booleanboolean

update

Parameters

orderEditIdstringRequired
dataDeepPartial<OrderEdit>Required

Returns

PromisePromise<OrderEdit>Required

updateLineItem

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
  • If the item change does not exist then create the item change of type update and apply the quantity as well as update the line adjustments

Parameters

orderEditIdstringRequired
itemIdstringRequired
dataobjectRequired
data.quantitynumberRequired

Returns

PromisePromise<void>Required

withTransaction

Parameters

transactionManagerEntityManager

Returns

OrderEditServiceobjectRequired

isOrderEditActive

Parameters

orderEditOrderEditRequired

Returns

booleanboolean
Was this section helpful?