CDCgov / prime-simplereport

SimpleReport is a fast, free, and easy way for COVID-19 testing facilities to report results to public health departments.
https://simplereport.gov
Creative Commons Zero v1.0 Universal
55 stars 58 forks source link

Persist role updates and add audit columns to ApiUserRole and ApiUserFacility #7828

Closed mehansen closed 1 week ago

mehansen commented 2 weeks ago

BACKEND PULL REQUEST

Related Issue

resolves #7597

Changes Proposed

Additional Information

if there's a cleaner way to do this in JPA, really interested to pair on it! it seems like you have to explicitly instantiate the ApiUserRole and ApiUserFacility instances in order to populate the additional audit columns

I decided to use the OrganizationRole enum for the role on ApiUserRole, even though it's not a perfect match with the DB constraints on that column (DB enum doesn't include NO_ACCESS). I'm hopeful they will be a match in the future when we finish the migration because we can delete the concept of NO_ACCESS as a role once we move off of Okta

Testing

deployed to dev4 options for testing:

fzhao99 commented 1 week ago

left a couple questions / suggestions for you to look at! excited to get this in :)

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
95.6% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud