Skip to content

Comments

Add user-policy associations and Alembic migrations#71

Merged
anth-volk merged 15 commits intoapp-v2-migrationfrom
feat/user-policy
Feb 17, 2026
Merged

Add user-policy associations and Alembic migrations#71
anth-volk merged 15 commits intoapp-v2-migrationfrom
feat/user-policy

Conversation

@SakshiKekre
Copy link

@SakshiKekre SakshiKekre commented Jan 12, 2026

This PR adds user-policy associations and Alembic migration infrastructure.

User-Policy Associations

  • Adds UserPolicy model to associate users with saved policies
  • Adds CRUD endpoints at /user-policies/
  • Adds 14 tests covering all endpoints

Endpoints

  • POST /user-policies/ - create association
  • GET /user-policies/?user_id=... - list by user (optional tax_benefit_model_id filter)
  • GET /user-policies/{id} - get by id
  • PATCH /user-policies/{id} - update label
  • DELETE /user-policies/{id} - delete association

Alembic Migration Infrastructure

Added Alembic for database migrations:

Archived old Supabase SQL migrations now handled by Alembic:

  • 20251229000000_add_parameter_values_indexes.sql
  • 20260103000000_add_poverty_inequality.sql
  • 20260111000000_add_aggregate_status.sql

Note: When Anthony's PR #77 merges, we'll need an Alembic merge migration to reconcile both branches.

@SakshiKekre SakshiKekre changed the title Add user-policy associations Add user-policy associations and Alembic migrations Feb 6, 2026
@SakshiKekre SakshiKekre marked this pull request as ready for review February 6, 2026 09:07
@SakshiKekre SakshiKekre changed the base branch from main to app-v2-migration February 7, 2026 00:14
anth-volk and others added 3 commits February 17, 2026 01:25
Move setup helpers (create_policy, create_user_policy) and constants
(US_COUNTRY_ID, UK_COUNTRY_ID) to test_fixtures/fixtures_user_policies.py.
Revert accidental supabase/.temp/cli-latest version change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add extra='forbid' to UserPolicyUpdate so Pydantic returns 422 if
clients send fields beyond 'label' (e.g. user_id, policy_id).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The fixtures were passing tax_benefit_model_version_id (a non-existent
field, silently ignored by SQLModel) instead of tax_benefit_model_id
(now required). Updated create_policy fixture and its 3 call sites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@anth-volk anth-volk merged commit 8a1195b into app-v2-migration Feb 17, 2026
1 check passed
@anth-volk anth-volk deleted the feat/user-policy branch February 17, 2026 00:47
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.

2 participants