Repository navigation
AMI-9: Add a category to expenses - #5
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Linear: https://linear.app/aminbaa/issue/AMI-9/add-a-category-to-expenses
Factory decision: build
Plan: Add
category: Literal[...] = "other"to ExpenseIn and include it in the INSERT in app/expenses.py.In app/db.py, add the column to SCHEMA with
NOT NULL DEFAULT 'other'and a CHECK constraint. Add an idempotent ALTER TABLE in init_db for existing databases, and add categories to the seed data if wanted.Add tests in tests/test_expenses.py: default is other, a valid category is accepted, an invalid one gives 422, and category appears in the get and list responses.
Why:
categoryenum (travel, meals, software, office, other), optional on create with defaultother, returned wherever expenses are returned, and existing rows backfilled toother. That is specific enough to implement without clarification.personal_phoneandwork_phoneare not involved, so the data rules in docs/data.md do not require escalation.SELECT *anddict(row), so a new column appears in every response without extra work.Opened by ticket-factory. CI and review run on this PR; the factory lands it into
factory_pre_mergewhen they pass.