validations and dockerfiles are updated

This commit is contained in:
2025-01-10 12:40:52 +03:00
parent f4f9e584ff
commit 4eb95e4d9c
107 changed files with 400185 additions and 1338 deletions

View File

@@ -1,136 +0,0 @@
from typing import Optional
from api_validations.core_validations import BaseModelRegular
from api_validations.validations_request import (
CrudRecordValidation,
CrudRecords,
)
class AccountListValidation:
tr = {
**CrudRecordValidation.tr,
"iban": "IBAN Numarası",
"bank_date": "Banka İşlem Tarihi",
"currency_value": "Para Birimi Değeri",
"bank_balance": "Banka Bakiyesi",
"currency": "Para Birimi Birimi",
"additional_balance": "Ek Bakiye",
"channel_branch": "Şube Banka",
"process_name": "Banka İşlem Türü Adı",
"process_type": "Banka İşlem Türü",
"process_comment": "İşlem Kayıt Yorumu",
"process_garbage": "İşlem Kayıt Çöpü",
"bank_reference_code": "Banka Referans Kodu",
"add_comment_note": "Yorum Not Ekle",
"is_receipt_mail_send": "Makbuz Posta Gönderildi",
"found_from": "Bulunduğu Yer",
"similarity": "Benzerlik",
"remainder_balance": "Kalan Bakiye",
"bank_date_y": "Banka İşlem Yılı",
"bank_date_m": "Banka İşlem Ayı",
"bank_date_w": "Banka İşlem Haftası",
"bank_date_d": "Banka İşlem Günü",
"approving_accounting_record": "Onaylayan Muhasebe Kaydı",
"accounting_receipt_date": "Muhasebe Makbuz Tarihi",
"accounting_receipt_number": "Muhasebe Makbuz Numarası",
"approved_record": "Onaylanmış Kayıt",
"import_file_name": "İçe Aktarım Dosya Adı",
"receive_debit": "Alacak Borç",
"receive_debit_uu_id": "Alacak Borç UU Kimliği",
"budget_type": "Bütçe Türü",
"budget_type_uu_id": "Bütçe Türü UU Kimliği",
"company_uu_id": "Şirket UU Kimliği",
"send_company_uu_id": "Şirket UU Kimliği Gönder",
"send_person_uu_id": "Kişi UU Kimliği Gönder",
"approving_accounting_person_uu_id": "Onaylayan Muhasebe Kişi UU Kimliği",
"living_space_uu_id": "Yaşam Alanı UU Kimliği",
"customer_uu_id": "Müşteri UU Kimliği",
"build_uu_id": "Yapı UU Kimliği",
"build_parts_uu_id": "Yapı Parça UU Kimliği",
"build_decision_book_uu_id": "Yapı Karar Defteri UU Kimliği",
}
en = {
**CrudRecordValidation.en,
"iban": "IBAN Number",
"bank_date": "Bank Transaction Date",
"currency_value": "Currency Value",
"bank_balance": "Bank Balance",
"currency": "Unit of Currency",
"additional_balance": "Additional Balance",
"channel_branch": "Branch Bank",
"process_name": "Bank Process Type Name",
"process_type": "Bank Process Type",
"process_comment": "Transaction Record Comment",
"process_garbage": "Transaction Record Garbage",
"bank_reference_code": "Bank Reference Code",
"add_comment_note": "Add Comment Note",
"is_receipt_mail_send": "Receipt Mail Send",
"found_from": "Found From",
"similarity": "Similarity",
"remainder_balance": "Remainder Balance",
"bank_date_y": "Bank Date Year",
"bank_date_m": "Bank Date Month",
"bank_date_w": "Bank Date Week",
"bank_date_d": "Bank Date Day",
"approving_accounting_record": "Approving Accounting Record",
"accounting_receipt_date": "Accounting Receipt Date",
"accounting_receipt_number": "Accounting Receipt Number",
"approved_record": "Approved Record",
"import_file_name": "Import File Name",
"receive_debit": "Receive Debit",
"receive_debit_uu_id": "Receive Debit UU ID",
"budget_type": "Budget Type",
"budget_type_uu_id": "Budget Type UU ID",
"company_uu_id": "Company UU ID",
"send_company_uu_id": "Send Company UU ID",
"send_person_uu_id": "Send Person UU ID",
"approving_accounting_person_uu_id": "Approving Accounting Person UU ID",
"living_space_uu_id": "Living Space UU ID",
"customer_uu_id": "Customer UU ID",
"build_uu_id": "Build UU ID",
"build_parts_uu_id": "Build Parts UU ID",
"build_decision_book_uu_id": "Build Decision Book UU ID",
}
class AccountListResponse(BaseModelRegular, CrudRecords, AccountListValidation):
iban: Optional[str] = None
bank_date: Optional[str] = None
currency_value: Optional[str] = None
bank_balance: Optional[str] = None
currency: Optional[str] = None
additional_balance: Optional[str] = None
channel_branch: Optional[str] = None
process_name: Optional[str] = None
process_type: Optional[str] = None
process_comment: Optional[str] = None
process_garbage: Optional[str] = None
bank_reference_code: Optional[str] = None
add_comment_note: Optional[str] = None
is_receipt_mail_send: Optional[str] = None
found_from: Optional[str] = None
similarity: Optional[str] = None
remainder_balance: Optional[str] = None
bank_date_y: Optional[str] = None
bank_date_m: Optional[str] = None
bank_date_w: Optional[str] = None
bank_date_d: Optional[str] = None
approving_accounting_record: Optional[str] = None
accounting_receipt_date: Optional[str] = None
accounting_receipt_number: Optional[str] = None
approved_record: Optional[str] = None
import_file_name: Optional[str] = None
receive_debit: Optional[str] = None
receive_debit_uu_id: Optional[str] = None
budget_type: Optional[str] = None
budget_type_uu_id: Optional[str] = None
company_uu_id: Optional[str] = None
send_company_uu_id: Optional[str] = None
send_person_uu_id: Optional[str] = None
approving_accounting_person_uu_id: Optional[str] = None
living_space_uu_id: Optional[str] = None
customer_uu_id: Optional[str] = None
build_uu_id: Optional[str] = None
build_parts_uu_id: Optional[str] = None
build_decision_book_uu_id: Optional[str] = None

View File

@@ -0,0 +1,234 @@
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

View File

@@ -0,0 +1,33 @@
from pydantic import BaseModel
from typing import Optional, List, Dict, Any
from datetime import datetime
from uuid import UUID
class AuthenticationLoginResponse(BaseModel):
"""Response model for authentication login endpoint"""
token: str
refresh_token: str
token_type: str
expires_in: int
user_info: Dict[str, Any]
class AuthenticationRefreshResponse(BaseModel):
"""Response model for authentication refresh endpoint"""
token: str
refresh_token: str
token_type: str
expires_in: int
class AuthenticationUserInfoResponse(BaseModel):
"""Response model for authentication user info endpoint"""
user_id: int
username: str
email: str
first_name: str
last_name: str
is_active: bool
created_at: datetime
updated_at: Optional[datetime]

View File

@@ -0,0 +1,38 @@
from pydantic import BaseModel
from typing import Optional, TypeVar, Generic, List
from datetime import datetime
from uuid import UUID
T = TypeVar('T')
class BaseResponse(BaseModel):
"""Base response model that all other response models inherit from"""
uu_id: str
created_at: datetime
updated_at: Optional[datetime]
created_by: Optional[str]
updated_by: Optional[str]
confirmed_by: Optional[str]
is_confirmed: Optional[bool] = None
active: Optional[bool] = True
deleted: Optional[bool] = False
expiry_starts: Optional[datetime]
expiry_ends: Optional[datetime]
is_notification_send: Optional[bool] = False
is_email_send: Optional[bool] = False
class Config:
from_attributes = True
class CrudCollection(BaseModel, Generic[T]):
"""Base collection model for paginated responses"""
page: int = 1
size: int = 10
total: int = 0
order_field: str = "id"
order_type: str = "asc"
items: List[T] = []
class Config:
from_attributes = True

