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


class DecisionBookDecisionBookInvitations(BaseModelRegular):
    build_decision_book_uu_id: str
    message: str
    planned_date: str


class DecisionBookDecisionBookInvitationsAttend(BaseModelRegular):
    token: str
    is_attend: bool


class DecisionBookDecisionBookInvitationsAssign(BaseModelRegular):
    token: str
    build_living_space_uu_id: str
    occupant_type_uu_id: str


class DecisionBookDecisionBookInvitationsUpdate(PydanticBaseModel):
    token: str
    occupant_type_uu_id: Optional[str] = None


class ListDecisionBook(ListOptions, PydanticBaseModel):
    build_decision_book_uu_id: Optional[str] = None


class InsertDecisionBook(PydanticBaseModel):
    build_uu_id: str
    decision_type: str
    meeting_date: str
    is_out_sourced: bool

    resp_company_fix_wage: Optional[float] = None
    resp_company_uu_id: Optional[str] = None


class InsertDecisionBookCompleted(BaseModelRegular):
    build_decision_book_uu_id: str
    meeting_completed_date: str


class InsertDecisionBookPerson(BaseModelRegular):
    person_uu_id: str
    build_decision_book_uu_id: str
    management_typecode_uu_id: str

    dues_discount_approval_date: Optional[str] = None
    dues_fix_discount: Optional[float] = None
    dues_percent_discount: Optional[int] = None


class RemoveDecisionBookPerson(PydanticBaseModel):
    person_uu_id: str
    build_decision_book_person_uu_id: str


class UpdateDecisionBook(PydanticBaseModel):
    decision_book_pdf_path: Optional[str] = None
    is_out_sourced: Optional[bool] = None
    contact_agreement_path: Optional[str] = None
    contact_agreement_date: Optional[str] = None
    meeting_date: Optional[str] = None
    decision_type: Optional[str] = None

    resp_company_fix_wage: Optional[float] = None
    resp_company_uu_id: Optional[str] = None


class InsertBuildDecisionBookItems(BaseModelRegular):
    token: str
    info_type_uu_id: str
    unit_price: float
    currency: Optional[str] = "TL"
    unit_type: Optional[str] = "M2"
    debit_start_date: Optional[str] = None
    debit_end_date: Optional[str] = None
    unit_price_is_fixed: Optional[bool] = False
    item_comment: Optional[str] = None

    # build_decision_book_uu_id: str
    # item_objection: Optional[str] = None


class UpdateBuildDecisionBookItems(PydanticBaseModel):
    item_comment: Optional[str] = None
    item_objection: Optional[str] = None


class InsertBuildDecisionBookItemDebits(BaseModelRegular):
    build_decision_book_item_uu_id: str
    dues_values: dict
    # dues_types_uu_id: str
    # decision_taken: Optional[bool] = None


class UpdateBuildDecisionBookItemDebits(PydanticBaseModel):
    dues_types_uu_id: Optional[str] = None
    dues_values: Optional[dict] = None
    decision_taken: Optional[bool] = None
