Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update institutions table, and dao's institution type fields #68

Closed
lchen-2101 opened this issue Dec 27, 2023 · 1 comment · Fixed by #75
Closed

Update institutions table, and dao's institution type fields #68

lchen-2101 opened this issue Dec 27, 2023 · 1 comment · Fixed by #75
Assignees
Labels
backend backend development

Comments

@lchen-2101
Copy link
Collaborator

Currently the institution type is treated as a single value within the institutions model; from prior discussions, an institution can be multiple institution types for SBL; I believe HMDA is still a single value, @Kibrael @nongarak? We need to create a relational mapping table between institution and institution_type; and update the models(dao, and dto) to reflect this.

@lchen-2101 lchen-2101 added the backend backend development label Dec 27, 2023
@nongarak
Copy link

AFAIK, HMDA institution type is a derived field with a single value, not actually something submitted to us by the FI. I think we get it with a combination of federal regulator and NIC data.

In SBL, we are asking institutions what their type is, and giving them up to ~15 options to choose from, as many as they would like. Some of these are mutually exclusive practically speaking, but I don't think we'll enforce that in this first year (i.e. you can't be both a credit union and a bank).

@jcadam14 jcadam14 self-assigned this Dec 28, 2023
@jcadam14 jcadam14 linked a pull request Dec 29, 2023 that will close this issue
jcadam14 added a commit that referenced this issue Jan 9, 2024
Closes #68 

Changed the FI DTO to have sbl_institution_type_ids (instead of id) and
use a list
Changed the FI DAO to have sbl_institution_type_ids and
sbl_institution_types, both of which are now lists
Changed the FI DAO sbl_institution_type_ids to be an AssociationProxy
(view) based on the sbl_institution_types
Created an fi_to_type_mapping table that holds the relationship between
FI sbl_institution_types and the slb_institution_type table entries
Updated the institution_repo fi upsert function to look for incoming DTO
sbl_institution_type_ids, and retrieve the corresponding
SBLInstitutionTypeDao entries. They are then associated with the fi_data
before being inserted/updated (which populates the new mapping table)
Updated the pytests to work with this new concept of lists, especially
the test_add_institution repo test.

Will write a new story for the sbl-project repo once these chanegs are
approved and merged in to update the mock_data json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend backend development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants