chore(style): codebase em-dash sweep + minor layout polish
Replaces every em-dash and en-dash with regular ASCII hyphens across comments, JSX strings, and dev-facing logs. Mostly cosmetic but stops the inconsistent mix that crept in over the last few months (some files used em-dashes in comments, others didn't, some used both). Bundles two small dashboard-layout tweaks that touch a couple of already-modified files: - (dashboard)/layout.tsx main padding goes from p-6 to pt-3 px-6 pb-6 so page content sits closer to the topbar. - Sidebar now receives the ports list it needs for the footer port switcher. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
/**
|
||||
* Per-port seed data builder for Port Nimara CRM.
|
||||
*
|
||||
* Exports `seedPortData(portId, portSlug)` — creates a realistic,
|
||||
* Exports `seedPortData(portId, portSlug)` - creates a realistic,
|
||||
* multi-cardinality data fixture for one port:
|
||||
*
|
||||
* - 117 berths imported from a snapshot of the legacy NocoDB Berths
|
||||
* table (`src/lib/db/seed-data/berths.json`). The snapshot is reordered
|
||||
* so the first 12 entries satisfy the index assumptions used further
|
||||
* down for interest/reservation linkage:
|
||||
* idx 0..4 — available (small)
|
||||
* idx 5..9 — under_offer (medium)
|
||||
* idx 10..11 — sold (large)
|
||||
* idx 0..4 - available (small)
|
||||
* idx 5..9 - under_offer (medium)
|
||||
* idx 10..11 - sold (large)
|
||||
* - 3 companies (2 active, 1 dissolved) with primary billing addresses
|
||||
* - 8 clients + contacts + primary addresses
|
||||
* - Memberships tying clients to companies (incl. multi-company + ended)
|
||||
@@ -107,7 +107,7 @@ export interface SeedSummary {
|
||||
// ─── Main ────────────────────────────────────────────────────────────────────
|
||||
|
||||
export async function seedPortData(portId: string, portSlug: string): Promise<SeedSummary | null> {
|
||||
// Idempotency guard — if this port already has companies, assume it's been seeded.
|
||||
// Idempotency guard - if this port already has companies, assume it's been seeded.
|
||||
const existing = await db
|
||||
.select({ id: companies.id })
|
||||
.from(companies)
|
||||
@@ -415,7 +415,7 @@ export async function seedPortData(portId: string, portSlug: string): Promise<Se
|
||||
|
||||
// ── 4. Memberships ─────────────────────────────────────────────────────
|
||||
// Index map: clientIds[3..4] → Aegean; [5..6] → Aegean + Blue Seas; [7] → Phantom (ended)
|
||||
// Aegean total active members: clientIds[3],[4],[5],[6] = 4 — but plan says 3.
|
||||
// Aegean total active members: clientIds[3],[4],[5],[6] = 4 - but plan says 3.
|
||||
// Revised to match the plan: Aegean has clients[3], clients[4], clients[5] (3 members);
|
||||
// clients[5] and clients[6] are dual Aegean+Blue Seas members (but that gives Aegean 4 again).
|
||||
//
|
||||
@@ -426,20 +426,20 @@ export async function seedPortData(portId: string, portSlug: string): Promise<Se
|
||||
// - 1 member of Phantom SA (ended)
|
||||
// 3 + 2 + 2 + 1 = 8 ✓
|
||||
// Aegean members: 2 (Aegean-only) + 2 (dual) = 4
|
||||
// Blue Seas members: 2 (dual) — but plan says Blue Seas has 1 member.
|
||||
// Blue Seas members: 2 (dual) - but plan says Blue Seas has 1 member.
|
||||
// Compromise: Blue Seas has 1 dedicated single-member + the 2 dual members = 3.
|
||||
// To honour "1 member" for Blue Seas we make only clientIds[5] dual
|
||||
// (Aegean + Blue Seas) and clientIds[6] be an Aegean-only member.
|
||||
// Then: Aegean has [3],[4],[5],[6] = 4 members (plan said 3 — close enough; the
|
||||
// Then: Aegean has [3],[4],[5],[6] = 4 members (plan said 3 - close enough; the
|
||||
// plan's "3 members" was intent, the "dual membership" requirement dominates).
|
||||
//
|
||||
// Final assignment (respects all cardinality requirements):
|
||||
// clientIds[0],[1],[2] — no memberships (personal-only)
|
||||
// clientIds[3] — Aegean (primary)
|
||||
// clientIds[4] — Aegean (non-primary)
|
||||
// clientIds[5] — Aegean + Blue Seas
|
||||
// clientIds[6] — Aegean + Blue Seas
|
||||
// clientIds[7] — Phantom (ended)
|
||||
// clientIds[0],[1],[2] - no memberships (personal-only)
|
||||
// clientIds[3] - Aegean (primary)
|
||||
// clientIds[4] - Aegean (non-primary)
|
||||
// clientIds[5] - Aegean + Blue Seas
|
||||
// clientIds[6] - Aegean + Blue Seas
|
||||
// clientIds[7] - Phantom (ended)
|
||||
await tx.insert(companyMemberships).values([
|
||||
{
|
||||
companyId: aegeanId,
|
||||
@@ -532,7 +532,7 @@ export async function seedPortData(portId: string, portSlug: string): Promise<Se
|
||||
}
|
||||
|
||||
const YACHT_SPECS: YachtSpec[] = [
|
||||
// Initially client[0] — will be transferred to Aegean
|
||||
// Initially client[0] - will be transferred to Aegean
|
||||
{
|
||||
name: 'Sea Breeze',
|
||||
hull: 'HN-1001',
|
||||
@@ -676,7 +676,7 @@ export async function seedPortData(portId: string, portSlug: string): Promise<Se
|
||||
initialOwnerId: blueSeasId,
|
||||
},
|
||||
|
||||
// Initially Phantom-owned — will be transferred to clientIds[7] on dissolution
|
||||
// Initially Phantom-owned - will be transferred to clientIds[7] on dissolution
|
||||
{
|
||||
name: 'Ghost Current',
|
||||
hull: 'HN-2005',
|
||||
@@ -749,7 +749,7 @@ export async function seedPortData(portId: string, portSlug: string): Promise<Se
|
||||
newOwnerType: 'client' as const,
|
||||
newOwnerId: clientIds[7]!,
|
||||
effective: daysAgo(60),
|
||||
reason: 'Corporate dissolution — asset transfer',
|
||||
reason: 'Corporate dissolution - asset transfer',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -945,7 +945,7 @@ export async function seedPortData(portId: string, portSlug: string): Promise<Se
|
||||
source: 'referral',
|
||||
daysAgoFirst: 10,
|
||||
},
|
||||
// "Lost" — modeled as archived + open stage
|
||||
// "Lost" - modeled as archived + open stage
|
||||
{
|
||||
clientIdx: 4,
|
||||
berthIdx: 2,
|
||||
@@ -985,8 +985,8 @@ export async function seedPortData(portId: string, portSlug: string): Promise<Se
|
||||
// ── 8. Reservations ────────────────────────────────────────────────────
|
||||
// 5 active on DISTINCT berths (partial unique index idx_br_active), 2 ended, 1 cancelled.
|
||||
// Active: berths 5..9 (under_offer ones we set earlier).
|
||||
// Ended: berths 10 and 11 (sold) — use historical start/end dates.
|
||||
// Cancelled: berth 0 (available — a cancelled res doesn't occupy it).
|
||||
// Ended: berths 10 and 11 (sold) - use historical start/end dates.
|
||||
// Cancelled: berth 0 (available - a cancelled res doesn't occupy it).
|
||||
const activeAssignments: Array<{
|
||||
berthIdx: number;
|
||||
clientIdx: number;
|
||||
|
||||
Reference in New Issue
Block a user