from pydantic import BaseModel from typing import Optional, List from datetime import datetime from decimal import Decimal from uuid import UUID from .base_responses import BaseResponse, CrudCollection class AccountBooksResponse(BaseResponse): """Response model for account books""" country: str branch_type: int company_id: int company_uu_id: str branch_id: Optional[int] branch_uu_id: Optional[str] class AccountBooksCollection(CrudCollection[AccountBooksResponse]): """Collection of account books""" pass class AccountCodesResponse(BaseResponse): """Response model for account codes""" account_code: str comment_line: str is_receive_or_debit: bool product_id: int = 0 nvi_id: str = "" status_id: int = 0 account_code_seperator: str = "." system_id: int = 0 locked: bool = False company_id: Optional[int] company_uu_id: str customer_id: Optional[int] customer_uu_id: str person_id: Optional[int] person_uu_id: str class AccountCodesCollection(CrudCollection[AccountCodesResponse]): """Collection of account codes""" pass class AccountCodeParserResponse(BaseResponse): """Response model for account code parser""" account_code_1: str account_code_2: str account_code_3: str account_code_4: str = "" account_code_5: str = "" account_code_6: str = "" account_code_id: int account_code_uu_id: str class AccountCodeParserCollection(CrudCollection[AccountCodeParserResponse]): """Collection of account code parsers""" pass class AccountMasterResponse(BaseResponse): """Response model for account master""" doc_date: datetime plug_type: str plug_number: int special_code: str = "" authorization_code: str = "" doc_code: str = "" doc_type: int = 0 comment_line1: str = "" comment_line2: str = "" comment_line3: str = "" comment_line4: str = "" comment_line5: str = "" comment_line6: str = "" project_code: str = "" module_no: str = "" journal_no: int = 0 status_id: int = 0 canceled: bool = False print_count: int = 0 total_active: Decimal = Decimal("0") total_passive: Decimal = Decimal("0") total_active_1: Decimal = Decimal("0") total_passive_1: Decimal = Decimal("0") total_active_2: Decimal = Decimal("0") total_passive_2: Decimal = Decimal("0") total_active_3: Decimal = Decimal("0") total_passive_3: Decimal = Decimal("0") total_active_4: Decimal = Decimal("0") total_passive_4: Decimal = Decimal("0") cross_ref: int = 0 data_center_id: str = "" data_center_rec_num: int = 0 account_header_id: int account_header_uu_id: str project_item_id: Optional[int] project_item_uu_id: Optional[str] department_id: Optional[int] department_uu_id: Optional[str] class AccountMasterCollection(CrudCollection[AccountMasterResponse]): """Collection of account masters""" pass class AccountDetailResponse(BaseResponse): """Response model for account detail""" doc_date: datetime line_no: int receive_debit: str debit: Decimal department: str = "" special_code: str = "" account_ref: int = 0 account_fiche_ref: int = 0 center_ref: int = 0 general_code: str = "" credit: Decimal = Decimal("0") currency_type: str = "TL" exchange_rate: Decimal = Decimal("0") debit_cur: Decimal = Decimal("0") credit_cur: Decimal = Decimal("0") discount_cur: Decimal = Decimal("0") amount: Decimal = Decimal("0") cross_account_code: str = "" inf_index: Decimal = Decimal("0") not_inflated: int = 0 not_calculated: int = 0 comment_line1: str = "" comment_line2: str = "" comment_line3: str = "" comment_line4: str = "" comment_line5: str = "" comment_line6: str = "" owner_acc_ref: int = 0 from_where: int = 0 orj_eid: int = 0 canceled: int = 0 cross_ref: int = 0 data_center_id: str = "" data_center_rec_num: str = "0" status_id: int = 0 plug_type_id: Optional[int] plug_type_uu_id: str account_header_id: int account_header_uu_id: str account_code_id: int account_code_uu_id: str account_master_id: int account_master_uu_id: str project_id: Optional[int] project_uu_id: Optional[str] class AccountDetailCollection(CrudCollection[AccountDetailResponse]): """Collection of account details""" pass class AccountRecordResponse(BaseResponse): """Response model for account records""" iban: str bank_date: datetime currency_value: Decimal bank_balance: Decimal currency: str = "TRY" additional_balance: Decimal = Decimal("0") channel_branch: str process_name: str process_type: str process_comment: str bank_reference_code: str add_comment_note: Optional[str] is_receipt_mail_send: Optional[bool] = False found_from: Optional[str] similarity: Optional[float] remainder_balance: Optional[Decimal] bank_date_y: Optional[int] bank_date_m: Optional[int] bank_date_w: Optional[int] bank_date_d: Optional[int] approving_accounting_record: Optional[bool] accounting_receipt_date: Optional[datetime] accounting_receipt_number: Optional[int] approved_record: Optional[bool] import_file_name: Optional[str] receive_debit_uu_id: Optional[str] budget_type_uu_id: Optional[str] company_uu_id: Optional[str] send_company_uu_id: Optional[str] customer_id: Optional[str] customer_uu_id: Optional[str] send_person_uu_id: Optional[str] approving_accounting_person_uu_id: Optional[str] build_parts_uu_id: Optional[str] build_decision_book_uu_id: Optional[str] class AccountRecordCollection(CrudCollection[AccountRecordResponse]): """Collection of account records""" pass class AccountRecordExchangeResponse(BaseResponse): """Response model for account record exchanges""" account_record_id: int account_record_uu_id: str exchange_rate: Decimal exchange_currency: str = "TRY" exchange_value: Decimal exchange_date: datetime class AccountRecordExchangeCollection(CrudCollection[AccountRecordExchangeResponse]): """Collection of account record exchanges""" pass class AccountRecordsListResponse(BaseModel): """Response model for account records list endpoint""" uu_id: UUID account_name: str account_code: str company_id: int company_uu_id: str created_at: datetime updated_at: Optional[datetime] deleted: bool = False