Skip to content

refactor: remove households and onboarding - #647

Merged
DigiBanks99 merged 6 commits into
mainfrom
refactor/646-remove-households-onboarding
Nov 15, 2026
Merged

DigiBanks99 merged 6 commits into
mainfrom
refactor/646-remove-households-onboarding

Conversation

@DigiBanks99

Copy link
Copy Markdown
Owner

Summary

Menlo runs one household, so this removes the Household aggregate, HouseholdId, the onboarding flow and the /api/households endpoints. Budgets are unique per year and shared by every member. An endpoint filter on the /api group makes sure each signed-in caller has a User record, provisioning one from the claims, or returning 403 USER_NOT_PROVISIONED when the claims can't make one.

Before merging: take a manual pg_dump of prod. The migration deletes budgets, budget categories, budget items, canonical categories and onboarding states, then drops the household columns and tables. Users are kept. Down recreates empty tables only.

Acceptance criteria

  • No HouseholdId in the domain, schema or API (only migration history and UI copy mention "household")
  • A new member signs in and lands in the app with a User record and no onboarding step (OIDC events test, GET /auth/user has no onboarding field)
  • A returning member lands in the app (provisioning returns the existing user)
  • A caller whose User row is missing can still use /api and the row is created, including two concurrent first calls
  • Two members see the same budgets and categories
  • No onboarding or household route, endpoint, guard or policy remains (GET /api/households returns 404)
  • Migration keeps every user and drops household-scoped rows (migration test: previous migration, seed, upgrade)
  • GLOSSARY.md defines household and household member; auth, persistence, budget, testing and architecture docs updated
  • Prod upgrade against real data: not verifiable here
  • Playwright e2e (e2e/home-landing.spec.ts) was added but not run here

Verification

  • dotnet test: all pass. dotnet format is clean.
  • pnpm lint and pnpm test pass; docs link check passes.
  • API coverage script: every changed file with executable lines is at or above 70%. It lists deleted files and files with no executable lines (constants, source-generated LoggerMessages.cs) as MISSING.

Notes

  • Includes a Windows-regenerated Menlo.AppHost/packages.lock.json and a dotnet format reformat of the AddOnboardingState migration, committed as-is on request. Worth a look before merge, since the lock file changed linux-x64 entries to win-x64.
  • Each /api call now does one extra user lookup (accepted in the spec).

Closes #646
Closes #627

🤖 Generated with Claude Code

https://claude.ai/code/session_01KaJ6skre16twz7vgrM6xTH

DigiBanks99 and others added 4 commits November 15, 2026 13:53
Menlo runs one household, so the Household aggregate, HouseholdId,
the onboarding context and the /api/households endpoints are gone.
Budgets are now unique per year and shared by every member.

User provisioning moves to a Users namespace, returns a Result and
survives concurrent first requests. An endpoint filter on the /api
group provisions a missing User from the claims, or returns 403
USER_NOT_PROVISIONED when the claims cannot make one.

One migration deletes household-scoped rows, then drops the
household columns and the households and onboarding tables. Users
are kept. Back up prod before deploying.

Includes the lock file and migration reformat from dotnet format.

Implements #646
Closes #627

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaJ6skre16twz7vgrM6xTH
Sign-in now goes straight to the app. The onboarding page, route,
guard and service, the household API service and the householdId
and onboarding fields are removed, so /onboarding 404s like any
unknown route. An e2e test checks a signed-in member lands on home.

Implements #646

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaJ6skre16twz7vgrM6xTH
Adds household and household member to the glossary, folds user
provisioning and GET /auth/user into the authentication reference,
and removes the onboarding API reference. Updates the budget,
persistence, testing and architecture docs for budgets shared per
year and the /api user-record rule.

Implements #646

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaJ6skre16twz7vgrM6xTH
Removing the household check split a combined condition, which left
the delete and update category handlers just under the 70% line
coverage guardrail. These tests cover the not-found paths.

Relates to #646

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaJ6skre16twz7vgrM6xTH
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

DigiBanks99 and others added 2 commits November 15, 2026 14:09
The API coverage baseline reported LoggerMessages.cs as missing,
because source-generated partial methods have no executable lines
in the report. The check skips files marked
[ExcludeFromCodeCoverage].

Relates to #646

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaJ6skre16twz7vgrM6xTH
Adds unit tests for the /api user-record filter: no external id,
blank email, provisioning returning an error, a database failure
that must surface as a 500, and the email as display name fallback.
Also tests that sign-in throws when the claims cannot make a user.

Relates to #646

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaJ6skre16twz7vgrM6xTH
@DigiBanks99
DigiBanks99 merged commit 5470479 into main Nov 15, 2026
13 checks passed
@DigiBanks99
DigiBanks99 deleted the refactor/646-remove-households-onboarding branch November 15, 2026 12:18
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.

Spec: Remove households and onboarding Decide whether the API enforces onboarding

1 participant