Skip to content

feat(db): add entry model and migration - #28

Merged
davideee222 merged 2 commits into
mainfrom
feat/20-db-entry-model
Nov 19, 2026
Merged

davideee222 merged 2 commits into
mainfrom
feat/20-db-entry-model

Conversation

@davideee222

Copy link
Copy Markdown
Collaborator

Closes #20

  • Added Entry model (table entries)
  • Added migration for it
  • Tested upgrade, downgrade and alembic check

@Andreas7274 Andreas7274 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auffälligkeiten:

1: entry_date heißt nicht date, obwohl Issue #20 date verlangt.
2: kind wird nur als beliebiger String akzeptiert. Sinnvoller wäre eine Einschränkung auf receipt / trip, beispielsweise mit Literal["receipt", "trip"].
3: category hat einen Defaultwert "uncategorized". Die sechs festen Kategorien aus Entscheidung Nr. 16 fehlen derzeit noch als Validierung oder Typdefinition.
4: amount, distance_km und days sind INTEGER bzw. optional. Für Beträge wären typischerweise Dezimalwerte oder centbasierte Ganzzahlen sinnvoll.
5: Die Migration stimmt strukturell mit dem Modell überein, aber es fehlen Datenbank-Constraints für erlaubte kind- und category-Werte.

Der PR ist nach Anpassung der Benennung, Enum-/Literal-Validierung und Kategorienkonfiguration deutlich robuster.

@davideee222

Copy link
Copy Markdown
Collaborator Author

Danke!

  1. entry_date bleibt so, weil date schon ein Python-Typ und ein SQL-Wort ist.
    2./3./5. Ist drin: Die DB erlaubt bei kind nur receipt/trip und bei category nur die 6 Keys. Hab's getestet.
  2. amount ist schon in Cent (1999 = 19,99 €).

@Andreas7274 Andreas7274 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passt jetzt

@davideee222
davideee222 merged commit 3cd987c into main Nov 19, 2026
1 check 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.

[Sprint 2][C] Entry model with kind + migration

2 participants