View File

@@ -0,0 +1,76 @@
from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime
from uuid import UUID
from decimal import Decimal
from .base_responses import BaseResponse, CrudCollection
class DecisionBookBudgetBooksResponse(BaseResponse):
"""Response model for decision book budget books"""
country: str
branch_type: int = 0
company_id: int
company_uu_id: str
branch_id: Optional[int]
branch_uu_id: Optional[str]
build_decision_book_id: int
build_decision_book_uu_id: Optional[str]
class DecisionBookBudgetBooksCollection(CrudCollection[DecisionBookBudgetBooksResponse]):
"""Collection of decision book budget books"""
pass
class DecisionBookBudgetCodesResponse(BaseResponse):
"""Response model for decision book budget codes"""
budget_code: str
comment_line: str
budget_type: str
budget_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
class DecisionBookBudgetCodesCollection(CrudCollection[DecisionBookBudgetCodesResponse]):
"""Collection of decision book budget codes"""
pass
class DecisionBookBudgetMasterResponse(BaseResponse):
"""Response model for decision book budget master"""
budget_type: str
currency: str = "TRY"
total_budget: Decimal
tracking_period_id: Optional[int]
tracking_period_uu_id: Optional[str]
budget_books_id: int
budget_books_uu_id: Optional[str]
department_id: int
department_uu_id: Optional[str]
class DecisionBookBudgetMasterCollection(CrudCollection[DecisionBookBudgetMasterResponse]):
"""Collection of decision book budget masters"""
pass
class DecisionBookBudgetsResponse(BaseResponse):
"""Response model for decision book budgets"""
process_date: datetime
budget_codes_id: int
total_budget: Decimal
used_budget: Decimal = Decimal("0")
remaining_budget: Decimal = Decimal("0")
decision_book_budget_master_id: int
decision_book_budget_master_uu_id: Optional[str]
class DecisionBookBudgetsCollection(CrudCollection[DecisionBookBudgetsResponse]):
"""Collection of decision book budgets"""
pass

View File

