ProductCategoryService
Provides layer to manipulate product categories.
constructor
Parameters
__namedParameters
InjectedDependenciesRequiredProperties
__container__
anyRequiredmanager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredEvents
objectRequiredEvents.CREATED
stringRequiredDefault: "product-category.created"
Events.DELETED
stringRequiredDefault: "product-category.deleted"
Events.UPDATED
stringRequiredDefault: "product-category.updated"
__configModule__
Record<string, unknown>__moduleDeclaration__
Record<string, unknown>Accessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
addProducts
Add a batch of product to a product category
Parameters
productCategoryId
stringRequiredThe id of the product category on which to add the products
productIds
string[]RequiredThe products ids to attach to the product category
Returns
Promise
Promise<void>Requiredthe product category on which the products have been added
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
TResult
objectRequiredTError
objectRequiredParameters
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 product category
Parameters
productCategoryInput
CreateProductCategoryInputRequiredparameters to create a product category
Returns
created product category
delete
Deletes a product category
Parameters
productCategoryId
stringRequiredis the id of the product category to delete
Returns
Promise
Promise<void>Requireda promise
fetchReorderConditions
Parameters
input
UpdateProductCategoryInputRequiredshouldDeleteElement
booleanRequiredDefault: false
Returns
ReorderConditions
ReorderConditionsRequiredlistAndCount
Lists product category based on the provided parameters and includes the count of product category that match the query.
Parameters
Filter options for product category.
Configuration for query.
Filter options for product category tree relations
Default: {}