Repository navigation
Tidy dictionaries and fill imports from earlier receipts - #108
Merged
Merged
Conversation
A new Dictionaries page lists stores, items and categories with how often and how recently they were used. An editor can rename one on every receipt; renaming to a name already in use merges the two. The old name is kept as an alias, so a later import that reads it gets the new name. Biedronka and photo imports now give each item the category of its most recent purchase instead of always "Spożywcze", and apply the aliases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPSUHkaJ2a5Qr3MBZAz2oN
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.
Requested by Frognar · project thread
Before: every line imported from a Biedronka file or a photo got the category "Spożywcze", and the same product could pile up under several spellings ("MLEK WYPAS 3,2 1L", "mleko 3,2%", "Mleko 3,2%") with no way to fix them other than editing each line.
After: a new Słowniki page (account menu) lists items, categories and stores with how often and when they were last used. An editor can rename one on every receipt; renaming to a name already in use merges the two. Imports give each item the category of its most recent purchase, and a name that was renamed comes in under its new name.
How: renames run as one bulk update in a transaction and store the old name in a new
expense.name_aliasestable (case-insensitive, chains A→B→C collapse to C, renaming back removes the alias).ImportHintsis a pure function applied inReceiptUseCases.ImportAsync, so both importers get it. New endpoints:GET /api/v1/dictionaries/{stores|items|categories}(readers) andPOST /api/v1/dictionaries/{kind}/rename(editors). MigrationNameAliasesonly adds the table.Tested: full suite (151 tests, 12 new) and a local run against Postgres with screenshots on a phone viewport.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NPSUHkaJ2a5Qr3MBZAz2oN
Generated by Claude Code