Skip to main content
Skip to main content

OrderEditService

constructor

Parameters

__namedParametersInjectedDependenciesRequired

Properties

manager_EntityManagerRequired
transactionManager_undefined | EntityManagerRequired
__container__anyRequired
EventsobjectRequired
Events.CREATEDstringRequired

Default: "order-edit.created"

Events.UPDATEDstringRequired

Default: "order-edit.updated"

Events.DECLINEDstringRequired

Default: "order-edit.declined"

Events.REQUESTEDstringRequired

Default: "order-edit.requested"

Events.CANCELEDstringRequired

Default: "order-edit.canceled"

Events.CONFIRMEDstringRequired

Default: "order-edit.confirmed"

orderEditRepository_Repository<OrderEdit>Required
orderService_OrderServiceRequired
totalsService_TotalsServiceRequired
newTotalsService_NewTotalsServiceRequired
lineItemService_LineItemServiceRequired
eventBusService_EventBusServiceRequired
taxProviderService_TaxProviderServiceRequired
lineItemAdjustmentService_LineItemAdjustmentServiceRequired
orderEditItemChangeService_OrderEditItemChangeServiceRequired
__configModule__Record<string, unknown>
__moduleDeclaration__Record<string, unknown>

Accessors

activeManager_

Returns

EntityManagerEntityManagerRequired

inventoryService_

Returns

undefined | IInventoryServiceundefined | IInventoryServiceRequired

Methods

withTransaction

Parameters

transactionManagerEntityManager

Returns

thisthisRequired

shouldRetryTransaction_

Parameters

errRecord<string, unknown> | objectRequired

Returns

booleanbooleanRequired

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

retrieve

Parameters

orderEditIdstringRequired
configFindConfig<OrderEdit>Required

Default: {}

Returns

PromisePromise<OrderEdit>Required

listAndCount

Parameters

selectorSelector<OrderEdit> & objectRequired

Returns

PromisePromise<[OrderEdit[], number]>Required

list

Parameters

selectorSelector<OrderEdit>Required

Returns

PromisePromise<OrderEdit[]>Required

create

Parameters

dataCreateOrderEditInputRequired
contextobjectRequired
context.createdBystringRequired

Returns

PromisePromise<OrderEdit>Required

update

Parameters

orderEditIdstringRequired
dataDeepPartial<OrderEdit>Required

Returns

PromisePromise<OrderEdit>Required

delete

Parameters

idstringRequired

Returns

PromisePromise<void>Required

decline

Parameters

orderEditIdstringRequired
contextobjectRequired
context.declinedReasonstring
context.declinedBystring

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
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

removeLineItem

Parameters

orderEditIdstringRequired
lineItemIdstringRequired

Returns

PromisePromise<void>Required

refreshAdjustments

Parameters

orderEditIdstringRequired
configobjectRequired
config.preserveCustomAdjustmentsbooleanRequired

Default: false

Returns

PromisePromise<void>Required

decorateTotals

Parameters

orderEditOrderEditRequired

Returns

PromisePromise<OrderEdit>Required

addLineItem

Parameters

orderEditIdstringRequired
dataAddOrderEditLineItemInputRequired

Returns

PromisePromise<void>Required

deleteItemChange

Parameters

orderEditIdstringRequired
itemChangeIdstringRequired

Returns

PromisePromise<void>Required

requestConfirmation

Parameters

orderEditIdstringRequired
contextobjectRequired

Default: {}

context.requestedBystring

Returns

PromisePromise<OrderEdit>Required

cancel

Parameters

orderEditIdstringRequired
contextobjectRequired

Default: {}

context.canceledBystring

Returns

PromisePromise<OrderEdit>Required

confirm

Parameters

orderEditIdstringRequired
contextobjectRequired

Default: {}

context.confirmedBystring

Returns

PromisePromise<OrderEdit>Required

retrieveActive

Parameters

orderIdstringRequired
configFindConfig<OrderEdit>Required

Default: {}

Returns

PromisePromise<undefined | null | OrderEdit>Required

deleteClonedItems

Parameters

orderEditIdstringRequired

Returns

PromisePromise<void>Required

isOrderEditActive

Parameters

orderEditOrderEditRequired

Returns

booleanbooleanRequired
Was this section helpful?