@@ -1,123 +0,0 @@
from typing import Optional
from api_validations.core_validations import BaseModelRegular
from api_validations.validations_request import (
CrudRecordValidation,
CrudRecords,
)
class BuildListValidation:
tr = {
**CrudRecordValidation.tr,
"gov_address_code": "Devlet Adres Kodu",
"build_name": "Bina Adı",
"build_types_uu_id": "Bina Tipi",
"build_no": "Bina No",
"max_floor": "Kat Sayısı",
"underground_floor": "Bodrum Kat Sayısı",
"address_uu_id": "Adres",
"build_date": "Yapım Tarihi",
"decision_period_date": "Karar Tarihi",
"tax_no": "Vergi No",
"lift_count": "Asansör Sayısı",
"heating_system": "Isıtma Sistemi",
"cooling_system": "Soğutma Sistemi",
"hot_water_system": "Sıcak Su Sistemi",
"block_service_man_count": "Hizmet Görevlisi Sayısı",
"security_service_man_count": "Güvenlik Görevlisi Sayısı",
"garage_count": "Garaj Sayısı",
"site_uu_id": "Site UUID",
}
en = {
**CrudRecordValidation.en,
"gov_address_code": "Government Address Code",
"build_name": "Building Name",
"build_types_uu_id": "Building Type",
"build_no": "Building No",
"max_floor": "Number of Floors",
"underground_floor": "Number of Basement Floors",
"address_uu_id": "Address",
"build_date": "Construction Date",
"decision_period_date": "Decision Date",
"tax_no": "Tax No",
"lift_count": "Number of Elevators",
"heating_system": "Heating System",
"cooling_system": "Cooling System",
"hot_water_system": "Hot Water System",
"block_service_man_count": "Number of Service Officers",
"security_service_man_count": "Number of Security Officers",
"garage_count": "Number of Garages",
"site_uu_id": "Site UUID",
}
class ListBuildingResponse(BaseModelRegular, CrudRecords, BuildListValidation):
gov_address_code: Optional[str] = None
build_name: Optional[str] = None
build_types_uu_id: Optional[str] = None
build_no: Optional[str] = None
max_floor: Optional[int] = None
underground_floor: Optional[int] = None
address_uu_id: Optional[str] = None
build_date: Optional[str] = None
decision_period_date: Optional[str] = None
tax_no: Optional[str] = None
lift_count: Optional[int] = None
heating_system: Optional[bool] = None
cooling_system: Optional[bool] = None
hot_water_system: Optional[bool] = None
block_service_man_count: Optional[int] = None
security_service_man_count: Optional[int] = None
garage_count: Optional[int] = None
site_uu_id: Optional[str] = None
# class InsertBuild(BaseModelRegular, BuildValidation):
# gov_address_code: str
# build_name: str
# build_types_uu_id: str
# max_floor: int
# underground_floor: int
# address_uu_id: str
# build_date: str
# decision_period_date: str
#
# tax_no: Optional[str] = None
# lift_count: Optional[int] = None
# heating_system: Optional[bool] = None
# cooling_system: Optional[bool] = None
# hot_water_system: Optional[bool] = None
# block_service_man_count: Optional[int] = None
# security_service_man_count: Optional[int] = None
# garage_count: Optional[int] = None
#
#
# class BuildUpdateValidation:
# tr = {
# **BuildValidation.tr,
# **PydanticBaseModelValidation.tr,
# }
# en = {
# **BuildValidation.en,
# **PydanticBaseModelValidation.en,
# }
#
#
# class UpdateBuild(PydanticBaseModel, BuildUpdateValidation):
# gov_address_code: Optional[str] = None
# build_name: Optional[str] = None
# build_no: Optional[str] = None
# build_types: Optional[str] = None
# max_floor: Optional[int] = None
# underground_floor: Optional[int] = None
# build_date: Optional[str] = None
# tax_no: Optional[str] = None
# lift_count: Optional[int] = None
# heating_system: Optional[bool] = None
# cooling_system: Optional[bool] = None
# hot_water_system: Optional[bool] = None
# block_service_man_count: Optional[int] = None
# security_service_man_count: Optional[int] = None
# garage_count: Optional[int] = None
# address_uu_id: Optional[str] = None

View File

