new api service and logic implemented
This commit is contained in:
239
ApiLayers/ApiValidations/Request/__init__.py
Normal file
239
ApiLayers/ApiValidations/Request/__init__.py
Normal file
@@ -0,0 +1,239 @@
|
||||
from .base_validations import (
|
||||
BaseModelRegular,
|
||||
PydanticBaseModel,
|
||||
ListOptions,
|
||||
CrudRecords,
|
||||
)
|
||||
from .address import (
|
||||
InsertAddress,
|
||||
UpdateAddress,
|
||||
UpdatePostCode,
|
||||
InsertPostCode,
|
||||
SearchAddress,
|
||||
)
|
||||
from .application import (
|
||||
SingleEnumUUID,
|
||||
SingleEnumClassKey,
|
||||
SingleEnumOnlyClass,
|
||||
SingleOccupantTypeUUID,
|
||||
SingleOccupantTypeClassKey,
|
||||
)
|
||||
from .area import (
|
||||
InsertBuildArea,
|
||||
InsertBuildSites,
|
||||
UpdateBuildArea,
|
||||
UpdateBuildSites,
|
||||
)
|
||||
from .authentication import (
|
||||
Login,
|
||||
Logout,
|
||||
ChangePassword,
|
||||
Remember,
|
||||
Forgot,
|
||||
CreatePassword,
|
||||
OccupantSelection,
|
||||
EmployeeSelection,
|
||||
)
|
||||
from .account_records import (
|
||||
InsertAccountRecord,
|
||||
UpdateAccountRecord,
|
||||
)
|
||||
|
||||
from .build_living_space import (
|
||||
InsertBuildLivingSpace,
|
||||
UpdateBuildLivingSpace,
|
||||
)
|
||||
from .build_part import (
|
||||
InsertBuildParts,
|
||||
InsertBuildTypes,
|
||||
UpdateBuildParts,
|
||||
UpdateBuildTypes,
|
||||
)
|
||||
from .building import (
|
||||
InsertBuild,
|
||||
UpdateBuild,
|
||||
)
|
||||
from .company import (
|
||||
MatchCompany2Company,
|
||||
InsertCompany,
|
||||
UpdateCompany,
|
||||
)
|
||||
from .decision_book import (
|
||||
DecisionBookDecisionBookInvitations,
|
||||
DecisionBookDecisionBookInvitationsUpdate,
|
||||
DecisionBookDecisionBookInvitationsAttend,
|
||||
DecisionBookDecisionBookInvitationsAssign,
|
||||
UpdateDecisionBook,
|
||||
UpdateBuildDecisionBookItems,
|
||||
UpdateBuildDecisionBookItemDebits,
|
||||
InsertBuildDecisionBookItems,
|
||||
InsertBuildDecisionBookItemDebits,
|
||||
InsertDecisionBookCompleted,
|
||||
InsertDecisionBook,
|
||||
InsertDecisionBookPerson,
|
||||
ListDecisionBook,
|
||||
RemoveDecisionBookPerson,
|
||||
)
|
||||
from .departments import (
|
||||
DepartmentsPydantic,
|
||||
)
|
||||
from .employee import (
|
||||
InsertDuties,
|
||||
UpdateDuties,
|
||||
InsertEmployees,
|
||||
SelectDuties,
|
||||
UnBindEmployees2People,
|
||||
BindEmployees2People,
|
||||
UpdateCompanyEmployees,
|
||||
InsertCompanyEmployees,
|
||||
InsertCompanyEmployeesSalaries,
|
||||
InsertCompanyDuty,
|
||||
UpdateCompanyEmployeesSalaries,
|
||||
UpdateCompanyDuty,
|
||||
)
|
||||
from .events import (
|
||||
# CreateEvents,
|
||||
RegisterEvents2Employee,
|
||||
RegisterEvents2Occupant,
|
||||
)
|
||||
from .people import (
|
||||
UpdatePerson,
|
||||
InsertPerson,
|
||||
)
|
||||
from .project_decision_book import (
|
||||
InsertBuildDecisionBookProjectItemDebits,
|
||||
UpdateBuildDecisionBookProjectItemDebits,
|
||||
InsertBuildDecisionBookProjects,
|
||||
UpdateBuildDecisionBookProjects,
|
||||
InsertBuildDecisionBookProjectPerson,
|
||||
UpdateBuildDecisionBookProjectPerson,
|
||||
InsertBuildDecisionBookProjectItems,
|
||||
UpdateBuildDecisionBookProjectItems,
|
||||
ApprovalsBuildDecisionBookProjects,
|
||||
)
|
||||
from .rules import (
|
||||
UpdateEndpointAccess,
|
||||
UpdateEndpointAccessList,
|
||||
InsertEndpointAccess,
|
||||
CheckEndpointAccess,
|
||||
)
|
||||
from .services import (
|
||||
RegisterServices2Employee,
|
||||
RegisterServices2Occupant,
|
||||
)
|
||||
from .staff import (
|
||||
InsertStaff,
|
||||
SelectStaff,
|
||||
)
|
||||
from .user import (
|
||||
InsertUsers,
|
||||
UpdateUsers,
|
||||
QueryUsers,
|
||||
# ActiveUsers,
|
||||
# ListUsers,
|
||||
# DeleteUsers,
|
||||
)
|
||||
from .modules import (
|
||||
RegisterModules2Occupant,
|
||||
RegisterModules2Employee,
|
||||
)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"BaseModelRegular",
|
||||
"PydanticBaseModel",
|
||||
"ListOptions",
|
||||
"CrudRecords",
|
||||
"ListOptions",
|
||||
"CrudRecords",
|
||||
"PydanticBaseModel",
|
||||
"BaseModelRegular",
|
||||
"InsertAddress",
|
||||
"UpdateAddress",
|
||||
"UpdatePostCode",
|
||||
"InsertPostCode",
|
||||
"SearchAddress",
|
||||
"SingleEnumUUID",
|
||||
"SingleEnumClassKey",
|
||||
"SingleEnumOnlyClass",
|
||||
"SingleOccupantTypeUUID",
|
||||
"SingleOccupantTypeClassKey",
|
||||
"InsertBuildArea",
|
||||
"InsertBuildSites",
|
||||
"UpdateBuildArea",
|
||||
"UpdateBuildSites",
|
||||
"Login",
|
||||
"Logout",
|
||||
"ChangePassword",
|
||||
"Remember",
|
||||
"Forgot",
|
||||
"CreatePassword",
|
||||
"OccupantSelection",
|
||||
"EmployeeSelection",
|
||||
"InsertAccountRecord",
|
||||
"UpdateAccountRecord",
|
||||
"InsertBuildLivingSpace",
|
||||
"UpdateBuildLivingSpace",
|
||||
"InsertBuildParts",
|
||||
"InsertBuildTypes",
|
||||
"UpdateBuildParts",
|
||||
"UpdateBuildTypes",
|
||||
"InsertBuild",
|
||||
"UpdateBuild",
|
||||
"MatchCompany2Company",
|
||||
"InsertCompany",
|
||||
"UpdateCompany",
|
||||
"DecisionBookDecisionBookInvitations",
|
||||
"DecisionBookDecisionBookInvitationsUpdate",
|
||||
"DecisionBookDecisionBookInvitationsAttend",
|
||||
"DecisionBookDecisionBookInvitationsAssign",
|
||||
"UpdateDecisionBook",
|
||||
"UpdateBuildDecisionBookItems",
|
||||
"UpdateBuildDecisionBookItemDebits",
|
||||
"InsertBuildDecisionBookItems",
|
||||
"InsertBuildDecisionBookItemDebits",
|
||||
"InsertDecisionBookCompleted",
|
||||
"InsertDecisionBook",
|
||||
"InsertDecisionBookPerson",
|
||||
"ListDecisionBook",
|
||||
"RemoveDecisionBookPerson",
|
||||
"DepartmentsPydantic",
|
||||
"InsertDuties",
|
||||
"UpdateDuties",
|
||||
"InsertEmployees",
|
||||
"SelectDuties",
|
||||
"UnBindEmployees2People",
|
||||
"BindEmployees2People",
|
||||
"UpdateCompanyEmployees",
|
||||
"InsertCompanyEmployees",
|
||||
"InsertCompanyEmployeesSalaries",
|
||||
"InsertCompanyDuty",
|
||||
"UpdateCompanyEmployeesSalaries",
|
||||
"UpdateCompanyDuty",
|
||||
"RegisterEvents2Employee",
|
||||
"RegisterEvents2Occupant",
|
||||
"UpdatePerson",
|
||||
"InsertPerson",
|
||||
"InsertBuildDecisionBookProjectItems",
|
||||
"UpdateBuildDecisionBookProjectItems",
|
||||
"ApprovalsBuildDecisionBookProjects",
|
||||
"InsertBuildDecisionBookProjectItemDebits",
|
||||
"UpdateBuildDecisionBookProjectItemDebits",
|
||||
"InsertBuildDecisionBookProjects",
|
||||
"UpdateBuildDecisionBookProjects",
|
||||
"InsertBuildDecisionBookProjectPerson",
|
||||
"UpdateBuildDecisionBookProjectPerson",
|
||||
"UpdateEndpointAccess",
|
||||
"UpdateEndpointAccessList",
|
||||
"InsertEndpointAccess",
|
||||
"CheckEndpointAccess",
|
||||
"RegisterServices2Employee",
|
||||
"RegisterServices2Occupant",
|
||||
"InsertStaff",
|
||||
"SelectStaff",
|
||||
"InsertUsers",
|
||||
"UpdateUsers",
|
||||
"QueryUsers",
|
||||
"RegisterModules2Occupant",
|
||||
"RegisterModules2Employee",
|
||||
]
|
||||
159
ApiLayers/ApiValidations/Request/account_records.py
Normal file
159
ApiLayers/ApiValidations/Request/account_records.py
Normal file
@@ -0,0 +1,159 @@
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class AccountValidation:
|
||||
tr = {
|
||||
"iban": "IBAN Numarası",
|
||||
"bank_date": "Bank Tarih",
|
||||
"currency_value": "Para Değeri",
|
||||
"bank_balance": "Banka Bakiye",
|
||||
"currency": "Para Birimi",
|
||||
"additional_balance": "Ek Bakiye",
|
||||
"channel_branch": "Kanal Şubesi",
|
||||
"process_name": "İşlem Adı",
|
||||
"process_type": "İşlem Tipi",
|
||||
"process_comment": "İşlem Yorum",
|
||||
"bank_reference_code": "Banka Referans Kodu",
|
||||
"add_comment_note": "Yorum Not",
|
||||
"is_receipt_mail_send": "Fiş Mail Gönderildi",
|
||||
"found_from": "Bulunduğu Yer",
|
||||
"similarity": "Benzerlik",
|
||||
"remainder_balance": "Kalan Bakiye",
|
||||
"bank_date_y": "Bank Tarih Yıl",
|
||||
"bank_date_m": "Bank Tarih Ay",
|
||||
"bank_date_w": "Bank Tarih Hafta",
|
||||
"bank_date_d": "Bank Tarih Gün",
|
||||
"approving_accounting_record": "Onaylayan Muhasebe Kaydı",
|
||||
"accounting_receipt_date": "Muhasebe Fiş Tarihi",
|
||||
"accounting_receipt_number": "Muhasebe Fiş Numarası",
|
||||
"approved_record": "Onaylanmış Kayıt",
|
||||
"import_file_name": "İçe Aktarım Dosya Adı",
|
||||
"receive_debit_uu_id": "Alacak UUID",
|
||||
"budget_type_uu_id": "Bütçe Tipi UUID",
|
||||
"company_uu_id": "Şirket UUID",
|
||||
"send_company_uu_id": "Gönderen Şirket UUID",
|
||||
"customer_id": "Müşteri ID",
|
||||
"customer_uu_id": "Müşteri UUID",
|
||||
"send_person_uu_id": "Gönderen Kişi UUID",
|
||||
"approving_accounting_person_uu_id": "Onaylayan Muhasebe Kişi UUID",
|
||||
"build_parts_uu_id": "Daire UUID",
|
||||
"build_decision_book_uu_id": "Karar Defteri UUID",
|
||||
}
|
||||
en = {
|
||||
"iban": "IBAN Number",
|
||||
"bank_date": "Bank Date",
|
||||
"currency_value": "Currency Value",
|
||||
"bank_balance": "Bank Balance",
|
||||
"currency": "Currency",
|
||||
"additional_balance": "Additional Balance",
|
||||
"channel_branch": "Channel Branch",
|
||||
"process_name": "Process Name",
|
||||
"process_type": "Process Type",
|
||||
"process_comment": "Process Comment",
|
||||
"bank_reference_code": "Bank Reference Code",
|
||||
"add_comment_note": "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_uu_id": "Receive Debit UUID",
|
||||
"budget_type_uu_id": "Budget Type UUID",
|
||||
"company_uu_id": "Company UUID",
|
||||
"send_company_uu_id": "Send Company UUID",
|
||||
"customer_id": "Customer ID",
|
||||
"customer_uu_id": "Customer UUID",
|
||||
"send_person_uu_id": "Send Person UUID",
|
||||
"approving_accounting_person_uu_id": "Approving Accounting Person UUID",
|
||||
"build_parts_uu_id": "Build Parts UUID",
|
||||
"build_decision_book_uu_id": "Build Decision Book UUID",
|
||||
}
|
||||
|
||||
|
||||
class InsertAccountRecord(BaseModelRegular, AccountValidation):
|
||||
|
||||
iban: str
|
||||
bank_date: str
|
||||
currency_value: float
|
||||
bank_balance: float
|
||||
currency: str
|
||||
additional_balance: float
|
||||
channel_branch: str
|
||||
process_name: str
|
||||
process_type: str
|
||||
process_comment: str
|
||||
bank_reference_code: str
|
||||
|
||||
add_comment_note: Optional[str] = None
|
||||
is_receipt_mail_send: Optional[bool] = None
|
||||
found_from: Optional[str] = None
|
||||
similarity: Optional[float] = None
|
||||
remainder_balance: Optional[float] = None
|
||||
bank_date_y: Optional[int] = None
|
||||
bank_date_m: Optional[int] = None
|
||||
bank_date_w: Optional[int] = None
|
||||
bank_date_d: Optional[int] = None
|
||||
approving_accounting_record: Optional[bool] = None
|
||||
accounting_receipt_date: Optional[str] = None
|
||||
accounting_receipt_number: Optional[int] = None
|
||||
approved_record: Optional[bool] = None
|
||||
import_file_name: Optional[str] = None
|
||||
# receive_debit_uu_id: Optional[str] = None
|
||||
budget_type_uu_id: Optional[str] = None
|
||||
company_uu_id: Optional[str] = None
|
||||
send_company_uu_id: Optional[str] = None
|
||||
customer_id: Optional[str] = None
|
||||
customer_uu_id: Optional[str] = None
|
||||
send_person_uu_id: Optional[str] = None
|
||||
approving_accounting_person_uu_id: Optional[str] = None
|
||||
build_parts_uu_id: Optional[str] = None
|
||||
build_decision_book_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class UpdateAccountRecord(PydanticBaseModel, AccountValidation):
|
||||
|
||||
iban: Optional[str] = None
|
||||
bank_date: Optional[str] = None
|
||||
currency_value: Optional[float] = None
|
||||
bank_balance: Optional[float] = None
|
||||
currency: Optional[str] = None
|
||||
additional_balance: Optional[float] = None
|
||||
channel_branch: Optional[str] = None
|
||||
process_name: Optional[str] = None
|
||||
process_type: Optional[str] = None
|
||||
process_comment: Optional[str] = None
|
||||
bank_reference_code: Optional[str] = None
|
||||
|
||||
add_comment_note: Optional[str] = None
|
||||
is_receipt_mail_send: Optional[bool] = None
|
||||
found_from: Optional[str] = None
|
||||
similarity: Optional[float] = None
|
||||
remainder_balance: Optional[float] = None
|
||||
bank_date_y: Optional[int] = None
|
||||
bank_date_m: Optional[int] = None
|
||||
bank_date_w: Optional[int] = None
|
||||
bank_date_d: Optional[int] = None
|
||||
approving_accounting_record: Optional[bool] = None
|
||||
accounting_receipt_date: Optional[str] = None
|
||||
accounting_receipt_number: Optional[int] = None
|
||||
approved_record: Optional[bool] = None
|
||||
import_file_name: Optional[str] = None
|
||||
receive_debit_uu_id: Optional[str] = None
|
||||
budget_type_uu_id: Optional[str] = None
|
||||
company_uu_id: Optional[str] = None
|
||||
send_company_uu_id: Optional[str] = None
|
||||
customer_id: Optional[str] = None
|
||||
customer_uu_id: Optional[str] = None
|
||||
send_person_uu_id: Optional[str] = None
|
||||
approving_accounting_person_uu_id: Optional[str] = None
|
||||
build_parts_uu_id: Optional[str] = None
|
||||
build_decision_book_uu_id: Optional[str] = None
|
||||
128
ApiLayers/ApiValidations/Request/address.py
Normal file
128
ApiLayers/ApiValidations/Request/address.py
Normal file
@@ -0,0 +1,128 @@
|
||||
from typing import Optional
|
||||
|
||||
from ApiValidations.Request import PydanticBaseModel, ListOptions
|
||||
from ApiValidations.handler import BaseModelRegular
|
||||
|
||||
|
||||
class PostCodeValidation:
|
||||
tr = {
|
||||
"post_code": "Posta Kodu",
|
||||
"street_uu_id": "Sokak UUID",
|
||||
}
|
||||
en = {
|
||||
"post_code": "Post Code",
|
||||
"street_uu_id": "Street UUID",
|
||||
}
|
||||
|
||||
|
||||
class InsertPostCode(BaseModelRegular, PostCodeValidation):
|
||||
street_uu_id: str
|
||||
post_code: str
|
||||
|
||||
|
||||
class UpdatePostCode(PydanticBaseModel, PostCodeValidation):
|
||||
street_uu_id: Optional[str] = None
|
||||
post_code: Optional[str] = None
|
||||
|
||||
|
||||
class SearchAddressValidation:
|
||||
tr = {
|
||||
"search": "Ara",
|
||||
"list_options": "Liste Seçenekleri",
|
||||
}
|
||||
en = {
|
||||
"search": "Search",
|
||||
"list_options": "List Options",
|
||||
}
|
||||
|
||||
|
||||
class SearchAddress(PydanticBaseModel, SearchAddressValidation):
|
||||
search: str
|
||||
list_options: ListOptions
|
||||
|
||||
|
||||
class StreetValidation:
|
||||
tr = {
|
||||
"street_code": "Sokak Kodu",
|
||||
"street_name": "Sokak Adı",
|
||||
"postcode": "Posta Kodu",
|
||||
"type_code": "Tip Kodu",
|
||||
"type_description": "Tip Açıklaması",
|
||||
"gov_code": "Devlet Kodu",
|
||||
"address_geographic_uu_id": "Coğrafi UUID",
|
||||
}
|
||||
en = {
|
||||
"street_code": "Street Code",
|
||||
"street_name": "Street Name",
|
||||
"postcode": "Post Code",
|
||||
"type_code": "Type Code",
|
||||
"type_description": "Type Description",
|
||||
"gov_code": "Government Code",
|
||||
"address_geographic_uu_id": "Address Geographic UUID",
|
||||
}
|
||||
|
||||
|
||||
class InsertStreet(PydanticBaseModel, StreetValidation):
|
||||
street_code: str
|
||||
street_name: str
|
||||
postcode: str
|
||||
|
||||
type_code: Optional[str] = None
|
||||
type_description: Optional[str] = None
|
||||
gov_code: Optional[str] = None
|
||||
address_geographic_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class AddressValidation:
|
||||
tr = {
|
||||
"post_code_uu_id": "Posta Kodu UUID",
|
||||
"comment_address": "Adres Yorumu",
|
||||
"letter_address": "Mektup Adresi",
|
||||
"build_number": "Bina Numarası",
|
||||
"door_number": "Kapı Numarası",
|
||||
"floor_number": "Kat Numarası",
|
||||
"short_letter_address": "Kısa Mektup Adresi",
|
||||
"latitude": "Enlem",
|
||||
"longitude": "Boylam",
|
||||
}
|
||||
en = {
|
||||
"post_code_uu_id": "Post Code UUID",
|
||||
"comment_address": "Address Comment",
|
||||
"letter_address": "Letter Address",
|
||||
"build_number": "Build Number",
|
||||
"door_number": "Door Number",
|
||||
"floor_number": "Floor Number",
|
||||
"short_letter_address": "Short Letter Address",
|
||||
"latitude": "Latitude",
|
||||
"longitude": "Longitude",
|
||||
}
|
||||
|
||||
|
||||
class InsertAddress(BaseModelRegular, AddressValidation):
|
||||
post_code_uu_id: str
|
||||
|
||||
comment_address: Optional[str] = None
|
||||
letter_address: Optional[str] = None
|
||||
|
||||
build_number: str
|
||||
door_number: Optional[str] = None
|
||||
floor_number: Optional[str] = None
|
||||
|
||||
short_letter_address: Optional[str] = None
|
||||
latitude: Optional[float] = None
|
||||
longitude: Optional[float] = None
|
||||
|
||||
|
||||
class UpdateAddress(PydanticBaseModel, AddressValidation):
|
||||
post_code_uu_id: Optional[str] = None
|
||||
|
||||
comment_address: Optional[str] = None
|
||||
letter_address: Optional[str] = None
|
||||
|
||||
build_number: Optional[str] = None
|
||||
door_number: Optional[str] = None
|
||||
floor_number: Optional[str] = None
|
||||
|
||||
short_letter_address: Optional[str] = None
|
||||
latitude: Optional[float] = None
|
||||
longitude: Optional[float] = None
|
||||
69
ApiLayers/ApiValidations/Request/application.py
Normal file
69
ApiLayers/ApiValidations/Request/application.py
Normal file
@@ -0,0 +1,69 @@
|
||||
from ApiValidations.Request import BaseModelRegular
|
||||
|
||||
|
||||
class SingleEnumClassKeyValidation:
|
||||
tr = {
|
||||
"class_name": "Sınıf Adı",
|
||||
"key_name": "Anahtar Adı",
|
||||
}
|
||||
en = {
|
||||
"class_name": "Class Name",
|
||||
"key_name": "Key Name",
|
||||
}
|
||||
|
||||
|
||||
class SingleEnumClassKey(BaseModelRegular):
|
||||
class_name: str
|
||||
key_name: str
|
||||
|
||||
|
||||
class SingleEnumUUIDValidation:
|
||||
tr = {
|
||||
"uu_id": "UUID",
|
||||
}
|
||||
en = {
|
||||
"uu_id": "UUID",
|
||||
}
|
||||
|
||||
|
||||
class SingleEnumUUID(BaseModelRegular):
|
||||
uu_id: str
|
||||
|
||||
|
||||
class SingleEnumOnlyClassValidation:
|
||||
tr = {
|
||||
"class_name": "Sınıf Adı",
|
||||
}
|
||||
en = {
|
||||
"class_name": "Class Name",
|
||||
}
|
||||
|
||||
|
||||
class SingleEnumOnlyClass(BaseModelRegular):
|
||||
class_name: str
|
||||
|
||||
|
||||
class SingleOccupantTypeClassKeyValidation:
|
||||
tr = {
|
||||
"type_code": "Tip Kodu",
|
||||
}
|
||||
en = {
|
||||
"type_code": "Type Code",
|
||||
}
|
||||
|
||||
|
||||
class SingleOccupantTypeClassKey(BaseModelRegular):
|
||||
type_code: str
|
||||
|
||||
|
||||
class SingleOccupantTypeUUIDValidation:
|
||||
tr = {
|
||||
"uu_id": "Görev UUID",
|
||||
}
|
||||
en = {
|
||||
"uu_id": "Occupant UUID",
|
||||
}
|
||||
|
||||
|
||||
class SingleOccupantTypeUUID(BaseModelRegular):
|
||||
uu_id: str
|
||||
73
ApiLayers/ApiValidations/Request/area.py
Normal file
73
ApiLayers/ApiValidations/Request/area.py
Normal file
@@ -0,0 +1,73 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class BuildAreaValidation:
|
||||
|
||||
tr = {
|
||||
"area_name": "Alan Adı",
|
||||
"area_code": "Alan Kodu",
|
||||
"area_type": "Alan Tipi",
|
||||
"area_direction": "Alan Yönü",
|
||||
"area_gross_size": "Brüt Alan",
|
||||
"area_net_size": "Net Alan",
|
||||
"width": "Genişlik",
|
||||
"size": "En",
|
||||
}
|
||||
en = {
|
||||
"area_name": "Area Name",
|
||||
"area_code": "Area Code",
|
||||
"area_type": "Area Type",
|
||||
"area_direction": "Area Direction",
|
||||
"area_gross_size": "Gross Size",
|
||||
"area_net_size": "Net Size",
|
||||
"width": "Width",
|
||||
"size": "Size",
|
||||
}
|
||||
|
||||
|
||||
class InsertBuildArea(BaseModelRegular, BuildAreaValidation):
|
||||
|
||||
build_uu_id: str
|
||||
area_name: str
|
||||
area_code: str
|
||||
area_type: str
|
||||
area_direction: Optional[str] = None
|
||||
area_gross_size: Optional[float] = None
|
||||
area_net_size: Optional[float] = None
|
||||
width: Optional[int] = None
|
||||
size: Optional[int] = None
|
||||
|
||||
|
||||
class UpdateBuildArea(PydanticBaseModel, BuildAreaValidation):
|
||||
|
||||
area_name: Optional[str] = None
|
||||
area_code: Optional[str] = None
|
||||
area_type: Optional[str] = None
|
||||
area_direction: Optional[str] = None
|
||||
area_gross_size: Optional[float] = None
|
||||
area_net_size: Optional[float] = None
|
||||
width: Optional[int] = None
|
||||
size: Optional[int] = None
|
||||
|
||||
|
||||
class BuildSites:
|
||||
tr = {"address_uu_id": "Adres UU ID", "site_name": "Site Adı", "site_no": "Site No"}
|
||||
en = {
|
||||
"address_uu_id": "Address UU ID",
|
||||
"site_name": "Site Name",
|
||||
"site_no": "Site No",
|
||||
}
|
||||
|
||||
|
||||
class InsertBuildSites(BaseModelRegular, BuildSites):
|
||||
|
||||
address_uu_id: str
|
||||
site_name: str
|
||||
site_no: str
|
||||
|
||||
|
||||
class UpdateBuildSites(PydanticBaseModel, BuildSites):
|
||||
|
||||
site_name: Optional[str] = None
|
||||
site_no: Optional[str] = None
|
||||
182
ApiLayers/ApiValidations/Request/authentication.py
Normal file
182
ApiLayers/ApiValidations/Request/authentication.py
Normal file
@@ -0,0 +1,182 @@
|
||||
from ApiValidations.Request import BaseModelRegular
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class ChangePasswordValidation:
|
||||
tr = {"old_password": "Eski Şifre", "new_password": "Yeni Şifre"}
|
||||
en = {"old_password": "Old Password", "new_password": "New Password"}
|
||||
|
||||
|
||||
class ChangePassword(BaseModelRegular, ChangePasswordValidation):
|
||||
old_password: str = Field(..., example="current123")
|
||||
new_password: str = Field(..., example="newpass456")
|
||||
|
||||
model_config = ConfigDict(
|
||||
json_schema_extra={
|
||||
"example": {"old_password": "current123", "new_password": "newpass456"}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class CreatePasswordValidation:
|
||||
tr = {
|
||||
"password_token": "Şifre Token",
|
||||
"password": "Şifre",
|
||||
"re_password": "Şifre Tekrar",
|
||||
}
|
||||
en = {
|
||||
"password_token": "Password Token",
|
||||
"password": "Password",
|
||||
"re_password": "Re-Password",
|
||||
}
|
||||
|
||||
|
||||
class CreatePassword(BaseModelRegular, CreatePasswordValidation):
|
||||
password_token: str = Field(..., example="abc123token")
|
||||
password: str = Field(..., example="newpass123")
|
||||
re_password: str = Field(..., example="newpass123")
|
||||
|
||||
model_config = ConfigDict(
|
||||
json_schema_extra={
|
||||
"example": {
|
||||
"password_token": "abc123token",
|
||||
"password": "newpass123",
|
||||
"re_password": "newpass123",
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class OccupantSelectionValidation:
|
||||
tr = {"occupant_uu_id": "Kiracı UU ID", "build_part_uu_id": "Bölüm UU ID"}
|
||||
en = {"occupant_uu_id": "Occupant UU ID", "build_part_uu_id": "Build Part UU ID"}
|
||||
|
||||
|
||||
class OccupantSelection(BaseModel, OccupantSelectionValidation):
|
||||
build_living_space_uu_id: str = Field(
|
||||
..., example="987fcdeb-51a2-43e7-9876-543210987654"
|
||||
)
|
||||
|
||||
model_config = ConfigDict(
|
||||
json_schema_extra={
|
||||
"example": [
|
||||
{"company_uu_id": "abcdef12-3456-7890-abcd-ef1234567890"},
|
||||
{"build_living_space_uu_id": "987fcdeb-51a2-43e7-9876-543210987654"},
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
@property
|
||||
def is_employee(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def is_occupant(self):
|
||||
return True
|
||||
|
||||
|
||||
class EmployeeSelectionValidation:
|
||||
tr = {"company_uu_id": "Şirket UU ID"}
|
||||
en = {"company_uu_id": "Company UU ID"}
|
||||
|
||||
|
||||
class EmployeeSelection(BaseModel, EmployeeSelectionValidation):
|
||||
company_uu_id: str = Field(..., example="abcdef12-3456-7890-abcd-ef1234567890")
|
||||
|
||||
model_config = ConfigDict(
|
||||
json_schema_extra={
|
||||
"example": [
|
||||
{"company_uu_id": "abcdef12-3456-7890-abcd-ef1234567890"},
|
||||
{"build_living_space_uu_id": "987fcdeb-51a2-43e7-9876-543210987654"},
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
@property
|
||||
def is_employee(self):
|
||||
return True
|
||||
|
||||
@property
|
||||
def is_occupant(self):
|
||||
return False
|
||||
|
||||
|
||||
class LoginValidation:
|
||||
tr = {
|
||||
"domain": "Domain",
|
||||
"access_key": "Erişim Anahtarı",
|
||||
"password": "Şifre",
|
||||
"remember_me": "Beni Hatırla",
|
||||
}
|
||||
en = {
|
||||
"domain": "Domain",
|
||||
"access_key": "Access Key",
|
||||
"password": "Password",
|
||||
"remember_me": "Remember Me",
|
||||
}
|
||||
|
||||
|
||||
class Login(BaseModelRegular, LoginValidation):
|
||||
domain: str = Field(..., example="example.com")
|
||||
access_key: str = Field(..., example="user@example.com")
|
||||
password: str = Field(..., example="password123")
|
||||
remember_me: Optional[bool] = Field(False, example=True)
|
||||
|
||||
model_config = ConfigDict(
|
||||
json_schema_extra={
|
||||
"example": {
|
||||
"domain": "evyos.com.tr",
|
||||
"access_key": "karatay.berkay.sup@evyos.com.tr",
|
||||
"password": "string",
|
||||
"remember_me": False,
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class LogoutValidation:
|
||||
tr = {"domain": "Domain"}
|
||||
en = {"domain": "Domain"}
|
||||
|
||||
|
||||
class Logout(BaseModelRegular, LogoutValidation):
|
||||
domain: str = Field(..., example="example.com")
|
||||
|
||||
model_config = ConfigDict(json_schema_extra={"example": {"domain": "example.com"}})
|
||||
|
||||
|
||||
class RememberValidation:
|
||||
tr = {"domain": "Domain", "refresh_token": "Yenileme Anahtarı"}
|
||||
en = {"domain": "Domain", "refresh_token": "Refresh Token"}
|
||||
|
||||
|
||||
class Remember(BaseModelRegular, RememberValidation):
|
||||
domain: str = Field(..., example="example.com")
|
||||
refresh_token: str = Field(..., example="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...")
|
||||
|
||||
model_config = ConfigDict(
|
||||
json_schema_extra={
|
||||
"example": {
|
||||
"domain": "example.com",
|
||||
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class ForgotValidation:
|
||||
tr = {"domain": "Domain", "access_key": "Erişim Anahtarı"}
|
||||
en = {"domain": "Domain", "access_key": "Access Key"}
|
||||
|
||||
|
||||
class Forgot(BaseModelRegular, ForgotValidation):
|
||||
domain: str = Field(..., example="example.com")
|
||||
access_key: str = Field(..., example="user@example.com")
|
||||
|
||||
model_config = ConfigDict(
|
||||
json_schema_extra={
|
||||
"example": {"domain": "example.com", "access_key": "user@example.com"}
|
||||
}
|
||||
)
|
||||
33
ApiLayers/ApiValidations/Request/base_validations.py
Normal file
33
ApiLayers/ApiValidations/Request/base_validations.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.handler import BaseModelRegular
|
||||
|
||||
|
||||
class ListOptions(BaseModelRegular):
|
||||
page: Optional[int] = 1
|
||||
size: Optional[int] = 10
|
||||
order_field: Optional[str] = "id"
|
||||
order_type: Optional[str] = "asc"
|
||||
include_joins: Optional[list] = None
|
||||
query: Optional[dict] = None
|
||||
|
||||
|
||||
class CrudRecords:
|
||||
uu_id: Optional[str] = None
|
||||
created_at: Optional[str] = None
|
||||
updated_at: Optional[str] = None
|
||||
created_by: Optional[str] = None
|
||||
updated_by: Optional[str] = None
|
||||
confirmed_by: Optional[str] = None
|
||||
is_confirmed: Optional[bool] = None
|
||||
active: Optional[bool] = None
|
||||
is_notification_send: Optional[bool] = None
|
||||
is_email_send: Optional[bool] = None
|
||||
|
||||
|
||||
class PydanticBaseModel(BaseModelRegular):
|
||||
|
||||
active: Optional[bool] = None
|
||||
deleted: Optional[bool] = None
|
||||
expiry_starts: Optional[str] = None
|
||||
# expiry_ends: Optional[str] = None
|
||||
is_confirmed: Optional[bool] = None
|
||||
22
ApiLayers/ApiValidations/Request/build_living_space.py
Normal file
22
ApiLayers/ApiValidations/Request/build_living_space.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import BaseModelRegular
|
||||
|
||||
# from api_validations.validations_request import (
|
||||
# PydanticBaseModel,
|
||||
# PydanticBaseModelValidation,
|
||||
# )
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class InsertBuildLivingSpace(BaseModelRegular):
|
||||
person_uu_id: str
|
||||
build_parts_uu_id: str
|
||||
occupant_type_uu_id: str
|
||||
expiry_starts: str
|
||||
expiry_ends: Optional[str] = None
|
||||
|
||||
|
||||
class UpdateBuildLivingSpace(PydanticBaseModel):
|
||||
is_tenant_live: Optional[bool] = None
|
||||
build_parts_uu_id: Optional[str] = None
|
||||
person_uu_id: Optional[str] = None
|
||||
43
ApiLayers/ApiValidations/Request/build_part.py
Normal file
43
ApiLayers/ApiValidations/Request/build_part.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class InsertBuildTypes(BaseModelRegular):
|
||||
function_code: str
|
||||
type_code: str
|
||||
lang: str
|
||||
type_name: str
|
||||
|
||||
|
||||
class UpdateBuildTypes(PydanticBaseModel): ...
|
||||
|
||||
|
||||
class InsertBuildParts(BaseModelRegular):
|
||||
build_uu_id: str
|
||||
address_gov_code: str
|
||||
part_no: int
|
||||
part_level: int
|
||||
build_part_type_uu_id: str
|
||||
|
||||
part_gross_size: Optional[int] = None
|
||||
part_net_size: Optional[int] = None
|
||||
default_accessory: Optional[str] = None
|
||||
human_livable: Optional[bool] = False
|
||||
part_direction_uu_id: Optional[str] = None
|
||||
ref_id: Optional[str] = None
|
||||
|
||||
|
||||
class UpdateBuildParts(PydanticBaseModel):
|
||||
address_gov_code: Optional[str] = None
|
||||
part_no: Optional[int] = None
|
||||
part_level: Optional[int] = None
|
||||
build_part_type_uu_id: Optional[str] = None
|
||||
|
||||
part_code: Optional[int] = None
|
||||
part_gross_size: Optional[int] = None
|
||||
part_net_size: Optional[int] = None
|
||||
default_accessory: Optional[str] = None
|
||||
human_livable: Optional[bool] = False
|
||||
part_direction: Optional[str] = None
|
||||
current_owner_person_uu_id: Optional[str] = None
|
||||
current_tenant_person_uu_id: Optional[str] = None
|
||||
43
ApiLayers/ApiValidations/Request/building.py
Normal file
43
ApiLayers/ApiValidations/Request/building.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class InsertBuild(BaseModelRegular):
|
||||
|
||||
gov_address_code: str
|
||||
build_name: str
|
||||
build_types_uu_id: str
|
||||
max_floor: int
|
||||
underground_floor: int
|
||||
address_uu_id: str
|
||||
build_date: datetime
|
||||
decision_period_date: datetime
|
||||
|
||||
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 UpdateBuild(PydanticBaseModel):
|
||||
gov_address_code: Optional[str] = None
|
||||
build_name: Optional[str] = None
|
||||
build_no: Optional[str] = None
|
||||
build_types_uu_id: Optional[str] = None
|
||||
max_floor: Optional[int] = None
|
||||
underground_floor: Optional[int] = None
|
||||
build_date: Optional[datetime] = 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
|
||||
32
ApiLayers/ApiValidations/Request/company.py
Normal file
32
ApiLayers/ApiValidations/Request/company.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from typing import Optional, List
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class InsertCompany(BaseModelRegular):
|
||||
formal_name: str
|
||||
company_type: str
|
||||
commercial_type: str
|
||||
tax_no: str
|
||||
public_name: Optional[str] = None
|
||||
company_tag: Optional[str] = None
|
||||
default_lang_type: Optional[str] = None
|
||||
default_money_type: Optional[str] = None
|
||||
official_address_uu_id: Optional[str] = None
|
||||
# parent_uu_id: Optional[int] = None
|
||||
|
||||
|
||||
class UpdateCompany(PydanticBaseModel):
|
||||
company_uu_id: str
|
||||
public_name: Optional[str] = None
|
||||
formal_name: Optional[str] = None
|
||||
tax_no: Optional[str] = None
|
||||
company_tag: Optional[str] = None
|
||||
default_lang_type: Optional[str] = None
|
||||
default_money_type: Optional[str] = None
|
||||
official_address_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class MatchCompany2Company(PydanticBaseModel):
|
||||
match_company_uu_id: List[str]
|
||||
duty_uu_id: str
|
||||
show_only: Optional[bool] = None
|
||||
116
ApiLayers/ApiValidations/Request/core_request_validations.py
Normal file
116
ApiLayers/ApiValidations/Request/core_request_validations.py
Normal file
@@ -0,0 +1,116 @@
|
||||
from typing import Optional
|
||||
|
||||
from ApiValidations.Request import BaseModelRegular
|
||||
|
||||
|
||||
class ListOptionsValidation:
|
||||
tr = {
|
||||
"page": "Sayfa",
|
||||
"size": "Boyut",
|
||||
"order_field": "Sıralama Alanı",
|
||||
"order_type": "Sıralama Türü",
|
||||
"include_joins": "Alt İçerikleri",
|
||||
"query": "Sorgu",
|
||||
}
|
||||
en = {
|
||||
"page": "Page",
|
||||
"size": "Size",
|
||||
"order_field": "Order Field",
|
||||
"order_type": "Order Type",
|
||||
"include_joins": "Include Joins",
|
||||
"query": "Query",
|
||||
}
|
||||
|
||||
|
||||
class ListOptions(BaseModelRegular, ListOptionsValidation):
|
||||
page: Optional[int] = 1
|
||||
size: Optional[int] = 10
|
||||
order_field: Optional[str] = "id"
|
||||
order_type: Optional[str] = "asc"
|
||||
include_joins: Optional[list] = None
|
||||
query: Optional[dict] = None
|
||||
|
||||
|
||||
class CrudRecordValidation:
|
||||
tr = {
|
||||
"uu_id": "UUID",
|
||||
"created_at": "Oluşturulma Tarihi",
|
||||
"updated_at": "Güncellenme Tarihi",
|
||||
"created_by": "Oluşturan",
|
||||
"updated_by": "Güncelleyen",
|
||||
"confirmed_by": "Onaylayan",
|
||||
"is_confirmed": "Onay",
|
||||
"expiry_starts": "Geçerlilik Başlangıç Tarihi",
|
||||
"expiry_ends": "Geçerlilik Bitiş Tarihi",
|
||||
"active": "Aktif",
|
||||
"is_notification_send": "Bildirim Gönderildi",
|
||||
"is_email_send": "E-posta Gönderildi",
|
||||
}
|
||||
en = {
|
||||
"uu_id": "UUID",
|
||||
"created_at": "Created At",
|
||||
"updated_at": "Updated At",
|
||||
"created_by": "Created By",
|
||||
"updated_by": "Updated By",
|
||||
"confirmed_by": "Confirmed By",
|
||||
"is_confirmed": "Confirmed",
|
||||
"expiry_starts": "Expiry Starts",
|
||||
"expiry_ends": "Expiry Ends",
|
||||
"active": "Active",
|
||||
"is_notification_send": "Notification Send",
|
||||
"is_email_send": "Email Send",
|
||||
}
|
||||
|
||||
|
||||
class CrudRecords:
|
||||
uu_id: Optional[str] = None
|
||||
created_at: Optional[str] = None
|
||||
updated_at: Optional[str] = None
|
||||
created_by: Optional[str] = None
|
||||
updated_by: Optional[str] = None
|
||||
confirmed_by: Optional[str] = None
|
||||
is_confirmed: Optional[bool] = None
|
||||
active: Optional[bool] = None
|
||||
is_notification_send: Optional[bool] = None
|
||||
is_email_send: Optional[bool] = None
|
||||
|
||||
|
||||
class PydanticBaseModelValidation:
|
||||
tr = {
|
||||
"active": "Aktif",
|
||||
"deleted": "Silinmiş",
|
||||
"expiry_starts": "Geçerlilik Başlangıç Tarihi",
|
||||
"expiry_ends": "Geçerlilik Bitiş Tarihi",
|
||||
"is_confirmed": "Onay",
|
||||
}
|
||||
en = {
|
||||
"active": "Active",
|
||||
"deleted": "Deleted",
|
||||
"expiry_starts": "Expiry Starts",
|
||||
"expiry_ends": "Expiry Ends",
|
||||
"is_confirmed": "Confirmed",
|
||||
}
|
||||
|
||||
|
||||
class PydanticBaseModel(BaseModelRegular):
|
||||
|
||||
active: Optional[bool] = None
|
||||
deleted: Optional[bool] = None
|
||||
expiry_starts: Optional[str] = None
|
||||
# expiry_ends: Optional[str] = None
|
||||
is_confirmed: Optional[bool] = None
|
||||
|
||||
|
||||
class EndpointPydantic(BaseModelRegular):
|
||||
data: Optional[dict] = None
|
||||
|
||||
|
||||
class EndpointValidation(BaseModelRegular):
|
||||
endpoint: Optional[str] = None
|
||||
|
||||
|
||||
class PatchRecord(BaseModelRegular):
|
||||
|
||||
confirm: Optional[bool] = None
|
||||
delete: Optional[bool] = None
|
||||
active: Optional[bool] = None
|
||||
73
ApiLayers/ApiValidations/Request/create_model.py
Normal file
73
ApiLayers/ApiValidations/Request/create_model.py
Normal file
@@ -0,0 +1,73 @@
|
||||
import typing
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class ConvertField:
|
||||
|
||||
def __init__(self, match, default_val=None):
|
||||
self.match = match
|
||||
self.default_val = default_val
|
||||
|
||||
def typing_return(self):
|
||||
typing_dict = {
|
||||
"<class 'float'>": float,
|
||||
"<class 'bool'>": bool,
|
||||
"<class 'int'>": int,
|
||||
"<class 'str'>": str,
|
||||
"<class 'dict'>": dict,
|
||||
"<class 'list'>": list,
|
||||
"<class 'datetime.datetime'>": datetime,
|
||||
"typing.Optional[datetime.datetime]": typing.Optional[datetime],
|
||||
"typing.Optional[bool]": typing.Optional[bool],
|
||||
"typing.Optional[list]": typing.Optional[list],
|
||||
"typing.Optional[str]": typing.Optional[str],
|
||||
"typing.Optional[int]": typing.Optional[int],
|
||||
"typing.Optional[float]": typing.Optional[float],
|
||||
"typing.Optional[dict]": typing.Optional[dict],
|
||||
}
|
||||
matches_with = typing_dict.get(self.match, typing.Optional[str])
|
||||
default_value = getattr(self.default_val, "field_default_value", None)
|
||||
return matches_with, default_value
|
||||
|
||||
|
||||
#
|
||||
# def create_model_from_database(model_id: typing.Union[int, str]):
|
||||
# if isinstance(model_id, int):
|
||||
# selected_model = Models.find_one(id=model_id)
|
||||
# else:
|
||||
# selected_model = Models.find_one(uu_id=str(model_id))
|
||||
#
|
||||
# if not selected_model:
|
||||
# raise HTTPException(
|
||||
# status_code=202,
|
||||
# detail=f"Model {selected_model.model_name} not found in database. Please add model to api.",
|
||||
# )
|
||||
# pydantic_class = getattr(root_validates, selected_model.model_type, None)
|
||||
# if not pydantic_class:
|
||||
# raise HTTPException(
|
||||
# status_code=202,
|
||||
# detail=f"Pydantic class {selected_model.model_type} not found in database. Please add model to api.",
|
||||
# )
|
||||
#
|
||||
# model_entities_records = ModelEntities.filter_all(
|
||||
# ModelEntities.model_id == selected_model.id
|
||||
# ).data
|
||||
#
|
||||
# if not model_entities_records:
|
||||
# raise HTTPException(
|
||||
# status_code=202,
|
||||
# detail="Model has no entities registered. Please add entities to model.",
|
||||
# )
|
||||
#
|
||||
# fields = {}
|
||||
# for entity in model_entities_records:
|
||||
# fields[entity.field_name] = ConvertField(
|
||||
# entity.field_type, entity.field_default_value
|
||||
# ).typing_return()
|
||||
#
|
||||
# return create_model(
|
||||
# __model_name=selected_model.model_name, # pydantic_name(User)
|
||||
# __module__=pydantic_class.__module__, # field_name(uu_id)
|
||||
# **fields, # field_name = (field_type (Optional[str]), default_value(None))
|
||||
# )
|
||||
110
ApiLayers/ApiValidations/Request/decision_book.py
Normal file
110
ApiLayers/ApiValidations/Request/decision_book.py
Normal file
@@ -0,0 +1,110 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel, ListOptions
|
||||
|
||||
|
||||
class DecisionBookDecisionBookInvitations(BaseModelRegular):
|
||||
build_decision_book_uu_id: str
|
||||
message: str
|
||||
planned_date: str
|
||||
|
||||
|
||||
class DecisionBookDecisionBookInvitationsAttend(BaseModelRegular):
|
||||
token: str
|
||||
is_attend: bool
|
||||
|
||||
|
||||
class DecisionBookDecisionBookInvitationsAssign(BaseModelRegular):
|
||||
token: str
|
||||
build_living_space_uu_id: str
|
||||
occupant_type_uu_id: str
|
||||
|
||||
|
||||
class DecisionBookDecisionBookInvitationsUpdate(PydanticBaseModel):
|
||||
token: str
|
||||
occupant_type_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class ListDecisionBook(ListOptions):
|
||||
build_decision_book_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class InsertDecisionBook(PydanticBaseModel):
|
||||
build_uu_id: str
|
||||
decision_type: str
|
||||
meeting_date: str
|
||||
is_out_sourced: bool
|
||||
|
||||
resp_company_fix_wage: Optional[float] = None
|
||||
resp_company_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class InsertDecisionBookCompleted(BaseModelRegular):
|
||||
build_decision_book_uu_id: str
|
||||
meeting_completed_date: str
|
||||
|
||||
|
||||
class InsertDecisionBookPerson(BaseModelRegular):
|
||||
person_uu_id: str
|
||||
build_decision_book_uu_id: str
|
||||
management_typecode_uu_id: str
|
||||
|
||||
dues_discount_approval_date: Optional[str] = None
|
||||
dues_fix_discount: Optional[float] = None
|
||||
dues_percent_discount: Optional[int] = None
|
||||
|
||||
|
||||
class UpdateDecisionBookPerson(PydanticBaseModel):
|
||||
|
||||
dues_fix_discount: Optional[float] = None
|
||||
dues_percent_discount: Optional[int] = None
|
||||
|
||||
|
||||
class RemoveDecisionBookPerson(PydanticBaseModel):
|
||||
person_uu_id: str
|
||||
build_decision_book_person_uu_id: str
|
||||
|
||||
|
||||
class UpdateDecisionBook(PydanticBaseModel):
|
||||
decision_book_pdf_path: Optional[str] = None
|
||||
is_out_sourced: Optional[bool] = None
|
||||
contact_agreement_path: Optional[str] = None
|
||||
contact_agreement_date: Optional[str] = None
|
||||
meeting_date: Optional[str] = None
|
||||
decision_type: Optional[str] = None
|
||||
|
||||
resp_company_fix_wage: Optional[float] = None
|
||||
resp_company_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class InsertBuildDecisionBookItems(BaseModelRegular):
|
||||
token: str
|
||||
info_type_uu_id: str
|
||||
item_comment: str
|
||||
|
||||
currency: Optional[str] = "TL"
|
||||
unit_type: Optional[str] = "M2"
|
||||
debit_start_date: Optional[str] = None
|
||||
debit_end_date: Optional[str] = None
|
||||
unit_price_is_fixed: Optional[bool] = False
|
||||
unit_price: Optional[float] = 0.00
|
||||
|
||||
# build_decision_book_uu_id: str
|
||||
# item_objection: Optional[str] = None
|
||||
|
||||
|
||||
class UpdateBuildDecisionBookItems(PydanticBaseModel):
|
||||
item_comment: Optional[str] = None
|
||||
item_objection: Optional[str] = None
|
||||
|
||||
|
||||
class InsertBuildDecisionBookItemDebits(BaseModelRegular):
|
||||
build_decision_book_item_uu_id: str
|
||||
dues_values: dict
|
||||
# dues_types_uu_id: str
|
||||
# decision_taken: Optional[bool] = None
|
||||
|
||||
|
||||
class UpdateBuildDecisionBookItemDebits(PydanticBaseModel):
|
||||
dues_types_uu_id: Optional[str] = None
|
||||
dues_values: Optional[dict] = None
|
||||
decision_taken: Optional[bool] = None
|
||||
22
ApiLayers/ApiValidations/Request/departments.py
Normal file
22
ApiLayers/ApiValidations/Request/departments.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import (
|
||||
PydanticBaseModel,
|
||||
)
|
||||
|
||||
|
||||
class DepartmentsPydantic(PydanticBaseModel):
|
||||
|
||||
department_code: Optional[str]
|
||||
department_name: Optional[str]
|
||||
department_description: Optional[str] = None
|
||||
company_uu_id: Optional[str] = None
|
||||
parent_department_uu_id: Optional[int] = None
|
||||
|
||||
|
||||
# class UpdateDepartments(PydanticBaseModel):
|
||||
#
|
||||
# department_code: Optional[str] = None
|
||||
# department_name: Optional[str] = None
|
||||
# department_description: Optional[str] = None
|
||||
# company_uu_id: Optional[str] = None
|
||||
# parent_department_uu_id: Optional[int] = None
|
||||
77
ApiLayers/ApiValidations/Request/employee.py
Normal file
77
ApiLayers/ApiValidations/Request/employee.py
Normal file
@@ -0,0 +1,77 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class BindEmployees2People(PydanticBaseModel):
|
||||
staff_uu_id: str
|
||||
people_uu_id: str
|
||||
expiry_starts: Optional[str] = None
|
||||
|
||||
|
||||
class UnBindEmployees2People(PydanticBaseModel):
|
||||
people_uu_id: str
|
||||
expiry_ends: str
|
||||
|
||||
|
||||
class InsertEmployees(BaseModelRegular):
|
||||
staff_uu_id: str
|
||||
people_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class InsertCompanyDuty(BaseModelRegular):
|
||||
duty_code: str
|
||||
duty_name: str
|
||||
duty_description: Optional[str] = None
|
||||
|
||||
|
||||
class SelectDuties(BaseModelRegular):
|
||||
duty_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class InsertDuties(BaseModelRegular):
|
||||
duties_uu_id: str
|
||||
department_uu_id: str
|
||||
is_default_duty: Optional[bool] = False
|
||||
|
||||
|
||||
class UpdateDuties(PydanticBaseModel):
|
||||
duties_uu_id: Optional[str] = None
|
||||
department_uu_id: Optional[str] = None
|
||||
is_default_duty: Optional[bool] = None
|
||||
|
||||
|
||||
class UpdateCompanyDuty(PydanticBaseModel):
|
||||
duty_code: Optional[str] = None
|
||||
duty_name: Optional[str] = None
|
||||
duty_description: Optional[str] = None
|
||||
|
||||
|
||||
class InsertCompanyEmployeesSalaries(BaseModelRegular):
|
||||
gross_salary: float
|
||||
net_salary: float
|
||||
start_date: str
|
||||
stop_date: Optional[str] = None
|
||||
people_id: int
|
||||
|
||||
|
||||
class UpdateCompanyEmployeesSalaries(PydanticBaseModel):
|
||||
gross_salary: Optional[float] = None
|
||||
net_salary: Optional[float] = None
|
||||
start_date: Optional[str] = None
|
||||
stop_date: Optional[str] = None
|
||||
people_id: Optional[int] = None
|
||||
|
||||
|
||||
class InsertCompanyEmployees(BaseModelRegular):
|
||||
|
||||
employee_description: Optional[str] = None
|
||||
person_uu_id: str
|
||||
duty_uu_id: str
|
||||
|
||||
start_date: Optional[str] = None
|
||||
stop_date: Optional[str] = None
|
||||
|
||||
|
||||
class UpdateCompanyEmployees(PydanticBaseModel):
|
||||
stop_date: Optional[str] = None
|
||||
employee_description: Optional[str] = None
|
||||
37
ApiLayers/ApiValidations/Request/events.py
Normal file
37
ApiLayers/ApiValidations/Request/events.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import BaseModelRegular
|
||||
|
||||
|
||||
class RegisterEvents2EmployeeValidation:
|
||||
tr = {
|
||||
"event_uu_id_list": "Etkinlikler Listesi",
|
||||
"employee_uu_id": "Çalışan UU ID",
|
||||
}
|
||||
en = {
|
||||
"event_uu_id_list": "Event List",
|
||||
"employee_uu_id": "Employee UU ID",
|
||||
}
|
||||
|
||||
|
||||
class RegisterEvents2Employee(BaseModelRegular, RegisterEvents2EmployeeValidation):
|
||||
event_uu_id_list: list[str] = None
|
||||
employee_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class RegisterEvents2OccupantValidation:
|
||||
tr = {
|
||||
"event_uu_id_list": "Etkinlikler Listesi",
|
||||
"build_part_uu_id": "Bina Parça UU ID",
|
||||
"occupant_uu_id": "Apartman Sakini UU ID",
|
||||
}
|
||||
en = {
|
||||
"event_uu_id_list": "Event List",
|
||||
"build_part_uu_id": "Building Part UU ID",
|
||||
"occupant_uu_id": "Occupant UU ID",
|
||||
}
|
||||
|
||||
|
||||
class RegisterEvents2Occupant(BaseModelRegular, RegisterEvents2OccupantValidation):
|
||||
event_uu_id_list: list[str] = None
|
||||
build_part_uu_id: Optional[str] = None
|
||||
occupant_uu_id: Optional[str] = None
|
||||
36
ApiLayers/ApiValidations/Request/modules.py
Normal file
36
ApiLayers/ApiValidations/Request/modules.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from ApiValidations.Request import BaseModelRegular
|
||||
|
||||
|
||||
class RegisterModules2OccupantValidation:
|
||||
tr = {
|
||||
"modules_uu_id": "Modül Listesi",
|
||||
"occupant_uu_id": "Mülk Sahibi",
|
||||
"build_part_uu_id": "Daire UUID",
|
||||
}
|
||||
en = {
|
||||
"modules_uu_id": "Module List",
|
||||
"occupant_uu_id": "Occupant",
|
||||
"build_part_uu_id": "Flat UUID",
|
||||
}
|
||||
|
||||
|
||||
class RegisterModules2Occupant(BaseModelRegular, RegisterModules2OccupantValidation):
|
||||
modules_uu_id: str
|
||||
occupant_uu_id: str
|
||||
build_part_uu_id: str
|
||||
|
||||
|
||||
class RegisterModules2EmployeeValidation:
|
||||
tr = {
|
||||
"modules_uu_id": "Modül Listesi",
|
||||
"employee_uu_id": "Çalışan",
|
||||
}
|
||||
en = {
|
||||
"modules_uu_id": "Module List",
|
||||
"employee_uu_id": "Employee",
|
||||
}
|
||||
|
||||
|
||||
class RegisterModules2Employee(BaseModelRegular, RegisterModules2EmployeeValidation):
|
||||
modules_uu_id: str
|
||||
employee_uu_id: str
|
||||
66
ApiLayers/ApiValidations/Request/people.py
Normal file
66
ApiLayers/ApiValidations/Request/people.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class InsertPerson(BaseModelRegular):
|
||||
firstname: str
|
||||
surname: str
|
||||
sex_code: str
|
||||
national_identity_id: str
|
||||
middle_name: Optional[str] = None
|
||||
father_name: Optional[str] = None
|
||||
mother_name: Optional[str] = None
|
||||
country_code: Optional[str] = "TR"
|
||||
birth_place: Optional[str] = None
|
||||
birth_date: Optional[str] = None
|
||||
tax_no: Optional[str] = None
|
||||
ref_id: Optional[str] = None
|
||||
|
||||
|
||||
class UpdatePerson(PydanticBaseModel):
|
||||
firstname: Optional[str] = None
|
||||
surname: Optional[str] = None
|
||||
middle_name: Optional[str]
|
||||
father_name: Optional[str] = None
|
||||
mother_name: Optional[str] = None
|
||||
sex_code: 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
|
||||
|
||||
|
||||
#
|
||||
# class QueryPeople(PydanticBaseModel):
|
||||
# uu_id: Optional[str] = None
|
||||
#
|
||||
#
|
||||
# class InsertPeople(PydanticBaseModel):
|
||||
# key_id: Optional[str] = None
|
||||
# query: Optional[dict] = None
|
||||
# data: Optional[_InsertPerson] = None
|
||||
#
|
||||
#
|
||||
# class UpdatePeople(PydanticBaseModel):
|
||||
# key_id: Optional[str] = None
|
||||
# query: Optional[QueryPeople] = None
|
||||
# data: Optional[_UpdatePerson] = None
|
||||
#
|
||||
#
|
||||
# class DeletePeople(PydanticBaseModel):
|
||||
# key_id: Optional[str] = None
|
||||
# query: Optional[List[QueryPeople]] = None
|
||||
# data: Optional[dict] = None
|
||||
#
|
||||
#
|
||||
# class ListPeople(PydanticBaseModel):
|
||||
# key_id: Optional[str] = None
|
||||
# query: Optional[QueryPeople] = None
|
||||
# data: Optional[ListOptions] = None
|
||||
#
|
||||
#
|
||||
# class ActivePeople(PydanticBaseModel):
|
||||
# key_id: Optional[str] = None
|
||||
# query: Optional[List[QueryPeople]] = None
|
||||
# data: Optional[dict] = None
|
||||
99
ApiLayers/ApiValidations/Request/project_decision_book.py
Normal file
99
ApiLayers/ApiValidations/Request/project_decision_book.py
Normal file
@@ -0,0 +1,99 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class InsertBuildDecisionBookProjectItems(BaseModelRegular):
|
||||
build_decision_book_project_uu_id: str
|
||||
item_header: str
|
||||
item_comment: str
|
||||
attachment_pdf_path: Optional[str] = None
|
||||
item_objection: Optional[str] = None
|
||||
|
||||
|
||||
class UpdateBuildDecisionBookProjectItems(PydanticBaseModel):
|
||||
item_header: Optional[str] = None
|
||||
item_comment: Optional[str] = None
|
||||
attachment_pdf_path: Optional[str] = None
|
||||
item_estimated_cost: Optional[float] = None
|
||||
build_decision_book_project_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class InsertBuildDecisionBookProjectPerson(BaseModelRegular):
|
||||
dues_percent_discount: Optional[int] = None
|
||||
job_fix_wage: Optional[float] = None
|
||||
bid_price: Optional[float] = None
|
||||
decision_price: Optional[float] = None
|
||||
build_decision_book_project_uu_id: str
|
||||
living_space_uu_id: str
|
||||
project_team_type_uu_id: str
|
||||
|
||||
|
||||
class UpdateBuildDecisionBookProjectPerson(PydanticBaseModel):
|
||||
dues_percent_discount: Optional[int] = None
|
||||
job_fix_wage: Optional[float] = None
|
||||
bid_price: Optional[float] = None
|
||||
decision_price: Optional[float] = None
|
||||
build_decision_book_project_uu_id: Optional[str] = None
|
||||
living_space_uu_id: Optional[str] = None
|
||||
project_team_type_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class InsertBuildDecisionBookProjects(BaseModelRegular):
|
||||
build_decision_book_item_uu_id: str
|
||||
project_responsible_person_uu_id: str
|
||||
project_name: str
|
||||
project_start_date: str
|
||||
project_stop_date: str
|
||||
project_type: str
|
||||
|
||||
is_out_sourced: Optional[bool] = False
|
||||
project_note: Optional[str] = None
|
||||
decision_book_pdf_path: Optional[str] = None
|
||||
resp_company_fix_wage: Optional[float] = None
|
||||
contact_agreement_path: Optional[str] = None
|
||||
contact_agreement_date: Optional[str] = None
|
||||
meeting_date: Optional[str] = None
|
||||
currency: Optional[str] = None
|
||||
bid_price: Optional[float] = None
|
||||
resp_company_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class UpdateBuildDecisionBookProjects(PydanticBaseModel):
|
||||
build_decision_book_project_uu_id: str
|
||||
is_out_sourced: Optional[bool] = False
|
||||
project_note: Optional[str] = None
|
||||
# decision_book_pdf_path: Optional[str] = None
|
||||
status_id: Optional[int] = None
|
||||
resp_company_fix_wage: Optional[float] = None
|
||||
contact_agreement_path: Optional[str] = None
|
||||
contact_agreement_date: Optional[str] = None
|
||||
contact_uu_id: Optional[str] = None
|
||||
resp_company_uu_id: Optional[str] = None
|
||||
approved_price: Optional[float] = None
|
||||
|
||||
|
||||
class ApprovalsBuildDecisionBookProjects(PydanticBaseModel):
|
||||
build_decision_book_project_uu_id: str
|
||||
project_stop_date: str
|
||||
status_code: Optional[int] = None
|
||||
final_price_list: Optional[list[dict]] = (
|
||||
None # {"date": "2021-01-01", "price": 1000}
|
||||
)
|
||||
|
||||
|
||||
class InsertBuildDecisionBookProjectItemDebits(PydanticBaseModel):
|
||||
build_decision_book_project_item_uu_id: str
|
||||
payment_date: str
|
||||
dues_values: dict
|
||||
is_official: Optional[bool] = False
|
||||
discount_value: Optional[float] = None
|
||||
discount_fix: Optional[float] = None
|
||||
decision_taken: Optional[bool] = None
|
||||
|
||||
|
||||
class UpdateBuildDecisionBookProjectItemDebits(PydanticBaseModel):
|
||||
dues_values: Optional[str] = None
|
||||
discount_value: Optional[float] = None
|
||||
discount_fix: Optional[float] = None
|
||||
decision_taken: Optional[bool] = None
|
||||
is_official: Optional[bool] = None
|
||||
23
ApiLayers/ApiValidations/Request/rules.py
Normal file
23
ApiLayers/ApiValidations/Request/rules.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from typing import Optional, List
|
||||
from ApiValidations.Request import BaseModelRegular
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class CheckEndpointAccess(BaseModelRegular):
|
||||
endpoint: str
|
||||
|
||||
|
||||
class InsertEndpointAccess(PydanticBaseModel):
|
||||
duty_uu_id: str
|
||||
endpoint_restriction_list_uu_ids: list
|
||||
|
||||
|
||||
class UpdateEndpointAccess(PydanticBaseModel):
|
||||
endpoint_restriction_uu_id: Optional[str] = None
|
||||
deleted: Optional[bool] = None
|
||||
active: Optional[bool] = None
|
||||
is_confirmed: Optional[bool] = None
|
||||
|
||||
|
||||
class UpdateEndpointAccessList(PydanticBaseModel):
|
||||
endpoint_restriction_list: List[UpdateEndpointAccess]
|
||||
36
ApiLayers/ApiValidations/Request/services.py
Normal file
36
ApiLayers/ApiValidations/Request/services.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from ApiValidations.Request import BaseModelRegular
|
||||
|
||||
|
||||
class RegisterServices2OccupantValidation:
|
||||
tr = {
|
||||
"service_uu_id": "Hizmet UUID",
|
||||
"occupant_uu_id": "Müşteri UUID",
|
||||
"build_part_uu_id": "Bina Parça UUID",
|
||||
}
|
||||
en = {
|
||||
"service_uu_id": "Service UUID",
|
||||
"occupant_uu_id": "Occupant UUID",
|
||||
"build_part_uu_id": "Building Part UUID",
|
||||
}
|
||||
|
||||
|
||||
class RegisterServices2Occupant(BaseModelRegular, RegisterServices2OccupantValidation):
|
||||
service_uu_id: str
|
||||
occupant_uu_id: str
|
||||
build_part_uu_id: str
|
||||
|
||||
|
||||
class RegisterServices2EmployeeValidation:
|
||||
tr = {
|
||||
"service_uu_id": "Hizmet UUID",
|
||||
"employee_uu_id": "Personel UUID",
|
||||
}
|
||||
en = {
|
||||
"service_uu_id": "Service UUID",
|
||||
"employee_uu_id": "Employee UUID",
|
||||
}
|
||||
|
||||
|
||||
class RegisterServices2Employee(BaseModelRegular, RegisterServices2EmployeeValidation):
|
||||
service_uu_id: str
|
||||
employee_uu_id: str
|
||||
39
ApiLayers/ApiValidations/Request/staff.py
Normal file
39
ApiLayers/ApiValidations/Request/staff.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import BaseModelRegular, PydanticBaseModel
|
||||
|
||||
|
||||
class InsertStaffValidation:
|
||||
tr = {
|
||||
"staff_name": "Kadro Adı",
|
||||
"staff_description": "Kadro Açıklaması",
|
||||
"staff_code": "Kadro Kodu",
|
||||
"duties_uu_id": "Görev UUID",
|
||||
}
|
||||
en = {
|
||||
"staff_name": "Staff Name",
|
||||
"staff_description": "Staff Description",
|
||||
"staff_code": "Staff Code",
|
||||
"duties_uu_id": "Duties UUID",
|
||||
}
|
||||
|
||||
|
||||
class InsertStaff(BaseModelRegular, InsertStaffValidation):
|
||||
|
||||
staff_name: str
|
||||
staff_description: Optional[str] = None
|
||||
staff_code: Optional[str] = None
|
||||
duties_uu_id: str
|
||||
|
||||
|
||||
class SelectStaffValidation:
|
||||
tr = {
|
||||
"duties_uu_id": "Görev UUID",
|
||||
}
|
||||
en = {
|
||||
"duties_uu_id": "Duties UUID",
|
||||
}
|
||||
|
||||
|
||||
class SelectStaff(PydanticBaseModel, SelectStaffValidation):
|
||||
|
||||
duties_uu_id: str
|
||||
68
ApiLayers/ApiValidations/Request/user.py
Normal file
68
ApiLayers/ApiValidations/Request/user.py
Normal file
@@ -0,0 +1,68 @@
|
||||
from typing import Optional
|
||||
from ApiValidations.Request import PydanticBaseModel
|
||||
|
||||
|
||||
class InsertUsersValidation:
|
||||
tr = {
|
||||
"people_uu_id": "Kişi UUID",
|
||||
"user_tag": "Kullanıcı Etiketi",
|
||||
"email": "E-posta",
|
||||
"phone_number": "Telefon Numarası",
|
||||
"avatar": "Avatar",
|
||||
}
|
||||
en = {
|
||||
"people_uu_id": "People UUID",
|
||||
"user_tag": "User Tag",
|
||||
"email": "Email",
|
||||
"phone_number": "Phone Number",
|
||||
"avatar": "Avatar",
|
||||
}
|
||||
|
||||
|
||||
class InsertUsers(PydanticBaseModel, InsertUsersValidation):
|
||||
people_uu_id: str
|
||||
user_tag: str
|
||||
email: Optional[str] = None
|
||||
phone_number: Optional[str] = None
|
||||
avatar: Optional[str] = None
|
||||
|
||||
|
||||
class UpdateUsersValidation:
|
||||
tr = {
|
||||
"people_uu_id": "Kişi UUID",
|
||||
"nick_name": "Kullanıcı Etiketi",
|
||||
"domain_name": "Domain Adı",
|
||||
"email": "E-posta",
|
||||
"phone_number": "Telefon Numarası",
|
||||
"avatar": "Avatar",
|
||||
}
|
||||
en = {
|
||||
"people_uu_id": "People UUID",
|
||||
"nick_name": "User Tag",
|
||||
"domain_name": "Domain Name",
|
||||
"email": "Email",
|
||||
"phone_number": "Phone Number",
|
||||
"avatar": "Avatar",
|
||||
}
|
||||
|
||||
|
||||
class UpdateUsers(PydanticBaseModel, UpdateUsersValidation):
|
||||
people_uu_id: Optional[str] = None
|
||||
nick_name: Optional[str] = None
|
||||
domain_name: Optional[str] = None
|
||||
email: Optional[str] = None
|
||||
phone_number: Optional[str] = None
|
||||
avatar: Optional[str] = None
|
||||
|
||||
|
||||
class QueryUsersValidation:
|
||||
tr = {
|
||||
"uu_id": "UUID",
|
||||
}
|
||||
en = {
|
||||
"uu_id": "UUID",
|
||||
}
|
||||
|
||||
|
||||
class QueryUsers(PydanticBaseModel):
|
||||
uu_id: Optional[str] = None
|
||||
Reference in New Issue
Block a user