from datetime import datetime
from decimal import Decimal
from typing import Optional

from fastapi import APIRouter
from sqlmodel import Field, SQLModel

router = APIRouter()


class Guardian(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    email = str
    email_verified_at: Optional[datetime] = None
    password: str
    remember_token: str
    first_name_thai: str
    last_name_thai: str
    first_name_english: str
    last_name_english: str
    occupation_id: Optional[int] = None
    gender: str
    is_thai_address: bool
    address_house_number: str
    address_moo: str
    address_soi: str
    address_road: str
    address_tambon_id: Optional[int] = None
    address_amphoe_id: Optional[int] = None
    address_province_id: Optional[int] = None
    address_other: str
    latitude: Decimal
    longitude: Decimal
    latitude_custom: Decimal
    longitude_custom: Decimal
    alive: bool
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class GuardianPhone(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    guardian_id: int
    number: str
    detail: str
    receive_sms: bool
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class GuardianIdNumber(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    guardian_id: int
    id_type_id: int
    number: str
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class GuardianPatientMap(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    guardian_id: int
    patient_id: int
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None


class GuardianNotification(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    guardian_id: int
    name: str
    detail: str
    is_read: bool
    created_at: datetime
    updated_at: datetime
    created_by: int
    updated_by: Optional[int] = None

sqlmodel.Field fastapi.APIRouter
[((164, 175), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (173, 175), False, 'from fastapi import APIRouter\n'), ((240, 277), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (245, 277), False, 'from sqlmodel import Field, SQLModel\n'), ((1118, 1155), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (1123, 1155), False, 'from sqlmodel import Field, SQLModel\n'), ((1410, 1447), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (1415, 1447), False, 'from sqlmodel import Field, SQLModel\n'), ((1686, 1723), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (1691, 1723), False, 'from sqlmodel import Field, SQLModel\n'), ((1948, 1985), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (1953, 1985), False, 'from sqlmodel import Field, SQLModel\n')]