예제 #1
0
 def handle(self, cud_message_dict: {}):
     cud_message = CUDMessage(from_string_to_enum(cud_message_dict["message_type"]), #MessageType
                              from_string_to_enum(cud_message_dict["message_collection"]), #MessageCollection
                              cud_message_dict["message_body"])
     if cud_message.message_collection == MessageCollection.PRODUCT:
         self.handle_product_cud(cud_message)
     if cud_message.message_collection == MessageCollection.CATEGORY:
         self.handle_category_cud(cud_message)
예제 #2
0
def product_insert(mapper, connection, target):
    changeMessagePublisher.publish_task(
        CUDMessage(MessageType.CREATE, MessageCollection.PRODUCT,
                   target.serialize()).serialize(),
        only_for_catalog=True)
예제 #3
0
def product_update(mapper, connection, target):
    changeMessagePublisher.publish_task(
        CUDMessage(MessageType.UPDATE, MessageCollection.PRODUCT,
                   target.serialize()).serialize(),
        only_for_catalog=False)
예제 #4
0
def category_delete(mapper, connection, target):
    changeMessagePublisher.publish_task(
        CUDMessage(MessageType.DELETE, MessageCollection.CATEGORY,
                   target.serialize()).serialize(),
        only_for_catalog=True)