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


class PostCodeValidation:
    tr = {
        "post_code": "Posta Kodu",
        "street_uu_id": "Sokak UUID",
    }
    en = {
        "post_code": "Post Code",
        "street_uu_id": "Street UUID",
    }


class InsertPostCode(BaseModelRegular, PostCodeValidation):
    street_uu_id: str
    post_code: str


class UpdatePostCode(PydanticBaseModel, PostCodeValidation):
    street_uu_id: Optional[str] = None
    post_code: Optional[str] = None


class SearchAddressValidation:
    tr = {
        "search": "Ara",
        "list_options": "Liste Seçenekleri",
    }
    en = {
        "search": "Search",
        "list_options": "List Options",
    }


class SearchAddress(PydanticBaseModel, SearchAddressValidation):
    search: str
    list_options: ListOptions


class StreetValidation:
    tr = {
        "street_code": "Sokak Kodu",
        "street_name": "Sokak Adı",
        "postcode": "Posta Kodu",
        "type_code": "Tip Kodu",
        "type_description": "Tip Açıklaması",
        "gov_code": "Devlet Kodu",
        "address_geographic_uu_id": "Coğrafi UUID",
    }
    en = {
        "street_code": "Street Code",
        "street_name": "Street Name",
        "postcode": "Post Code",
        "type_code": "Type Code",
        "type_description": "Type Description",
        "gov_code": "Government Code",
        "address_geographic_uu_id": "Address Geographic UUID",
    }


class InsertStreet(PydanticBaseModel, StreetValidation):
    street_code: str
    street_name: str
    postcode: str

    type_code: Optional[str] = None
    type_description: Optional[str] = None
    gov_code: Optional[str] = None
    address_geographic_uu_id: Optional[str] = None


class AddressValidation:
    tr = {
        "post_code_uu_id": "Posta Kodu UUID",
        "comment_address": "Adres Yorumu",
        "letter_address": "Mektup Adresi",
        "build_number": "Bina Numarası",
        "door_number": "Kapı Numarası",
        "floor_number": "Kat Numarası",
        "short_letter_address": "Kısa Mektup Adresi",
        "latitude": "Enlem",
        "longitude": "Boylam",
    }
    en = {
        "post_code_uu_id": "Post Code UUID",
        "comment_address": "Address Comment",
        "letter_address": "Letter Address",
        "build_number": "Build Number",
        "door_number": "Door Number",
        "floor_number": "Floor Number",
        "short_letter_address": "Short Letter Address",
        "latitude": "Latitude",
        "longitude": "Longitude",
    }


class InsertAddress(BaseModelRegular, AddressValidation):
    post_code_uu_id: str

    comment_address: Optional[str] = None
    letter_address: Optional[str] = None

    build_number: str
    door_number: Optional[str] = None
    floor_number: Optional[str] = None

    short_letter_address: Optional[str] = None
    latitude: Optional[float] = None
    longitude: Optional[float] = None


class UpdateAddress(PydanticBaseModel, AddressValidation):
    post_code_uu_id: Optional[str] = None

    comment_address: Optional[str] = None
    letter_address: Optional[str] = None

    build_number: Optional[str] = None
    door_number: Optional[str] = None
    floor_number: Optional[str] = None

    short_letter_address: Optional[str] = None
    latitude: Optional[float] = None
    longitude: Optional[float] = None
