IAttributeModuleService Reference
This section of the documentation provides a reference to theIAttributeModuleService interface’s methods. This is the interface developers use to use the functionalities provided by the Attribute Module.
The main service interface for the Attribute Module.
Methods
- createAttributes
- updateAttributes
- deleteAttributes
- retrieveAttribute
- listAttributes
- listAndCountAttributes
- softDeleteAttributes
- restoreAttributes
- createAttributeValues
- updateAttributeValues
- deleteAttributeValues
- retrieveAttributeValue
- listAttributeValues
- listAndCountAttributeValues
- softDeleteAttributeValues
- restoreAttributeValues
- createAttributePossibleValues
- updateAttributePossibleValues
- deleteAttributePossibleValues
- retrieveAttributePossibleValue
- listAttributePossibleValues
- listAndCountAttributePossibleValues
- softDeleteAttributePossibleValues
- restoreAttributePossibleValues
- updateAttributeWithUpsertOrReplacePossibleValues
createAttributes
This section provides a reference to thecreateAttributes method. This belongs to the Attribute Module.
createAttributes(data, sharedContext?): Promise<AttributeDTO[]>
This method creates attributes.Example
Parameters
The attributes to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created attributes.
createAttributes(data, sharedContext?): Promise<AttributeDTO>
This method creates an attribute.Example
Parameters
The attribute to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created attribute.
updateAttributeWithUpsertOrReplacePossibleValues
This section provides a reference to theupdateAttributeWithUpsertOrReplacePossibleValues method. This belongs to the Attribute Module.
updateAttributeWithUpsertOrReplacePossibleValues(input, sharedContext?): Promise<void>
This method updates an attribute and upserts or replaces its possible values in a single operation. Ifid is not provided for possible_values entries, it will lookup the database by attributePossibleValue.value to update or create accordingly.
Example
Parameters
The attribute(s) to update with possible values to upsert.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the attribute and its possible values are updated successfully.
listAttributes
This section provides a reference to thelistAttributes method. This belongs to the Attribute Module.
This method retrieves a paginated list of attributes based on optional filters and configuration.
Example
To retrieve a list of attributes 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 attributes.
The configurations determining how the attribute is retrieved. Its properties, such as
select or relations, accept the attributes or relations associated with an attribute.A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of attributes.
retrieveAttribute
This section provides a reference to theretrieveAttribute method. This belongs to the Attribute Module.
This method retrieves an attribute by its ID.
Example
Parameters
The ID of the attribute.
The configurations determining how the attribute is retrieved. Its properties, such as
select or relations, accept the attributes or relations associated with an attribute.A context used to share resources, such as transaction manager, between the application and the module.
Returns
The retrieved attribute.
updateAttributes
This section provides a reference to theupdateAttributes method. This belongs to the Attribute Module.
updateAttributes(id, data, sharedContext?): Promise<AttributeDTO>
This method updates an existing attribute.Example
Parameters
The ID of the attribute.
The attributes to update in the attribute.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The updated attribute.
deleteAttributes
This section provides a reference to thedeleteAttributes method. This belongs to the Attribute Module.
deleteAttributes(ids, sharedContext?): Promise<void>
This method deletes attributes by their IDs.Example
Parameters
The IDs of the attributes.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the attributes are deleted successfully.
deleteAttributes(id, sharedContext?): Promise<void>
This method deletes an attribute by its ID.Example
Parameters
The ID of the attribute.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the attribute is deleted successfully.
listAndCountAttributes
This section provides a reference to thelistAndCountAttributes method. This belongs to the Attribute Module.
This method retrieves a paginated list of attributes along with the total count of available attributes satisfying the provided filters.
Example
To retrieve a list of attributes 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 attributes.
The configurations determining how the attribute is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of attributes along with their total count.
softDeleteAttributes
This section provides a reference to thesoftDeleteAttributes method. This belongs to the Attribute Module.
This method soft deletes attributes by their IDs.
Example
Parameters
The IDs of the attributes.
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.restoreAttributes
This section provides a reference to therestoreAttributes method. This belongs to the Attribute Module.
This method restores soft deleted attributes by their IDs.
Example
Parameters
The IDs of the attributes.
Configurations determining which relations to restore along with each of the attribute.
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.createAttributeValues
This section provides a reference to thecreateAttributeValues method. This belongs to the Attribute Module.
This method creates attribute values.
Example
Parameters
The attribute values to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created attribute values.
updateAttributeValues
This section provides a reference to theupdateAttributeValues method. This belongs to the Attribute Module.
This method updates existing attribute values.
Example
Parameters
The attribute values to update.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The updated attribute values.
deleteAttributeValues
This section provides a reference to thedeleteAttributeValues method. This belongs to the Attribute Module.
This method deletes attribute values by their IDs.
Example
Parameters
The IDs of the attribute values.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the attribute values are deleted successfully.
listAttributeValues
This section provides a reference to thelistAttributeValues method. This belongs to the Attribute Module.
This method retrieves a paginated list of attribute values based on optional filters and configuration.
Example
Parameters
The filters to apply on the retrieved attribute values.
The configurations determining how the attribute value is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of attribute values.
retrieveAttributeValue
This section provides a reference to theretrieveAttributeValue method. This belongs to the Attribute Module.
This method retrieves an attribute value by its ID.
Example
Parameters
The ID of the attribute value.
The configurations determining how the attribute value is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The retrieved attribute value.
listAndCountAttributeValues
This section provides a reference to thelistAndCountAttributeValues method. This belongs to the Attribute Module.
This method retrieves a paginated list of attribute values along with the total count of available attribute values satisfying the provided filters.
Example
Parameters
The filters to apply on the retrieved attribute values.
The configurations determining how the attribute value is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of attribute values along with their total count.
softDeleteAttributeValues
This section provides a reference to thesoftDeleteAttributeValues method. This belongs to the Attribute Module.
This method soft deletes attribute values by their IDs.
Example
Parameters
The IDs of the attribute values.
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.restoreAttributeValues
This section provides a reference to therestoreAttributeValues method. This belongs to the Attribute Module.
This method restores soft deleted attribute values by their IDs.
Example
Parameters
The IDs of the attribute values.
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.createAttributePossibleValues
This section provides a reference to thecreateAttributePossibleValues method. This belongs to the Attribute Module.
This method creates attribute possible values.
Example
Parameters
The attribute possible values to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created attribute possible values.
updateAttributePossibleValues
This section provides a reference to theupdateAttributePossibleValues method. This belongs to the Attribute Module.
This method updates existing attribute possible values.
Example
Parameters
The attribute possible values to update.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The updated attribute possible values.
deleteAttributePossibleValues
This section provides a reference to thedeleteAttributePossibleValues method. This belongs to the Attribute Module.
This method deletes attribute possible values by their IDs.
Example
Parameters
The IDs of the attribute possible values.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the attribute possible values are deleted successfully.
listAttributePossibleValues
This section provides a reference to thelistAttributePossibleValues method. This belongs to the Attribute Module.
This method retrieves a paginated list of attribute possible values based on optional filters and configuration.
Example
Parameters
The filters to apply on the retrieved attribute possible values.
The configurations determining how the attribute possible value is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of attribute possible values.
retrieveAttributePossibleValue
This section provides a reference to theretrieveAttributePossibleValue method. This belongs to the Attribute Module.
This method retrieves an attribute possible value by its ID.
Example
Parameters
The ID of the attribute possible value.
The configurations determining how the attribute possible value is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The retrieved attribute possible value.
listAndCountAttributePossibleValues
This section provides a reference to thelistAndCountAttributePossibleValues method. This belongs to the Attribute Module.
This method retrieves a paginated list of attribute possible values along with the total count of available attribute possible values satisfying the provided filters.
Example
Parameters
The filters to apply on the retrieved attribute possible values.
The configurations determining how the attribute possible value is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of attribute possible values along with their total count.
softDeleteAttributePossibleValues
This section provides a reference to thesoftDeleteAttributePossibleValues method. This belongs to the Attribute Module.
This method soft deletes attribute possible values by their IDs.
Example
Parameters
The IDs of the attribute possible values.
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.restoreAttributePossibleValues
This section provides a reference to therestoreAttributePossibleValues method. This belongs to the Attribute Module.
This method restores soft deleted attribute possible values by their IDs.
Example
Parameters
The IDs of the attribute possible values.
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.