Account routes: /accounts/{username} public profile; drop company_name#154
Merged
Conversation
- Rename the profile route /u/{username} -> /accounts/{username}, unifying the
account vocabulary (self at /account/, others at /accounts/{username}), mirroring
GitHub's /user + /users/{login} split.
- Return a trimmed PublicAccount (username, display name, created_at) for
cross-account lookups; email and account flags stay in the caller's own
/account/ view only. Access remains gated by a shared workspace (404 otherwise).
- Remove company_name entirely: column + constraint, model/query, request/response,
and the accounts constraint enum arm.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves the account-route inconsistency (
PATCH /account/vsGET /u/{username}/used two different nouns for one resource) and removes the unusedcompany_namefield.Account vocabulary
Researched GitHub's model (cited): it keeps two shapes — an identifier-less self route (
/user, resolved from the token, richer representation) and a named-other route (/users/{login}, public representation) — and never mutates a user via/users/{name}. The two shapes are intentional; only the noun should be unified./u/{username}/→/accounts/{username}/, so the account resource uses one noun:/account/(self) +/accounts/{username}/(others). No more/u/shorthand.PublicAccount(username, display name, created_at) instead of the full account — email and account flags (isAdmin/isSuspended/isActivated) are available only through the caller's own/account/view. This matches GitHub's public-vs-self representation split.Remove
company_nameDeleted the field end to end:
accountscolumn + length constraint + comment,schema.rs,Account/NewAccount/UpdateAccountmodels and thehas_companyhelper, theCompanyNameLengthMaxconstraint enum arm and its error mapping, the create/update normalization, and the request/response DTOs.Verification
check/clippy -D warnings/nightly fmt/rustdoc -D warnings/test(13 suites). Migrations reset+reapplied;schema.rsregenerated./account/returns the full self view (with email, no company);/accounts/{username}/returns the trimmed public view (no email/company/flags); old/u/{username}/→ 404; peer with no shared workspace → 404; unknown handle → 404. OpenAPI spec confirmed: 0companyName,/accounts/{username}/present,/u/{username}/gone.🤖 Generated with Claude Code