Moved out of studio/TODO.md (see #6).
some contracts have show while others have get: one or the other
Problem
The single-record GET route path is inconsistent across contracts:
| Contract |
Path |
campaigns.ts:44 |
/show/{id} |
leads_labels.ts:14 |
/show/{id} |
projects.ts:11 |
/{id} |
leads_lists.ts:12 |
/{id} |
campaigns_sequences_versions.ts:47 |
/{id} |
The procedure is named get in all of them; only the URL differs.
The /show/ segment is not arbitrary — contract/campaigns.ts:42 documents why:
// the /show/ segment is required, otherwise {id} would overwrite all other
A bare /{id} under a prefix that also has sibling static segments (e.g. /campaigns/sequences, /campaigns/counters, /leads/lists, /leads/labels) swallows those siblings. So /show/{id} is needed exactly where a router shares its prefix with sub-routers, and unnecessary where it doesn't.
Decision needed
Pick one and apply it everywhere:
/show/{id} everywhere — uniform and immune to future sub-routers being added under any prefix, at the cost of a slightly unusual REST shape.
/{id} where it is safe, /show/{id} only where a prefix collision exists — more conventional REST, but the rule is subtle and easy to break later (adding /projects/templates would silently break /projects/{id}).
Recommendation: option 1, for predictability — but that is the call to make here.
Scope
All of packages/orpc/src/contract/*.ts single-record GET routes, the matching apps/api/src/modules/** controllers, and any dashboard query files under apps/dashboard/src/tanstack/query/** that hit them. Rebuild packages/orpc afterwards. Also worth documenting the final rule in CONTRIBUTING.md / CLAUDE.md so it stops drifting.
Moved out of
studio/TODO.md(see #6).Problem
The single-record
GETroute path is inconsistent across contracts:campaigns.ts:44/show/{id}leads_labels.ts:14/show/{id}projects.ts:11/{id}leads_lists.ts:12/{id}campaigns_sequences_versions.ts:47/{id}The procedure is named
getin all of them; only the URL differs.The
/show/segment is not arbitrary —contract/campaigns.ts:42documents why:// the /show/ segment is required, otherwise {id} would overwrite all otherA bare
/{id}under a prefix that also has sibling static segments (e.g./campaigns/sequences,/campaigns/counters,/leads/lists,/leads/labels) swallows those siblings. So/show/{id}is needed exactly where a router shares its prefix with sub-routers, and unnecessary where it doesn't.Decision needed
Pick one and apply it everywhere:
/show/{id}everywhere — uniform and immune to future sub-routers being added under any prefix, at the cost of a slightly unusual REST shape./{id}where it is safe,/show/{id}only where a prefix collision exists — more conventional REST, but the rule is subtle and easy to break later (adding/projects/templateswould silently break/projects/{id}).Recommendation: option 1, for predictability — but that is the call to make here.
Scope
All of
packages/orpc/src/contract/*.tssingle-record GET routes, the matchingapps/api/src/modules/**controllers, and any dashboard query files underapps/dashboard/src/tanstack/query/**that hit them. Rebuildpackages/orpcafterwards. Also worth documenting the final rule inCONTRIBUTING.md/CLAUDE.mdso it stops drifting.