MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-391

6.10.6 Seed loader — model the `moooon` org over its workspace(s); backfill in `pnpm db:seed`

Done
Description

Estimate: 40m · Depends on: 6.10.3

Teach the seed loader (scripts/plan-seed/seed.ts + the seed data) about the org tier so pnpm db:seed models the moooon org over its workspace(s) — the dev/demo data that exercises the new hierarchy. This keeps the seeded world consistent with the 6.10.3 schema + the 6.10.4 gating (every seeded workspace lives under an org; the seeding owner is an org owner).

  • Create the moooon Organization and attach the existing seeded workspace(s) to it via organizationId (the seed’s workspaces no longer top-level-orphan — they nest under moooon).
  • Create an OrganizationMembership(owner) for the seed’s owning/admin user, plus a couple of org members at different org-roles (owner / admin / member) so the cross-workspace member management UI (6.10.5) + the e2e (6.10.8) have realistic data.
  • Apply the SAME backfill rule the 6.10.3 migration uses (idempotent: re-seeding does not duplicate the org / memberships) so seed + migrate agree.
  • If the plan-seed world models MORE than one workspace, attach them under moooon (or a second seeded org if the demo needs the multi-org switcher case) — pick whichever exercises the org switcher + cross-workspace roster. Document the choice in the seed module.

Acceptance criteria

  • After pnpm db:seed, the moooon Organization exists, owns its workspace(s) (each workspace’s organizationId points at it), and has an owner OrganizationMembership for the seed owner + a few members at varied org-roles.
  • Re-running pnpm db:seed is idempotent (no duplicate org / memberships) and agrees with the 6.10.3 migration backfill.
  • The seeded world satisfies the 6.10.4 gate (no seeded workspace is orphaned from an org; the seed owner can administer it as org owner).

Context refs

  • 6.10.3 — the schema + the backfill rule the seed mirrors (idempotent).
  • motir-core/scripts/plan-seed/seed.ts — the loader to extend (it already builds the moooon/motir workspace + project tree).
  • 6.10.4 — the gate the seeded data must satisfy.
  • motir-core/CLAUDE.md § 4-layer (the seed goes through the same repositories where practical).