initial commit

This commit is contained in:
2025-05-25 22:09:31 +02:00
commit e8b832addc
19 changed files with 1177 additions and 0 deletions

42
app/models.py Normal file
View File

@@ -0,0 +1,42 @@
import uuid
from pydantic import EmailStr
from sqlmodel import Field, SQLModel
from enum import Enum
from datetime import date, datetime
from sqlalchemy.sql import func
class VoiceEnum(str, Enum):
base = "Bass"
tenor = "Tenor"
alto = "Alt"
soprano = "Sopran"
men = "Bass oder Tenor"
women = "Alt oder Sopran"
class PeriodEnum(str, Enum):
halfyear = "1/2 Jahr"
year = "1/2 - 1 Jahr"
twoyears = "1 - 2 Jahre"
longterm = "mehr als zwei Jahre"
class RegistrationBase(SQLModel):
email: EmailStr = Field(unique=True, index=True, max_length=255)
first_name: str
last_name: str
birthday: date
voice: VoiceEnum
duration: PeriodEnum
class RegistrationCreate(RegistrationBase):
pass
class Registration(RegistrationBase, table=True):
id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
timestamp: datetime = Field(default_factory=func.now)