from Utils.global_variate import Global from Utils.mockData_handler import data_handler from Utils.sql_handler import SqlHandler from Utils.config_handler import base_config class orderflowData(Global): orderflow_db = SqlHandler(address=base_config.get_value('mysql', 'address'), port=int(base_config.get_value('mysql', 'port')), account=base_config.get_value('mysql', 'account'), password=base_config.get_value('mysql', 'password')) orderflow_name = 'autotest_orderflow%s'%data_handler.random_id() orderflow_type = 'Triggers' orderflow_status = 1 event_id = "cq1ssgf73uvh93lop2mg" orderflow_describe = "autotest_orderflow_describe%s"%data_handler.random_id() create_orderflow_data = {"logicIf": { "ruleCond": { "condType": 2, "robId": "cq1ssgf73uvh93lop2mg", "objName": "ChatBotOrderEventReturn", "objType": "bool", "compOperatorType": "eq", "compOperatorValue": "true", "nodeFlag": "Triggers", "showType": "", "showKind": "", "extendedAttributes": "{\"triggerBtnName\":\"Return\",\"title\":\"Order return\",\"x\":212,\"y\":212,\"nodeId\":\"Triggers_5533975931326896\"}" }, "result": [ { "childRuleObject": None, "extendedAttributes": "{\"showType\":\"next\",\"nodeId\":\"Actions_8758719561772293\",\"title\":\"Reason of cancellatiion\",\"triggerBtnName\":\"Submit\",\"actionType\":\"ChatBotOrderOperationReason\",\"x\":686,\"y\":212}", "inner": [ { "robId": "cjhg9iuein687habss50", "objName": "ChatBotMulReply", "objType": "string", "objValue": "{\"contentList\":\"Just in case we get disconnected, please provide your name and email address, thanks.\",\"attachmentList\":[]}", "showType": "mulInput", "showKind": "chatBotReply", "extendedAttributes": "{\"title\":\"Reason of cancellatiion\",\"nodeId\":\"Actions_8758719561772293\",\"triggerBtnName\":\"Submit\",\"actionType\":\"ChatBotOrderOperationReason\",\"x\":686,\"y\":212}" }, { "robId": "cq19pg773uvprfk5v68g", "objName": "ChatBotOrderOperationReason", "objType": "string", "objValue": "[{\"key\":\"CUSTOMER\",\"value\":\"The customer wanted to cancel the order.\",\"checked\":false},{\"key\":\"DECLINED\",\"value\":\"Payment was declined.\",\"checked\":false},{\"key\":\"FRAUD\",\"value\":\"The order was fraudulent.\",\"checked\":false},{\"key\":\"INVENTORY\",\"value\":\"There was insufficient inventory.\",\"checked\":false},{\"key\":\"OTHER\",\"value\":\"The order was canceled for an unlisted reason.\",\"checked\":false},{\"key\":\"STAFF\",\"value\":\"Staff made an error.\",\"checked\":false}]", "showType": "", "showKind": "", "extendedAttributes": "{\"title\":\"Reason of cancellatiion\",\"nodeId\":\"Actions_8758719561772293\",\"triggerBtnName\":\"Submit\",\"actionType\":\"ChatBotOrderOperationReason\",\"x\":686,\"y\":212}" } ], "resultType": 2, "next": { "childRuleObject": None, "extendedAttributes": "{\"showType\":\"next\",\"nodeId\":\"Actions_42083044729569607\",\"title\":\"Message content\",\"x\":1160,\"y\":212}", "inner": [ { "robId": "cjhg9iuein687habss50", "objName": "ChatBotMulReply", "objType": "string", "objValue": "{\"contentList\":\"Hi👋~ Please check with our return policy and make sure you are eligible for the return.\\n\",\"attachmentList\":[],\"productList\":[],\"faqList\":[]}", "showType": "mulInput", "showKind": "chatBotReply", "extendedAttributes": "{\"title\":\"Message content\",\"nodeId\":\"Actions_42083044729569607\",\"x\":1160,\"y\":212}", "childRuleObject": None } ], "resultType": 2, "next": None } } ] }} create_orderflow_data2 ={"logicIf": { "ruleCond": { "compOperatorType": "eq", "compOperatorValue": "", "condType": 1, "extendedAttributes": "{\"triggerBtnName\":\"Return\",\"title\":\"Order return\",\"x\":212,\"y\":212,\"nodeId\":\"Triggers_5533975931326896\"}", "logicType": "", "next": None, "objName": "", "objType": "", "robId": "", "inner": { "condType": 2, "robId": "cq1ssgf73uvh93lop2mg", "objName": "ChatBotOrderEventReturn", "objType": "bool", "logicType": "and", "compOperatorType": "eq", "compOperatorValue": "true", "nodeFlag": "Triggers", "showType": "", "showKind": "", "extendedAttributes": "{\"triggerBtnName\":\"Return\",\"title\":\"Order return\",\"x\":212,\"y\":212,\"nodeId\":\"Triggers_5533975931326896\"}", "next": { "compOperatorType": "checkMultipleShopHost", "compOperatorValue": "[\"et-tyl-06604.myshopify.com\"]", "condType": 2, "extendedAttributes": "{}", "inner": None, "next": None, "logicType": "and", "objName": "ChatBotMultipleShopHost", "objType": "string", "robId": "cq19d9v73uvvu9p8ottg" } } }, "result": [ { "robId": "cjhg9iuein687habss50", "objName": "ChatBotMulReply", "objType": "string", "objValue": "{\"contentList\":\"Was this helpful?\",\"attachmentList\":[]}", "showType": "mulInput", "showKind": "chatBotReply", "extendedAttributes": "{\"title\":\"Ask for feedback\",\"nodeId\":\"Actions_8945405052216719\",\"x\":674.9265927977838,\"y\":77.71883656509698}" }, { "robId": "cjis7p6ein6e3lp2v0m0", "objName": "ChildRule", "objType": "string", "showType": "", "showKind": "", "objId": "Actions_46850976565688953", "childRule": 1, "objValue": "{\"ruleName\":\"Yes, Thanks\"}", "childRuleObject": None, "extendedAttributes": "{\"title\":\"Ask for feedback\",\"nodeId\":\"Actions_8945405052216719\",\"x\":674.9265927977838,\"y\":77.71883656509698}" }, { "robId": "cjis7p6ein6e3lp2v0m0", "objName": "ChildRule", "objType": "string", "showType": "", "showKind": "", "objId": "Actions_879089445170381", "childRule": 1, "objValue": "{\"ruleName\":\"No, I need more help\"}", "childRuleObject": None, "extendedAttributes": "{\"title\":\"Ask for feedback\",\"nodeId\":\"Actions_8945405052216719\",\"x\":674.9265927977838,\"y\":77.71883656509698}" } ] }}