PolicyEngine / policyengine-api

PolicyEngine's REST API for computing policy impacts.
GNU Affero General Public License v3.0
10 stars 21 forks source link

user_profile POST requests now return complete user object #1426

Closed anth-volk closed 5 months ago

anth-volk commented 5 months ago

Fixes #1425. Fixes #1427.

First, this PR changes the timestamp values from the user_profiles and user_policies tables to BIGINT types, since they will be consumed by the front end in the context of JavaScript's Date.now() function, which returns the number of seconds since the epoch. This also prevents the numerous Python-JS-SQLite-MySQL conflicts that have emerged in the context of the DATETIME type (Python has various different formats, JS's formats are all based on epoch time, SQLite has no native handling and converts everything to TEXT using specialized handlers, and MySQL requires very specific formatting for successful insertion).

Additionally, instead of merely returning the created user_id value, this PR enables the user_profile POST endpoint to return the entire user object, other than the auth0_id.

anth-volk commented 5 months ago

Note: For these tests to pass, the prod db will have to be updated to use the new BIGINT types

anth-volk commented 5 months ago

Tables have been updated