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


class InsertBuildDecisionBookProjectItemsValidation:
    tr = {
        "build_decision_book_project_uu_id": "Proje UUID",
        "item_header": "Başlık",
        "item_comment": "Açıklama",
        "attachment_pdf_path": "Ek Dosya Yolu",
        "item_objection": "İtiraz",
    }
    en = {
        "build_decision_book_project_uu_id": "Project UUID",
        "item_header": "Header",
        "item_comment": "Comment",
        "attachment_pdf_path": "Attachment PDF Path",
        "item_objection": "Objection",
    }


class InsertBuildDecisionBookProjectItems(
    BaseModelRegular, InsertBuildDecisionBookProjectItemsValidation
):
    build_decision_book_project_uu_id: str
    item_header: str
    item_comment: str
    attachment_pdf_path: Optional[str] = None
    item_objection: Optional[str] = None


class UpdateBuildDecisionBookProjectItemsValidation:
    tr = {
        **InsertBuildDecisionBookProjectItemsValidation.tr,
        **PydanticBaseModelValidation.tr,
    }
    en = {
        **InsertBuildDecisionBookProjectItemsValidation.en,
        **PydanticBaseModelValidation.en,
    }


class UpdateBuildDecisionBookProjectItems(PydanticBaseModel):
    item_header: Optional[str] = None
    item_comment: Optional[str] = None
    attachment_pdf_path: Optional[str] = None
    item_estimated_cost: Optional[float] = None
    build_decision_book_project_uu_id: Optional[str] = None


class InsertBuildDecisionBookProjectPersonValidation:
    tr = {
        "dues_percent_discount": "İskonto Oranı",
        "job_fix_wage": "Sabit Ücret",
        "bid_price": "Teklif Fiyatı",
        "decision_price": "Karar Fiyatı",
        "build_decision_book_project_uu_id": "Proje UUID",
        "living_space_uu_id": "Yaşam Alanı UUID",
        "project_team_type_uu_id": "Proje Takım Tipi UUID",
    }
    en = {
        "dues_percent_discount": "Discount Rate",
        "job_fix_wage": "Fixed Wage",
        "bid_price": "Bid Price",
        "decision_price": "Decision Price",
        "build_decision_book_project_uu_id": "Project UUID",
        "living_space_uu_id": "Living Space UUID",
        "project_team_type_uu_id": "Project Team Type UUID",
    }


class InsertBuildDecisionBookProjectPerson(
    BaseModelRegular, InsertBuildDecisionBookProjectPersonValidation
):
    dues_percent_discount: Optional[int] = None
    job_fix_wage: Optional[float] = None
    bid_price: Optional[float] = None
    decision_price: Optional[float] = None
    build_decision_book_project_uu_id: str
    living_space_uu_id: str
    project_team_type_uu_id: str


class UpdateBuildDecisionBookProjectPersonValidation:
    tr = {
        **InsertBuildDecisionBookProjectPersonValidation.tr,
        **PydanticBaseModelValidation.tr,
    }
    en = {
        **InsertBuildDecisionBookProjectPersonValidation.en,
        **PydanticBaseModelValidation.en,
    }


class UpdateBuildDecisionBookProjectPerson(
    PydanticBaseModel, UpdateBuildDecisionBookProjectPersonValidation
):
    dues_percent_discount: Optional[int] = None
    job_fix_wage: Optional[float] = None
    bid_price: Optional[float] = None
    decision_price: Optional[float] = None
    build_decision_book_project_uu_id: Optional[str] = None
    living_space_uu_id: Optional[str] = None
    project_team_type_uu_id: Optional[str] = None


class InsertBuildDecisionBookProjectsValidation:
    tr = {
        "build_decision_book_item_uu_id": "Karar Defteri UUID",
        "project_responsible_person_uu_id": "Proje Sorumlu Kişi UUID",
        "project_name": "Proje Adı",
        "project_start_date": "Proje Başlangıç Tarihi",
        "project_stop_date": "Proje Bitiş Tarihi",
        "project_type": "Proje Tipi",
        "is_out_sourced": "Dış Kaynak Kullanımı",
        "project_note": "Proje Notu",
        "decision_book_pdf_path": "Karar Defteri PDF Yolu",
        "resp_company_fix_wage": "Firma Sabit Ücreti",
        "contact_agreement_path": "İletişim Anlaşması Yolu",
        "contact_agreement_date": "İletişim Anlaşması Tarihi",
        "meeting_date": "Toplantı Tarihi",
        "currency": "Para Birimi",
        "bid_price": "Teklif Fiyatı",
        "resp_company_uu_id": "Firma UUID",
    }
    en = {
        "build_decision_book_item_uu_id": "Decision Book UUID",
        "project_responsible_person_uu_id": "Project Responsible Person UUID",
        "project_name": "Project Name",
        "project_start_date": "Project Start Date",
        "project_stop_date": "Project Stop Date",
        "project_type": "Project Type",
        "is_out_sourced": "Out Sourced",
        "project_note": "Project Note",
        "decision_book_pdf_path": "Decision Book PDF Path",
        "resp_company_fix_wage": "Company Fixed Wage",
        "contact_agreement_path": "Contact Agreement Path",
        "contact_agreement_date": "Contact Agreement Date",
        "meeting_date": "Meeting Date",
        "currency": "Currency",
        "bid_price": "Bid Price",
        "resp_company_uu_id": "Company UUID",
    }


