DOB is a relatively new field for us as we've not historically need it. For Financial Instutitions, they can call the core and retrieve it there. But for partners who want their integration to work with lots of financial instutitions, the data needs to come from the Q2 DB.
We have started to bring in that data for some FIs. Note that you will still need to support DOB not being present at all since that is still very common.
Introduce a DB Config so we can switch between the two possible locations.
Then there are two places that should be checked for DOB:
async def get_dob(self):
dob_location = self.vendor_configs.get('DOB_Location')
if dob_location and dob_location == 'User.DOB':
user_svc = User(self.logger, hq_credentials=self.hq_credentials)
db_users = await user_svc.get(self.online_user.user_id)
if len(db_users) > 0 and getattr(db_users[0], 'DOB', False):
return db_users[0].DOB.text
else:
return ''
elif dob_location and dob_location.startswith('UserData'):
user_data_svc = UserData(self.logger, hq_credentials=self.hq_credentials)
user_data = await user_data_svc.get(self.online_user.user_id,dob_location.split('.')[1])
if len(user_data) > 0:
return user_data[0].GTDataValue.text
else:
return ''
else:
return ''