feat(backup): say whether an account can take an erased account's copy

A restore replaces the account's records and has no merge, so the copy
of an account that no longer exists may only go into an account that
holds none of the records a backup carries. The check reads every
backed-up model by its userId, reaches the owner-less children through
their parent, and is held to the schema so a new model cannot be read
as empty. Managed profiles and accounts pending deletion are refused as
well. The admin console asks GET /api/admin/backups/targets/{userId}
before it sends a file again, so a refusal costs no upload.
This commit is contained in:
Marc-André Bombeck committed 2026-10-29 20:11:08 +01:00
1 parent 973bb8e5fc
commit 9baeb95bab
4 files changed
+266

No files matched your search

@@ -225,6 +225,10 @@ const UNPUBLISHED: Readonly<Record<string, Exemption>> = {
// newer schema) an operator has to be able to look up the same way. See
// `src/lib/openapi/routes/admin-backups.ts`.
"/api/admin/backups/{id}/summary": { kind: "adminConsole", methods: ["GET"] },
"/api/admin/backups/targets/{userId}": {
kind: "adminConsole",
methods: ["GET"],
},
"/api/admin/central-codex": {
kind: "adminConsole",
methods: ["DELETE", "GET"],