OrderEditService
internal.internal.OrderEditService
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredEvents
objectRequiredEvents.CANCELED
stringRequiredEvents.CONFIRMED
stringRequiredEvents.CREATED
stringRequiredEvents.DECLINED
stringRequiredEvents.REQUESTED
stringRequiredEvents.UPDATED
stringRequiredisOrderEditActive
anyRequiredAccessors
activeManager_
Protected
get
activeManager_(): EntityManager
Returns
EntityManager
EntityManager
EntityManagerRequiredInherited from
TransactionBaseService.activeManager_
Methods
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>RequiredInherited from
TransactionBaseService.atomicPhase_
cancel
cancel(orderEditId
, context?
): Promise
<OrderEdit
>
Parameters
orderEditId
stringRequiredcontext
objectcontext.canceledBy
stringReturns
Promise
<OrderEdit
>
confirm
confirm(orderEditId
, context?
): Promise
<OrderEdit
>
Parameters
orderEditId
stringRequiredcontext
objectcontext.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
objectconfig.preserveCustomAdjustments
booleanRequiredReturns
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
objectcontext.requestedBy
stringReturns
Promise
<OrderEdit
>
retrieve
retrieve(orderEditId
, config?
): Promise
<OrderEdit
>
Parameters
orderEditId
stringRequiredconfig
FindConfig<OrderEdit>Returns
Promise
<OrderEdit
>
retrieveActive
Protected
retrieveActive(orderId
, config?
): Promise
<undefined
| null
| OrderEdit
>
Parameters
orderId
stringRequiredconfig
FindConfig<OrderEdit>Returns
Promise
<undefined
| null
| OrderEdit
>
shouldRetryTransaction_
Protected
shouldRetryTransaction_(err
): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanInherited from
TransactionBaseService.shouldRetryTransaction_
update
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
EntityManager