32 lines
1.8 KiB
Markdown
32 lines
1.8 KiB
Markdown
# Local mock data
|
|
|
|
## Goal
|
|
|
|
Provide richer local mock data so the养老机构工作台 can be opened locally with realistic content across the existing dashboard, beds, elders, care, health, and emergency surfaces.
|
|
|
|
## Confirmed Facts
|
|
|
|
- The project already has Drizzle/Postgres schema and a `seedDefaultWorkspaceData(organizationId)` helper in `modules/core/server/default-workspace-data.ts`.
|
|
- Existing default data covers rooms, beds, elders, admissions, health profiles, vital records, chronic conditions, health anomaly reviews, and care tasks.
|
|
- Local Postgres is configured through `compose.yaml`; Drizzle uses `DATABASE_URL`.
|
|
- This is a lightweight task: no schema change, no product workflow redesign, and no new external dependency is required.
|
|
|
|
## Requirements
|
|
|
|
- Add a larger, more varied default dataset using existing schema tables and enum values.
|
|
- Include enough records to make local pages visibly populated: facilities/beds, elder roster, active admissions, care tasks, health vitals/reviews, chronic conditions, and emergency incidents.
|
|
- Keep seeding idempotent for an organization that already has workspace data; do not overwrite user-created local data.
|
|
- Preserve existing TypeScript type safety and existing data relationships by resolving records through names/codes inside the seed transaction.
|
|
- Avoid production-only assumptions; this data is for local/demo initialization only.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [x] Default workspace seed data has more realistic volume and state variety across the existing modules.
|
|
- [x] Seed data inserts without foreign-key errors into a migrated local database.
|
|
- [x] `pnpm type-check` passes.
|
|
- [x] No schema migration is introduced for this task.
|
|
|
|
## Notes
|
|
|
|
- Out of scope: fake auth users, generated production data, cross-organization demo scenarios, and UI redesign.
|