Money: incremental imports into an existing Budget (later exports, overlapping sources) #968

Open
opened 2026-10-03 04:47:01 +00:00 by kayg · 0 comments
Owner

Owner request (2026-10-03)

"Can I import YNAB first and Actual over that and it will correctly incrementally import transactions?" Today every Money import creates a new Budget; a second import with the same title returns 409, and nothing merges transactions into an existing Budget.

Goal

Import new transactions into an existing Budget without duplicates or wrong numbers, from:

  • a later export of the same source (YNAB JSON, Actual zip, CSV): only transactions not yet imported are added;
  • a different source covering an overlapping period (for example YNAB history, then an Actual export that continues it): overlapping transactions are recognised, not doubled.

Behaviour

  1. Choose the target: the import preview offers "New Budget" or "Add to ".
  2. Identity and dedup: match by stable source identity first (source transaction ID / import ID; the YNAB import_id and Actual transaction IDs), then by a conservative fingerprint (Account, date, amount, payee) for sources without IDs. The preview shows: new, already present (skipped), and possible duplicates the User decides on. Never silently merge two different transactions.
  3. Account and Category mapping: map source Accounts and Categories to existing ones by source ID, then by name with the User confirming in the preview; unmapped ones are created.
  4. Transfers stay linked transfers (both legs), including when one leg is already present.
  5. Budget months: Assigned amounts from the new source apply only to months the User selects (default: months after the last existing month), so earlier assignments are not overwritten.
  6. Undo: the whole incremental import is one Undo step (shared Undo receipt), restoring the Budget files exactly.
  7. Numbers: after import, every Account balance and every month's Ready to Assign / Activity / Available must equal the source's numbers for the imported range (the same differential check used for #462).

Tests

  • Property test: random overlapping exports (with and without IDs, transfers, splits, month boundaries) → no duplicates, balances equal an independent oracle.
  • Re-import of the same file adds 0 transactions.
  • Real-data check on the owner's Actual export (aggregates only, private data stays in ~/calternal-private/).
  • Money rule: property tests and a separate break-the-numbers review before merge.
## Owner request (2026-10-03) "Can I import YNAB first and Actual over that and it will correctly incrementally import transactions?" Today every Money import creates a **new** Budget; a second import with the same title returns 409, and nothing merges transactions into an existing Budget. ## Goal Import new transactions into an **existing** Budget without duplicates or wrong numbers, from: - a later export of the same source (YNAB JSON, Actual zip, CSV): only transactions not yet imported are added; - a different source covering an overlapping period (for example YNAB history, then an Actual export that continues it): overlapping transactions are recognised, not doubled. ## Behaviour 1. **Choose the target:** the import preview offers "New Budget" or "Add to <existing Budget>". 2. **Identity and dedup:** match by stable source identity first (source transaction ID / import ID; the YNAB `import_id` and Actual transaction IDs), then by a conservative fingerprint (Account, date, amount, payee) for sources without IDs. The preview shows: new, already present (skipped), and **possible duplicates the User decides on**. Never silently merge two different transactions. 3. **Account and Category mapping:** map source Accounts and Categories to existing ones by source ID, then by name with the User confirming in the preview; unmapped ones are created. 4. **Transfers** stay linked transfers (both legs), including when one leg is already present. 5. **Budget months:** Assigned amounts from the new source apply only to months the User selects (default: months after the last existing month), so earlier assignments are not overwritten. 6. **Undo:** the whole incremental import is one Undo step (shared Undo receipt), restoring the Budget files exactly. 7. **Numbers:** after import, every Account balance and every month's Ready to Assign / Activity / Available must equal the source's numbers for the imported range (the same differential check used for #462). ## Tests - Property test: random overlapping exports (with and without IDs, transfers, splits, month boundaries) → no duplicates, balances equal an independent oracle. - Re-import of the same file adds 0 transactions. - Real-data check on the owner's Actual export (aggregates only, private data stays in `~/calternal-private/`). - Money rule: property tests and a separate break-the-numbers review before merge.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#968
No description provided.