OrderEditService
Constructors
constructor
new OrderEditService(«destructured»
)
Parameters
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredEvents
objectRequiredEvents.CANCELED
stringRequiredDefault: "order-edit.canceled"
Events.CONFIRMED
stringRequiredDefault: "order-edit.confirmed"
Events.CREATED
stringRequiredDefault: "order-edit.created"
Events.DECLINED
stringRequiredDefault: "order-edit.declined"
Events.REQUESTED
stringRequiredDefault: "order-edit.requested"
Events.UPDATED
stringRequiredDefault: "order-edit.updated"
Accessors
activeManager_
Protected
get
activeManager_(): EntityManager
Returns
EntityManager
EntityManager
EntityManagerRequiredinventoryService_
Protected
get
inventoryService_(): undefined
| IInventoryService
Returns
undefined
| IInventoryService
undefined \| IInventoryService
undefined | IInventoryServiceMethods
addLineItem
addLineItem(orderEditId
, data
): Promise
<void
>
Parameters
orderEditId
stringRequiredReturns
Promise
<void
>
Promise
Promise<void>RequiredatomicPhase_
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.
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
<TResult
>
Promise
Promise<TResult>Requiredcancel
cancel(orderEditId
, context?
): Promise
<OrderEdit
>
Parameters
orderEditId
stringRequiredcontext
objectRequiredDefault: {}
context.canceledBy
stringReturns
Promise
<OrderEdit
>
confirm
confirm(orderEditId
, context?
): Promise
<OrderEdit
>
Parameters
orderEditId
stringRequiredcontext
objectRequiredDefault: {}
context.confirmedBy
stringReturns
Promise
<OrderEdit
>
create
create(data
, context
): Promise
<OrderEdit
>
Parameters
Returns
Promise
<OrderEdit
>
decline
decline(orderEditId
, context
): Promise
<OrderEdit
>
Parameters
orderEditId
stringRequiredcontext
objectRequiredcontext.declinedBy
stringcontext.declinedReason
stringReturns
Promise
<OrderEdit
>
decorateTotals
decorateTotals(orderEdit
): Promise
<OrderEdit
>
Parameters
Returns
Promise
<OrderEdit
>
delete
delete(id
): Promise
<void
>
Parameters
id
stringRequiredReturns
Promise
<void
>
Promise
Promise<void>RequireddeleteClonedItems
Protected
deleteClonedItems(orderEditId
): Promise
<void
>
Parameters
orderEditId
stringRequiredReturns
Promise
<void
>
Promise
Promise<void>RequireddeleteItemChange
deleteItemChange(orderEditId
, itemChangeId
): Promise
<void
>
Parameters
orderEditId
stringRequireditemChangeId
stringRequiredReturns
Promise
<void
>
Promise
Promise<void>Requiredlist
list(selector
, config?
): Promise
<OrderEdit
[]>
Parameters
config
FindConfig<OrderEdit>Returns
Promise
<OrderEdit
[]>
listAndCount
listAndCount(selector
, config?
): Promise
<[OrderEdit
[], number
]>
Parameters
config
FindConfig<OrderEdit>Returns
Promise
<[OrderEdit
[], number
]>
refreshAdjustments
refreshAdjustments(orderEditId
, config?
): Promise
<void
>
Parameters
orderEditId
stringRequiredconfig
objectRequiredconfig.preserveCustomAdjustments
booleanRequiredDefault: false
Returns
Promise
<void
>
Promise
Promise<void>RequiredremoveLineItem
removeLineItem(orderEditId
, lineItemId
): Promise
<void
>
Parameters
orderEditId
stringRequiredlineItemId
stringRequiredReturns
Promise
<void
>
Promise
Promise<void>RequiredrequestConfirmation
requestConfirmation(orderEditId
, context?
): Promise
<OrderEdit
>
Parameters
orderEditId
stringRequiredcontext
objectRequiredDefault: {}
context.requestedBy
stringReturns
Promise
<OrderEdit
>
retrieve
retrieve(orderEditId
, config?
): Promise
<OrderEdit
>
Parameters
orderEditId
stringRequiredDefault: {}
Returns
Promise
<OrderEdit
>
retrieveActive
Protected
retrieveActive(orderId
, config?
): Promise
<undefined
| null
| OrderEdit
>
Parameters
orderId
stringRequiredDefault: {}
Returns
Promise
<undefined
| null
| OrderEdit
>
shouldRetryTransaction_
Protected
shouldRetryTransaction_(err
): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanupdate
update(orderEditId
, data
): Promise
<OrderEdit
>
Parameters
orderEditId
stringRequiredReturns
Promise
<OrderEdit
>
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
orderEditId
stringRequireditemId
stringRequireddata
objectRequireddata.quantity
numberRequiredReturns
Promise
<void
>
Promise
Promise<void>RequiredwithTransaction
withTransaction(transactionManager?
): OrderEditService
Parameters
transactionManager
EntityManagerReturns
isOrderEditActive
Static
Private
isOrderEditActive(orderEdit
): boolean
Parameters
Returns
boolean
boolean
boolean