Skip to main content

Product Service

The Product Service handles the actions of creating, updating, and deleting products. To perform these actions, it relies on integrations with OmnitronIntegration and ChannelIntegration.

class ProductService (object)

Insert Products

(self, add_mapped=True, add_stock=True, add_price=True, add_categories=True, is_sync=True, is_success_log=True)

This function first connects to Akinon Omnitron and retrieves the products that can be added to the sales channel. Based on the provided parameters, it fetches product mapping information for add_mapped, stock information for add_stock, price information for add_price, and category information for add_categories from Akinon to send to the sales channel. Subsequently, these details are transmitted to the Sales Channel via the send_inserted_products command. The value of the is_sync parameter determines whether the communication with the sales channel will be synchronous or asynchronous. If it is asynchronous, the necessary records are created through batch_service. If an error occurs, an error_report is generated in the Sales Channel Logs.

Update Products

(self, add_mapped=True, add_stock=True, add_price=True, add_categories=True, is_sync=True, is_success_log=True)

This function first connects to Akinon Omnitron and retrieves the products that can be updated in the sales channel. Based on the provided parameters, it fetches product mapping information for add_mapped, stock information for add_stock, price information for add_price, and category information for add_categories from Akinon to send to the sales channel. Subsequently, these details are transmitted to the Sales Channel via the send_updated_products command. The value of the is_sync parameter determines whether the communication with the sales channel will be synchronous or asynchronous. If it is asynchronous, the necessary records are created through batch_service. If an error occurs, an error_report is generated in the Sales Channel Logs.

Delete Products

(self, is_sync=True, is_content_object=True, is_success_log=True)

This function first connects to Akinon Omnitron and retrieves the products that can be removed from the sales channel. Subsequently, these details are transmitted to the Sales Channel via the send_deleted_products command. The value of the is_sync parameter determines whether the communication with the sales channel will be synchronous or asynchronous. If it is asynchronous, the necessary records are created through batch_service. If an error occurs, an error_report is generated in the Sales Channel Logs.

Get Delete Product Batch Requests

(self, is_success_log=True)

This function first connects to Akinon Omnitron and retrieves the batch_requests that have been sent to delete products from the sales channel and are still processing. It then queries the Sales Channel using the check_deleted_products command. If an error occurs, an error_report is generated in the Sales Channel Logs. Finally, it completes the flow by sending the response received from the sales channel back to Akinon Omnitron.

Get Product Batch Requests

(self, is_success_log=True)

This function first connects to Akinon Omnitron and retrieves the batch_requests that have been sent to create or update products in the sales channel and are still processing. It then queries the Sales Channel using the check_products command. If an error occurs, an error_report is generated in the Sales Channel Logs. Finally, it completes the flow by sending the response received from the sales channel back to Akinon Omnitron.