from datetime import date
from typing import Optional

from pydantic import BaseModel


class KundeOut(BaseModel):
    id: int
    name: str

    class Config:
        from_attributes = True


class ZahlungOut(BaseModel):
    id: int
    betrag: float
    datum: date

    class Config:
        from_attributes = True


class BemerkungIn(BaseModel):
    bemerkung: Optional[str]
    wiedervorlage_datum: Optional[date]


class Token(BaseModel):
    access_token: str
    token_type: str


class TokenData(BaseModel):
    username: str | None = None


class User(BaseModel):
    username: str
    email: str | None = None
    hashed_password: str


class UserInDB(User):
    username: str
    email: str | None = None
    hashed_password: str
