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


class CompanyValidation:
    tr = {
        "formal_name": "Resmi Ad",
        "company_type": "Şirket Tipi",
        "commercial_type": "Ticari Tip",
        "tax_no": "Vergi No",
        "public_name": "Halka Açık Ad",
        "company_tag": "Şirket Etiketi",
        "default_lang_type": "Varsayılan Dil Tipi",
        "default_money_type": "Varsayılan Para Tipi",
        "official_address_uu_id": "Resmi Adres UU ID",
    }


class InsertCompany(BaseModelRegular, CompanyValidation):
    formal_name: str
    company_type: str
    commercial_type: str
    tax_no: str
    public_name: Optional[str] = None
    company_tag: Optional[str] = None
    default_lang_type: Optional[str] = None
    default_money_type: Optional[str] = None
    official_address_uu_id: Optional[str] = None
    # parent_uu_id: Optional[int] = None


class CompanyUpdateValidation:
    tr = {
        **CompanyValidation.tr,
        **PydanticBaseModelValidation.tr,
    }
    en = {
        **CompanyValidation.tr,
        **PydanticBaseModelValidation.en,
    }


class UpdateCompany(PydanticBaseModel, CompanyUpdateValidation):
    company_uu_id: str
    public_name: Optional[str] = None
    formal_name: Optional[str] = None
    tax_no: Optional[str] = None
    company_tag: Optional[str] = None
    default_lang_type: Optional[str] = None
    default_money_type: Optional[str] = None
    official_address_uu_id: Optional[str] = None


class MatchCompany2CompanyValidation:
    tr = {
        **PydanticBaseModelValidation.tr,
        "match_company_uu_id": "Eşleşen Şirket UU ID",
        "duty_uu_id": "Görev UU ID",
    }
    en = {
        **PydanticBaseModelValidation.en,
        "match_company_uu_id": "Match Company UU ID",
        "duty_uu_id": "Duty UU ID",
    }


class MatchCompany2Company(PydanticBaseModel, MatchCompany2CompanyValidation):
    match_company_uu_id: List[str]
    duty_uu_id: str
    show_only: Optional[bool] = None
