Example #1
0
def insert_borrower_row(self, verify_pid, borrower_id):
    with self.app.app_context():
        remove_verify_match_row(self, 999)
        remove_borrower_row(self, 999)
        borrower = Borrower()
        borrower.id = 999
        borrower.forename = 'some'
        borrower.middlename = 'nice'
        borrower.surname = 'guy'
        borrower.dob = 'a date'
        borrower.gender = 'a gender'
        borrower.phonenumber = '07777777777'
        borrower.address = 'an address'
        borrower.token = 'a token'
        borrower.deed_token = 'a deed token'
        borrower.esec_user_name = 'an esec user name'
        borrower.save()
Example #2
0
    def saveBorrower(self, borrower, deed_token):
        borrowerModel = Borrower()
        borrowerModel.forename = borrower['forename']

        if 'middle_name' in borrower:
            borrowerModel.middlename = borrower['middle_name']

        borrowerModel.surname = borrower['surname']
        borrowerModel.dob = borrower['dob']
        borrowerModel.deed_token = deed_token

        if 'gender' in borrower:
            borrowerModel.gender = borrower['gender']

        borrowerModel.phonenumber = borrower['phone_number']
        borrowerModel.address = borrower['address']

        borrowerModel.token = borrowerModel.generate_token()

        borrowerModel.save()

        return borrowerModel