feat(data): include tenant_name in the export envelope (PMS-647) #443
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-647-export-tenant-name"
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?
Summary
Adds
tenant_nameto the tenant data export envelope (GET /api/v1/data/export), next to the existingtenant_id.Why
POST /api/v1/data/importguards the destructive wipe-and-replace by requiringconfirmto equal the target tenant's name. An automated orchestrator that exports a tenant and later re-imports it - specifically Bunyip account backup/restore (BUNYIP-356) - does not otherwise know the Mokosh tenant name. Carrying it in the envelope lets the orchestrator echo it back asconfirmwithout a second lookup round-trip, and keeps the destructive-action guard fully intact.Notes
schema_version+entitiesand ignores unknown envelope fields, so existing exports/imports are unaffected andschema_versionis unchanged.tenant_nameis present.Verification
just pre-commitgreen (fmt + clippy-D warnings+ check + unit + doc). Integration tests compile; the DB round-trip is exercised by CI (integration.yml) - it could not run on the author's box (host port 5433 held by an unrelated container, and the local mokosh Postgres lacked thejust devsecret provisioning).🤖 Generated with Claude Code