In the setup steps, the codes for the regularly running jobs that operate system-wide are located in the channel_app_template.app.tasks file. There are three jobs that can run regularly related to the setup steps.
1. Update Channel Conf Schema
Creates the necessary settings for the sales channel to be established in the business process. The process starts by reading the settings through the development made in the sales channel integration, and then sends them to Akinon.
The process is managed via the update_channel_conf_schema function within the Setup Service.
You can place your desired settings inside the sales channel as key-value pairs, and develop accordingly.
The class GetChannelConfSchema needs to be modified.
GetChannelConfSchema
Class GetChannelConfSchema(integration, objects=None, batch_request=None, **kwargs)
The dynamic sales channel configuration settings for the sales channel to be opened are defined here. You can specify the information you want to enter as the sales channel settings in the format below.
Creates the category tree for the sales channel on the Akinon side.
The class GetCategoryTreeAndNodes needs to be modified.
GetCategoryTreeAndNodes
class GetCategoryTreeAndNodes(integration, objects=None, batch_request=None, **kwargs)
The category tree present in the sales channel provides the necessary data for it to be created on the Akinon side as well. The command operates without any parameters.
class CategoryAttributeDto:
remote_id: str # "If available, the remote_id of the attribute; otherwise, the name can be used as the remote_id."
name: str # "The name of the attribute, such as color, size, content, etc."
required: bool # "Indicates whether the attribute is mandatory."
variant: bool # "Indicates whether the attribute is used for variant breakdown."
allow_custom_value: bool # "Indicates whether values other than the predefined values in the sales channel are accepted."
# "For example, may not accept values other than defined for color."
# "For size, it may accept values not defined in the sales channel."
# "Descriptions cannot have defined values, so they always accept custom values."
values: List[CategoryAttributeValueDto]
The created attributes require mapping during product submission.
After the mapping is done, the mapped_attributes are added to the product data. For detailed information, refer to Mapping Data in the Product.
CategoryAttributeValueDto can be created as follow:
class CategoryAttributeValueDto:
remote_id: str # "The code of the attribute in the sales channel."
name: str # "The value of the attribute."
send_request(transformed_data) → HttpResponse
A request is made to access the properties of the category tree.
This service is responsible for creating attributes and attribute value pairs for the sales channel in Omnitron and can be used in scenarios where there are no attributes associated with categories.
This service is responsible for retrieving the attributes and their values from the sales channel and creating the AttributeDto DataClass.
The created attributes require mapping during product submission.
After the mapping is done, the mapped_attributes are added to the product data. For detailed information, refer to Mapping Data in the Product.
AttributeDto can be created as follow:
GetAttributes channel.setup.GetAttributes
class AttributeDto:
remote_id: str # "If the attribute exists, this is the code in the sales channel; if not, the name can be used as the remote_id."
name: str # "The name of the attribute, such as color, size, content, etc."
values: List[AttributeValueDto]
AttributeValueDto can be created as follow:
class AttributeValueDto:
remote_id: str # "The code of the attribute in the sales channel."
name: str # "The value of the attribute."
send_request(transformed_data) → HttpResponse
A request is made to access the attributes of the channel.
In category trees, there is a nested structure. The object to be returned is CategoryTreeDto.
This service will generate the attributes and their values used in the category tree of the sales channel. The DataClass used for creating attributes is CategoryAttributeDto.