@@ -0,0 +1,251 @@
from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime
from uuid import UUID
from decimal import Decimal
from .base_responses import BaseResponse, CrudCollection
class BuildAreaListResponse(BaseResponse):
"""Response model for building area list endpoint"""
uu_id: UUID
build_id: int
build_uu_id: str
area_name: str
area_value: float
created_at: datetime
updated_at: Optional[datetime]
deleted: bool = False
class BuildAreaListCollection(CrudCollection[BuildAreaListResponse]):
"""Collection of building area list"""
pass
class BuildSitesListResponse(BaseResponse):
"""Response model for building sites list endpoint"""
uu_id: UUID
address_id: int
site_name: str
site_value: float
created_at: datetime
updated_at: Optional[datetime]
deleted: bool = False
class BuildSitesListCollection(CrudCollection[BuildSitesListResponse]):
"""Collection of building sites list"""
pass
class BuildTypesListResponse(BaseResponse):
"""Response model for building types list endpoint"""
uu_id: UUID
type_name: str
type_value: str
created_at: datetime
updated_at: Optional[datetime]
deleted: bool = False
class BuildTypesListCollection(CrudCollection[BuildTypesListResponse]):
"""Collection of building types list"""
pass
class BuildTypesResponse(BaseResponse):
"""Response model for building types"""
function_code: str
type_code: str
lang: str = "TR"
class BuildTypesCollection(CrudCollection[BuildTypesResponse]):
"""Collection of building types"""
pass
class Part2EmployeeResponse(BaseResponse):
"""Response model for part to employee mapping"""
build_id: int
part_id: int
employee_id: int
class Part2EmployeeCollection(CrudCollection[Part2EmployeeResponse]):
"""Collection of part to employee mappings"""
pass
class RelationshipEmployee2BuildResponse(BaseResponse):
"""Response model for employee to build relationship"""
company_id: int
employee_id: int
member_id: int
relationship_type: Optional[str] = "Employee"
show_only: bool = False
class RelationshipEmployee2BuildCollection(CrudCollection[RelationshipEmployee2BuildResponse]):
"""Collection of employee to build relationships"""
pass
class BuildResponse(BaseResponse):
"""Response model for buildings"""
gov_address_code: str = ""
build_name: str
build_no: str
max_floor: int = 1
underground_floor: int = 0
build_date: datetime
decision_period_date: datetime
tax_no: str = ""
lift_count: int = 0
heating_system: bool = True
cooling_system: bool = False
hot_water_system: bool = False
block_service_man_count: int = 0
security_service_man_count: int = 0
garage_count: int = 0
management_room_id: Optional[int]
site_id: Optional[int]
site_uu_id: Optional[str]
address_id: int
address_uu_id: str
build_types_id: int
build_types_uu_id: Optional[str]
class BuildCollection(CrudCollection[BuildResponse]):
"""Collection of buildings"""
pass
class BuildPartsResponse(BaseResponse):
"""Response model for building parts"""
address_gov_code: str
part_no: int = 0
part_level: int = 0
part_code: str
part_gross_size: int = 0
part_net_size: int = 0
default_accessory: str = "0"
human_livable: bool = True
due_part_key: str
build_id: int
build_uu_id: str
part_direction_id: Optional[int]
part_direction_uu_id: Optional[str]
part_type_id: int
part_type_uu_id: str
class BuildPartsCollection(CrudCollection[BuildPartsResponse]):
"""Collection of building parts"""
pass
class BuildLivingSpaceResponse(BaseResponse):
"""Response model for building living space"""
fix_value: Decimal = Decimal("0")
fix_percent: Decimal = Decimal("0")
agreement_no: str = ""
marketing_process: bool = False
marketing_layer: int = 0
build_parts_id: int
build_parts_uu_id: str
person_id: int
person_uu_id: str
occupant_type: int
occupant_type_uu_id: str
class BuildLivingSpaceCollection(CrudCollection[BuildLivingSpaceResponse]):
"""Collection of building living spaces"""
pass
class BuildManagementResponse(BaseResponse):
"""Response model for building management"""
discounted_percentage: Decimal = Decimal("0.00")
discounted_price: Decimal = Decimal("0.00")
calculated_price: Decimal = Decimal("0.00")
occupant_type: int
occupant_type_uu_id: str
build_id: int
build_uu_id: str
build_parts_id: int
build_parts_uu_id: str
class BuildManagementCollection(CrudCollection[BuildManagementResponse]):
"""Collection of building management records"""
pass
class BuildAreaResponse(BaseResponse):
"""Response model for building area"""
area_name: str = ""
area_code: str = ""
area_type: str = "GREEN"
area_direction: str = "NN"
area_gross_size: Decimal = Decimal("0")
area_net_size: Decimal = Decimal("0")
width: int = 0
size: int = 0
build_id: int
build_uu_id: str
part_type_id: Optional[int]
part_type_uu_id: Optional[str]
class BuildAreaCollection(CrudCollection[BuildAreaResponse]):
"""Collection of building areas"""
pass
class BuildSitesResponse(BaseResponse):
"""Response model for building sites"""
site_name: str
site_no: str
address_id: int
address_uu_id: Optional[str]
class BuildSitesCollection(CrudCollection[BuildSitesResponse]):
"""Collection of building sites"""
pass
class BuildCompaniesProvidingResponse(BaseResponse):
"""Response model for building companies providing services"""
build_id: int
build_uu_id: Optional[str]
company_id: int
company_uu_id: Optional[str]
provide_id: Optional[int]
provide_uu_id: Optional[str]
contract_id: Optional[int]
class BuildCompaniesProvidingCollection(CrudCollection[BuildCompaniesProvidingResponse]):
"""Collection of building companies providing services"""
pass
class BuildPersonProvidingResponse(BaseResponse):
"""Response model for building person providing services"""
build_id: int
build_uu_id: Optional[str]
people_id: int
people_uu_id: Optional[str]
provide_id: Optional[int]
provide_uu_id: Optional[str]
contract_id: Optional[int]
class BuildPersonProvidingCollection(CrudCollection[BuildPersonProvidingResponse]):
"""Collection of building person providing services"""
pass

