Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
/**
|
2026-05-06 20:19:50 +02:00
|
|
|
* Realistic seed (the "production-shaped" fixture).
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
*
|
2026-05-06 20:19:50 +02:00
|
|
|
* Bootstraps ports + roles + super-admin profile, then runs
|
|
|
|
|
* `seedPortData()` per port to load the NocoDB-shaped multi-cardinality
|
|
|
|
|
* fixture (117 berths, 8 clients, 3 companies, 12 yachts, 15 interests,
|
|
|
|
|
* 8 reservations).
|
|
|
|
|
*
|
|
|
|
|
* For a focused test fixture covering every pipeline stage + archive
|
|
|
|
|
* variants, use `pnpm db:seed:synthetic` instead.
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
*
|
2026-04-24 13:26:37 +02:00
|
|
|
* Run with: pnpm db:seed
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import 'dotenv/config';
|
2026-05-06 20:19:50 +02:00
|
|
|
import { seedBootstrap } from './seed-bootstrap';
|
2026-04-24 13:26:37 +02:00
|
|
|
import { seedPortData, type SeedSummary } from './seed-data';
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
|
|
|
|
|
async function seed() {
|
2026-05-06 20:19:50 +02:00
|
|
|
console.log('Seeding Port Nimara CRM (realistic fixture)...');
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
|
2026-05-06 20:19:50 +02:00
|
|
|
const portIds = await seedBootstrap();
|
2026-04-24 13:26:37 +02:00
|
|
|
|
|
|
|
|
console.log('');
|
|
|
|
|
console.log('Seeding per-port fixtures...');
|
|
|
|
|
|
|
|
|
|
const summaries: Array<{ name: string; summary: SeedSummary | null }> = [];
|
|
|
|
|
for (const p of portIds) {
|
|
|
|
|
console.log(` [${p.slug}] seeding fixture data...`);
|
|
|
|
|
const summary = await seedPortData(p.id, p.slug);
|
|
|
|
|
summaries.push({ name: p.name, summary });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log('');
|
|
|
|
|
console.log('─── Summary ───────────────────────────────────────────────');
|
|
|
|
|
for (const s of summaries) {
|
|
|
|
|
if (s.summary === null) {
|
2026-05-04 22:57:01 +02:00
|
|
|
console.log(` ✓ Port "${s.name}" - already seeded (skipped)`);
|
2026-04-24 13:26:37 +02:00
|
|
|
} else {
|
|
|
|
|
const x = s.summary;
|
|
|
|
|
console.log(
|
2026-05-25 15:09:35 +02:00
|
|
|
` ✓ Port "${s.name}" - ${x.berths} berths, ${x.clients} clients, ${x.companies} companies, ${x.yachts} yachts, ${x.interests} interests, ${x.tenancies} tenancies`,
|
2026-04-24 13:26:37 +02:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
console.log('');
|
|
|
|
|
console.log('Seed complete!');
|
|
|
|
|
|
|
|
|
|
process.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
seed().catch((err) => {
|
|
|
|
|
console.error('Seed failed:', err);
|
|
|
|
|
process.exit(1);
|
|
|
|
|
});
|