feat(management): seed comprehensive demo data and test accounts for local development #180

Closed
opened 2026-09-30 13:47:42 +00:00 by yuris · 0 comments
Owner

Problem

Local development and automated agent testing currently lack realistic domain data. The existing demo seed script only populates two items without stock movements or lots (failing invariant audits), with zero customers, vehicles, purchases, or sales orders, and without provisioning the documented local test accounts.

Acceptance Criteria

  • Expand apps/management/scripts/seed-demo.mts to seed 14 realistic Indonesian catalog items across parts, consumables, and accessories with categories matching services, specifications, fitments, and prices.
  • Seed 5 realistic customers with vehicles.
  • Seed supplier purchases via createPurchase with FIFO lots, purchase items, and incoming stock movements ('IN').
  • Seed sales orders via createOrder depleting lots via FIFO and recording outgoing stock movements ('OUT').
  • Ensure local test accounts (agent@garage.local with admin role and operator@garage.local with operator role) are idempotently provisioned with password garagepassword123.
  • Add garage:seed task in devenv.nix and db:seed script in root package.json and apps/management/package.json.
  • Verify that auditInvariants passes with 0 integrity failures and 0 warnings.
  • Typechecks (pnpm --filter garage typecheck), tests (pnpm --filter garage test), and biome checks pass with 0 errors.
## Problem Local development and automated agent testing currently lack realistic domain data. The existing demo seed script only populates two items without stock movements or lots (failing invariant audits), with zero customers, vehicles, purchases, or sales orders, and without provisioning the documented local test accounts. ## Acceptance Criteria - [ ] Expand `apps/management/scripts/seed-demo.mts` to seed 14 realistic Indonesian catalog items across parts, consumables, and accessories with categories matching services, specifications, fitments, and prices. - [ ] Seed 5 realistic customers with vehicles. - [ ] Seed supplier purchases via `createPurchase` with FIFO lots, purchase items, and incoming stock movements ('IN'). - [ ] Seed sales orders via `createOrder` depleting lots via FIFO and recording outgoing stock movements ('OUT'). - [ ] Ensure local test accounts (`agent@garage.local` with admin role and `operator@garage.local` with operator role) are idempotently provisioned with password `garagepassword123`. - [ ] Add `garage:seed` task in `devenv.nix` and `db:seed` script in root `package.json` and `apps/management/package.json`. - [ ] Verify that `auditInvariants` passes with 0 integrity failures and 0 warnings. - [ ] Typechecks (`pnpm --filter garage typecheck`), tests (`pnpm --filter garage test`), and biome checks pass with 0 errors.
yuris closed this issue 2026-09-30 14:26:24 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/garage#180
No description provided.