feat(seed): add richer showcase demo dataset with create/refresh #430
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-620-showcase-seed-dataset"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add an operator-triggered showcase demo seed (PMS-620) sized for the Mokosh showcase video: ~20 MSP-generic client companies (one primary contact each), ~5 projects with phases and tasks across a mix of active/planning/completed statuses, a batch of tickets, and roughly two weeks of prior time entries for the operator user (last week Monday..Friday and this week Monday..today). Both weeks are submitted and approved through the real timesheet service, so the timesheet reads as approved history and the billable entries land in ready_to_bill for a report. The whole set writes through the real tenant-scoped service layer (validation, FKs, audit rows), not hand-rolled INSERTs, following the proven QA-seed pattern. PMS-621 (the uniform file-based generator) has not landed, so this uses the sanctioned hardcoded-rows fallback.
Expose it as three server subcommands: showcase-seed (create, idempotent skip if present), showcase-refresh (teardown + re-seed in one call so a recording take can be reset without manual DB surgery), and showcase-teardown (remove). Each resolves the target tenant from --tenant or MOKOSH_SHOWCASE_TENANT_ID and is fail-closed: it refuses with zero writes unless the tenant is explicitly marked settings->>'is_showcase' = true, and never runs against an environment=production tenant, mirroring the QA seed guardrail.
Everything is SHOWCASE- name-prefixed and showcase-tagged so teardown removes exactly the seeded rows in FK order and leaves stock config intact. Compile-time asserts pin the ~20-client / ~5-project volume and unit tests cover the client/project prefixes, the two-week/all-billable time-entry spread, and the Monday week-anchor helper.
#PMS-620