from datetime import datetime
from typing import Optional

from fastapi import APIRouter
from sqlmodel import Field, SQLModel

router = APIRouter()


class Right(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str


class Province(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str


class Amphoe(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    province_id: int
    name: str


class Tambon(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    amphoe_id: int
    name: str


class Religion(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str


class National(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str


class Occupation(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str


class MaritalStatus(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str


class AcademicDegree(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    name: str


class Allergy(SQLModel, table=True):
    id: Optional[int] = 