feat: enrich default workspace mock data

This commit is contained in:
2026-07-03 02:27:48 -07:00
parent 0bc296a8ee
commit 36eae0be53
5 changed files with 508 additions and 26 deletions

View File

@@ -0,0 +1 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}

View File

@@ -0,0 +1 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}

View File

@@ -0,0 +1,31 @@
# 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.

View File

@@ -0,0 +1,26 @@
{
"id": "local-mock-data",
"name": "local-mock-data",
"title": "Local mock data",
"description": "",
"status": "in_progress",
"dev_type": null,
"scope": null,
"package": null,
"priority": "P2",
"creator": "TalexDreamSoul",
"assignee": "TalexDreamSoul",
"createdAt": "2026-07-03",
"completedAt": null,
"branch": null,
"base_branch": "main",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": null,
"relatedFiles": [],
"notes": "",
"meta": {}
}