chore(crewing): expand abbreviated rank names (+ seed ranks to prod) #111

Merged
shad0w merged 1 commit from feat/expand-rank-names into master 2026-06-24 00:45:10 +00:00
Owner

Context

Seeded the crewing ranks (org hierarchy from wiki Crewing-Data-Model §2) into prod's Rank table — which was empty (crewing's UI is flag-gated off, but the reference data can still live in the table). 19 ranks loaded with the wiki parent/child hierarchy, with abbreviations expanded per request.

The canonical seed (prisma/seed-ranks.ts) upserts ranks by code and overwrites name from prisma/rank-data.ts. So expanding the names only in prod would be reverted by any future seed. This PR expands them in the source of truth too:

  • PM → Project Manager
  • Assistant PM → Assistant Project Manager
  • Sr. Dredge Operator → Senior Dredge Operator
  • Jr. Dredge Operator → Junior Dredge Operator
  • Sr. Fabricator → Senior Fabricator

(The other names were already expanded: Pipeline Assistant, Engine Room Operator, Fabricator / Welder, etc.) Hierarchy, codes, category, isSeafarer, and grantsLogin are unchanged.

What I did on prod (out-of-band data load)

  • Generated the insert SQL, dry-ran it on an empty local Rank table (mirrors prod): 19 ranks, exact wiki hierarchy, expanded names, grantsLogin only on the three management ranks (Project Manager / Assistant Project Manager / Site In-charge), idempotent (re-run adds nothing).
  • Confirmed db:seed stays compatible (upsert by code, count stays 19 — no duplicates).
  • Applied transactionally to prod → Rank now has the 19 ranks. Document requirements (RankDocRequirement) were not loaded — you asked for ranks only.

tsc clean; no tests/code referenced the old abbreviated names.

🤖 Generated with Claude Code

## Context Seeded the crewing **ranks** (org hierarchy from wiki `Crewing-Data-Model` §2) into **prod's `Rank` table** — which was empty (crewing's UI is flag-gated off, but the reference data can still live in the table). 19 ranks loaded with the wiki parent/child hierarchy, with abbreviations **expanded** per request. The canonical seed (`prisma/seed-ranks.ts`) **upserts ranks by `code` and overwrites `name`** from `prisma/rank-data.ts`. So expanding the names only in prod would be reverted by any future seed. This PR expands them in the source of truth too: - `PM` → **Project Manager** - `Assistant PM` → **Assistant Project Manager** - `Sr. Dredge Operator` → **Senior Dredge Operator** - `Jr. Dredge Operator` → **Junior Dredge Operator** - `Sr. Fabricator` → **Senior Fabricator** (The other names were already expanded: Pipeline Assistant, Engine Room Operator, Fabricator / Welder, etc.) Hierarchy, codes, `category`, `isSeafarer`, and `grantsLogin` are unchanged. ## What I did on prod (out-of-band data load) - Generated the insert SQL, **dry-ran it on an empty local `Rank` table** (mirrors prod): 19 ranks, exact wiki hierarchy, expanded names, `grantsLogin` only on the three management ranks (Project Manager / Assistant Project Manager / Site In-charge), idempotent (re-run adds nothing). - Confirmed `db:seed` stays compatible (upsert by `code`, count stays 19 — no duplicates). - Applied transactionally to prod → `Rank` now has the 19 ranks. Document requirements (`RankDocRequirement`) were **not** loaded — you asked for ranks only. `tsc` clean; no tests/code referenced the old abbreviated names. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
shad0w added 1 commit 2026-06-24 00:09:33 +00:00
chore(crewing): expand abbreviated rank names in rank-data
All checks were successful
PR checks / checks (pull_request) Successful in 44s
PR checks / integration (pull_request) Successful in 31s
d25a600566
Fully expand the five abbreviated rank names so the canonical seed (which
upserts ranks by code and overwrites name) matches the names loaded into prod:
- PM → Project Manager
- Assistant PM → Assistant Project Manager
- Sr. Dredge Operator → Senior Dredge Operator
- Jr. Dredge Operator → Junior Dredge Operator
- Sr. Fabricator → Senior Fabricator

Hierarchy, codes, category, isSeafarer and grantsLogin are unchanged. (The
prod Rank table was seeded with these 19 ranks out-of-band; this keeps the
source of truth in sync so a future seed won't revert the names.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shad0w merged commit 502411afe6 into master 2026-06-24 00:45:10 +00:00
Sign in to join this conversation.
No description provided.