Files
gaehsnitz/gaehsnitz/migrations/0004_drink_year.py
T
flo 4c9d041254 Add year-scoped drink data, UserPayment model, German verbose names
Drink gets a year field (default 2024 for legacy rows), with name+year
unique together so each festival can have its own price/crate config
without overwriting the previous year. User balance properties
(consumed_drinks_price, paid_amount, open_balance) and the new
current_year() helper all filter by current year so year-over-year data
stays separated.

UserPayment model tracks per-user payments (cash/PayPal/bank/other)
against their drink tab, separate from Donation (event-level income).

Verbose names + Meta verbose_name(_plural) added across all models, and
LANGUAGE_CODE set to "de" so the admin renders German throughout.

Drink gains a few derived properties (crates_full_returned,
crates_remaining, bottles_consumed, bottles_remaining,
remaining_purchase_value) used by the upcoming admin and dashboard
views.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 22:18:57 +02:00

27 lines
685 B
Python

# Generated by Django 6.0.5 on 2026-05-14 18:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("gaehsnitz", "0003_consumption_created_at_user_pin"),
]
operations = [
migrations.AddField(
model_name="drink",
name="year",
field=models.PositiveSmallIntegerField(default=2024),
),
migrations.AlterField(
model_name="drink",
name="name",
field=models.CharField(max_length=32),
),
migrations.AlterUniqueTogether(
name="drink",
unique_together={("name", "year")},
),
]