2.4 KiB
Setup Integration Scenarios
This document defines the D.7.10 setup integration workflow and the golden dataset validation contract.
Golden Dataset
Source: setup/golden-dataset/
The dataset must remain compatible with setup/templates/templates.json and must not introduce business behavior beyond existing setup/import contracts.
Scenario 1: Fresh Install Smoke
- Start from an empty local or CI database.
- Run migrations.
- Run setup readiness.
- Start a setup run.
- Preview every CSV in
setup/golden-dataset/. - Commit with the returned
previewHash. - Run verification.
- Complete setup.
- Confirm seed manifests and setup run report exist.
Expected result: setup completes without manual SQL.
Scenario 2: Idempotent Import
- Preview and commit the full golden dataset.
- Preview and commit the same files again.
- Preview and commit the same files a third time.
Expected result: repeated imports produce update/skip behavior and do not create duplicate business-key records.
Scenario 3: Preview Hash Rejection
- Preview the golden dataset.
- Modify one CSV row.
- Attempt commit using the old
previewHash.
Expected result: commit is rejected and requires re-preview.
Scenario 4: Resume
- Start setup run.
- Save readiness and CSV preview steps.
- Refresh browser or call
GET /api/setup/run/current.
Expected result: persisted setup run and step statuses are returned without raw CSV contents.
Scenario 5: Reset Safety
- Preview
business_resetwith a target organization. - Execute only after matching preview hash, token, and typed phrase.
- Preview
setup_run_reset. - Confirm blocked reports for
foundation_reset,organization_reset,demo_uat_reset,full_reset, andcsv_import_rollback.
Expected result: only explicitly supported safe reset paths execute; unsupported reset paths return blocking reports.
Scenario 6: Operational Readiness
After setup completes, verify these domains are ready:
- login
- CRM dashboard
- customer list and detail
- lead list and detail
- opportunity list and detail
- quotation list and detail
- quotation approval routing
- document sequence previews
- PDF/document template readiness
- setup report and seed manifest report
Automated Contract Tests
Run:
npm run test:setup
These tests validate golden dataset headers, counts, import ordering, reset/reseed API surfaces, setup state surfaces, and non-destructive reset policy contracts.