from datetime import date
from typing import Optional
from sqlmodel import Field, SQLModel


class UserSettings(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    cle: str = Field(unique=True)
    valeur: str


class LunarCalendarEntry(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    jour: date = Field(unique=True)
    phase: str  # nouvelle_lune | premier_quartier | pleine_lune | dernier_quartier | croissante | decroissante
    type_jour: Optional[str] = None  # racine | feuille | fleur | fruit
    lune_montante: Optional[bool] = None
