def do(self, kwarg):

        db = Database(self.db_info)
        db.connect()
        command = SQLQUERIES['delete_application_required_documents'].format(kwarg['application_uuid'],
                             kwarg['applicant_uuid'])
        db.execute(command)
        db.close()
예제 #2
0
    def do(self, opportunity_uuid):

        db = Database(self.db_info)
        db.connect()
        command = SQLQUERIES['select_uploaded_documents'].format(
            opportunity_uuid)
        db.execute(command)
        self.result = db.get_result('all')
        db.close()
예제 #3
0
 def do(self, kwarg):
     db = Database(self.db_info)
     db.connect()
     command = SQLQUERIES['application_rules'].format(kwarg['application_uuid'], kwarg['applicant_uuid'])
     db.execute(command)
     rule = db.get_result('all')
     command = SQLQUERIES['select_uploaded_documents'].format(kwarg['application_uuid'], kwarg['applicant_uuid'])
     db.execute(command)
     result = db.get_result('all')
     evaluation_result = self.evaluate_rule(result, rule)
     db.close()
예제 #4
0
    def do(self, kwarg):

        db = Database(self.db_info)
        db.connect()
        command = SQLQUERIES['select_required_documents'].format(kwarg['lender_name'],
                            kwarg['employment_type'], kwarg['loan_type'])
        db.execute(command)
        self.result = db.get_result('all')

        data = [(kwarg['application_uuid'],
                 kwarg['applicant_uuid'], r['uuid'],
                 json.dumps(r['conditions']),
                 json.dumps(r['constraints'])) for r in self.result]
        command = SQLQUERIES['insert_required_documents']
        db.executemany(command, data)

        db.close()
예제 #5
0
    def do(self, kwarg):

        db = Database(self.db_info)
        db.connect()
        command = SQLQUERIES['select_lender_rule'].format(
            kwarg['lender_name'], kwarg['loan_type'], kwarg['employment_type'],
            kwarg['type'])
        db.execute(command)
        self.result = db.get_result('all')

        for row in self.result:
            command = SQLQUERIES['insert_application_reqdoc_rule'].format(
                kwarg['application_uuid'], kwarg['applicant_uuid'],
                row['rule'])
            db.execute(command, 'w')

        db.close()