[34588f42] Feat: Freigabe-Anfrage mit Gutschein-Webhook integriert

- Datenbank um 'DiscountCode' Modell erweitert.
- Neue Backend API-Routen für Upload von Gutscheincodes, Abfrage der Verfügbarkeit und Webhook-Listener (Google Forms) zur automatischen Dankes-E-Mail erstellt.
- Frontend (App.tsx) um ein neues Tool ('Anfrage Veröffentlichung') erweitert, das anhand der CSV-Daten Platzhalter (<Name>, <Kind>, <Kindergarten>) personalisiert und Mails via Gmail versendet.
- Google Forms Webhook Script (google_forms_webhook.js) als Kopiervorlage erstellt.
This commit is contained in:
2026-04-17 20:17:30 +00:00
parent 1a3568f69e
commit 929d92afeb
5 changed files with 339 additions and 0 deletions

View File

@@ -28,6 +28,14 @@ class GmailToken(Base):
token_json = Column(String) # Stores the full credentials JSON
updated_at = Column(DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow)
class DiscountCode(Base):
__tablename__ = "discount_codes"
id = Column(Integer, primary_key=True)
code = Column(String, unique=True, index=True)
is_used = Column(Integer, default=0) # 0 for false, 1 for true
assigned_to_email = Column(String, nullable=True)
used_at = Column(DateTime, nullable=True)
Base.metadata.create_all(bind=engine)
def get_db():