feat(backup): export the account settings and restore them onto the account

Both backup purposes now carry an accountSettings section. The restore writes
it to the account being restored inside the same transaction, names every
refused value under the new accountSetting skip catalogue, and re-warms the
stored texts after the transaction when a unit preference changed, the way the
unit settings routes do. A file without the section leaves the account row as
it is, which is how every older backup restores. The instance settings
restore stays its own opt-in.
This commit is contained in:
Marc-André Bombeck committed 2026-10-01 13:04:41 +02:00
1 parent d731a1b8fe
commit 7abaa25c14
15 files changed
+159 -2

No files matched your search

@@ -27,6 +27,9 @@ vi.mock("@/lib/db", () => ({
intradayCumulativeProfile: { findMany: vi.fn().mockResolvedValue([]) },
healthScoreRecord: { findMany: vi.fn().mockResolvedValue([]) },
onboardingRecord: { findUnique: vi.fn().mockResolvedValue(null) },
// The account row's settings, read by `buildAccountSettingsBackupSection`.
// Absent here; the section has its own tests.
user: { findUnique: vi.fn().mockResolvedValue(null) },
// The visit tables. Empty here: this file asserts the sections it seeds,
// and an account with no visits is the ordinary case the builder must
// still answer for.