Skip to content

Add endpoint for creating a policy acceptance for a specific user#1197

Open
dati18 wants to merge 3 commits into
mainfrom
policy-accept-user
Open

Add endpoint for creating a policy acceptance for a specific user#1197
dati18 wants to merge 3 commits into
mainfrom
policy-accept-user

Conversation

@dati18

@dati18 dati18 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add authenticated endpoint to record policy acceptances for the current user, with strict validation and all-or-nothing behavior for invalid policy IDs.

Behavior

  • Uses authenticated user from session context (no user_id in payload)
  • Ignores already-accepted policies (idempotent writes via firstOrCreate)
  • If any provided policy ID does not exist, returns 400 with missing_policy_ids
  • No acceptances are created when invalid policy IDs are present
  • Returns 422 for invalid payload (missing policy_ids, non-array, non-integer items)

Bug: T431674

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant