How do I get the Date of Birth for a user?
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:
```
if self.wedge_address_configs.get('dob_location',None) == 'UserDOB':
user_obj = User(self.logger, self.hq_credentials)
user_data = await user_obj.get(user_id=self.online_user.user_id)
if len(user_data) > 0:
dob = user_data[0].DOB
else:
data_obj = UserData(self.logger, self.hq_credentials)
user_data = await data_obj.get(user_id=self.online_user.user_id, short_name='DateOfBirth')
if len(user_data) > 0:
dob = user_data[0].GTDataValue
```
How do I get the Date of Birth (DOB) for a user?
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:
```
if self.wedge_address_configs.get('dob_location',None) == 'UserDOB':
user_obj = User(self.logger, self.hq_credentials)
user_data = await user_obj.get(user_id=self.online_user.user_id)
if len(user_data) > 0:
dob = user_data[0].DOB
else:
data_obj = UserData(self.logger, self.hq_credentials)
user_data = await data_obj.get(user_id=self.online_user.user_id, short_name='DateOfBirth')
if len(user_data) > 0:
dob = user_data[0].GTDataValue
```