class InsertBuildDecisionBookProjects(
    BaseModelRegular, InsertBuildDecisionBookProjectsValidation
):
    build_decision_book_item_uu_id: str
    project_responsible_person_uu_id: str
    project_name: str
    project_start_date: str
    project_stop_date: str
    project_type: str

    is_out_sourced: Optional[bool] = False
    project_note: Optional[str] = None
    decision_book_pdf_path: Optional[str] = None
    resp_company_fix_wage: Optional[float] = None
    contact_agreement_path: Optional[str] = None
    contact_agreement_date: Optional[str] = None
    meeting_date: Optional[str] = None
    currency: Optional[str] = None
    bid_price: Optional[float] = None
    resp_company_uu_id: Optional[str] = None


class UpdateBuildDecisionBookProjectsValidation:
    tr = {
        **InsertBuildDecisionBookProjectsValidation.tr,
        **PydanticBaseModelValidation.tr,
    }
    en = {
        **InsertBuildDecisionBookProjectsValidation.en,
        **PydanticBaseModelValidation.en,
    }


class UpdateBuildDecisionBookProjects(
    PydanticBaseModel, UpdateBuildDecisionBookProjectsValidation
):
    build_decision_book_project_uu_id: str
    is_out_sourced: Optional[bool] = False
    project_note: Optional[str] = None
    # decision_book_pdf_path: Optional[str] = None
    status_id: Optional[int] = None
    resp_company_fix_wage: Optional[float] = None
    contact_agreement_path: Optional[str] = None
    contact_agreement_date: Optional[str] = None
    contact_uu_id: Optional[str] = None
    resp_company_uu_id: Optional[str] = None
    approved_price: Optional[float] = None


class ApprovalsBuildDecisionBookProjectsValidation:
    tr = {
        "build_decision_book_project_uu_id": "Karar Defteri Proje UUID",
        "project_stop_date": "Proje Bitiş Tarihi",
        "status_code": "Durum Kodu",
        "final_price_list": "Son Fiyat Listesi",
    }
    en = {
        "build_decision_book_project_uu_id": "Decision Book Project UUID",
        "project_stop_date": "Project Stop Date",
        "status_code": "Status Code",
        "final_price_list": "Final Price List",
    }


class ApprovalsBuildDecisionBookProjects(
    PydanticBaseModel, ApprovalsBuildDecisionBookProjectsValidation
):
    build_decision_book_project_uu_id: str
    project_stop_date: str
    status_code: Optional[int] = None
    final_price_list: Optional[list[dict]] = (
        None  # {"date": "2021-01-01", "price": 1000}
    )


class InsertBuildDecisionBookProjectItemDebitsValidation:
    tr = {
        "build_decision_book_project_item_uu_id": "Karar Defteri Proje Öğe UUID",
        "payment_date": "Ödeme Tarihi",
        "dues_values": "Borç Değerleri",
        "is_official": "Resmi Mi?",
        "discount_value": "İskonto Oranı",
        "discount_fix": "İskonto Sabit",
        "decision_taken": "Karar Alındı Mı?",
    }
    en = {
        "build_decision_book_project_item_uu_id": "Decision Book Project Item UUID",
        "payment_date": "Payment Date",
        "dues_values": "Dues Values",
        "is_official": "Is Official?",
        "discount_value": "Discount Rate",
        "discount_fix": "Discount Fix",
        "decision_taken": "Decision Taken?",
    }


class InsertBuildDecisionBookProjectItemDebits(
    PydanticBaseModel, InsertBuildDecisionBookProjectItemDebitsValidation
):
    build_decision_book_project_item_uu_id: str
    payment_date: str
    dues_values: dict
    is_official: Optional[bool] = False
    discount_value: Optional[float] = None
    discount_fix: Optional[float] = None
    decision_taken: Optional[bool] = None


class UpdateBuildDecisionBookProjectItemDebitsValidation:
    tr = {
        **InsertBuildDecisionBookProjectItemDebitsValidation.tr,
        **PydanticBaseModelValidation.tr,
    }
    en = {
        **InsertBuildDecisionBookProjectItemDebitsValidation.en,
        **PydanticBaseModelValidation.en,
    }


class UpdateBuildDecisionBookProjectItemDebits(
    PydanticBaseModel, UpdateBuildDecisionBookProjectItemDebitsValidation
):
    dues_values: Optional[str] = None
    discount_value: Optional[float] = None
    discount_fix: Optional[float] = None
    decision_taken: Optional[bool] = None
    is_official: Optional[bool] = None
