CustomerGroupService
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>customerGroupRepository_
Repository<CustomerGroup> & { addCustomers: Method addCustomers ; findWithRelationsAndCount: Method findWithRelationsAndCount ; removeCustomers: Method removeCustomers }RequiredhandleCreationFail
anyRequiredmanager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
addCustomers
Add a batch of customers to a customer group at once
Parameters
id
stringRequiredid of the customer group to add customers to
customerIds
string | string[]Requiredcustomer id's to add to the group
Returns
the customer group after insertion
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.
Parameters
work
(transactionManager: EntityManager) => Promise<TResult>Requiredthe transactional work to be done
isolationOrErrorHandler
IsolationLevel | (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
Promise<TResult>Requiredthe result of the transactional work
create
Creates a customer group with the provided data.
Parameters
the customer group to create
Returns
the result of the create operation
delete
Remove customer group
Parameters
groupId
stringRequiredid of the customer group to delete
Returns
Promise
Promise<void>Requireda promise
list
List customer groups.
Parameters
selector
undefined | Selector<CustomerGroup> & { discount_condition_id?: string ; q?: string }Requiredthe query object for find
the config to be used for find
Returns
the result of the find operation
listAndCount
Retrieve a list of customer groups and total count of records that match the query.
Parameters
selector
undefined | Selector<CustomerGroup> & { discount_condition_id?: string ; q?: string }Requiredthe query object for find
the config to be used for find
Returns
the result of the find operation
removeCustomer
Remove list of customers from a customergroup
Parameters
id
stringRequiredid of the customer group from which the customers are removed
customerIds
string | string[]Requiredid's of the customer to remove from group
Returns
the customergroup with the provided id
retrieve
Parameters
customerGroupId
stringRequiredconfig
objectReturns
shouldRetryTransaction_
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
booleanupdate
Update a customer group.
Parameters
customerGroupId
stringRequiredid of the customer group
customer group partial data
Returns
resulting customer group
withTransaction
Parameters
transactionManager
EntityManagerReturns
Was this section helpful?