from typing import Optional
from api_validations.core_validations import BaseModelRegular
from api_validations.validations_request import (
    PydanticBaseModel,
    PydanticBaseModelValidation,
    CrudRecordValidation,
    ListOptions,
)

class BuildValidation:
    tr = {
        **CrudRecordValidation.tr,
        "gov_address_code": "Devlet Adres Kodu",
        "build_name": "Bina Adı",
        "build_types_uu_id": "Bina Tipi",
        "max_floor": "Kat Sayısı",
        "underground_floor": "Bodrum Kat Sayısı",
        "address_uu_id": "Adres",
        "build_date": "Yapım Tarihi",
        "decision_period_date": "Karar Tarihi",
        "tax_no": "Vergi No",
        "lift_count": "Asansör Sayısı",
        "heating_system": "Isıtma Sistemi",
        "cooling_system": "Soğutma Sistemi",
        "hot_water_system": "Sıcak Su Sistemi",
        "block_service_man_count": "Hizmet Görevlisi Sayısı",
        "security_service_man_count": "Güvenlik Görevlisi Sayısı",
        "garage_count": "Garaj Sayısı",
    }
    en = {
        **CrudRecordValidation.en,
        "gov_address_code": "Government Address Code",
        "build_name": "Building Name",
        "build_types_uu_id": "Building Type",
        "max_floor": "Number of Floors",
        "underground_floor": "Number of Basement Floors",
        "address_uu_id": "Address",
        "build_date": "Construction Date",
        "decision_period_date": "Decision Date",
        "tax_no": "Tax No",
        "lift_count": "Number of Elevators",
        "heating_system": "Heating System",
        "cooling_system": "Cooling System",
        "hot_water_system": "Hot Water System",
        "block_service_man_count": "Number of Service Officers",
        "security_service_man_count": "Number of Security Officers",
        "garage_count": "Number of Garages",
    }


class InsertBuild(BaseModelRegular, BuildValidation):
    gov_address_code: str
    build_name: str
    build_types_uu_id: str
    max_floor: int
    underground_floor: int
    address_uu_id: str
    build_date: str
    decision_period_date: str

    tax_no: Optional[str] = None
    lift_count: Optional[int] = None
    heating_system: Optional[bool] = None
    cooling_system: Optional[bool] = None
    hot_water_system: Optional[bool] = None
    block_service_man_count: Optional[int] = None
    security_service_man_count: Optional[int] = None
    garage_count: Optional[int] = None


class BuildUpdateValidation:
    tr = {
        **BuildValidation.tr,
        **PydanticBaseModelValidation.tr,
    }
    en = {
        **BuildValidation.en,
        **PydanticBaseModelValidation.en,
    }


class UpdateBuild(PydanticBaseModel, BuildUpdateValidation):
    gov_address_code: Optional[str] = None
    build_name: Optional[str] = None
    build_no: Optional[str] = None
    build_types: Optional[str] = None
    max_floor: Optional[int] = None
    underground_floor: Optional[int] = None
    build_date: Optional[str] = None
    tax_no: Optional[str] = None
    lift_count: Optional[int] = None
    heating_system: Optional[bool] = None
    cooling_system: Optional[bool] = None
    hot_water_system: Optional[bool] = None
    block_service_man_count: Optional[int] = None
    security_service_man_count: Optional[int] = None
    garage_count: Optional[int] = None
    address_uu_id: Optional[str] = None
