auth service up running

This commit is contained in:
2025-01-10 14:15:35 +03:00
parent 4eb95e4d9c
commit 03accfed1b
23 changed files with 457 additions and 317 deletions

View File

@@ -1,5 +1,119 @@
from .building import ListBuildingResponse
from .building_responses import (
BuildResponse,
BuildLivingSpaceResponse,
BuildLivingSpaceCollection,
BuildAreaResponse,
BuildAreaCollection,
BuildTypesResponse,
BuildTypesCollection,
BuildPartsResponse,
BuildPartsCollection,
BuildSitesResponse,
BuildSitesCollection,
Part2EmployeeResponse,
Part2EmployeeCollection,
BuildPersonProvidingResponse,
BuildPersonProvidingCollection,
RelationshipEmployee2BuildResponse,
RelationshipEmployee2BuildCollection,
BuildCompaniesProvidingResponse,
BuildCompaniesProvidingCollection,
BuildManagementResponse,
BuildManagementCollection
)
from .account_responses import (
AccountRecordResponse,
AccountRecordCollection,
AccountRecordExchangeResponse,
AccountRecordExchangeCollection
)
from .address_responses import ListAddressResponse, AddressPostCodeResponse
from .auth_responses import (
AuthenticationLoginResponse,
AuthenticationRefreshResponse,
AuthenticationUserInfoResponse
)
from .base_responses import BaseResponse, CrudCollection
from .budget_responses import (
DecisionBookBudgetBooksResponse,
DecisionBookBudgetBooksCollection,
DecisionBookBudgetCodesResponse,
DecisionBookBudgetCodesCollection,
DecisionBookBudgetMasterResponse,
DecisionBookBudgetMasterCollection,
DecisionBookBudgetsResponse,
DecisionBookBudgetsCollection
)
from .company_responses import (
CompanyListResponse,
CompanyDepartmentListResponse,
CompanyDutyListResponse,
CompanyEmployeeListResponse
)
from .decision_book_responses import (
BuildDecisionBookResponse,
BuildDecisionBookCollection,
BuildDecisionBookInvitationsResponse,
BuildDecisionBookInvitationsCollection,
BuildDecisionBookPersonResponse,
BuildDecisionBookPersonCollection,
BuildDecisionBookPersonOccupantsResponse,
BuildDecisionBookPersonOccupantsCollection,
BuildDecisionBookItemsResponse,
BuildDecisionBookItemsCollection,
BuildDecisionBookItemsUnapprovedResponse,
BuildDecisionBookItemsUnapprovedCollection,
BuildDecisionBookPaymentsResponse,
BuildDecisionBookPaymentsCollection,
BuildDecisionBookLegalResponse,
BuildDecisionBookLegalCollection
)
from .living_space_responses import LivingSpaceListResponse
from .parts_responses import BuildPartsListResponse
from .people_responses import PeopleListResponse
__all__ = [
"ListBuildingResponse",
"BuildResponse",
"AccountRecordResponse",
"AccountRecordCollection",
"AccountRecordExchangeResponse",
"AccountRecordExchangeCollection",
"ListAddressResponse",
"AddressPostCodeResponse",
"AuthenticationLoginResponse",
"AuthenticationRefreshResponse",
"AuthenticationUserInfoResponse",
"BaseResponse",
"CrudCollection",
"DecisionBookBudgetBooksResponse",
"DecisionBookBudgetBooksCollection",
"DecisionBookBudgetCodesResponse",
"DecisionBookBudgetCodesCollection",
"DecisionBookBudgetMasterResponse",
"DecisionBookBudgetMasterCollection",
"DecisionBookBudgetsResponse",
"DecisionBookBudgetsCollection",
"CompanyListResponse",
"CompanyDepartmentListResponse",
"CompanyDutyListResponse",
"CompanyEmployeeListResponse",
"BuildDecisionBookResponse",
"BuildDecisionBookCollection",
"BuildDecisionBookInvitationsResponse",
"BuildDecisionBookInvitationsCollection",
"BuildDecisionBookPersonResponse",
"BuildDecisionBookPersonCollection",
"BuildDecisionBookPersonOccupantsResponse",
"BuildDecisionBookPersonOccupantsCollection",
"BuildDecisionBookItemsResponse",
"BuildDecisionBookItemsCollection",
"BuildDecisionBookItemsUnapprovedResponse",
"BuildDecisionBookItemsUnapprovedCollection",
"BuildDecisionBookPaymentsResponse",
"BuildDecisionBookPaymentsCollection",
"BuildDecisionBookLegalResponse",
"BuildDecisionBookLegalCollection",
"LivingSpaceListResponse",
"BuildPartsListResponse",
"PeopleListResponse"
]

View File

@@ -164,7 +164,48 @@ class AccountDetailCollection(CrudCollection[AccountDetailResponse]):
class AccountRecordResponse(BaseResponse):
"""Response model for account records"""
"""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
@@ -203,12 +244,28 @@ class AccountRecordResponse(BaseResponse):
class AccountRecordCollection(CrudCollection[AccountRecordResponse]):
"""Collection of account records"""
"""Collection of account financial records.
This model represents a paginated list of account records with
sorting and pagination information.
"""
pass
class AccountRecordExchangeResponse(BaseResponse):
"""Response model for account record exchanges"""
"""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
@@ -218,7 +275,11 @@ class AccountRecordExchangeResponse(BaseResponse):
class AccountRecordExchangeCollection(CrudCollection[AccountRecordExchangeResponse]):
"""Collection of account record exchanges"""
"""Collection of currency exchange records.
This model represents a paginated list of currency exchange records
with sorting and pagination information.
"""
pass

View File

@@ -6,7 +6,27 @@ from uuid import UUID
T = TypeVar('T')
class BaseResponse(BaseModel):
"""Base response model that all other response models inherit from"""
"""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]
@@ -22,11 +42,48 @@ class BaseResponse(BaseModel):
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"""
"""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
@@ -35,4 +92,9 @@ class CrudCollection(BaseModel, Generic[T]):
items: List[T] = []
class Config:
"""Pydantic configuration for the collection model.
Attributes:
from_attributes (bool): Enables ORM mode for SQLAlchemy integration
"""
from_attributes = True