Skip to content

Create real-data JSON dev seed fixture #262

@asku1990

Description

@asku1990

Description

Development is slow because local workflows often require rerunning the full legacy import. Add a fast local dev seed based on a curated real-data JSON fixture exported from a known-good imported database.

Goal

Create a deterministic seed file that can reset and repopulate local dev data quickly without rerunning import:bootstrap.

Requirements

  • Add an export script that writes a relationship-complete JSON fixture from a fully imported local DB.
  • Store the fixture under packages/db/fixtures/, for example dev-seed.json.
  • Update db:seed:initial-test-data to reset app-domain data and load the fixture.
  • Preserve auth/admin users.
  • Sanitize people-related data before committing:
    • owners
    • breeder owner/person fields
    • judges if treated as personal data

Fixture coverage

  • Trials:
    • include examples for trw_range_2005_2011
    • include examples for trw_post_20110801
    • include examples for trw_post_20230801
    • include linked dogs, registrations, trial events, entries, eras, lisatiedot, scores, statuses, and owner snapshots
  • Shows:
    • include pre-2003-01-01 legacy class+digit quality stored as LEGACY-LAATUARVOSTELU
    • include post-2003-01-01 class+digit normalized to modern quality
    • include modern PUPN, SIJOITUS, quality, and awards examples

Docs

  • Document fixture export/refresh command.

  • Document fast reseed command:

    pass-cli run --env-file .env.local -- pnpm db:seed:initial-test-data

  • Clarify that import:bootstrap remains the real migration path.

Acceptance criteria

  • Seed can be run repeatedly with stable counts.
  • Seed does not require legacy MariaDB/import.
  • Public dog profile, show detail, trial detail/PDF, admin show, and admin trial pages have usable data.
  • pnpm --filter @beagle/db typecheck passes.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions