Feat: Rechnungsadresse — Profil, Upgrade-Modal Hinweis, Rechnung-erstellen-Button in Upgrade-Cards (SW by-v967)

This commit is contained in:
rene 2026-05-15 10:59:12 +02:00
parent 95b70d5119
commit 0a466ef6ce
9 changed files with 89 additions and 20 deletions

View file

@ -1137,7 +1137,7 @@ async def list_upgrade_requests(user=Depends(require_admin)):
with db() as conn:
rows = conn.execute("""
SELECT r.id, r.user_id, r.tier, r.message, r.created_at, r.fulfilled_at,
u.name, u.email
u.name, u.email, u.billing_address
FROM upgrade_requests r
JOIN users u ON u.id = r.user_id
ORDER BY r.fulfilled_at IS NOT NULL, r.created_at DESC

View file

@ -241,7 +241,8 @@ async def me(user=Depends(get_current_user)):
is_founder, is_partner, founder_number, is_founder_pending,
notes_ki_enabled, gassi_stunde_push,
preferred_theme, subscription_tier,
subscription_expires_at, subscription_cancelled_at, needs_dog_selection
subscription_expires_at, subscription_cancelled_at, needs_dog_selection,
billing_address
FROM users WHERE id=?""",
(user["id"],)
).fetchone()

View file

@ -28,6 +28,7 @@ class ProfileUpdate(BaseModel):
notes_ki_enabled: Optional[int] = None
gassi_stunde_push: Optional[int] = None
preferred_theme: Optional[str] = None
billing_address: Optional[str] = None
def _load_user(user_id: int) -> dict:
@ -35,7 +36,7 @@ def _load_user(user_id: int) -> dict:
row = conn.execute(
"""SELECT id, name, real_name, email, rolle, is_premium, email_verified,
bio, wohnort, erfahrung, social_link,
profil_sichtbarkeit, avatar_url, created_at
profil_sichtbarkeit, avatar_url, created_at, billing_address
FROM users WHERE id=?""",
(user_id,)
).fetchone()