示例#1
0
 def getUserInitializedInTimeline(timelineDB):
     query = "select count(*) from user_initialization_history"
     if constant.config['os'] == 'windows':
         result = dbHelper.queryAPITester(
             query, timelineDB, constant.config['apiTesterDB']['timeline'])
     else:
         result = dbHelper.query(query, timelineDB,
                                 constant.config['TIMELINE_DB_MYSQL'][0])
     return result[0][0]
示例#2
0
    def getCapPocinfo(self):
        query = "SELECT admin_user_roles.admin_user_id from admin_user_roles  INNER JOIN org_roles ON admin_user_roles.org_id = org_roles.org_id AND org_roles.id=admin_user_roles.role_id  WHERE role_name = 'CAP_POC' and admin_user_roles.org_id = {}".format(
            constant.config['orgId'])
        for port in constant.config['INTOUCH_DB_MYSQL_MASTER']:
            result = dbHelper.query(query, 'masters', port)
            if len(result) != 0: break

        for eachCapPoc in result:
            self.pocCapMeta.update({eachCapPoc[0]: {'userId': eachCapPoc[0]}})
示例#3
0
 def getCurrentMilestoneContext(timelineDB, milestoneId='2'):
     query = "select user_id from current_milestone_contexts where milestone_id ={} and status = 'ERROR';".format(
         milestoneId)
     if constant.config['os'] == 'windows':
         result = dbHelper.queryAPITester(
             query, timelineDB, constant.config['apiTesterDB']['timeline'])
     else:
         result = dbHelper.query(query, timelineDB,
                                 constant.config['TIMELINE_DB_MYSQL'][0])
     return result
示例#4
0
 def getActivityContextHistory(timelineDB, milestoneId='2'):
     query = "select user_id,status,status_context from activity_context_history where milestone_id = {}".format(
         milestoneId)
     if constant.config['os'] == 'windows':
         result = dbHelper.queryAPITester(
             query, timelineDB, constant.config['apiTesterDB']['timeline'])
     else:
         result = dbHelper.query(query, timelineDB,
                                 constant.config['TIMELINE_DB_MYSQL'][0])
     return result
示例#5
0
 def getCapPocDetails(self):
     for eachPoc in self.pocCapMeta:
         query = "SELECT first_name,last_name,email,mobile,mobile_validated,email_validated  FROM `admin_users` WHERE `id` = {}".format(
             eachPoc)
         for port in constant.config['INTOUCH_DB_MYSQL_MASTER']:
             result = dbHelper.query(query, 'masters', port)
             if len(result) != 0: break
         if len(result) != 0:
             result = result[0]
             self.pocCapMeta[eachPoc].update({
                 'firstName': result[0],
                 'lastName': result[1],
                 'email': result[2],
                 'mobile': result[3],
                 'validMobile': bool(result[4]),
                 'validEmail': bool(result[5])
             })
         else:
             Logger.log('No CapPoc users Found')
示例#6
0
 def getOrgStatus(self):
     query = 'select status from  campaign_v2_org_status where org_id = {} '.format(
         constant.config['orgId'])
     result = dbHelper.query(query, 'masters',constant.config['INTOUCH_META_DB_MYSQL'][0])
     return result
示例#7
0
 def markCampaignAsInactive(org_config_id):
     query = "update sharding_config set status = 'INACTIVE' where org_id ={} and org_config_id = {}".format(
         constant.config['orgId'], org_config_id)
     dbHelper.query(query, 'temporal_engine_bootstrap',
                    constant.config['TIMELINE_DB_MYSQL'][0])
示例#8
0
 def getDeepLinkvalue(self, accountId, keyId):
     query = "select value from channel_config_key_values where account_id = {} and key_id = {}".format(
         accountId, keyId)
     port = constant.config['INTOUCH_META_DB_MYSQL'][0]
     return json.loads(dbHelper.query(query, 'masters', port)[0][0])
示例#9
0
 def getKeyOfDeepLink(self):
     query = "select id from  channel_config_keys where label = 'Deep Link'"
     port = constant.config['INTOUCH_META_DB_MYSQL'][0]
     key = dbHelper.query(query, 'masters', port)[0][0]
     return key
示例#10
0
 def getAccountIdFromMeta(self, accountId):
     query = "select id from org_channel_accounts where org_id = {} and account_name = '{}'".format(
         constant.config['orgId'], accountId)
     port = constant.config['INTOUCH_META_DB_MYSQL'][0]
     accountId = dbHelper.query(query, 'masters', port)[0][0]
     return accountId