Repository navigation
Conversation
Transaction data is currently only kept as one uploaded file per transaction in the vector store, which makes date filters and totals approximate and leaves no way to correct or deduplicate a record. Write every transaction into a D1 table in parallel with the existing upload. The vector store stays the read path, so this change only accumulates structured data; no query behaviour changes. Schema notes: * Amounts are stored as integers in minor units, with the merchant-side amount kept separately when a bank settles a foreign charge in another currency. * The exchange rate is resolved and frozen when a transaction is recorded, so historical reports stop moving as rates change. A transaction is never blocked on a rate lookup; a daily job backfills any row recorded while no rate was available, using the rate for that row's own date. * An FTS5 index covers the free-text columns with diacritics folded, so untoned Vietnamese queries match. Duplicates are handled in two layers. A unique constraint drops exact repeats from delivery retries. A merchant receipt and the matching bank debit, which arrive minutes apart under different senders, are linked through duplicate_of instead of dropped, so both stay queryable while totals count the payment once. Direction separates that case from a transfer between accounts, which produces a debit and a credit and must remain two records. Writes are best-effort: failures are logged and never interrupt notification or the vector store upload, and the write is skipped when no binding exists. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SwuhAs5n7j6dGB3fcaqCDp
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
mine-personal-accounting | c97c029 | Commit Preview URL Branch Preview URL |
Sep 21 2026, 07:57 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Transaction data is currently only kept as one uploaded file per transaction in the vector store, which makes date filters and totals approximate and leaves no way to correct or deduplicate a record.
Write every transaction into a D1 table in parallel with the existing upload. The vector store stays the read path, so this change only accumulates structured data; no query behaviour changes.
Schema notes:
Duplicates are handled in two layers. A unique constraint drops exact repeats from delivery retries. A merchant receipt and the matching bank debit, which arrive minutes apart under different senders, are linked through duplicate_of instead of dropped, so both stay queryable while totals count the payment once. Direction separates that case from a transfer between accounts, which produces a debit and a credit and must remain two records.
Writes are best-effort: failures are logged and never interrupt notification or the vector store upload, and the write is skipped when no binding exists.
Claude-Session: https://claude.ai/code/session_01SwuhAs5n7j6dGB3fcaqCDp