Simpl-Resultat/src/components
le king fu 09c7b32dd1 fix: carry the budget in SREF backups and keep it on restore (#520)
A restore with categories (full backup, categories only, and "Restore the
backup" of the categories migration) ran DELETE FROM categories, whose
ON DELETE CASCADE took every budget line, template line and adjustment
line with it, while the backup held none: the restore succeeded and left
the budget empty.

- SREF format 3: the two modes that carry the categories now carry
  budget_entries, budget_templates (by name, with their lines) and
  adjustments (with their lines). collectExportData(mode) gathers the
  arrays of each mode for the export and for the pre-migration backup.
- Restore: the profile's budget lines, template lines and adjustment
  lines are read and taken out before DELETE FROM categories, in both
  formats, through the restore's handle. At format 3 the file's budget
  lines and adjustments replace the profile's, each file template is
  upserted by name with its lines replaced, and a template absent from
  the file keeps its header and its lines whose category comes back.
  Below format 3 the lines whose category comes back are put back as
  they were.
- The restores of the two category modes take the file's format
  (formatVersion), passed by useDataImport and applyBackup.
- Pure validation at the parse and at the head of each restore: a
  format newer than this build is refused (newerFormat), a non-integer
  or below 1 gets the malformed-file error, and at format 3 a missing
  array or a line the tables cannot hold is refused (invalidBudgetRows).
- restoreCategories writes i18n_key.
- Confirmations: willDeleteCategories and willDeleteAll name the budget,
  the counts of budget lines, templates and adjustments, and the note of
  a backup older than format 3 in the card and in the second
  confirmation of "Restore the backup"; categories.reinitializeConfirm
  names what "Re-initialize" erases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 23:32:58 -05:00
..
adjustments test: share texts and move the last local find copies onto src/test/elementTree.ts (#495) 2026-10-26 20:12:04 -04:00
balance test: share texts and move the last local find copies onto src/test/elementTree.ts (#495) 2026-10-26 20:12:04 -04:00
budget test: pin four cases the reviews of the stack left unpinned 2026-10-24 09:09:36 -04:00
categories test: restore the space the move to elementTree took from HierarchyCheckModal (#495) 2026-10-26 20:23:25 -04:00
categories-migration feat(categories): merge custom categories into the standard taxonomy (#259) 2026-07-19 19:43:47 +00:00
dashboard test: share texts and move the last local find copies onto src/test/elementTree.ts (#495) 2026-10-26 20:12:04 -04:00
import test: share texts and move the last local find copies onto src/test/elementTree.ts (#495) 2026-10-26 20:12:04 -04:00
layout test: share texts and move the last local find copies onto src/test/elementTree.ts (#495) 2026-10-26 20:12:04 -04:00
onboarding test: share texts and move the last local find copies onto src/test/elementTree.ts (#495) 2026-10-26 20:12:04 -04:00
profile feat: focus of the upsell windows and ProfileFormModal as a dialog (#494) 2026-10-26 20:45:19 -04:00
reports feat(onboarding): step cards of the Categories and Reports pages 2026-10-13 21:45:05 -04:00
settings fix: carry the budget in SREF backups and keep it on restore (#520) 2026-11-04 23:32:58 -05:00
shared test: pin the UTM label of each product page button (#525) 2026-11-02 21:57:24 -05:00
transactions fix: a split's offset line follows its parent when it is recategorized (#454) 2026-10-27 22:13:08 -04:00