View File

@@ -0,0 +1,55 @@
from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime
from uuid import UUID
class CompanyListResponse(BaseModel):
"""Response model for company list endpoint"""
uu_id: UUID
company_name: str
company_code: str
company_email: str
company_phone: str
company_address: str
created_at: datetime
updated_at: Optional[datetime]
deleted: bool = False
class CompanyDepartmentListResponse(BaseModel):
"""Response model for company department list endpoint"""
uu_id: UUID
department_name: str
department_code: str
company_id: int
company_uu_id: str
created_at: datetime
updated_at: Optional[datetime]
deleted: bool = False
class CompanyDutyListResponse(BaseModel):
"""Response model for company duty list endpoint"""
uu_id: UUID
duty_name: str
duty_code: str
department_id: int
department_uu_id: str
created_at: datetime
updated_at: Optional[datetime]
deleted: bool = False
class CompanyEmployeeListResponse(BaseModel):
"""Response model for company employee list endpoint"""
uu_id: UUID
employee_id: int
employee_uu_id: str
company_id: int
company_uu_id: str
duty_id: int
duty_uu_id: str
created_at: datetime
updated_at: Optional[datetime]
deleted: bool = False

View File

@@ -0,0 +1,178 @@
from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime
from uuid import UUID
from decimal import Decimal
from .base_responses import BaseResponse, CrudCollection
class BuildDecisionBookResponse(BaseResponse):
"""Response model for building decision book"""
decision_book_pdf_path: Optional[str] = ""
resp_company_fix_wage: float = 0
contact_agreement_path: Optional[str] = ""
contact_agreement_date: Optional[datetime]
meeting_date: Optional[str]
decision_type: Optional[str]
class BuildDecisionBookCollection(CrudCollection[BuildDecisionBookResponse]):
"""Collection of building decision books"""
pass
class BuildDecisionBookInvitationsResponse(BaseResponse):
"""Response model for building decision book invitations"""
build_id: int
build_uu_id: Optional[str]
decision_book_id: int
decision_book_uu_id: Optional[str]
invitation_type: str
invitation_attempt: int = 1
living_part_count: int = 1
living_part_percentage: Decimal = Decimal("0.51")
message: Optional[str]
planned_date: datetime
planned_date_expires: datetime
class BuildDecisionBookInvitationsCollection(CrudCollection[BuildDecisionBookInvitationsResponse]):
"""Collection of building decision book invitations"""
pass
class BuildDecisionBookPersonResponse(BaseResponse):
"""Response model for building decision book person"""
dues_percent_discount: int = 0
dues_fix_discount: Decimal = Decimal("0")
dues_discount_approval_date: datetime
send_date: datetime
is_attending: bool = False
confirmed_date: Optional[datetime]
token: str = ""
vicarious_person_id: Optional[int]
vicarious_person_uu_id: Optional[str]
invite_id: int
invite_uu_id: str
build_decision_book_id: int
build_decision_book_uu_id: str
build_living_space_id: int
build_living_space_uu_id: Optional[str]
person_id: int
class BuildDecisionBookPersonCollection(CrudCollection[BuildDecisionBookPersonResponse]):
"""Collection of building decision book persons"""
pass
class BuildDecisionBookPersonOccupantsResponse(BaseResponse):
"""Response model for building decision book person occupants"""
build_decision_book_person_id: int
build_decision_book_person_uu_id: Optional[str]
invite_id: Optional[int]
invite_uu_id: Optional[str]
occupant_type_id: int
occupant_type_uu_id: Optional[str]
class BuildDecisionBookPersonOccupantsCollection(CrudCollection[BuildDecisionBookPersonOccupantsResponse]):
"""Collection of building decision book person occupants"""
pass
class BuildDecisionBookItemsResponse(BaseResponse):
"""Response model for building decision book items"""
item_order: int
item_comment: str
item_objection: Optional[str]
info_is_completed: bool = False
is_payment_created: bool = False
info_type_id: Optional[int]
info_type_uu_id: Optional[str]
build_decision_book_id: int
build_decision_book_uu_id: Optional[str]
item_short_comment: Optional[str]
class BuildDecisionBookItemsCollection(CrudCollection[BuildDecisionBookItemsResponse]):
"""Collection of building decision book items"""
pass
class BuildDecisionBookItemsUnapprovedResponse(BaseResponse):
"""Response model for building decision book items unapproved"""
item_objection: str
item_order: int
decision_book_item_id: int
decision_book_item_uu_id: Optional[str]
person_id: int
person_uu_id: Optional[str]
build_decision_book_item: int
build_decision_book_item_uu_id: Optional[str]
class BuildDecisionBookItemsUnapprovedCollection(CrudCollection[BuildDecisionBookItemsUnapprovedResponse]):
"""Collection of building decision book items unapproved"""
pass
class BuildDecisionBookPaymentsResponse(BaseResponse):
"""Response model for building decision book payments"""
payment_plan_time_periods: str
process_date: datetime
payment_amount: Decimal
currency: str = "TRY"
payment_types_id: Optional[int]
payment_types_uu_id: Optional[str]
period_time: str
process_date_y: int
process_date_m: int
build_decision_book_item_id: int
build_decision_book_item_uu_id: str
build_parts_id: int
build_parts_uu_id: str
decision_book_project_id: Optional[int]
decision_book_project_uu_id: Optional[str]
account_records_id: Optional[int]
account_records_uu_id: Optional[str]
class BuildDecisionBookPaymentsCollection(CrudCollection[BuildDecisionBookPaymentsResponse]):
"""Collection of building decision book payments"""
pass
class BuildDecisionBookLegalResponse(BaseResponse):
"""Response model for building decision book legal"""
period_start_date: datetime
lawsuits_decision_number: str
lawsuits_decision_date: datetime
period_stop_date: datetime
decision_book_pdf_path: Optional[str] = ""
resp_company_total_wage: Optional[Decimal] = Decimal("0")
contact_agreement_path: Optional[str] = ""
contact_agreement_date: Optional[datetime]
meeting_date: str
lawsuits_type: str = "C"
lawsuits_name: str
lawsuits_note: str
lawyer_cost: Decimal
mediator_lawyer_cost: Decimal
other_cost: Decimal
legal_cost: Decimal
approved_cost: Decimal
total_price: Decimal
build_db_item_id: int
build_db_item_uu_id: Optional[str]
resp_attorney_id: int
resp_attorney_uu_id: Optional[str]
resp_attorney_company_id: int
resp_attorney_company_uu_id: Optional[str]
mediator_lawyer_person_id: int
mediator_lawyer_person_uu_id: Optional[str]
class BuildDecisionBookLegalCollection(CrudCollection[BuildDecisionBookLegalResponse]):
"""Collection of building decision book legal records"""
pass