Skip to content

Tidy dictionaries and fill imports from earlier receipts - #108

Merged
Frognar merged 1 commit into
mainfrom
claude/project-thread-bi7dnf
Oct 3, 2026
Merged

Frognar merged 1 commit into
mainfrom
claude/project-thread-bi7dnf

Conversation

@Frognar

@Frognar Frognar commented Oct 3, 2026

Copy link
Copy Markdown
Owner

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_aliases table (case-insensitive, chains A→B→C collapse to C, renaming back removes the alias). ImportHints is a pure function applied in ReceiptUseCases.ImportAsync, so both importers get it. New endpoints: GET /api/v1/dictionaries/{stores|items|categories} (readers) and POST /api/v1/dictionaries/{kind}/rename (editors). Migration NameAliases only 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

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
@Frognar Frognar self-assigned this Oct 3, 2026
@Frognar
Frognar merged commit e810340 into main Oct 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants