feat(berths,seed): polish detail display + prune ports to Port Nimara + Amador

Berth detail (src/components/berths/berth-tabs.tsx):
- Numeric display polish, exposed by the new NocoDB-sourced seed:
  - Power capacity now renders with kW unit (e.g. "330 kW")
  - Voltage now renders with V unit (e.g. "480 V")
  - All metric/imperial values rounded to <= 2 decimals
    (was: "62.999112 m" -> now: "62.99 m")
  - Nominal Boat Size shows full ft + m pair (was: ft only)

Seed ports (src/lib/db/seed.ts):
- Drop Marina Azzurra and Harbor Royale; install now seeds only:
  - Port Nimara  (the real install)
  - Port Amador  (secondary, for multi-tenant isolation tests / Panama
                  scaffolding)
- Existing dev DBs are not touched; this only affects fresh `pnpm db:seed`
  runs. Users wanting to migrate should drop existing rows in the obsolete
  ports manually before re-seeding.

Verification:
- lint clean, tsc unchanged from baseline (36 pre-existing errors), 858/858
  vitest passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt Ciaccio
2026-05-03 15:59:36 +02:00
parent c7ab816c99
commit 21868ee5fc
2 changed files with 51 additions and 23 deletions

View File

@@ -2,16 +2,16 @@
* Seed script for Port Nimara CRM.
*
* Top-level orchestrator:
* 1. Create 3 ports (idempotent):
* - Port Nimara
* - Marina Azzurra
* - Harbor Royale
* 1. Create the operational ports (idempotent):
* - Port Nimara (primary install — the real marina)
* - Port Amador (secondary, kept for multi-tenant isolation tests
* and as scaffolding for a future Panama install)
* 2. Create 5 system roles with full permission maps
* 3. Create the super admin user profile placeholder (matt@portnimara.com)
* 4. For each port, call `seedPortData(portId, portSlug)` from seed-data.ts
* to produce the realistic multi-cardinality fixture
* (berths, clients, companies, yachts, memberships, interests,
* reservations, ownership-transfer history).
* (117 berths from the NocoDB snapshot, plus clients, companies, yachts,
* memberships, interests, reservations, ownership-transfer history).
* 5. Print a summary.
*
* Run with: pnpm db:seed
@@ -413,19 +413,15 @@ const PORT_DEFINITIONS: Array<{
defaultCurrency: 'USD',
timezone: 'America/Anguilla',
},
// Second port kept for multi-tenant isolation tests (cross-port scoping,
// permission boundaries). Drop or rename if the production install is
// single-port.
{
name: 'Marina Azzurra',
slug: 'marina-azzurra',
primaryColor: '#2E86AB',
defaultCurrency: 'EUR',
timezone: 'Europe/Rome',
},
{
name: 'Harbor Royale',
slug: 'harbor-royale',
primaryColor: '#8B1E3F',
defaultCurrency: 'GBP',
timezone: 'Europe/London',
name: 'Port Amador',
slug: 'port-amador',
primaryColor: '#D97706',
defaultCurrency: 'USD',
timezone: 'America/Panama',
},
];