PolicyEngine / policyengine-api

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

Ensure unique user policies #1406

Closed anth-volk closed 4 months ago

anth-volk commented 4 months ago

Fixes #1404. This PR ensures that any time a user policy is emitted to the database, a new record is only created if unique (barring the "type" field, which it does not check at the moment). Below is a video demonstrating the behavior when records are emitted to the testing database with Postman. This also adds a test to ensure proper behavior.

https://github.com/PolicyEngine/policyengine-api/assets/14987227/7aaf74cc-0207-4826-94c1-ce7161cafb24