feat(seed): on-demand QA walkthrough dataset for a QA-marked tenant #265
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-331-qa-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?
Adds an operator-triggered QA seed (
mokosh-bootstrap qa-seed --tenant <uuid>/qa-teardown) that loads a small but realistic, related dataset into a dedicated QA tenant so the staging walkthrough (PMS-326) can exercise list sort/filter/pagination/grouping/reports and relationship features that an empty tenant cannot.Hard guardrail (fail closed):
confirm_qa_tenantruns first for both seed and teardown and refuses with zero writes unless the target tenant'ssettings->>'is_qa'is true. A tenant markedenvironment=productionis rejected outright, and a missing tenant row also fails closed. There is no flag that lets the seed touch an unmarked tenant, so it can never write to production or a real customer tenant.Dataset (all QA-prefixed in names and
qa-seedtagged where a tags column exists): 8 companies across every type with a parent and two children plus account managers, ~16 contacts (one primary per company, varied roles/phones/emails), 35 tickets (exceeds the 25/page default so the primary list paginates) cycling every status and priority over staggered dates with mixed billable/assignee, 2 projects with phases and tasks, 8 time entries with fractional hours both billable and not, one contract of every type, and two invoices with multiple line items plus payments (one full, one partial). Records are wired through the real service create paths so FK relationships and validation hold.Idempotent: a pre-existing QA company short-circuits the seed without inserting. Teardown removes the dataset and the QA lookup rows it created in FK-dependency order, leaving stock tenant configuration intact. Includes unit tests and a compile-time assertion that the ticket count paginates.
#PMS-331