Skip to main content
Skip to main content

OrderEditService

internal.internal.OrderEditService

Properties

__configModule__Record<string, unknown>
__container__anyRequired
__moduleDeclaration__Record<string, unknown>
eventBusService_EventBusServiceRequired
inventoryService_undefined | IInventoryServiceRequired
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
Events.CONFIRMEDstringRequired
Events.CREATEDstringRequired
Events.DECLINEDstringRequired
Events.REQUESTEDstringRequired
Events.UPDATEDstringRequired
isOrderEditActiveanyRequired

Accessors

activeManager_

Protected get activeManager_(): EntityManager

Returns

EntityManager

EntityManagerEntityManagerRequired

Inherited from

TransactionBaseService.activeManager_

Methods

addLineItem

addLineItem(orderEditId, data): Promise<void>

Parameters

orderEditIdstringRequired

Returns

Promise<void>

PromisePromise<void>Required

atomicPhase_

Protected atomicPhase_<TResult, TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise<TResult>

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.

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

Promise<TResult>

PromisePromise<TResult>Required
the result of the transactional work

Inherited from

TransactionBaseService.atomicPhase_


cancel

cancel(orderEditId, context?): Promise<OrderEdit>

Parameters

orderEditIdstringRequired
contextobject
context.canceledBystring

Returns

Promise<OrderEdit>

PromisePromise<OrderEdit>Required

confirm

confirm(orderEditId, context?): Promise<OrderEdit>

Parameters

orderEditIdstringRequired
contextobject
context.confirmedBystring

Returns

Promise<OrderEdit>

PromisePromise<OrderEdit>Required

create

create(data, context): Promise<OrderEdit>

Parameters

contextobjectRequired
context.createdBystringRequired

Returns

Promise<OrderEdit>

PromisePromise<OrderEdit>Required

decline

decline(orderEditId, context): Promise<OrderEdit>

Parameters

orderEditIdstringRequired
contextobjectRequired
context.declinedBystring
context.declinedReasonstring

Returns

Promise<OrderEdit>

PromisePromise<OrderEdit>Required

decorateTotals

decorateTotals(orderEdit): Promise<OrderEdit>

Parameters

orderEditOrderEditRequired

Returns

Promise<OrderEdit>

PromisePromise<OrderEdit>Required

delete

delete(id): Promise<void>

Parameters

idstringRequired

Returns

Promise<void>

PromisePromise<void>Required

deleteClonedItems

Protected deleteClonedItems(orderEditId): Promise<void>

Parameters

orderEditIdstringRequired

Returns

Promise<void>

PromisePromise<void>Required

deleteItemChange

deleteItemChange(orderEditId, itemChangeId): Promise<void>

Parameters

orderEditIdstringRequired
itemChangeIdstringRequired

Returns

Promise<void>

PromisePromise<void>Required

list

list(selector, config?): Promise<OrderEdit[]>

Parameters

selectorSelector<OrderEdit>Required

Returns

Promise<OrderEdit[]>

PromisePromise<OrderEdit[]>Required

listAndCount

listAndCount(selector, config?): Promise<[OrderEdit[], number]>

Parameters

selectorSelector<OrderEdit> & { q?: string }Required

Returns

Promise<[OrderEdit[], number]>

PromisePromise<[OrderEdit[], number]>Required

refreshAdjustments

refreshAdjustments(orderEditId, config?): Promise<void>

Parameters

orderEditIdstringRequired
configobject
config.preserveCustomAdjustmentsbooleanRequired

Returns

Promise<void>

PromisePromise<void>Required

removeLineItem

removeLineItem(orderEditId, lineItemId): Promise<void>

Parameters

orderEditIdstringRequired
lineItemIdstringRequired

Returns

Promise<void>

PromisePromise<void>Required

requestConfirmation

requestConfirmation(orderEditId, context?): Promise<OrderEdit>

Parameters

orderEditIdstringRequired
contextobject
context.requestedBystring

Returns

Promise<OrderEdit>

PromisePromise<OrderEdit>Required

retrieve

retrieve(orderEditId, config?): Promise<OrderEdit>

Parameters

orderEditIdstringRequired

Returns

Promise<OrderEdit>

PromisePromise<OrderEdit>Required

retrieveActive

Protected retrieveActive(orderId, config?): Promise<undefined | null | OrderEdit>

Parameters

orderIdstringRequired

Returns

Promise<undefined | null | OrderEdit>

PromisePromise<undefined | null | OrderEdit>Required

shouldRetryTransaction_

Protected shouldRetryTransaction_(err): boolean

Parameters

errRecord<string, unknown> | { code: string }Required

Returns

boolean

booleanboolean

Inherited from

TransactionBaseService.shouldRetryTransaction_


update

update(orderEditId, data): Promise<OrderEdit>

Parameters

orderEditIdstringRequired
dataDeepPartial<OrderEdit>Required

Returns

Promise<OrderEdit>

PromisePromise<OrderEdit>Required

updateLineItem

updateLineItem(orderEditId, itemId, data): Promise<void>

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

Promise<void>

PromisePromise<void>Required

withTransaction

withTransaction(transactionManager?): OrderEditService

Parameters

transactionManagerEntityManager

Returns

OrderEditService

defaultOrderEditServiceRequired

Inherited from

TransactionBaseService.withTransaction

Was this section helpful?