IConfigurationModuleService Reference
This section of the documentation provides a reference to theIConfigurationModuleService interface’s methods. This is the interface developers use to use the functionalities provided by the Configuration Module.
The main service interface for the Configuration Module.
Methods
- createConfigurationRules
- updateConfigurationRules
- deleteConfigurationRules
- retrieveConfigurationRule
- listConfigurationRules
- listAndCountConfigurationRules
- softDeleteConfigurationRules
- restoreConfigurationRules
- isRuleEnabled
createConfigurationRules
This section provides a reference to thecreateConfigurationRules method. This belongs to the Configuration Module.
createConfigurationRules(data, sharedContext?): Promise<ConfigurationRuleDTO[]>
This method creates configuration rules.Example
Parameters
The configuration rules to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created configuration rules.
createConfigurationRules(data, sharedContext?): Promise<ConfigurationRuleDTO>
This method creates a configuration rule.Example
Parameters
The configuration rule to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created configuration rule.
updateConfigurationRules
This section provides a reference to theupdateConfigurationRules method. This belongs to the Configuration Module.
updateConfigurationRules(id, data, sharedContext?): Promise<ConfigurationRuleDTO>
This method updates an existing configuration rule.Example
Parameters
The ID of the configuration rule.
The attributes to update in the configuration rule.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The updated configuration rule.
deleteConfigurationRules
This section provides a reference to thedeleteConfigurationRules method. This belongs to the Configuration Module.
deleteConfigurationRules(ids, sharedContext?): Promise<void>
This method deletes configuration rules by their IDs.Example
Parameters
The IDs of the configuration rules.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the configuration rules are deleted successfully.
deleteConfigurationRules(id, sharedContext?): Promise<void>
This method deletes a configuration rule by its ID.Example
Parameters
The ID of the configuration rule.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the configuration rule is deleted successfully.
retrieveConfigurationRule
This section provides a reference to theretrieveConfigurationRule method. This belongs to the Configuration Module.
This method retrieves a configuration rule by its ID.
Example
Parameters
The ID of the configuration rule.
The configurations determining how the configuration rule is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The retrieved configuration rule.
listConfigurationRules
This section provides a reference to thelistConfigurationRules method. This belongs to the Configuration Module.
This method retrieves a paginated list of configuration rules based on optional filters and configuration.
Example
To retrieve a list of configuration rules 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 configuration rules.
The configurations determining how the configuration rule is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of configuration rules.
listAndCountConfigurationRules
This section provides a reference to thelistAndCountConfigurationRules method. This belongs to the Configuration Module.
This method retrieves a paginated list of configuration rules along with the total count of available configuration rules satisfying the provided filters.
Example
To retrieve a list of configuration rules 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 configuration rules.
The configurations determining how the configuration rule is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of configuration rules along with their total count.
softDeleteConfigurationRules
This section provides a reference to thesoftDeleteConfigurationRules method. This belongs to the Configuration Module.
This method soft deletes configuration rules by their IDs.
Example
Parameters
The IDs of the configuration rules.
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.restoreConfigurationRules
This section provides a reference to therestoreConfigurationRules method. This belongs to the Configuration Module.
This method restores soft deleted configuration rules by their IDs.
Example
Parameters
The IDs of the configuration rules.
Configurations determining which relations to restore along with each of the configuration rule.
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.isRuleEnabled
This section provides a reference to theisRuleEnabled method. This belongs to the Configuration Module.
This method checks whether a specific configuration rule is enabled. If the rule doesn’t exist in the database, it returns the default value for that rule type.
Example
Parameters
The type of the configuration rule to check. Can be
global_product_catalog, require_product_approval, product_request_enabled, or product_import_enabled.Returns
A boolean indicating whether the configuration rule is enabled.