ISecondaryCategoryModuleService Reference
This section of the documentation provides a reference to theISecondaryCategoryModuleService interface’s methods. This is the interface developers use to use the functionalities provided by the Secondary Category Module.
The main service interface for the Secondary Category Module.
Methods
- createSecondaryCategories
- updateSecondaryCategories
- deleteSecondaryCategories
- retrieveSecondaryCategory
- listSecondaryCategories
- listAndCountSecondaryCategories
- softDeleteSecondaryCategories
- restoreSecondaryCategories
createSecondaryCategories
This section provides a reference to thecreateSecondaryCategories method. This belongs to the Secondary Category Module.
createSecondaryCategories(data, sharedContext?): Promise<SecondaryCategoryDTO[]>
This method creates secondary categories.Example
Parameters
The secondary categories to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created secondary categories.
createSecondaryCategories(data, sharedContext?): Promise<SecondaryCategoryDTO>
This method creates a secondary category.Example
Parameters
The secondary category to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created secondary category.
updateSecondaryCategories
This section provides a reference to theupdateSecondaryCategories method. This belongs to the Secondary Category Module.
updateSecondaryCategories(id, data, sharedContext?): Promise<SecondaryCategoryDTO>
This method updates an existing secondary category.Example
Parameters
The ID of the secondary category.
The attributes to update in the secondary category.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The updated secondary category.
deleteSecondaryCategories
This section provides a reference to thedeleteSecondaryCategories method. This belongs to the Secondary Category Module.
deleteSecondaryCategories(ids, sharedContext?): Promise<void>
This method deletes secondary categories by their IDs.Example
Parameters
The IDs of the secondary categories.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the secondary categories are deleted successfully.
deleteSecondaryCategories(id, sharedContext?): Promise<void>
This method deletes a secondary category by its ID.Example
Parameters
The ID of the secondary category.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the secondary category is deleted successfully.
retrieveSecondaryCategory
This section provides a reference to theretrieveSecondaryCategory method. This belongs to the Secondary Category Module.
This method retrieves a secondary category by its ID.
Example
Parameters
The ID of the secondary category.
The configurations determining how the secondary category is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The retrieved secondary category.
listSecondaryCategories
This section provides a reference to thelistSecondaryCategories method. This belongs to the Secondary Category Module.
This method retrieves a paginated list of secondary categories based on optional filters and configuration.
Example
To retrieve a list of secondary categories using their IDs:15 records are retrieved. You can control pagination by specifying the skip and take properties of the config parameter:
Parameters
The filters to apply on the retrieved secondary categories.
The configurations determining how the secondary category is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of secondary categories.
listAndCountSecondaryCategories
This section provides a reference to thelistAndCountSecondaryCategories method. This belongs to the Secondary Category Module.
This method retrieves a paginated list of secondary categories along with the total count of available secondary categories satisfying the provided filters.
Example
To retrieve a list of secondary categories using their IDs:15 records are retrieved. You can control pagination by specifying the skip and take properties of the config parameter:
Parameters
The filters to apply on the retrieved secondary categories.
The configurations determining how the secondary category is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of secondary categories along with their total count.
softDeleteSecondaryCategories
This section provides a reference to thesoftDeleteSecondaryCategories method. This belongs to the Secondary Category Module.
This method soft deletes secondary categories by their IDs.
Example
Parameters
The IDs of the secondary categories.
An object that is used to specify an entity’s related entities that should be soft-deleted when the main entity is soft-deleted.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
An object that includes the IDs of related records that were also soft deleted. If there are no related records, the promise resolves to
void.restoreSecondaryCategories
This section provides a reference to therestoreSecondaryCategories method. This belongs to the Secondary Category Module.
This method restores soft deleted secondary categories by their IDs.
Example
Parameters
The IDs of the secondary categories.
Configurations determining which relations to restore along with each of the secondary category.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
An object that includes the IDs of related records that were restored. If there are no related records restored, the promise resolves to
void.