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


class BuildTypesUpdateValidation:
    tr = {
        **PydanticBaseModelValidation.tr,
        "function_code": "Fonksiyon Kodu",
        "type_code": "Tip Kodu",
        "lang": "Dil",
        "type_name": "Tip Adı",
    }
    en = {
        **PydanticBaseModelValidation.en,
        "function_code": "Function Code",
        "type_code": "Type Code",
        "lang": "Language",
        "type_name": "Type Name",
    }


class BuildTypesValidation:
    tr = {
        "function_code": "Fonksiyon Kodu",
        "type_code": "Tip Kodu",
        "lang": "Dil",
        "type_name": "Tip Adı",
    }
    en = {
        "function_code": "Function Code",
        "type_code": "Type Code",
        "lang": "Language",
        "type_name": "Type Name",
    }


class InsertBuildTypes(BaseModelRegular, BuildTypesValidation):
    function_code: str
    type_code: str
    lang: str
    type_name: str


class UpdateBuildTypes(PydanticBaseModel, BuildTypesUpdateValidation): ...


class BuildPartsValidation:
    tr = {
        "address_gov_code": "Adres İl Kodu",
        "part_no": "Daire No",
        "part_level": "Daire Seviyesi",
        "build_part_type_uu_id": "Bina Daire Tipi UUID'si",
        "part_code": "Daire Kodu",
        "part_gross_size": "Daire Brüt Alanı",
        "part_net_size": "Daire Net Alanı",
        "default_accessory": "Varsayılan Aksesuar",
        "human_livable": "İnsan Yaşanabilir",
        "part_direction": "Daire Yönü",
    }
    en = {
        "address_gov_code": "Address Gov Code",
        "part_no": "Flat No",
        "part_level": "Flat Level",
        "build_part_type_uu_id": "Build Flat Type UUID",
        "part_code": "Flat Code",
        "part_gross_size": "Flat Gross Size",
        "part_net_size": "Flat Net Size",
        "default_accessory": "Default Accessory",
        "human_livable": "Human Livable",
        "part_direction": "Flat Direction",
    }


class InsertBuildParts(BaseModelRegular, BuildPartsValidation):
    build_uu_id: str
    address_gov_code: str
    part_no: int
    part_level: int
    build_part_type_uu_id: str

    part_gross_size: Optional[int] = None
    part_net_size: Optional[int] = None
    default_accessory: Optional[str] = None
    human_livable: Optional[bool] = False
    part_direction_uu_id: Optional[str] = None
    ref_id: Optional[str] = None


class UpdateBuildPartsValidation:
    tr = {
        **PydanticBaseModelValidation.tr,
        "address_gov_code": "Adres İl Kodu",
        "part_no": "Daire No",
        "part_level": "Daire Seviyesi",
        "build_part_type_uu_id": "Bina Daire Tipi UUID'si",
        "part_code": "Daire Kodu",
        "part_gross_size": "Daire Brüt Alanı",
        "part_net_size": "Daire Net Alanı",
        "default_accessory": "Varsayılan Aksesuar",
        "human_livable": "İnsan Yaşanabilir",
        "part_direction": "Daire Yönü",
        "current_owner_person_uu_id": "Mevcut Sahip Kişi UUID'si",
        "current_tenant_person_uu_id": "Mevcut Kiracı Kişi UUID'si",
    }
    en = {
        **PydanticBaseModelValidation.en,
        "address_gov_code": "Address Gov Code",
        "part_no": "Flat No",
        "part_level": "Flat Level",
        "build_part_type_uu_id": "Build Flat Type UUID",
        "part_code": "Flat Code",
        "part_gross_size": "Flat Gross Size",
        "part_net_size": "Flat Net Size",
        "default_accessory": "Default Accessory",
        "human_livable": "Human Livable",
        "part_direction": "Flat Direction",
        "current_owner_person_uu_id": "Current Owner Person UUID",
        "current_tenant_person_uu_id": "Current Tenant Person UUID",
    }


class UpdateBuildParts(PydanticBaseModel, UpdateBuildPartsValidation):
    address_gov_code: Optional[str] = None
    part_no: Optional[int] = None
    part_level: Optional[int] = None
    build_part_type_uu_id: Optional[str] = None

    part_code: Optional[int] = None
    part_gross_size: Optional[int] = None
    part_net_size: Optional[int] = None
    default_accessory: Optional[str] = None
    human_livable: Optional[bool] = False
    part_direction: Optional[str] = None
    current_owner_person_uu_id: Optional[str] = None
    current_tenant_person_uu_id: Optional[str] = None
