new api service and logic implemented
This commit is contained in:
16
ApiLayers/ApiValidations/Response/__init__.py
Normal file
16
ApiLayers/ApiValidations/Response/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from .account_responses import AccountRecordResponse
|
||||
from .address_responses import ListAddressResponse
|
||||
from .auth_responses import (
|
||||
AuthenticationLoginResponse,
|
||||
AuthenticationRefreshResponse,
|
||||
AuthenticationUserInfoResponse,
|
||||
)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"AccountRecordResponse",
|
||||
"ListAddressResponse",
|
||||
"AuthenticationLoginResponse",
|
||||
"AuthenticationRefreshResponse",
|
||||
"AuthenticationUserInfoResponse",
|
||||
]
|
||||
260
ApiLayers/ApiValidations/Response/account_responses.py
Normal file
260
ApiLayers/ApiValidations/Response/account_responses.py
Normal file
@@ -0,0 +1,260 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional, List
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class AccountBooksResponse(BaseModel):
|
||||
"""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 AccountCodesResponse(BaseModel):
|
||||
"""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 AccountCodeParserResponse(BaseModel):
|
||||
"""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 AccountMasterResponse(BaseModel):
|
||||
"""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 AccountDetailResponse(BaseModel):
|
||||
"""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 AccountRecordResponse(BaseModel):
|
||||
"""Response model for account financial records.
|
||||
|
||||
This model represents a financial transaction record in the system,
|
||||
including bank transaction details, amounts, and related metadata.
|
||||
|
||||
Attributes:
|
||||
iban (str): International Bank Account Number
|
||||
bank_date (datetime): Date when the transaction occurred at the bank
|
||||
currency_value (Decimal): Original transaction amount
|
||||
bank_balance (Decimal): Account balance after the transaction
|
||||
currency (str): Currency code (e.g., "TRY", "USD")
|
||||
additional_balance (Decimal): Any additional balance adjustments
|
||||
channel_branch (str): Bank branch or channel where transaction occurred
|
||||
process_name (str): Name/type of the transaction
|
||||
process_type (str): Classification of the transaction
|
||||
process_comment (str): Additional transaction details or notes
|
||||
bank_reference_code (str): Bank's reference code for the transaction
|
||||
add_comment_note (Optional[str]): Additional internal notes
|
||||
is_receipt_mail_send (Optional[bool]): Whether receipt was emailed
|
||||
found_from (Optional[str]): Source of the transaction record
|
||||
similarity (Optional[float]): Matching confidence for duplicate detection
|
||||
remainder_balance (Optional[Decimal]): Remaining balance if partial
|
||||
bank_date_y (Optional[int]): Year of bank transaction
|
||||
bank_date_m (Optional[int]): Month of bank transaction
|
||||
bank_date_w (Optional[int]): Week of bank transaction
|
||||
bank_date_d (Optional[int]): Day of bank transaction
|
||||
approving_accounting_record (Optional[bool]): Accounting approval status
|
||||
accounting_receipt_date (Optional[datetime]): When receipt was processed
|
||||
accounting_receipt_number (Optional[int]): Receipt reference number
|
||||
approved_record (Optional[bool]): Whether record is approved
|
||||
import_file_name (Optional[str]): Source file if imported
|
||||
receive_debit_uu_id (Optional[str]): Related debit record ID
|
||||
budget_type_uu_id (Optional[str]): Associated budget type ID
|
||||
company_uu_id (Optional[str]): Associated company ID
|
||||
send_company_uu_id (Optional[str]): Sending company ID
|
||||
customer_id (Optional[str]): Associated customer ID
|
||||
customer_uu_id (Optional[str]): Associated customer UUID
|
||||
send_person_uu_id (Optional[str]): Sending person ID
|
||||
approving_accounting_person_uu_id (Optional[str]): Approver ID
|
||||
build_parts_uu_id (Optional[str]): Related building part ID
|
||||
build_decision_book_uu_id (Optional[str]): Related decision book ID
|
||||
"""
|
||||
|
||||
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 AccountRecordExchangeResponse(BaseModel):
|
||||
"""Response model for currency exchange records.
|
||||
|
||||
This model represents a currency exchange transaction, tracking
|
||||
exchange rates and converted amounts for financial records.
|
||||
|
||||
Attributes:
|
||||
account_record_id (int): ID of the related account record
|
||||
account_record_uu_id (str): UUID of the related account record
|
||||
exchange_rate (Decimal): Applied exchange rate
|
||||
exchange_currency (str): Target currency code
|
||||
exchange_value (Decimal): Converted amount
|
||||
exchange_date (datetime): When the exchange was calculated
|
||||
"""
|
||||
|
||||
account_record_id: int
|
||||
account_record_uu_id: str
|
||||
exchange_rate: Decimal
|
||||
exchange_currency: str = "TRY"
|
||||
exchange_value: Decimal
|
||||
exchange_date: datetime
|
||||
|
||||
|
||||
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
|
||||
20
ApiLayers/ApiValidations/Response/address_responses.py
Normal file
20
ApiLayers/ApiValidations/Response/address_responses.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ListAddressResponse(BaseModel):
|
||||
build_number: Optional[str] = None
|
||||
door_number: Optional[str] = None
|
||||
floor_number: Optional[str] = None
|
||||
comment_address: Optional[str] = None
|
||||
letter_address: Optional[str] = None
|
||||
short_letter_address: Optional[str] = None
|
||||
latitude: Optional[float] = None
|
||||
longitude: Optional[float] = None
|
||||
street_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class AddressPostCodeResponse:
|
||||
street_id: Optional[int] = None
|
||||
street_uu_id: Optional[str] = None
|
||||
postcode: Optional[str] = None
|
||||
36
ApiLayers/ApiValidations/Response/auth_responses.py
Normal file
36
ApiLayers/ApiValidations/Response/auth_responses.py
Normal file
@@ -0,0 +1,36 @@
|
||||
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]
|
||||
105
ApiLayers/ApiValidations/Response/base_responses.py
Normal file
105
ApiLayers/ApiValidations/Response/base_responses.py
Normal file
@@ -0,0 +1,105 @@
|
||||
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 response models inherit from.
|
||||
|
||||
This model provides common fields that are present in all database records,
|
||||
including tracking information (created/updated timestamps), user actions
|
||||
(created by, updated by, confirmed by), and record status (active, deleted).
|
||||
|
||||
Attributes:
|
||||
uu_id (str): Unique identifier for the record, typically a UUID
|
||||
created_at (datetime): Timestamp when the record was created
|
||||
updated_at (Optional[datetime]): Timestamp when the record was last updated
|
||||
created_by (Optional[str]): Username or identifier of the user who created the record
|
||||
updated_by (Optional[str]): Username or identifier of the user who last updated the record
|
||||
confirmed_by (Optional[str]): Username or identifier of the user who confirmed the record
|
||||
is_confirmed (Optional[bool]): Whether the record has been confirmed/approved
|
||||
active (Optional[bool]): Whether the record is currently active
|
||||
deleted (Optional[bool]): Whether the record has been marked as deleted
|
||||
expiry_starts (Optional[datetime]): When the record becomes valid/active
|
||||
expiry_ends (Optional[datetime]): When the record expires/becomes inactive
|
||||
is_notification_send (Optional[bool]): Whether notifications have been sent for this record
|
||||
is_email_send (Optional[bool]): Whether emails have been sent for this record
|
||||
"""
|
||||
|
||||
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:
|
||||
"""Pydantic configuration for the base response model.
|
||||
|
||||
Attributes:
|
||||
from_attributes (bool): Enables ORM mode for SQLAlchemy integration
|
||||
"""
|
||||
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class CrudCollection(BaseModel, Generic[T]):
|
||||
"""Base collection model for paginated responses.
|
||||
|
||||
This model is used to return collections of items with pagination information.
|
||||
It is generic over the type of items in the collection, allowing it to be
|
||||
used with any response model.
|
||||
|
||||
Type Parameters:
|
||||
T: The type of items in the collection
|
||||
|
||||
Attributes:
|
||||
page (int): Current page number, 1-based indexing
|
||||
size (int): Number of items per page
|
||||
total (int): Total number of items across all pages
|
||||
order_field (str): Field used for sorting the collection
|
||||
order_type (str): Sort direction ('asc' or 'desc')
|
||||
items (List[T]): List of items in the current page
|
||||
|
||||
Example:
|
||||
```python
|
||||
class UserResponse(BaseResponse):
|
||||
name: str
|
||||
email: str
|
||||
|
||||
users = CrudCollection[UserResponse](
|
||||
page=1,
|
||||
size=10,
|
||||
total=100,
|
||||
order_field="name",
|
||||
order_type="asc",
|
||||
items=[...]
|
||||
)
|
||||
```
|
||||
"""
|
||||
|
||||
page: int = 1
|
||||
size: int = 10
|
||||
total: int = 0
|
||||
order_field: str = "id"
|
||||
order_type: str = "asc"
|
||||
items: List[T] = []
|
||||
|
||||
class Config:
|
||||
"""Pydantic configuration for the collection model.
|
||||
|
||||
Attributes:
|
||||
from_attributes (bool): Enables ORM mode for SQLAlchemy integration
|
||||
"""
|
||||
|
||||
from_attributes = True
|
||||
90
ApiLayers/ApiValidations/Response/budget_responses.py
Normal file
90
ApiLayers/ApiValidations/Response/budget_responses.py
Normal file
@@ -0,0 +1,90 @@
|
||||
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
|
||||
309
ApiLayers/ApiValidations/Response/building_responses.py
Normal file
309
ApiLayers/ApiValidations/Response/building_responses.py
Normal file
@@ -0,0 +1,309 @@
|
||||
from typing import Optional, List, Generic
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
from decimal import Decimal
|
||||
|
||||
from api_validations.validations_response.base_responses import (
|
||||
BaseResponse,
|
||||
CrudCollection,
|
||||
)
|
||||
from api_validations.validations_request import PydanticBaseModel
|
||||
|
||||
|
||||
class ListBuildingResponse(PydanticBaseModel):
|
||||
|
||||
gov_address_code: str
|
||||
build_name: str
|
||||
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 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
|
||||
59
ApiLayers/ApiValidations/Response/company_responses.py
Normal file
59
ApiLayers/ApiValidations/Response/company_responses.py
Normal file
@@ -0,0 +1,59 @@
|
||||
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
|
||||
204
ApiLayers/ApiValidations/Response/decision_book_responses.py
Normal file
204
ApiLayers/ApiValidations/Response/decision_book_responses.py
Normal file
@@ -0,0 +1,204 @@
|
||||
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
|
||||
175
ApiLayers/ApiValidations/Response/default_response.py
Normal file
175
ApiLayers/ApiValidations/Response/default_response.py
Normal file
@@ -0,0 +1,175 @@
|
||||
from ast import Dict
|
||||
from typing import Any, Optional
|
||||
from fastapi import status
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
class BaseEndpointResponse:
|
||||
|
||||
def __init__(self, code: str, lang: str):
|
||||
self.code = code
|
||||
self.lang = lang
|
||||
|
||||
def retrieve_message(self):
|
||||
messages = {}
|
||||
return messages[self.code][self.lang]
|
||||
|
||||
|
||||
# 1. 200 OK
|
||||
class EndpointSuccessResponse(BaseEndpointResponse):
|
||||
|
||||
def as_dict(self, data: Optional[Dict[str, Any]] = None):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_200_OK,
|
||||
content=dict(
|
||||
completed=True,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang,
|
||||
data=data
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# 2. 201 Created
|
||||
class EndpointCreatedResponse(BaseEndpointResponse):
|
||||
|
||||
def as_dict(self, data: Optional[Dict[str, Any]] = None):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_201_CREATED,
|
||||
content=dict(
|
||||
completed=True,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang,
|
||||
data=data
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# 3. 202 Accepted
|
||||
class EndpointAcceptedResponse(BaseEndpointResponse):
|
||||
|
||||
|
||||
def as_dict(self, data: Optional[Dict[str, Any]] = None):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_202_ACCEPTED,
|
||||
content=dict(
|
||||
completed=True,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang,
|
||||
data=data
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# 4. 400 Bad Request
|
||||
class EndpointBadRequestResponse(BaseEndpointResponse):
|
||||
|
||||
def as_dict(self, data: Optional[Dict[str, Any]] = None):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
content=dict(
|
||||
completed=False,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang,
|
||||
data=data
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# 5. 401 Unauthorized
|
||||
class EndpointUnauthorizedResponse(BaseEndpointResponse):
|
||||
|
||||
def as_dict(self):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
content=dict(
|
||||
completed=False,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# 6. 404 Not Found
|
||||
class EndpointNotFoundResponse(BaseEndpointResponse):
|
||||
|
||||
def as_dict(self):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
content=dict(
|
||||
completed=False,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# 3. 403 Forbidden
|
||||
class EndpointForbiddenResponse(BaseEndpointResponse):
|
||||
|
||||
def as_dict(self):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
content=dict(
|
||||
completed=False,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# 6. 409 Conflict
|
||||
class EndpointConflictResponse(BaseEndpointResponse):
|
||||
|
||||
def as_dict(self):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_409_CONFLICT,
|
||||
content=dict(
|
||||
completed=False,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang
|
||||
)
|
||||
)
|
||||
|
||||
# 7. 429 Too Many Requests
|
||||
class EndpointTooManyRequestsResponse(BaseEndpointResponse):
|
||||
|
||||
def __init__(self, retry_after: int):
|
||||
self.retry_after = retry_after
|
||||
|
||||
def as_dict(self):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_429_TOO_MANY_REQUESTS,
|
||||
headers={"Retry-After": str(self.retry_after)},
|
||||
content=dict(
|
||||
completed=False,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# 7. 500 Internal Server Error
|
||||
class EndpointInternalErrorResponse(BaseEndpointResponse):
|
||||
|
||||
def as_dict(self):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
content=dict(
|
||||
completed=False,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class EndpointErrorResponse(BaseEndpointResponse):
|
||||
|
||||
def as_dict(self):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_304_NOT_MODIFIED,
|
||||
content=dict(
|
||||
completed=False,
|
||||
message=self.retrieve_message(),
|
||||
lang=self.lang
|
||||
)
|
||||
)
|
||||
52
ApiLayers/ApiValidations/Response/living_space_responses.py
Normal file
52
ApiLayers/ApiValidations/Response/living_space_responses.py
Normal file
@@ -0,0 +1,52 @@
|
||||
from typing import Optional
|
||||
from api_validations.core_validations import BaseModelRegular
|
||||
from api_validations.validations_request import (
|
||||
CrudRecordValidation,
|
||||
CrudRecords,
|
||||
)
|
||||
|
||||
|
||||
class LivingSpaceListValidation:
|
||||
tr = {
|
||||
**CrudRecordValidation.tr,
|
||||
"fix_value": "Sabit Değer",
|
||||
"fix_percent": "Sabit Yüzde",
|
||||
"agreement_no": "Anlaşma No",
|
||||
"marketing_process": "Pazarlama Süreci",
|
||||
"marketing_layer": "Pazarlama Katmanı",
|
||||
"build_parts_id": "Bölüm ID",
|
||||
"build_parts_uu_id": "Bölüm UUID",
|
||||
"person_id": "Sorumlu Kişi ID",
|
||||
"person_uu_id": "Sorumlu Kişi UUID",
|
||||
"occupant_type": "Kiracı Tipi",
|
||||
"occupant_type_uu_id": "Kiracı Tipi UUID",
|
||||
}
|
||||
en = {
|
||||
**CrudRecordValidation.en,
|
||||
"fix_value": "Fixed Value",
|
||||
"fix_percent": "Fixed Percent",
|
||||
"agreement_no": "Agreement No",
|
||||
"marketing_process": "Marketing Process",
|
||||
"marketing_layer": "Marketing Layer",
|
||||
"build_parts_id": "Part ID",
|
||||
"build_parts_uu_id": "Part UUID",
|
||||
"person_id": "Responsible Person ID",
|
||||
"person_uu_id": "Responsible Person UUID",
|
||||
"occupant_type": "Occupant Type",
|
||||
"occupant_type_uu_id": "Occupant Type UUID",
|
||||
}
|
||||
|
||||
|
||||
class LivingSpaceListResponse(BaseModelRegular, CrudRecords, LivingSpaceListValidation):
|
||||
|
||||
fix_value: Optional[float] = None
|
||||
fix_percent: Optional[float] = None
|
||||
agreement_no: Optional[str] = None
|
||||
marketing_process: Optional[str] = None
|
||||
marketing_layer: Optional[str] = None
|
||||
build_parts_id: Optional[int] = None
|
||||
build_parts_uu_id: Optional[str] = None
|
||||
person_id: Optional[int] = None
|
||||
person_uu_id: Optional[str] = None
|
||||
occupant_type: Optional[str] = None
|
||||
occupant_type_uu_id: Optional[str] = None
|
||||
54
ApiLayers/ApiValidations/Response/parts_responses.py
Normal file
54
ApiLayers/ApiValidations/Response/parts_responses.py
Normal file
@@ -0,0 +1,54 @@
|
||||
from typing import Optional
|
||||
from api_validations.core_validations import BaseModelRegular
|
||||
from api_validations.validations_request import (
|
||||
CrudRecordValidation,
|
||||
CrudRecords,
|
||||
)
|
||||
|
||||
|
||||
class BuildPartsListValidation:
|
||||
tr = {
|
||||
**CrudRecordValidation.tr,
|
||||
"address_gov_code": "Adres Kapı Kodu",
|
||||
"part_no": "Bölüm No",
|
||||
"part_level": "Bölüm Seviyesi",
|
||||
"part_code": "Bölüm Kodu",
|
||||
"part_gross": "Bölüm Brüt",
|
||||
"part_net": "Bölüm Net",
|
||||
"default_accessory": "Varsayılan Aksesuar",
|
||||
"human_livable": "İnsan Yaşamı",
|
||||
"due_part_key": "Sabit Ödeme Grubu",
|
||||
"build_uu_id": "Bina UUID",
|
||||
"part_direction_uu_id": "Bölüm Yönü UUID",
|
||||
"part_type_uu_id": "Bölüm Tipi UUID",
|
||||
}
|
||||
en = {
|
||||
**CrudRecordValidation.en,
|
||||
"address_gov_code": "Address Government Code",
|
||||
"part_no": "Part Number",
|
||||
"part_level": "Part Level",
|
||||
"part_code": "Part Code",
|
||||
"part_gross": "Part Gross",
|
||||
"part_net": "Part Net",
|
||||
"default_accessory": "Default Accessory",
|
||||
"human_livable": "Human Livable",
|
||||
"due_part_key": "Constant Payment Group",
|
||||
"build_uu_id": "Building UUID",
|
||||
"part_direction_uu_id": "Part Direction UUID",
|
||||
"part_type_uu_id": "Part Type UUID",
|
||||
}
|
||||
|
||||
|
||||
class BuildPartsListResponse(BaseModelRegular, CrudRecords, BuildPartsListValidation):
|
||||
address_gov_code: Optional[str] = None
|
||||
part_no: Optional[int] = None
|
||||
part_level: Optional[int] = None
|
||||
part_code: Optional[str] = None
|
||||
part_gross: Optional[int] = None
|
||||
part_net: Optional[int] = None
|
||||
default_accessory: Optional[str] = None
|
||||
human_livable: Optional[bool] = None
|
||||
due_part_key: Optional[str] = None
|
||||
build_uu_id: Optional[str] = None
|
||||
part_direction_uu_id: Optional[str] = None
|
||||
part_type_uu_id: Optional[str] = None
|
||||
57
ApiLayers/ApiValidations/Response/people_responses.py
Normal file
57
ApiLayers/ApiValidations/Response/people_responses.py
Normal file
@@ -0,0 +1,57 @@
|
||||
from typing import Optional
|
||||
from api_validations.core_validations import BaseModelRegular
|
||||
from api_validations.validations_request import (
|
||||
CrudRecordValidation,
|
||||
CrudRecords,
|
||||
)
|
||||
|
||||
|
||||
class PeopleListValidation:
|
||||
tr = {
|
||||
**CrudRecordValidation.tr,
|
||||
"firstname": "Ad",
|
||||
"surname": "Soyad",
|
||||
"middle_name": "Orta İsim",
|
||||
"sex_code": "Cinsiyet Kodu",
|
||||
"person_ref": "Kişi Referansı",
|
||||
"person_tag": "Kişi Etiketi",
|
||||
"father_name": "Baba Adı",
|
||||
"mother_name": "Anne Adı",
|
||||
"country_code": "Ülke Kodu",
|
||||
"national_identity_id": "Kimlik Numarası",
|
||||
"birth_place": "Doğum Yeri",
|
||||
"birth_date": "Doğum Tarihi",
|
||||
"tax_no": "Vergi Numarası",
|
||||
}
|
||||
en = {
|
||||
**CrudRecordValidation.en,
|
||||
"firstname": "First Name",
|
||||
"surname": "Surname",
|
||||
"middle_name": "Middle Name",
|
||||
"sex_code": "Sex Code",
|
||||
"person_ref": "Person Reference",
|
||||
"person_tag": "Person Tag",
|
||||
"father_name": "Father's Name",
|
||||
"mother_name": "Mother's Name",
|
||||
"country_code": "Country Code",
|
||||
"national_identity_id": "National Identity ID",
|
||||
"birth_place": "Birth Place",
|
||||
"birth_date": "Birth Date",
|
||||
"tax_no": "Tax Number",
|
||||
}
|
||||
|
||||
|
||||
class PeopleListResponse(BaseModelRegular, CrudRecords, PeopleListValidation):
|
||||
firstname: Optional[str] = None
|
||||
surname: Optional[str] = None
|
||||
middle_name: Optional[str] = None
|
||||
sex_code: Optional[str] = None
|
||||
person_ref: Optional[str] = None
|
||||
person_tag: Optional[str] = None
|
||||
father_name: Optional[str] = None
|
||||
mother_name: Optional[str] = None
|
||||
country_code: Optional[str] = None
|
||||
national_identity_id: Optional[str] = None
|
||||
birth_place: Optional[str] = None
|
||||
birth_date: Optional[str] = None
|
||||
tax_no: Optional[str] = None
|
||||
Reference in New Issue
Block a user