From f4f9e584ffe6e4309c9695acc5fec9150ad3fb19 Mon Sep 17 00:00:00 2001 From: berkay Date: Thu, 9 Jan 2025 14:57:30 +0300 Subject: [PATCH] language_models updated --- ApiServices/EventService/routers/__init__.py | 2 +- api_configs/__init__.py | 3 +- api_configs/databaseConfigs.py | 2 - api_configs/emailConfigs.py | 2 - api_objects/errors/errors_dictionary.py | 11 +- api_services/redis/conn.py | 2 - api_services/redis/functions.py | 4 +- api_services/redis/old_functions.py | 9 +- api_validations/validations_request/rules.py | 1 + .../language_models/Mixins/crud_mixin.py | 42 ++ databases/language_models/__init__.py | 176 ++++++++ databases/language_models/account/account.py | 384 +++++++++++++++- databases/language_models/account/iban.py | 158 ++----- databases/language_models/building/budget.py | 102 +++++ databases/language_models/building/build.py | 302 +++++++++++++ .../language_models/building/decision_book.py | 399 ++++++++++++++++ databases/language_models/company/company.py | 66 +++ .../language_models/company/department.py | 63 +++ databases/language_models/company/employee.py | 72 +++ databases/language_models/event/event.py | 184 ++++++++ .../language_models/identity/identity.py | 424 ++++++++++++++++++ databases/language_models/rules/rules.py | 20 + databases/no_sql_models/identity.py | 10 +- databases/no_sql_models/mongo_database.py | 59 ++- databases/sql_models/account/account.py | 23 +- databases/sql_models/core_mixin.py | 13 +- 26 files changed, 2346 insertions(+), 187 deletions(-) create mode 100644 databases/language_models/Mixins/crud_mixin.py create mode 100644 databases/language_models/__init__.py create mode 100644 databases/language_models/building/budget.py create mode 100644 databases/language_models/building/build.py create mode 100644 databases/language_models/building/decision_book.py create mode 100644 databases/language_models/company/company.py create mode 100644 databases/language_models/company/department.py create mode 100644 databases/language_models/company/employee.py create mode 100644 databases/language_models/event/event.py create mode 100644 databases/language_models/identity/identity.py create mode 100644 databases/language_models/rules/rules.py diff --git a/ApiServices/EventService/routers/__init__.py b/ApiServices/EventService/routers/__init__.py index b680692..a9a2c5b 100644 --- a/ApiServices/EventService/routers/__init__.py +++ b/ApiServices/EventService/routers/__init__.py @@ -1 +1 @@ -__all__ = [] \ No newline at end of file +__all__ = [] diff --git a/api_configs/__init__.py b/api_configs/__init__.py index 46e7b4e..d11dd0a 100644 --- a/api_configs/__init__.py +++ b/api_configs/__init__.py @@ -2,7 +2,6 @@ from .databaseConfigs import ( WagDatabase, WagRedis, MongoConfig, - ) from .emailConfigs import ( EmailConfig, @@ -44,4 +43,4 @@ __all__ = [ # "TestMongo", # "RelationAccess", # "EmailConfig", -# "TestDatabase", \ No newline at end of file +# "TestDatabase", diff --git a/api_configs/databaseConfigs.py b/api_configs/databaseConfigs.py index 5ef24b6..c930eb4 100644 --- a/api_configs/databaseConfigs.py +++ b/api_configs/databaseConfigs.py @@ -1,5 +1,3 @@ - - storeHost = "10.10.2.36" diff --git a/api_configs/emailConfigs.py b/api_configs/emailConfigs.py index 3cc27aa..5709f16 100644 --- a/api_configs/emailConfigs.py +++ b/api_configs/emailConfigs.py @@ -1,5 +1,3 @@ - - class EmailConfig: EMAIL_HOST: str = "10.10.2.34" EMAIL_USERNAME: str = "karatay@mehmetkaratay.com.tr" diff --git a/api_objects/errors/errors_dictionary.py b/api_objects/errors/errors_dictionary.py index 3ac90b2..585f3a6 100644 --- a/api_objects/errors/errors_dictionary.py +++ b/api_objects/errors/errors_dictionary.py @@ -9,13 +9,14 @@ class ErrorMessages: return cls.__messages__[lang][message_key] - class ErrorHandlers: def __init__(self, requests, exceptions, response_model, status): - self.requests = requests # from fastapi.requests import Request - self.exceptions = exceptions # from fastapi.exceptions import HTTPException - self.response_model = response_model # from fastapi.responses import JSONResponse - self.status = status # from fastapi import status + self.requests = requests # from fastapi.requests import Request + self.exceptions = exceptions # from fastapi.exceptions import HTTPException + self.response_model = ( + response_model # from fastapi.responses import JSONResponse + ) + self.status = status # from fastapi import status def exception_handler_http(self, request, exc): exc_detail = getattr(exc, "detail", None) diff --git a/api_services/redis/conn.py b/api_services/redis/conn.py index 0d863e8..4713218 100644 --- a/api_services/redis/conn.py +++ b/api_services/redis/conn.py @@ -27,5 +27,3 @@ try: redis_cli = redis_conn.redis except Exception as e: print("Redis Connection Error", e) - - diff --git a/api_services/redis/functions.py b/api_services/redis/functions.py index fc4d9fd..c21782e 100644 --- a/api_services/redis/functions.py +++ b/api_services/redis/functions.py @@ -4,7 +4,9 @@ from api_services.redis.conn import redis_cli class RedisResponse: - def __init__(self, status: bool, message: str, data: dict = None, error: str = None): + def __init__( + self, status: bool, message: str, data: dict = None, error: str = None + ): self.status = status self.message = message self.data = data diff --git a/api_services/redis/old_functions.py b/api_services/redis/old_functions.py index 539c1f8..dc3cb46 100644 --- a/api_services/redis/old_functions.py +++ b/api_services/redis/old_functions.py @@ -5,7 +5,9 @@ from .conn import redis_cli class RedisImports: - def __init__(self, status, exceptions, access_token_tag, employee_token, occupant_token): + def __init__( + self, status, exceptions, access_token_tag, employee_token, occupant_token + ): self.status = status self.exceptions = exceptions self.ACCESS_TOKEN_TAG = access_token_tag @@ -13,10 +15,7 @@ class RedisImports: self.OccupantTokenObject = occupant_token -def get_object_via_access_key( - request, - redis_imports: RedisImports -): +def get_object_via_access_key(request, redis_imports: RedisImports): if not hasattr(request, "headers"): raise redis_imports.exceptions( diff --git a/api_validations/validations_request/rules.py b/api_validations/validations_request/rules.py index 8350baa..23f22c7 100644 --- a/api_validations/validations_request/rules.py +++ b/api_validations/validations_request/rules.py @@ -8,6 +8,7 @@ from api_validations.validations_request import ( class CheckEndpointAccess(BaseModelRegular): endpoint: str + class InsertEndpointAccess(PydanticBaseModel): duty_uu_id: str endpoint_restriction_list_uu_ids: list diff --git a/databases/language_models/Mixins/crud_mixin.py b/databases/language_models/Mixins/crud_mixin.py new file mode 100644 index 0000000..dcbfa84 --- /dev/null +++ b/databases/language_models/Mixins/crud_mixin.py @@ -0,0 +1,42 @@ +CrudCollectionLanguageModel = dict( + tr={ + "id": "ID", + "uu_id": "UUID", + "ref_id": "Referans ID", + "created_at": "Oluşturulma Tarihi", + "updated_at": "Güncellenme Tarihi", + "cryp_uu_id": "Şifreli ID", + "created_by": "Oluşturan", + "created_by_id": "Oluşturan ID", + "updated_by": "Güncelleyen", + "updated_by_id": "Güncelleyen ID", + "confirmed_by": "Onaylayan", + "confirmed_by_id": "Onaylayan ID", + "is_confirmed": "Onay Durumu", + "replication_id": "Replikasyon ID", + "deleted": "Silindi", + "active": "Aktif", + "is_notification_send": "Bildirim Gönderildi", + "is_email_send": "E-posta Gönderildi", + }, + en={ + "id": "Identity", + "uu_id": "UUID", + "ref_id": "Reference Identity", + "created_at": "Created At", + "updated_at": "Updated At", + "cryp_uu_id": "Encrypted Identity", + "created_by": "Created By", + "created_by_id": "Created By Identity", + "updated_by": "Updated By", + "updated_by_id": "Updated By Identity", + "confirmed_by": "Confirmed By", + "confirmed_by_id": "Confirmed By Identity", + "is_confirmed": "Confirmation Status", + "replication_id": "Replication Identity", + "deleted": "Deleted", + "active": "Active", + "is_notification_send": "Notification Sent", + "is_email_send": "Email Sent", + }, +) diff --git a/databases/language_models/__init__.py b/databases/language_models/__init__.py new file mode 100644 index 0000000..da24d6f --- /dev/null +++ b/databases/language_models/__init__.py @@ -0,0 +1,176 @@ +from databases.language_models.account.account import ( + AccountBooksLanguageModel, + AccountDetailLanguageModel, + AccountMasterLanguageModel, + AccountRecordExchangesLanguageModel, + AccountCodesLanguageModel, + AccountRecordsLanguageModel, + AccountCodeParserLanguageModel, +) +from databases.language_models.account.iban import ( + BuildIbansLanguageModel, + BuildIbanDescriptionLanguageModel, +) +from databases.language_models.building.budget import ( + DecisionBookBudgetBooksLanguageModel, + DecisionBookBudgetMasterLanguageModel, + DecisionBookBudgetCodesLanguageModel, + DecisionBookBudgetsLanguageModel, +) +from databases.language_models.building.build import ( + BuildTypesLanguageModel, + BuildAreaLanguageModel, + BuildLanguageModel, + BuildPartsLanguageModel, + RelationshipEmployee2BuildLanguageModel, + BuildSitesLanguageModel, + BuildManagementLanguageModel, + BuildCompaniesProvidingLanguageModel, + Part2EmployeeLanguageModel, + BuildLivingSpaceLanguageModel, + BuildPersonProvidingLanguageModel, +) +from databases.language_models.building.decision_book import ( + BuildDecisionBookPaymentsLanguageModel, + BuildDecisionBookItemsLanguageModel, + BuildDecisionBookLegalLanguageModel, + BuildDecisionBookLanguageModel, + BuildDecisionBookProjectPersonLanguageModel, + BuildDecisionBookInvitationsLanguageModel, + BuildDecisionBookProjectsLanguageModel, + BuildDecisionBookPersonLanguageModel, + BuildDecisionBookProjectItemsLanguageModel, + BuildDecisionBookItemsUnapprovedLanguageModel, + BuildDecisionBookPersonOccupantsLanguageModel, +) +from databases.language_models.company.company import ( + CompaniesLanguageModel, + RelationshipDutyCompanyLanguageModel, +) +from databases.language_models.company.department import ( + DutiesLanguageModel, + DutyLanguageModel, + DepartmentsLanguageModel, +) +from databases.language_models.company.employee import ( + EmployeesLanguageModel, + EmployeeHistoryLanguageModel, + EmployeesSalariesLanguageModel, + StaffLanguageModel, +) +from databases.language_models.event.event import ( + EventsLanguageModel, + ModulesLanguageModel, + ServicesLanguageModel, + Service2EventsLanguageModel, + Event2OccupantExtraLanguageModel, + Event2EmployeeExtraLanguageModel, + Event2EmployeeLanguageModel, + Event2OccupantLanguageModel, + ModulePriceLanguageModel, +) +from databases.language_models.identity.identity import ( + UsersTokensLanguageModel, + UsersLanguageModel, + RelationshipDutyPeopleLanguageModel, + PeopleLanguageModel, + RelationshipEmployee2PostCodeLanguageModel, + AddressPostcodeLanguageModel, + AddressesLanguageModel, + AddressGeographicLocationsLanguageModel, + AddressCountryLanguageModel, + AddressStateLanguageModel, + AddressCityLanguageModel, + AddressDistrictLanguageModel, + AddressLocalityLanguageModel, + AddressNeighborhoodLanguageModel, + AddressStreetLanguageModel, + OccupantTypesLanguageModel, + ContractsLanguageModel, +) +from databases.language_models.rules.rules import ( + EndpointRestrictionLanguageModel, +) + +__all__ = [ + "AccountBooksLanguageModel", + "AccountDetailLanguageModel", + "AccountMasterLanguageModel", + "AccountRecordExchangesLanguageModel", + "AccountCodesLanguageModel", + "AccountRecordsLanguageModel", + "AccountCodeParserLanguageModel", + "BuildIbansLanguageModel", + "BuildIbanDescriptionLanguageModel", + "DecisionBookBudgetBooksLanguageModel", + "DecisionBookBudgetMasterLanguageModel", + "DecisionBookBudgetCodesLanguageModel", + "DecisionBookBudgetsLanguageModel", + "BuildTypesLanguageModel", + "BuildAreaLanguageModel", + "BuildLanguageModel", + "BuildPartsLanguageModel", + "RelationshipEmployee2BuildLanguageModel", + "BuildSitesLanguageModel", + "BuildManagementLanguageModel", + "BuildCompaniesProvidingLanguageModel", + "Part2EmployeeLanguageModel", + "BuildLivingSpaceLanguageModel", + "BuildPersonProvidingLanguageModel", + "BuildDecisionBookPaymentsLanguageModel", + "BuildDecisionBookItemsLanguageModel", + "BuildDecisionBookLegalLanguageModel", + "BuildDecisionBookLanguageModel", + "BuildDecisionBookProjectPersonLanguageModel", + "BuildDecisionBookInvitationsLanguageModel", + "BuildDecisionBookProjectsLanguageModel", + "BuildDecisionBookPersonLanguageModel", + "BuildDecisionBookProjectItemsLanguageModel", + "BuildDecisionBookItemsUnapprovedLanguageModel", + "BuildDecisionBookPersonOccupantsLanguageModel", + "CompaniesLanguageModel", + "RelationshipDutyCompanyLanguageModel", + "DutiesLanguageModel", + "DutyLanguageModel", + "DepartmentsLanguageModel", + "EmployeesLanguageModel", + "EmployeeHistoryLanguageModel", + "EmployeesSalariesLanguageModel", + "StaffLanguageModel", + "EventsLanguageModel", + "ModulesLanguageModel", + "ServicesLanguageModel", + "Service2EventsLanguageModel", + "Event2OccupantExtraLanguageModel", + "Event2EmployeeExtraLanguageModel", + "Event2EmployeeLanguageModel", + "Event2OccupantLanguageModel", + "ModulePriceLanguageModel", + "UsersTokensLanguageModel", + "UsersLanguageModel", + "RelationshipDutyPeopleLanguageModel", + "PeopleLanguageModel", + "RelationshipEmployee2PostCodeLanguageModel", + "AddressPostcodeLanguageModel", + "AddressesLanguageModel", + "AddressGeographicLocationsLanguageModel", + "AddressCountryLanguageModel", + "AddressStateLanguageModel", + "AddressCityLanguageModel", + "AddressDistrictLanguageModel", + "AddressLocalityLanguageModel", + "AddressNeighborhoodLanguageModel", + "AddressStreetLanguageModel", + "OccupantTypesLanguageModel", + "ContractsLanguageModel", + "EndpointRestrictionLanguageModel", +] + +# LanguageModel = dict( +# tr={ +# **CrudCollectionLanguageModel["tr"], +# }, +# en={ +# **CrudCollectionLanguageModel["en"], +# }, +# ) diff --git a/databases/language_models/account/account.py b/databases/language_models/account/account.py index c3b1a75..3ee0b4a 100644 --- a/databases/language_models/account/account.py +++ b/databases/language_models/account/account.py @@ -1,45 +1,389 @@ -from databases.sql_models.account.account import AccountBooks -from databases.sql_models.core_mixin import CrudCollection - +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel AccountBooksLanguageModel = dict( tr={ - str(AccountBooks.created_at.key): "Oluşturulma Tarihi", - str(AccountBooks.updated_at.key): "Güncellenme Tarihi", + **CrudCollectionLanguageModel["tr"], + "country": "Ülke", + "branch_type": "Şube Türü", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UU ID", + "branch_id": "Şube ID", + "branch_uu_id": "Şube UU ID", }, en={ - str(AccountBooks.created_at.key): "Created At", - str(AccountBooks.updated_at.key): "Updated At", - } + **CrudCollectionLanguageModel["en"], + "country": "Country", + "branch_type": "Branch Type", + "company_id": "Company ID", + "company_uu_id": "Company UU ID", + "branch_id": "Branch ID", + "branch_uu_id": "Branch UU ID", + }, ) AccountCodesLanguageModel = dict( - tr={}, - en={} + tr={ + **CrudCollectionLanguageModel["tr"], + "account_code": "Hesap Kodu", + "comment_line": "Yorum Satırı", + "is_receive_or_debit": "Alacak veya Borç", + "product_id": "Ürün ID", + "nvi_id": "Nvi ID", + "status_id": "Durum ID", + "account_code_seperator": "Hesap Kodu Ayırıcı", + "system_id": "Sistem ID", + "locked": "Kilitli", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UU ID", + "customer_id": "Müşteri ID", + "customer_uu_id": "Müşteri UU ID", + "person_id": "Kişi ID", + "person_uu_id": "Kişi UU ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "account_code": "Account Code", + "comment_line": "Comment Line", + "is_receive_or_debit": "Is Receive or Debit", + "product_id": "Product ID", + "nvi_id": "Nvi ID", + "status_id": "Status ID", + "account_code_seperator": "Account Code Seperator", + "system_id": "System ID", + "locked": "Locked", + "company_id": "Company ID", + "company_uu_id": "Company UU ID", + "customer_id": "Customer ID", + "customer_uu_id": "Customer UU ID", + "person_id": "Person ID", + "person_uu_id": "Person UU ID", + }, ) AccountCodeParserLanguageModel = dict( - tr={}, - en={} + tr={ + **CrudCollectionLanguageModel["tr"], + "account_code_1": "Hesap Kodu 1", + "account_code_2": "Hesap Kodu 2", + "account_code_3": "Hesap Kodu 3", + "account_code_4": "Hesap Kodu 4", + "account_code_5": "Hesap Kodu 5", + "account_code_6": "Hesap Kodu 6", + "account_code_id": "Hesap Kodu ID", + "account_code_uu_id": "Hesap Kodu UU ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "account_code_1": "Account Code 1", + "account_code_2": "Account Code 2", + "account_code_3": "Account Code 3", + "account_code_4": "Account Code 4", + "account_code_5": "Account Code 5", + "account_code_6": "Account Code 6", + "account_code_id": "Account Code ID", + "account_code_uu_id": "Account Code UU ID", + }, ) AccountMasterLanguageModel = dict( - tr={}, - en={} + tr={ + **CrudCollectionLanguageModel["tr"], + "doc_date": "Belge Tarihi", + "plug_type": "Fiş Türü", + "plug_number": "Fiş Numarası", + "special_code": "Özel Kod", + "authorization_code": "Yetki Kodu", + "doc_code": "Belge Kodu", + "doc_type": "Belge Türü", + "comment_line1": "Yorum Satırı 1", + "comment_line2": "Yorum Satırı 2", + "comment_line3": "Yorum Satırı 3", + "comment_line4": "Yorum Satırı 4", + "comment_line5": "Yorum Satırı 5", + "comment_line6": "Yorum Satırı 6", + "project_code": "Proje Kodu", + "module_no": "Modül No", + "journal_no": "Defter No", + "status_id": "Durum ID", + "canceled": "İptal Edildi", + "print_count": "Yazdırma Sayısı", + "total_active": "Toplam Aktif", + "total_passive": "Toplam Pasif", + "total_active_1": "Toplam Aktif 1", + "total_passive_1": "Toplam Pasif 1", + "total_active_2": "Toplam Aktif 2", + "total_passive_2": "Toplam Pasif 2", + "total_active_3": "Toplam Aktif 3", + "total_passive_3": "Toplam Pasif 3", + "total_active_4": "Toplam Aktif 4", + "total_passive_4": "Toplam Pasif 4", + "cross_ref": "Çapraz Referans", + "data_center_id": "Veri Merkezi ID", + "data_center_rec_num": "Veri Merkezi Kayıt Numarası", + "account_header_id": "Hesap Başlığı ID", + "account_header_uu_id": "Hesap Başlığı UU ID", + "project_item_id": "Proje Öğesi ID", + "project_item_uu_id": "Proje Öğesi UU ID", + "department_id": "Departman ID", + "department_uu_id": "Departman UU ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "doc_date": "Document Date", + "plug_type": "Plug Type", + "plug_number": "Plug Number", + "special_code": "Special Code", + "authorization_code": "Authorization Code", + "doc_code": "Document Code", + "doc_type": "Document Type", + "comment_line1": "Comment Line 1", + "comment_line2": "Comment Line 2", + "comment_line3": "Comment Line 3", + "comment_line4": "Comment Line 4", + "comment_line5": "Comment Line 5", + "comment_line6": "Comment Line 6", + "project_code": "Project Code", + "module_no": "Module No", + "journal_no": "Journal No", + "status_id": "Status ID", + "canceled": "Canceled", + "print_count": "Print Count", + "total_active": "Total Active", + "total_passive": "Total Passive", + "total_active_1": "Total Active 1", + "total_passive_1": "Total Passive 1", + "total_active_2": "Total Active 2", + "total_passive_2": "Total Passive 2", + "total_active_3": "Total Active 3", + "total_passive_3": "Total Passive 3", + "total_active_4": "Total Active 4", + "total_passive_4": "Total Passive 4", + "cross_ref": "Cross Reference", + "data_center_id": "Data Center ID", + "data_center_rec_num": "Data Center Record Number", + "account_header_id": "Account Header ID", + "account_header_uu_id": "Account Header UU ID", + "project_item_id": "Project Item ID", + "project_item_uu_id": "Project Item UU ID", + "department_id": "Department ID", + "department_uu_id": "Department UU ID", + }, ) AccountDetailLanguageModel = dict( - tr={}, - en={} + tr={ + **CrudCollectionLanguageModel["tr"], + "doc_date": "Belge Tarihi", + "plug_type": "Fiş Türü", + "plug_number": "Fiş Numarası", + "special_code": "Özel Kod", + "authorization_code": "Yetki Kodu", + "doc_code": "Belge Kodu", + "doc_type": "Belge Türü", + "comment_line1": "Yorum Satırı 1", + "comment_line2": "Yorum Satırı 2", + "comment_line3": "Yorum Satırı 3", + "comment_line4": "Yorum Satırı 4", + "comment_line5": "Yorum Satırı 5", + "comment_line6": "Yorum Satırı 6", + "project_code": "Proje Kodu", + "module_no": "Modül No", + "journal_no": "Defter No", + "status_id": "Durum ID", + "canceled": "İptal Edildi", + "print_count": "Yazdırma Sayısı", + "total_active": "Toplam Aktif", + "total_passive": "Toplam Pasif", + "total_active_1": "Toplam Aktif 1", + "total_passive_1": "Toplam Pasif 1", + "total_active_2": "Toplam Aktif 2", + "total_passive_2": "Toplam Pasif 2", + "total_active_3": "Toplam Aktif 3", + "total_passive_3": "Toplam Pasif 3", + "total_active_4": "Toplam Aktif 4", + "total_passive_4": "Toplam Pasif 4", + "cross_ref": "Çapraz Referans", + "data_center_id": "Veri Merkezi ID", + "data_center_rec_num": "Veri Merkezi Kayıt Numarası", + "account_header_id": "Hesap Başlığı ID", + "account_header_uu_id": "Hesap Başlığı UU ID", + "project_item_id": "Proje Öğesi ID", + "project_item_uu_id": "Proje Öğesi UU ID", + "department_id": "Departman ID", + "department_uu_id": "Departman UU ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "doc_date": "Document Date", + "plug_type": "Plug Type", + "plug_number": "Plug Number", + "special_code": "Special Code", + "authorization_code": "Authorization Code", + "doc_code": "Document Code", + "doc_type": "Document Type", + "comment_line1": "Comment Line 1", + "comment_line2": "Comment Line 2", + "comment_line3": "Comment Line 3", + "comment_line4": "Comment Line 4", + "comment_line5": "Comment Line 5", + "comment_line6": "Comment Line 6", + "project_code": "Project Code", + "module_no": "Module No", + "journal_no": "Journal No", + "status_id": "Status ID", + "canceled": "Canceled", + "print_count": "Print Count", + "total_active": "Total Active", + "total_passive": "Total Passive", + "total_active_1": "Total Active 1", + "total_passive_1": "Total Passive 1", + "total_active_2": "Total Active 2", + "total_passive_2": "Total Passive 2", + "total_active_3": "Total Active 3", + "total_passive_3": "Total Passive 3", + "total_active_4": "Total Active 4", + "total_passive_4": "Total Passive 4", + "cross_ref": "Cross Reference", + "data_center_id": "Data Center ID", + "data_center_rec_num": "Data Center Record Number", + "account_header_id": "Account Header ID", + "account_header_uu_id": "Account Header UU ID", + "project_item_id": "Project Item ID", + "project_item_uu_id": "Project Item UU ID", + "department_id": "Department ID", + "department_uu_id": "Department UU ID", + }, ) AccountRecordsLanguageModel = dict( - tr={}, - en={} + tr={ + **CrudCollectionLanguageModel["tr"], + "iban": "IBAN", + "bank_date": "Banka Tarihi", + "currency_value": "Döviz Değeri", + "bank_balance": "Banka Bakiyesi", + "currency": "Döviz", + "additional_balance": "Ek Bakiye", + "channel_branch": "Kanal Şubesi", + "process_name": "İşlem Türü Adı", + "process_type": "İşlem Türü", + "process_comment": "İşlem Kayıt Yorumu", + "process_garbage": "İşlem Kayıt Çöpü", + "bank_reference_code": "Banka Referans Kodu", + "add_comment_note": "Yorum Not Ekle", + "is_receipt_mail_send": "Alındı Mail Gönderildi", + "found_from": "Bulunduğu", + "similarity": "Benzerlik", + "remainder_balance": "Kalan Bakiye", + "bank_date_y": "Banka Tarihi Yıl", + "bank_date_m": "Banka Tarihi Ay", + "bank_date_w": "Banka Tarihi Hafta", + "bank_date_d": "Banka Tarihi Gün", + "approving_accounting_record": "Onaylayan Muhasebe Kaydı", + "accounting_receipt_date": "Muhasebe Alındı Tarihi", + "accounting_receipt_number": "Muhasebe Alındı Numarası", + "status_id": "Durum ID", + "approved_record": "Onaylanmış Kayıt", + "import_file_name": "İçe Aktarım Dosya Adı", + "receive_debit": "Alacak Borç", + "receive_debit_uu_id": "Alacak Borç UU ID", + "budget_type": "Bütçe Türü", + "budget_type_uu_id": "Bütçe Türü UU ID", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UU ID", + "send_company_id": "Gönderen Şirket ID", + "send_company_uu_id": "Gönderen Şirket UU ID", + "send_person_id": "Gönderen Kişi ID", + "send_person_uu_id": "Gönderen Kişi UU ID", + "approving_accounting_person": "Onaylayan Muhasebe Kişi", + "approving_accounting_person_uu_id": "Onaylayan Muhasebe Kişi UU ID", + "living_space_id": "Yaşam Alanı ID", + "living_space_uu_id": "Yaşam Alanı UU ID", + "customer_id": "Müşteri ID", + "customer_uu_id": "Müşteri UU ID", + "build_id": "Bina ID", + "build_uu_id": "Bina UU ID", + "build_parts_id": "Bina Parça ID", + "build_parts_uu_id": "Bina Parça UU ID", + "build_decision_book_id": "Bina Karar Defteri ID", + "build_decision_book_uu_id": "Bina Karar Defteri UU ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "iban": "IBAN", + "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 Type Name", + "process_type": "Process Type", + "process_comment": "Process Record Comment", + "process_garbage": "Process Record Garbage", + "bank_reference_code": "Bank Reference Code", + "add_comment_note": "Add Comment Note", + "is_receipt_mail_send": "Is 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", + "status_id": "Status ID", + "approved_record": "Approved Record", + "import_file_name": "Import File Name", + "receive_debit": "Receive Debit", + "receive_debit_uu_id": "Receive Debit UU ID", + "budget_type": "Budget Type", + "budget_type_uu_id": "Budget Type UU ID", + "company_id": "Company ID", + "company_uu_id": "Company UU ID", + "send_company_id": "Send Company ID", + "send_company_uu_id": "Send Company UU ID", + "send_person_id": "Send Person ID", + "send_person_uu_id": "Send Person UU ID", + "approving_accounting_person": "Approving Accounting Person", + "approving_accounting_person_uu_id": "Approving Accounting Person UU ID", + "living_space_id": "Living Space ID", + "living_space_uu_id": "Living Space UU ID", + "customer_id": "Customer ID", + "customer_uu_id": "Customer UU ID", + "build_id": "Build ID", + "build_uu_id": "Build UU ID", + "build_parts_id": "Build Parts ID", + "build_parts_uu_id": "Build Parts UU ID", + "build_decision_book_id": "Build Decision Book ID", + "build_decision_book_uu_id": "Build Decision Book UU ID", + }, ) AccountRecordExchangesLanguageModel = dict( - tr={}, - en={} + tr={ + **CrudCollectionLanguageModel["tr"], + "are_currency": "Para Birimi", + "are_exchange_rate": "Döviz Kuru", + "usd_exchange_rate_value": "USD Döviz Kuru Değeri", + "eur_exchange_rate_value": "EUR Döviz Kuru Değeri", + "gbp_exchange_rate_value": "GBP Döviz Kuru Değeri", + "cny_exchange_rate_value": "CNY Döviz Kuru Değeri", + "account_records_id": "Hesap Kayıt ID", + "account_records_uu_id": "Hesap Kayıt UU ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "are_currency": "Currency", + "are_exchange_rate": "Exchange Rate", + "usd_exchange_rate_value": "USD Exchange Rate Value", + "eur_exchange_rate_value": "EUR Exchange Rate Value", + "gbp_exchange_rate_value": "GBP Exchange Rate Value", + "cny_exchange_rate_value": "CNY Exchange Rate Value", + "account_records_id": "Account Record ID", + "account_records_uu_id": "Account Record UU ID", + }, ) diff --git a/databases/language_models/account/iban.py b/databases/language_models/account/iban.py index e4b338f..07d1f76 100644 --- a/databases/language_models/account/iban.py +++ b/databases/language_models/account/iban.py @@ -1,113 +1,53 @@ -from sqlalchemy.orm import mapped_column, Mapped -from sqlalchemy import String, ForeignKey, Index, TIMESTAMP, SmallInteger, Identity - -from databases.sql_models.core_mixin import CrudCollection +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel -class BuildIbans(CrudCollection): - """ - BuildParts class based on declarative_base and BaseMixin via session - """ - - __tablename__ = "build_ibans" - __exclude__fields__ = [] - - iban: Mapped[str] = mapped_column( - String(40), server_default="", nullable=False, comment="IBAN number" - ) - start_date: Mapped[TIMESTAMP] = mapped_column( - TIMESTAMP(timezone=True), nullable=False, comment="Bank Transaction Start Date" - ) - - stop_date: Mapped[TIMESTAMP] = mapped_column( - TIMESTAMP(timezone=True), server_default="2900-01-01 00:00:00" - ) - bank_code: Mapped[str] = mapped_column(String(24), server_default="TR0000000000000") - xcomment: Mapped[str] = mapped_column(String(64), server_default="????") - - build_id: Mapped[int] = mapped_column( - ForeignKey("build.id"), nullable=True, comment="Building ID" - ) - build_uu_id: Mapped[str] = mapped_column( - String, nullable=True, comment="Building UUID", index=True - ) - # building: Mapped["Build"] = relationship( - # "Build", back_populates="build_ibans", foreign_keys=[build_id] - # ) - - __table_args__ = ( - Index("_build_ibans_ndx_01", iban, start_date, unique=True), - {"comment": "IBANs related to money transactions due to building objects"}, - ) - - # @property - # def enums(self): - # return_dict = {} - # for key, enum in self.__enums_list__.items(): - # for enum_item in EnumDropdown.filter_by(enum_class=enum): - # return_dict[key] = { - # enum_item.get_dict(include=["key", "value", "description"]) - # } - # return return_dict +BuildIbansLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "iban": "IBAN Numarası", + "start_date": "Banka İşlem Başlangıç Tarihi", + "stop_date": "Banka İşlem Bitiş Tarihi", + "bank_code": "Banka Kodu", + "xcomment": "Yorum", + "build_id": "Bina ID", + "build_uu_id": "Bina UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "iban": "IBAN Number", + "start_date": "Bank Transaction Start Date", + "stop_date": "Bank Transaction End Date", + "bank_code": "Bank Code", + "xcomment": "Comment", + "build_id": "Build ID", + "build_uu_id": "Build UUID", + }, +) -class BuildIbanDescription(CrudCollection): - """ - SearchComments class based on declarative_base and CrudCollection via session - """ - - __tablename__ = "build_iban_description" - __exclude__fields__ = [] - - iban: Mapped[str] = mapped_column(String, nullable=False, comment="IBAN Number") - group_id: Mapped[int] = mapped_column( - SmallInteger, nullable=False, comment="Group ID" - ) - search_word: Mapped[str] = mapped_column( - String, nullable=False, comment="Search Word", index=True - ) - - # decision_book_project_id: Mapped[int] = mapped_column( - # ForeignKey("build_decision_book_projects.id") - # ) - # decision_book_project_uu_id: Mapped[str] = mapped_column( - # String, nullable=False, comment="Decision Book Project UUID" - # ) - customer_id: Mapped[int] = mapped_column(ForeignKey("people.id"), nullable=True) - customer_uu_id: Mapped[str] = mapped_column( - String, nullable=True, comment="Customer UUID" - ) - company_id: Mapped[int] = mapped_column(ForeignKey("companies.id"), nullable=True) - company_uu_id: Mapped[str] = mapped_column( - String, nullable=True, comment="Company UUID" - ) - build_parts_id: Mapped[int] = mapped_column( - ForeignKey("build_parts.id"), nullable=True - ) - build_parts_uu_id: Mapped[str] = mapped_column( - String, nullable=True, comment="Build Parts UUID" - ) - - # decision_book_project: Mapped["BuildDecisionBookProjects"] = relationship( - # "BuildDecisionBookProjects", - # back_populates="search_iban_description", - # foreign_keys=[decision_book_project_id], - # ) - # customer: Mapped["People"] = relationship( - # "People", back_populates="search_iban_description", foreign_keys=[customer_id] - # ) - # company: Mapped["Companies"] = relationship( - # "Company", back_populates="search_iban_description", foreign_keys=[company_id] - # ) - # parts: Mapped["BuildParts"] = relationship( - # "BuildParts", - # back_populates="search_iban_description", - # foreign_keys=[build_parts_id], - # ) - - __table_args__ = ( - Index( - "_search_iban_description_ndx_00", iban, search_word, group_id, unique=True - ), - {"comment": "Search Iban Description Information"}, - ) +BuildIbanDescriptionLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "iban": "IBAN Numarası", + "group_id": "Grup ID", + "search_word": "Arama Kelimesi", + "customer_id": "Müşteri ID", + "customer_uu_id": "Müşteri UUID", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UUID", + "build_parts_id": "Bina Parça ID", + "build_parts_uu_id": "Bina Parça UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "iban": "IBAN Number", + "group_id": "Group ID", + "search_word": "Search Word", + "customer_id": "Customer ID", + "customer_uu_id": "Customer UUID", + "company_id": "Company ID", + "company_uu_id": "Company UUID", + "build_parts_id": "Build Parts ID", + "build_parts_uu_id": "Build Parts UUID", + }, +) diff --git a/databases/language_models/building/budget.py b/databases/language_models/building/budget.py new file mode 100644 index 0000000..bd037e8 --- /dev/null +++ b/databases/language_models/building/budget.py @@ -0,0 +1,102 @@ +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel + + +DecisionBookBudgetBooksLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "country": "Ülke", + "branch_type": "Şube Tipi", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UUID", + "branch_id": "Şube ID", + "branch_uu_id": "Şube UUID", + "build_decision_book_id": "Karar Defteri ID", + "build_decision_book_uu_id": "Karar Defteri UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "country": "Country", + "branch_type": "Branch Type", + "company_id": "Company ID", + "company_uu_id": "Company UUID", + "branch_id": "Branch ID", + "branch_uu_id": "Branch UUID", + "build_decision_book_id": "Build Decision Book ID", + "build_decision_book_uu_id": "Build Decision Book UUID", + }, +) + +DecisionBookBudgetCodesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "budget_code": "Bütçe Kodu", + "comment_line": "Yorum Satırı", + "build_decision_book_id": "Karar Defteri ID", + "build_decision_book_uu_id": "Karar Defteri UUID", + "build_parts_id": "Bina Parça ID", + "build_parts_uu_id": "Bina Parça UUID", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "budget_code": "Budget Code", + "comment_line": "Comment Line", + "build_decision_book_id": "Build Decision Book ID", + "build_decision_book_uu_id": "Build Decision Book UUID", + "build_parts_id": "Build Parts ID", + "build_parts_uu_id": "Build Parts UUID", + "company_id": "Company ID", + "company_uu_id": "Company UUID", + }, +) + +DecisionBookBudgetMasterLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "budget_type": "Bütçe Tipi", + "currency": "Para Birimi", + "total_budget": "Toplam Bütçe", + "tracking_period_id": "Takip Dönemi ID", + "tracking_period_uu_id": "Takip Dönemi UUID", + "budget_books_id": "Bütçe Kitapları ID", + "budget_books_uu_id": "Bütçe Kitapları UUID", + "department_id": "Departman ID", + "department_uu_id": "Departman UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "budget_type": "Budget Type", + "currency": "Currency", + "total_budget": "Total Budget", + "tracking_period_id": "Tracking Period ID", + "tracking_period_uu_id": "Tracking Period UUID", + "budget_books_id": "Budget Books ID", + "budget_books_uu_id": "Budget Books UUID", + "department_id": "Department ID", + "department_uu_id": "Department UUID", + }, +) + +DecisionBookBudgetsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "process_date": "İşlem Tarihi", + "budget_codes_id": "Bütçe Kodları ID", + "total_budget": "Toplam Bütçe", + "used_budget": "Kullanılan Bütçe", + "remaining_budget": "Kalan Bütçe", + "decision_book_budget_master_id": "Karar Defteri Bütçesi ID", + "decision_book_budget_master_uu_id": "Karar Defteri Bütçesi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "process_date": "Process Date", + "budget_codes_id": "Budget Codes ID", + "total_budget": "Total Budget", + "used_budget": "Used Budget", + "remaining_budget": "Remaining Budget", + "decision_book_budget_master_id": "Decision Book Budget Master ID", + "decision_book_budget_master_uu_id": "Decision Book Budget Master UUID", + }, +) diff --git a/databases/language_models/building/build.py b/databases/language_models/building/build.py new file mode 100644 index 0000000..18022da --- /dev/null +++ b/databases/language_models/building/build.py @@ -0,0 +1,302 @@ +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel + + +BuildTypesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "function_code": "Fonksiyon Kodu", + "type_code": "Yapı Tipi Kodu", + "lang": "Dil", + "type_name": "Tip Adı", + }, + en={ + **CrudCollectionLanguageModel["en"], + "function_code": "Function Code", + "type_code": "Type Code", + "lang": "Language", + "type_name": "Type Name", + }, +) + +Part2EmployeeLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "build_id": "Bina ID", + "part_id": "Bina Parça ID", + "employee_id": "Çalışan ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "build_id": "Build ID", + "part_id": "Build Part ID", + "employee_id": "Employee ID", + }, +) + +RelationshipEmployee2BuildLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "company_id": "Şirket ID", + "employee_id": "Çalışan ID", + "member_id": "Üye ID", + "relationship_type": "İlişki Tipi", + "show_only": "Sadece Göster", + }, + en={ + **CrudCollectionLanguageModel["en"], + "company_id": "Company ID", + "employee_id": "Employee ID", + "member_id": "Member ID", + "relationship_type": "Relationship Type", + "show_only": "Show Only", + }, +) + +BuildLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "gov_address_code": "Adres Kodu", + "build_name": "Bina Adı", + "build_no": "Bina No", + "max_floor": "Max Kat", + "underground_floor": "Zemin Kat", + "build_date": "Bina Tarihi", + "decision_period_date": "Karar Dönemi Tarihi", + "tax_no": "Vergi No", + "lift_count": "Asansör Sayısı", + "heating_system": "Isıtma Sistemi", + "cooling_system": "Soğutma Sistemi", + "hot_water_system": "Sıcak Su Sistemi", + "block_service_man_count": "Blok Hizmet Görevlisi Sayısı", + "security_service_man_count": "Güvenlik Görevlisi Sayısı", + "garage_count": "Garaj Sayısı", + "management_room_id": "Yönetim Odası ID", + "site_id": "Site ID", + "site_uu_id": "Site UUID", + "address_id": "Adres ID", + "address_uu_id": "Adres UUID", + "build_types_id": "Bina Tipi ID", + "build_types_uu_id": "Bina Tipi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "gov_address_code": "Address Code", + "build_name": "Building Name", + "build_no": "Building Number", + "max_floor": "Max Floor", + "underground_floor": "Underground Floor", + "build_date": "Building Date", + "decision_period_date": "Decision Period Date", + "tax_no": "Tax No", + "lift_count": "Lift Count", + "heating_system": "Heating System", + "cooling_system": "Cooling System", + "hot_water_system": "Hot Water System", + "block_service_man_count": "Block Service Man Count", + "security_service_man_count": "Security Service Man Count", + "garage_count": "Garage Count", + "management_room_id": "Management Room ID", + "site_id": "Site ID", + "site_uu_id": "Site UUID", + "address_id": "Address ID", + "address_uu_id": "Address UUID", + "build_types_id": "Build Types ID", + "build_types_uu_id": "Build Types UUID", + }, +) + +BuildPartsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "address_gov_code": "Adres Kodu", + "part_no": "Bina Parça No", + "part_level": "Bina Parça Katı", + "part_code": "Bina Parça Kodu", + "part_gross_size": "Bina Parça Brüt Alanı", + "part_net_size": "Bina Parça Net Alanı", + "default_accessory": "Varsayılan Aksesuar", + "human_livable": "İnsan Yaşam Alanı", + "due_part_key": "Ödeme Grubu", + "build_id": "Bina ID", + "build_uu_id": "Bina UUID", + "part_direction_id": "Bina Parça Yönü ID", + "part_direction_uu_id": "Bina Parça Yönü UUID", + "part_type_id": "Bina Parça Tipi ID", + "part_type_uu_id": "Bina Parça Tipi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "address_gov_code": "Address Code", + "part_no": "Part Number", + "part_level": "Part Level", + "part_code": "Part Code", + "part_gross_size": "Part Gross Size", + "part_net_size": "Part Net Size", + "default_accessory": "Default Accessory", + "human_livable": "Human Livable", + "due_part_key": "Due Part Key", + "build_id": "Build ID", + "build_uu_id": "Build UUID", + "part_direction_id": "Part Direction ID", + "part_direction_uu_id": "Part Direction UUID", + "part_type_id": "Part Type ID", + "part_type_uu_id": "Part Type UUID", + }, +) + + +BuildLivingSpaceLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "fix_value": "Düz Değer", + "fix_percent": "Düz Yüzde", + "agreement_no": "Anlaşma No", + "marketing_process": "Pazarlama İşlemi", + "marketing_layer": "Pazarlama Katmanı", + "build_parts_id": "Bina Parça ID", + "build_parts_uu_id": "Bina Parça UUID", + "person_id": "Kişi ID", + "person_uu_id": "Kişi UUID", + "occupant_type": "Sakin Tipi", + "occupant_type_uu_id": "Sakin Tipi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "fix_value": "Fixed Value", + "fix_percent": "Fixed Percent", + "agreement_no": "Agreement No", + "marketing_process": "Marketing Process", + "marketing_layer": "Marketing Layer", + "build_parts_id": "Build Part ID", + "build_parts_uu_id": "Build Part UUID", + "person_id": "Person ID", + "person_uu_id": "Person UUID", + "occupant_type": "Occupant Type", + "occupant_type_uu_id": "Occupant Type UUID", + }, +) + +BuildManagementLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "discounted_percentage": "İndirim Yüzdesi", + "discounted_price": "İndirimli Fiyat", + "calculated_price": "Hesaplanan Fiyat", + "occupant_type": "Sakin Tipi", + "occupant_type_uu_id": "Sakin Tipi UUID", + "build_id": "Bina ID", + "build_uu_id": "Bina UUID", + "build_parts_id": "Bina Parça ID", + "build_parts_uu_id": "Bina Parça UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "discounted_percentage": "Discounted Percentage", + "discounted_price": "Discounted Price", + "calculated_price": "Calculated Price", + "occupant_type": "Occupant Type", + "occupant_type_uu_id": "Occupant Type UUID", + "build_id": "Build ID", + "build_uu_id": "Build UUID", + "build_parts_id": "Build Part ID", + "build_parts_uu_id": "Build Part UUID", + }, +) + +BuildAreaLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "area_name": "Alan Adı", + "area_code": "Alan Kodu", + "area_type": "Alan Tipi", + "area_direction": "Alan Yönü", + "area_gross_size": "Alan Brüt Alanı", + "area_net_size": "Alan Net Alanı", + "width": "En", + "size": "Boyut", + "build_id": "Bina ID", + "build_uu_id": "Bina UUID", + "part_type_id": "Bina Parça Tipi ID", + "part_type_uu_id": "Bina Parça Tipi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "area_name": "Area Name", + "area_code": "Area Code", + "area_type": "Area Type", + "area_direction": "Area Direction", + "area_gross_size": "Area Gross Size", + "area_net_size": "Area Net Size", + "width": "Width", + "size": "Size", + "build_id": "Build ID", + "build_uu_id": "Build UUID", + "part_type_id": "Part Type ID", + "part_type_uu_id": "Part Type UUID", + }, +) + + +BuildSitesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "site_name": "Site Adı", + "site_no": "Site No", + "address_id": "Adres ID", + "address_uu_id": "Adres UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "site_name": "Site Name", + "site_no": "Site No", + "address_id": "Address ID", + "address_uu_id": "Address UUID", + }, +) + +BuildCompaniesProvidingLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "build_id": "Bina ID", + "build_uu_id": "Bina UUID", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UUID", + "provide_id": "Sağlayıcı ID", + "provide_uu_id": "Sağlayıcı UUID", + "contract_id": "Sözleşme ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "build_id": "Build ID", + "build_uu_id": "Build UUID", + "company_id": "Company ID", + "company_uu_id": "Company UUID", + "provide_id": "Provide ID", + "provide_uu_id": "Provide UUID", + "contract_id": "Contract ID", + }, +) + + +BuildPersonProvidingLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "build_id": "Bina ID", + "build_uu_id": "Bina UUID", + "people_id": "Kişi ID", + "people_uu_id": "Kişi UUID", + "provide_id": "Sağlayıcı ID", + "provide_uu_id": "Sağlayıcı UUID", + "contract_id": "Sözleşme ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "build_id": "Build ID", + "build_uu_id": "Build UUID", + "people_id": "People ID", + "people_uu_id": "People UUID", + "provide_id": "Provide ID", + "provide_uu_id": "Provide UUID", + "contract_id": "Contract ID", + }, +) diff --git a/databases/language_models/building/decision_book.py b/databases/language_models/building/decision_book.py new file mode 100644 index 0000000..53dbbc3 --- /dev/null +++ b/databases/language_models/building/decision_book.py @@ -0,0 +1,399 @@ +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel + + +BuildDecisionBookLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "decision_book_pdf_path": "Karar Defteri PDF Yolu", + "resp_company_fix_wage": "Firma Sabit Ücreti", + "is_out_sourced": "Dış Kaynak Kullanımı", + "meeting_date": "Toplantı Tarihi", + "decision_type": "Karar Türü", + "meeting_is_completed": "Toplantı Tamamlandı", + "meeting_completed_date": "Toplantı Tamamlanma Tarihi", + "build_id": "Bina ID", + "build_uu_id": "Bina UUID", + "resp_company_id": "Sorumlu Firma ID", + "resp_company_uu_id": "Sorumlu Firma UUID", + "contact_id": "İletişim ID", + "contact_uu_id": "İletişim UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "decision_book_pdf_path": "Decision Book PDF Path", + "resp_company_fix_wage": "Resp Company Fix Wage", + "is_out_sourced": "Is Out Sourced", + "meeting_date": "Meeting Date", + "decision_type": "Decision Type", + "meeting_is_completed": "Meeting Is Completed", + "meeting_completed_date": "Meeting Completed Date", + "build_id": "Build ID", + "build_uu_id": "Build UUID", + "resp_company_id": "Resp Company ID", + "resp_company_uu_id": "Resp Company UUID", + "contact_id": "Contact ID", + "contact_uu_id": "Contact UUID", + }, +) + +BuildDecisionBookInvitationsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "build_id": "Bina ID", + "build_uu_id": "Bina UUID", + "decision_book_id": "Karar Defteri ID", + "decision_book_uu_id": "Karar Defteri UUID", + "invitation_type": "Davet Türü", + "invitation_attempt": "Davet Denemesi", + "living_part_count": "Yaşam Bölüm Sayısı", + "living_part_percentage": "Yaşam Bölüm Yüzdesi", + "message": "Davet Mesajı", + "planned_date": "Planlanan Tarih", + "planned_date_expires": "Planlanan Tarih Bitiş", + }, + en={ + **CrudCollectionLanguageModel["en"], + "build_id": "Build ID", + "build_uu_id": "Build UUID", + "decision_book_id": "Decision Book ID", + "decision_book_uu_id": "Decision Book UUID", + "invitation_type": "Invitation Type", + "invitation_attempt": "Invitation Attempt", + "living_part_count": "Living Part Count", + "living_part_percentage": "Living Part Percentage", + "message": "Message", + "planned_date": "Planned Date", + "planned_date_expires": "Planned Date Expires", + }, +) + +BuildDecisionBookPersonLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "dues_percent_discount": "Aidat İndirim Oranı", + "dues_fix_discount": "Aidat Sabit İndirim", + "dues_discount_approval_date": "İndirim Onay Tarihi", + "send_date": "Gönderme Tarihi", + "is_attending": "Katılıyor", + "confirmed_date": "Onay Tarihi", + "token": "Token", + "vicarious_person_id": "Vekil Kişi ID", + "vicarious_person_uu_id": "Vekil Kişi UUID", + "invite_id": "Davet ID", + "invite_uu_id": "Davet UUID", + "build_decision_book_id": "Karar Defteri ID", + "build_decision_book_uu_id": "Karar Defteri UUID", + "build_living_space_id": "Yaşam Alanı ID", + "build_living_space_uu_id": "Yaşam Alanı UUID", + "person_id": "Kişi ID", + "person_uu_id": "Kişi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "dues_percent_discount": "Dues Percent Discount", + "dues_fix_discount": "Dues Fix Discount", + "dues_discount_approval_date": "Dues Discount Approval Date", + "send_date": "Send Date", + "is_attending": "Is Attending", + "confirmed_date": "Confirmed Date", + "token": "Token", + "vicarious_person_id": "Vicarious Person ID", + "vicarious_person_uu_id": "Vicarious Person UUID", + "invite_id": "Invite ID", + "invite_uu_id": "Invite UUID", + "build_decision_book_id": "Decision Book ID", + "build_decision_book_uu_id": "Decision Book UUID", + "build_living_space_id": "Living Space ID", + "build_living_space_uu_id": "Living Space UUID", + "person_id": "Person ID", + "person_uu_id": "Person UUID", + }, +) + +BuildDecisionBookPersonOccupantsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "build_decision_book_person_id": "Karar Defteri Kişi ID", + "build_decision_book_person_uu_id": "Karar Defter Kişi UUID", + "invite_id": "Davet ID", + "invite_uu_id": "Davet UUID", + "occupant_type_id": "Kişi Tür ID", + "occupant_type_uu_id": "Kişi Tür UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "build_decision_book_person_id": "Build Decision Book Person ID", + "build_decision_book_person_uu_id": "Build Decision Book Person UUID", + "invite_id": "Invite ID", + "invite_uu_id": "Invite UUID", + "occupant_type_id": "Occupant Type ID", + "occupant_type_uu_id": "Occupant Type UUID", + }, +) + +BuildDecisionBookItemsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "item_order": "Madde Sırası", + "item_comment": "Madde Yorumu", + "item_objection": "Madde İtirazı", + "info_is_completed": "Bilgi Tamamlandı", + "is_payment_created": "Ödeme Yapıldı", + "info_type_id": "Bilgi Türü ID", + "info_type_uu_id": "Bilgi Türü UUID", + "build_decision_book_id": "Karar Defteri ID", + "build_decision_book_uu_id": "Karar Defteri UUID", + "item_short_comment": "Kısa Yorum", + }, + en={ + **CrudCollectionLanguageModel["en"], + "item_order": "Item Order", + "item_comment": "Item Comment", + "item_objection": "Item Objection", + "info_is_completed": "Info Is Completed", + "is_payment_created": "Is Payment Created", + "info_type_id": "Info Type ID", + "info_type_uu_id": "Info Type UUID", + "build_decision_book_id": "Build Decision Book ID", + "build_decision_book_uu_id": "Build Decision Book UUID", + "item_short_comment": "Item Short Comment", + }, +) + +BuildDecisionBookItemsUnapprovedLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "item_objection": "Madde İtirazı", + "item_order": "Madde Sırası", + "decision_book_item_id": "Karar Defteri Madde ID", + "decision_book_item_uu_id": "Karar Defteri Madde UUID", + "person_id": "Kişi ID", + "person_uu_id": "Kişi UUID", + "build_decision_book_item": "Karar Defteri Madde ID", + "build_decision_book_item_uu_id": "Karar Defteri Madde UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "item_objection": "Item Objection", + "item_order": "Item Order", + "decision_book_item_id": "Decision Book Item ID", + "decision_book_item_uu_id": "Decision Book Item UUID", + "person_id": "Person ID", + "person_uu_id": "Person UUID", + "build_decision_book_item": "Build Decision Book Item ID", + "build_decision_book_item_uu_id": "Build Decision Book Item UUID", + }, +) + +BuildDecisionBookPaymentsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "payment_plan_time_periods": "Ödeme Planı Zaman Periyodu", + "process_date": "Ödeme Tarihi", + "payment_amount": "Ödeme Miktarı", + "currency": "Para Birimi", + "payment_types_id": "Ödeme Türü ID", + "payment_types_uu_id": "Ödeme Türü UUID", + "period_time": "Dönem Zamanı", + "process_date_y": "Tarih Yılı", + "process_date_m": "Tarih Ayı", + "build_decision_book_item_id": "Karar Defteri Madde ID", + "build_decision_book_item_uu_id": "Karar Defteri Madde UUID", + "build_parts_id": "Bina Parça ID", + "build_parts_uu_id": "Bina Parça UUID", + "decision_book_project_id": "Karar Defteri Proje ID", + "decision_book_project_uu_id": "Karar Defteri Proje UUID", + "account_records_id": "Hesap Kayıtları ID", + "account_records_uu_id": "Hesap Kayıtları UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "payment_plan_time_periods": "Payment Plan Time Periods", + "process_date": "Process Date", + "payment_amount": "Payment Amount", + "currency": "Currency", + "payment_types_id": "Payment Types ID", + "payment_types_uu_id": "Payment Types UUID", + "period_time": "Period Time", + "process_date_y": "Process Date Year", + "process_date_m": "Process Date Month", + "build_decision_book_item_id": "Build Decision Book Item ID", + "build_decision_book_item_uu_id": "Build Decision Book Item UUID", + "build_parts_id": "Build Parts ID", + "build_parts_uu_id": "Build Parts UUID", + "decision_book_project_id": "Decision Book Project ID", + "decision_book_project_uu_id": "Decision Book Project UUID", + "account_records_id": "Account Records ID", + "account_records_uu_id": "Account Records UUID", + }, +) + +BuildDecisionBookLegalLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "period_start_date": "Dönem Başlangıç Tarihi", + "lawsuits_decision_number": "Dava Karar Numarası", + "lawsuits_decision_date": "Dava Karar Tarihi", + "period_stop_date": "Dönem Bitiş Tarihi", + "decision_book_pdf_path": "Karar Defteri PDF Yolu", + "resp_company_total_wage": "Firma Toplam Ücreti", + "contact_agreement_path": "İletişim Anlaşma Yolu", + "contact_agreement_date": "İletişim Anlaşma Tarihi", + "meeting_date": "Toplantı Tarihi", + "lawsuits_type": "Dava Türü", + "lawsuits_name": "Dava Adı", + "lawsuits_note": "Dava Notu", + "lawyer_cost": "Avukat Ücreti", + "mediator_lawyer_cost": "Arabulucu Avukat Ücreti", + "other_cost": "Diğer Ücret", + "legal_cost": "Yasal Ücret", + "approved_cost": "Onaylanan Ücret", + "total_price": "Toplam Ücret", + "build_db_item_id": "Karar Defteri Madde ID", + "build_db_item_uu_id": "Karar Defteri Madde UUID", + "resp_attorney_id": "Sorumlu Avukat ID", + "resp_attorney_uu_id": "Sorumlu Avukat UUID", + "resp_attorney_company_id": "Sorumlu Avukat Firma ID", + "resp_attorney_company_uu_id": "Sorumlu Avukat Firma UUID", + "mediator_lawyer_person_id": "Arabulucu Avukat Kişi ID", + "mediator_lawyer_person_uu_id": "Arabulucu Avukat Kişi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "period_start_date": "Period Start Date", + "lawsuits_decision_number": "Lawsuits Decision Number", + "lawsuits_decision_date": "Lawsuits Decision Date", + "period_stop_date": "Period Stop Date", + "decision_book_pdf_path": "Decision Book PDF Path", + "resp_company_total_wage": "Resp Company Total Wage", + "contact_agreement_path": "Contact Agreement Path", + "contact_agreement_date": "Contact Agreement Date", + "meeting_date": "Meeting Date", + "lawsuits_type": "Lawsuits Type", + "lawsuits_name": "Lawsuits Name", + "lawsuits_note": "Lawsuits Note", + "lawyer_cost": "Lawyer Cost", + "mediator_lawyer_cost": "Mediator Lawyer Cost", + "other_cost": "Other Cost", + "legal_cost": "Legal Cost", + "approved_cost": "Approved Cost", + "total_price": "Total Price", + "build_db_item_id": "Build Decision Book Item ID", + "build_db_item_uu_id": "Build Decision Book Item UUID", + "resp_attorney_id": "Resp Attorney ID", + "resp_attorney_uu_id": "Resp Attorney UUID", + "resp_attorney_company_id": "Resp Attorney Company ID", + "resp_attorney_company_uu_id": "Resp Attorney Company UUID", + "mediator_lawyer_person_id": "Mediator Lawyer Person ID", + "mediator_lawyer_person_uu_id": "Mediator Lawyer Person UUID", + }, +) + +BuildDecisionBookProjectsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "project_no": "Proje No", + "project_name": "Proje Adı", + "project_start_date": "Proje Başlangıç Tarihi", + "project_stop_date": "Proje Bitiş Tarihi", + "project_type": "Proje Türü", + "project_note": "Proje Notu", + "decision_book_pdf_path": "Karar Defteri PDF Yolu", + "is_completed": "Proje Tamamlandı", + "status_code": "Durum Kodu", + "resp_company_fix_wage": "Firma Sabit Ücreti", + "is_out_sourced": "Dış Kaynak Kullanımı", + "meeting_date": "Toplantı Tarihi", + "currency": "Para Birimi", + "bid_price": "Teklif Fiyatı", + "approved_price": "Onaylanan Fiyat", + "final_price": "Son Fiyat", + "contact_id": "İletişim ID", + "contact_uu_id": "İletişim UUID", + "build_decision_book_id": "Karar Defteri ID", + "build_decision_book_uu_id": "Karar Defteri UUID", + "build_decision_book_item_id": "Karar Defteri Madde ID", + "build_decision_book_item_uu_id": "Karar Defteri Madde UUID", + "project_response_living_space_id": "Proje Yanıt Yaşam Alanı ID", + "project_response_living_space_uu_id": "Proje Yanıt Yaşam Alanı UUID", + "resp_company_id": "Sorumlu Firma ID", + "resp_company_uu_id": "Sorumlu Firma UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "project_no": "Project No", + "project_name": "Project Name", + "project_start_date": "Project Start Date", + "project_stop_date": "Project Stop Date", + "project_type": "Project Type", + "project_note": "Project Note", + "decision_book_pdf_path": "Decision Book PDF Path", + "is_completed": "Is Completed", + "status_code": "Status Code", + "resp_company_fix_wage": "Resp Company Fix Wage", + "is_out_sourced": "Is Out Sourced", + "meeting_date": "Meeting Date", + "currency": "Currency", + "bid_price": "Bid Price", + "approved_price": "Approved Price", + "final_price": "Final Price", + "contact_id": "Contact ID", + "contact_uu_id": "Contact UUID", + "build_decision_book_id": "Build Decision Book ID", + "build_decision_book_uu_id": "Build Decision Book UUID", + "build_decision_book_item_id": "Build Decision Book Item ID", + "build_decision_book_item_uu_id": "Build Decision Book Item UUID", + "project_response_living_space_id": "Project Response Living Space ID", + "project_response_living_space_uu_id": "Project Response Living Space UUID", + "resp_company_id": "Resp Company ID", + "resp_company_uu_id": "Resp Company UUID", + }, +) + +BuildDecisionBookProjectPersonLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "dues_percent_discount": "Aidat İndirim Oranı", + "job_fix_wage": "İş Sabit Ücreti", + "bid_price": "Teklif Fiyatı", + "decision_price": "Karar Fiyatı", + "build_decision_book_project_id": "Karar Defteri Proje ID", + "build_decision_book_project_uu_id": "Karar Defteri Proje UUID", + "living_space_id": "Yaşam Alanı ID", + "living_space_uu_id": "Yaşam Alanı UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "dues_percent_discount": "Dues Percent Discount", + "job_fix_wage": "Job Fix Wage", + "bid_price": "Bid Price", + "decision_price": "Decision Price", + "build_decision_book_project_id": "Build Decision Book Project ID", + "build_decision_book_project_uu_id": "Build Decision Book Project UUID", + "living_space_id": "Living Space ID", + "living_space_uu_id": "Living Space UUID", + }, +) + +BuildDecisionBookProjectItemsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "item_header": "Madde Başlığı", + "item_comment": "Madde Yorumu", + "attachment_pdf_path": "Ek PDF Yolu", + "item_estimated_cost": "Tahmini Maliyet", + "item_short_comment": "Kısa Yorum", + "build_decision_book_project_id": "Karar Defteri Proje ID", + "build_decision_book_project_uu_id": "Karar Defteri Proje UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "item_header": "Item Header", + "item_comment": "Item Comment", + "attachment_pdf_path": "Attachment PDF Path", + "item_estimated_cost": "Estimated Cost", + "item_short_comment": "Item Short Comment", + "build_decision_book_project_id": "Build Decision Book Project ID", + "build_decision_book_project_uu_id": "Build Decision Book Project UUID", + }, +) diff --git a/databases/language_models/company/company.py b/databases/language_models/company/company.py new file mode 100644 index 0000000..793678f --- /dev/null +++ b/databases/language_models/company/company.py @@ -0,0 +1,66 @@ +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel + + +RelationshipDutyCompanyLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "owner_id": "Sahip ID", + "duties_id": "Görev ID", + "member_id": "Üye ID", + "parent_id": "Üst ID", + "relationship_type": "İlişki Tipi", + "child_count": "Çocuk Sayısı", + "show_only": "Sadece Göster", + }, + en={ + **CrudCollectionLanguageModel["en"], + "owner_id": "Owner ID", + "duties_id": "Duties ID", + "member_id": "Member ID", + "parent_id": "Parent ID", + "relationship_type": "Relationship Type", + "child_count": "Child Count", + "show_only": "Show Only", + }, +) + +CompaniesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "formal_name": "Resmi Ad", + "company_type": "Şirket Tipi", + "commercial_type": "Ticari Tip", + "tax_no": "Vergi No", + "public_name": "Kamu Adı", + "company_tag": "Şirket Etiketi", + "default_lang_type": "Varsayılan Dil Tipi", + "default_money_type": "Varsayılan Para Tipi", + "is_commercial": "Ticari", + "is_blacklist": "Kara Liste", + "parent_id": "Üst ID", + "workplace_no": "İşyeri No", + "official_address_id": "Resmi Adres ID", + "official_address_uu_id": "Resmi Adres UUID", + "top_responsible_company_id": "Üst Sorumlu Şirket ID", + "top_responsible_company_uu_id": "Üst Sorumlu Şirket UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "formal_name": "Formal Name", + "company_type": "Company Type", + "commercial_type": "Commercial Type", + "tax_no": "Tax No", + "public_name": "Public Name", + "company_tag": "Company Tag", + "default_lang_type": "Default Language Type", + "default_money_type": "Default Money Type", + "is_commercial": "Commercial", + "is_blacklist": "Blacklist", + "parent_id": "Parent ID", + "workplace_no": "Workplace No", + "official_address_id": "Official Address ID", + "official_address_uu_id": "Official Address UUID", + "top_responsible_company_id": "Top Responsible Company ID", + "top_responsible_company_uu_id": "Top Responsible Company UUID", + }, +) diff --git a/databases/language_models/company/department.py b/databases/language_models/company/department.py new file mode 100644 index 0000000..16b7960 --- /dev/null +++ b/databases/language_models/company/department.py @@ -0,0 +1,63 @@ +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel + + +DepartmentsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "parent_department_id": "Üst Departman ID", + "department_code": "Departman Kodu", + "department_name": "Departman Adı", + "department_description": "Departman Açıklaması", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "parent_department_id": "Parent Department ID", + "department_code": "Department Code", + "department_name": "Department Name", + "department_description": "Department Description", + "company_id": "Company ID", + "company_uu_id": "Company UUID", + }, +) + +DutiesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "users_default_duty": "Kullanıcılar için Varsayılan Görev", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UUID", + "duties_id": "Görev ID", + "duties_uu_id": "Görev UUID", + "department_id": "Departman ID", + "department_uu_id": "Departman UUID", + "management_duty": "Yönetim Görevi", + }, + en={ + **CrudCollectionLanguageModel["en"], + "users_default_duty": "Default Duty for Users", + "company_id": "Company ID", + "company_uu_id": "Company UUID", + "duties_id": "Duty ID", + "duties_uu_id": "Duty UUID", + "department_id": "Department ID", + "department_uu_id": "Department UUID", + "management_duty": "Management Duty", + }, +) + +DutyLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "duty_name": "Görev Adı", + "duty_code": "Görev Kodu", + "duty_description": "Görev Açıklaması", + }, + en={ + **CrudCollectionLanguageModel["en"], + "duty_name": "Duty Name", + "duty_code": "Duty Code", + "duty_description": "Duty Description", + }, +) diff --git a/databases/language_models/company/employee.py b/databases/language_models/company/employee.py new file mode 100644 index 0000000..1a7a3fd --- /dev/null +++ b/databases/language_models/company/employee.py @@ -0,0 +1,72 @@ +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel + + +StaffLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "staff_description": "Personel Açıklaması", + "staff_name": "Personel Adı", + "staff_code": "Personel Kodu", + "duties_id": "Görev ID", + "duties_uu_id": "Görev UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "staff_description": "Staff Description", + "staff_name": "Staff Name", + "staff_code": "Staff Code", + "duties_id": "Duty ID", + "duties_uu_id": "Duty UUID", + }, +) + +EmployeesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "staff_id": "Personel ID", + "staff_uu_id": "Personel UUID", + "people_id": "Kişi ID", + "people_uu_id": "Kişi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "staff_id": "Staff ID", + "staff_uu_id": "Staff UUID", + "people_id": "People ID", + "people_uu_id": "People UUID", + }, +) + +EmployeeHistoryLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "staff_id": "Personel ID", + "staff_uu_id": "Personel UUID", + "people_id": "Kişi ID", + "people_uu_id": "Kişi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "staff_id": "Staff ID", + "staff_uu_id": "Staff UUID", + "people_id": "People ID", + "people_uu_id": "People UUID", + }, +) + +EmployeesSalariesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "gross_salary": "Brüt Maaş", + "net_salary": "Net Maaş", + "people_id": "Kişi ID", + "people_uu_id": "Kişi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "gross_salary": "Gross Salary", + "net_salary": "Net Salary", + "people_id": "People ID", + "people_uu_id": "People UUID", + }, +) diff --git a/databases/language_models/event/event.py b/databases/language_models/event/event.py new file mode 100644 index 0000000..8f15920 --- /dev/null +++ b/databases/language_models/event/event.py @@ -0,0 +1,184 @@ +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel + +EventsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "event_type": "Etkinlik Türü", + "function_code": "Fonksiyon Kodu", + "function_class": "Fonksiyon Sınıfı", + "description": "Açıklama", + "property_description": "Özellik Açıklaması", + "marketing_layer": "Pazarlama Katmanı", + "cost": "Maliyet", + "unit_price": "Birim Fiyat", + "endpoint_id": "Endpoint ID", + "endpoint_uu_id": "Endpoint UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "event_type": "Event Type", + "function_code": "Function Code", + "function_class": "Function Class", + "description": "Description", + "property_description": "Property Description", + "marketing_layer": "Marketing Layer", + "cost": "Cost", + "unit_price": "Unit Price", + "endpoint_id": "Endpoint ID", + "endpoint_uu_id": "Endpoint UUID", + }, +) + +ModulesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "module_name": "Modül Adı", + "module_description": "Modül Açıklaması", + "module_code": "Modül Kodu", + "module_layer": "Modül Katmanı", + "is_default_module": "Varsayılan Modül", + }, + en={ + **CrudCollectionLanguageModel["en"], + "module_name": "Module Name", + "module_description": "Module Description", + "module_code": "Module Code", + "module_layer": "Module Layer", + "is_default_module": "Default Module", + }, +) + +ServicesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "module_id": "Modül ID", + "module_uu_id": "Modül UUID", + "service_name": "Servis Adı", + "service_description": "Servis Açıklaması", + "service_code": "Servis Kodu", + "related_responsibility": "İlgili Sorumluluk", + }, + en={ + **CrudCollectionLanguageModel["en"], + "module_id": "Module ID", + "module_uu_id": "Module UUID", + "service_name": "Service Name", + "service_description": "Service Description", + "service_code": "Service Code", + "related_responsibility": "Related Responsibility", + }, +) + +Service2EventsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "service_id": "Servis ID", + "service_uu_id": "Servis UUID", + "event_id": "Etkinlik ID", + "event_uu_id": "Etkinlik UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "service_id": "Service ID", + "service_uu_id": "Service UUID", + "event_id": "Event ID", + "event_uu_id": "Event UUID", + }, +) + +Event2OccupantExtraLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "build_living_space_id": "Bina Yaşam Alanı ID", + "build_living_space_uu_id": "Bina Yaşam Alanı UUID", + "event_id": "Etkinlik ID", + "event_uu_id": "Etkinlik UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "build_living_space_id": "Build Living Space ID", + "build_living_space_uu_id": "Build Living Space UUID", + "event_id": "Event ID", + "event_uu_id": "Event UUID", + }, +) + +Event2EmployeeExtraLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "employee_id": "Çalışan ID", + "employee_uu_id": "Çalışan UUID", + "event_id": "Etkinlik ID", + "event_uu_id": "Etkinlik UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "employee_id": "Employee ID", + "employee_uu_id": "Employee UUID", + "event_id": "Event ID", + "event_uu_id": "Event UUID", + }, +) + +Event2EmployeeLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "employee_id": "Çalışan ID", + "employee_uu_id": "Çalışan UUID", + "event_service_id": "Etkinlik Servis ID", + "event_service_uu_id": "Etkinlik Servis UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "employee_id": "Employee ID", + "employee_uu_id": "Employee UUID", + "event_service_id": "Event Service ID", + "event_service_uu_id": "Event Service UUID", + }, +) + +Event2OccupantLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "build_living_space_id": "Bina Yaşam Alanı ID", + "build_living_space_uu_id": "Bina Yaşam Alanı UUID", + "event_service_id": "Etkinlik Servis ID", + "event_service_uu_id": "Etkinlik Servis UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "build_living_space_id": "Build Living Space ID", + "build_living_space_uu_id": "Build Living Space UUID", + "event_service_id": "Event Service ID", + "event_service_uu_id": "Event Service UUID", + }, +) + +ModulePriceLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "campaign_code": "Kampanya Kodu", + "module_id": "Modül ID", + "module_uu_id": "Modül UUID", + "service_id": "Servis ID", + "service_uu_id": "Servis UUID", + "event_id": "Etkinlik ID", + "event_uu_id": "Etkinlik UUID", + "is_counted_percentage": "İndirim Oranı", + "discounted_price": "İndirimli Fiyat", + "calculated_price": "Hesaplanan Fiyat", + }, + en={ + **CrudCollectionLanguageModel["en"], + "campaign_code": "Campaign Code", + "module_id": "Module ID", + "module_uu_id": "Module UUID", + "service_id": "Service ID", + "service_uu_id": "Service UUID", + "event_id": "Event ID", + "event_uu_id": "Event UUID", + "is_counted_percentage": "Discount Rate", + "discounted_price": "Discounted Price", + "calculated_price": "Calculated Price", + }, +) diff --git a/databases/language_models/identity/identity.py b/databases/language_models/identity/identity.py new file mode 100644 index 0000000..0220fed --- /dev/null +++ b/databases/language_models/identity/identity.py @@ -0,0 +1,424 @@ +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel + +UsersTokensLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "user_id": "Kullanıcı ID", + "token_type": "Token Türü", + "token": "Token", + "domain": "Domain", + "expires_at": "Bitiş Tarihi", + }, + en={ + **CrudCollectionLanguageModel["en"], + "user_id": "User ID", + "token_type": "Token Type", + "token": "Token", + "domain": "Domain", + "expires_at": "Expires At", + }, +) + +UsersLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "user_tag": "Kullanıcı Etiketi", + "email": "E-posta", + "phone_number": "Telefon Numarası", + "via": "Via", + "avatar": "Avatar", + "hash_password": "Şifre", + "password_token": "Şifre Token", + "remember_me": "Beni Hatırla", + "password_expires_day": "Şifre Son Kullanma Günü", + "password_expiry_begins": "Şifre Son Kullanma Başlangıç", + "related_company": "İlgili Şirket", + "person_id": "Kişi ID", + "person_uu_id": "Kişi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "user_tag": "User Tag", + "email": "Email", + "phone_number": "Phone Number", + "via": "Via", + "avatar": "Avatar", + "hash_password": "Password", + "password_token": "Password Token", + "remember_me": "Remember Me", + "password_expires_day": "Password Expires Day", + "password_expiry_begins": "Password Expiry Begins", + "related_company": "Related Company", + "person_id": "Person ID", + "person_uu_id": "Person UUID", + }, +) + +RelationshipDutyPeopleLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "company_id": "Şirket ID", + "duties_id": "Görev ID", + "member_id": "Üye ID", + "relationship_type": "İlişki Türü", + "show_only": "Sadece Göster", + }, + en={ + **CrudCollectionLanguageModel["en"], + "company_id": "Company ID", + "duties_id": "Duty ID", + "member_id": "Member ID", + "relationship_type": "Relationship Type", + "show_only": "Show Only", + } +) + +PeopleLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "firstname": "Ad", + "surname": "Soyad", + "middle_name": "Orta Ad", + "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={ + **CrudCollectionLanguageModel["en"], + "firstname": "First Name", + "surname": "Last Name", + "middle_name": "Middle Name", + "sex_code": "Gender", + "person_ref": "Person Reference", + "person_tag": "Person Tag", + "father_name": "Father Name", + "mother_name": "Mother Name", + "country_code": "Country Code", + "national_identity_id": "National Identity ID", + "birth_place": "Birth Place", + "birth_date": "Birth Date", + "tax_no": "Tax No", + } +) + +RelationshipEmployee2PostCodeLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "company_id": "Şirket ID", + "employee_id": "Çalışan ID", + "member_id": "Üye ID", + "relationship_type": "İlişki Türü", + "show_only": "Sadece Göster", + }, + en={ + **CrudCollectionLanguageModel["en"], + "company_id": "Company ID", + "employee_id": "Employee ID", + "member_id": "Member ID", + "relationship_type": "Relationship Type", + "show_only": "Show Only", + } +) + +AddressPostcodeLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "street_id": "Sokak ID", + "street_uu_id": "Sokak UUID", + "postcode": "Posta Kodu", + }, + en={ + **CrudCollectionLanguageModel["en"], + "street_id": "Street ID", + "street_uu_id": "Street UUID", + "postcode": "Postcode", + }, +) + +AddressesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "build_number": "Bina Numarası", + "door_number": "Kapı Numarası", + "floor_number": "Kat Numarası", + "comment_address": "Adres", + "letter_address": "Adres", + "short_letter_address": "Adres", + "latitude": "Enlem", + "longitude": "Boylam", + "street_id": "Sokak ID", + "street_uu_id": "Sokak UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "build_number": "Build Number", + "door_number": "Door Number", + "floor_number": "Floor Number", + "comment_address": "Address", + "letter_address": "Address", + "short_letter_address": "Address", + "latitude": "Latitude", + "longitude": "Longitude", + "street_id": "Street ID", + "street_uu_id": "Street UUID", + } +) + +AddressGeographicLocationsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "geo_table": "Tablo Adı", + "geo_id": "ID", + "geo_name": "Ad", + "geo_latitude": "Enlem", + "geo_longitude": "Boylam", + "geo_altitude": "Yükseklik", + "geo_description": "Açıklama", + "geo_area_size": "Alan", + "geo_population": "Nüfus", + }, + en={ + **CrudCollectionLanguageModel["en"], + "geo_table": "Table Name", + "geo_id": "ID", + "geo_name": "Name", + "geo_latitude": "Latitude", + "geo_longitude": "Longitude", + "geo_altitude": "Altitude", + "geo_description": "Description", + "geo_area_size": "Area", + "geo_population": "Population", + } +) + +AddressCountryLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "country_code": "Ülke Kodu", + "country_name": "Ülke Adı", + "money_code": "Para Kodu", + "language": "Dil Kodu", + "address_geographic_id": "Adres Coğrafi ID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "country_code": "Country Code", + "country_name": "Country Name", + "money_code": "Money Code", + "language": "Language Code", + "address_geographic_id": "Address Geographic ID", + }, +) + +AddressStateLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "state_code": "Eyalet Kodu", + "state_name": "Eyalet Adı", + "licence_plate": "Plaka Kodu", + "phone_code": "Telefon Kodu", + "gov_code": "Hükümet Kodu", + "address_geographic_id": "Adres Coğrafi ID", + "country_id": "Ülke ID", + "country_uu_id": "Ülke UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "state_code": "State Code", + "state_name": "State Name", + "licence_plate": "Licence Plate", + "phone_code": "Phone Code", + "gov_code": "Government Code", + "address_geographic_id": "Address Geographic ID", + "country_id": "Country ID", + "country_uu_id": "Country UUID", + }, +) + +AddressCityLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "city_code": "Şehir Kodu", + "city_name": "Şehir Adı", + "licence_plate": "Plaka Kodu", + "phone_code": "Telefon Kodu", + "gov_code": "Hükümet Kodu", + "address_geographic_id": "Adres Coğrafi ID", + "state_id": "Eyalet ID", + "state_uu_id": "Eyalet UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "city_code": "City Code", + "city_name": "City Name", + "licence_plate": "Licence Plate", + "phone_code": "Phone Code", + "gov_code": "Government Code", + "address_geographic_id": "Address Geographic ID", + "state_id": "State ID", + "state_uu_id": "State UUID", + }, +) + +AddressDistrictLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "district_code": "İlçe Kodu", + "district_name": "İlçe Adı", + "phone_code": "Telefon Kodu", + "gov_code": "Hükümet Kodu", + "address_geographic_id": "Adres Coğrafi ID", + "city_id": "Şehir ID", + "city_uu_id": "Şehir UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "district_code": "District Code", + "district_name": "District Name", + "phone_code": "Phone Code", + "gov_code": "Government Code", + "address_geographic_id": "Address Geographic ID", + "city_id": "City ID", + "city_uu_id": "City UUID", + }, +) + +AddressLocalityLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "locality_code": "Mahalle Kodu", + "locality_name": "Mahalle Adı", + "type_code": "Tip Kodu", + "type_description": "Tip Açıklaması", + "gov_code": "Hükümet Kodu", + "address_show": "Adres Göster", + "address_geographic_id": "Adres Coğrafi ID", + "district_id": "İlçe ID", + "district_uu_id": "İlçe UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "locality_code": "Locality Code", + "locality_name": "Locality Name", + "type_code": "Type Code", + "type_description": "Type Description", + "gov_code": "Government Code", + "address_show": "Address Show", + "address_geographic_id": "Address Geographic ID", + "district_id": "District ID", + "district_uu_id": "District UUID", + }, +) + +AddressNeighborhoodLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "neighborhood_code": "Mahalle Kodu", + "neighborhood_name": "Mahalle Adı", + "type_code": "Tip Kodu", + "type_description": "Tip Açıklaması", + "gov_code": "Hükümet Kodu", + "address_show": "Adres Göster", + "address_geographic_id": "Adres Coğrafi ID", + "district_id": "İlçe ID", + "district_uu_id": "İlçe UUID", + "locality_id": "Mahalle ID", + "locality_uu_id": "Mahalle UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "neighborhood_code": "Neighborhood Code", + "neighborhood_name": "Neighborhood Name", + "type_code": "Type Code", + "type_description": "Type Description", + "gov_code": "Government Code", + "address_show": "Address Show", + "address_geographic_id": "Address Geographic ID", + "district_id": "District ID", + "district_uu_id": "District UUID", + "locality_id": "Locality ID", + "locality_uu_id": "Locality UUID", + }, +) + +AddressStreetLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "street_code": "Sokak Kodu", + "street_name": "Sokak Adı", + "type_code": "Tip Kodu", + "type_description": "Tip Açıklaması", + "gov_code": "Hükümet Kodu", + "address_geographic_id": "Adres Coğrafi ID", + "neighborhood_id": "Mahalle ID", + "neighborhood_uu_id": "Mahalle UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "street_code": "Street Code", + "street_name": "Street Name", + "type_code": "Type Code", + "type_description": "Type Description", + "gov_code": "Government Code", + "address_geographic_id": "Address Geographic ID", + "neighborhood_id": "Neighborhood ID", + "neighborhood_uu_id": "Neighborhood UUID", + }, +) + +OccupantTypesLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "occupant_type": "Kişi Türü", + "occupant_description": "Kişi Açıklaması", + "occupant_code": "Kişi Kodu", + "occupant_category": "Kişi Kategori", + "occupant_category_type": "Kişi Kategori Türü", + "occupant_is_unique": "Kişi Benzersiz", + }, + en={ + **CrudCollectionLanguageModel["en"], + "occupant_type": "Occupant Type", + "occupant_description": "Occupant Description", + "occupant_code": "Occupant Code", + "occupant_category": "Occupant Category", + "occupant_category_type": "Occupant Category Type", + "occupant_is_unique": "Occupant Unique", + }, +) + +ContractsLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "contract_type": "Sözleşme Türü", + "contract_title": "Sözleşme Başlığı", + "contract_details": "Sözleşme Detayları", + "contract_terms": "Sözleşme Şartları", + "contract_code": "Sözleşme Kodu", + "contract_date": "Sözleşme Tarihi", + "company_id": "Şirket ID", + "company_uu_id": "Şirket UUID", + "person_id": "Kişi ID", + "person_uu_id": "Kişi UUID", + }, + en={ + **CrudCollectionLanguageModel["en"], + "contract_type": "Contract Type", + "contract_title": "Contract Title", + "contract_details": "Contract Details", + "contract_terms": "Contract Terms", + "contract_code": "Contract Code", + "contract_date": "Contract Date", + "company_id": "Company ID", + "company_uu_id": "Company UUID", + "person_id": "Person ID", + "person_uu_id": "Person UUID", + }, +) diff --git a/databases/language_models/rules/rules.py b/databases/language_models/rules/rules.py new file mode 100644 index 0000000..39cb033 --- /dev/null +++ b/databases/language_models/rules/rules.py @@ -0,0 +1,20 @@ +from databases.language_models.Mixins.crud_mixin import CrudCollectionLanguageModel + +EndpointRestrictionLanguageModel = dict( + tr={ + **CrudCollectionLanguageModel["tr"], + "endpoint_function": "API Fonksiyonu", + "endpoint_name": "API Adı", + "endpoint_method": "API Metodu", + "endpoint_desc": "API Açıklaması", + "endpoint_code": "API Kodu", + }, + en={ + **CrudCollectionLanguageModel["en"], + "endpoint_function": "API Function", + "endpoint_name": "API Name", + "endpoint_method": "API Method", + "endpoint_desc": "API Description", + "endpoint_code": "API Code", + } +) diff --git a/databases/no_sql_models/identity.py b/databases/no_sql_models/identity.py index de278be..6f32101 100644 --- a/databases/no_sql_models/identity.py +++ b/databases/no_sql_models/identity.py @@ -1,6 +1,10 @@ import datetime -from databases.no_sql_models.validations import PasswordHistoryViaUser, DomainViaUser, AccessHistoryViaUser +from databases.no_sql_models.validations import ( + PasswordHistoryViaUser, + DomainViaUser, + AccessHistoryViaUser, +) from databases.no_sql_models.mongo_database import MongoQuery @@ -39,7 +43,7 @@ class MongoQueryIdentity: "other_domains_list": [payload.main_domain], "main_domain": payload.main_domain, "modified_at": datetime.datetime.now().timestamp(), - } + }, ) def update_domain_via_user(self, payload: DomainViaUser): @@ -79,7 +83,7 @@ class MongoQueryIdentity: raise Exception( dict( status_code=400, - detail="Password already used. Please enter a new password that you have not used last 3 times." + detail="Password already used. Please enter a new password that you have not used last 3 times.", ) ) diff --git a/databases/no_sql_models/mongo_database.py b/databases/no_sql_models/mongo_database.py index 9ced7b5..f21898f 100644 --- a/databases/no_sql_models/mongo_database.py +++ b/databases/no_sql_models/mongo_database.py @@ -28,9 +28,19 @@ class Paginate(BaseModel): self.sortField, -1 if self.sortOrder == "desc" else 1, ) + + class MongoResponse: - def __init__(self, status: bool, message: str, message_code:str = None, data: dict = None, mongo=None, count: int = 1): + def __init__( + self, + status: bool, + message: str, + message_code: str = None, + data: dict = None, + mongo=None, + count: int = 1, + ): self.status = status self.message = message self.data = data @@ -47,6 +57,7 @@ class MongoResponse: "data": self.data, } + class MongoQuery: def __init__(self, table_name: str, database_name: str): @@ -82,7 +93,7 @@ class MongoQuery: message_code="NOT_CREATED", data=None, mongo=insert, - count=0 + count=0, ) def insert_many(self, payload) -> MongoResponse: @@ -94,7 +105,7 @@ class MongoQuery: message_code="CREATED", data=payload, mongo=insert_many, - count=len(payload) + count=len(payload), ) return MongoResponse( status=False, @@ -102,7 +113,7 @@ class MongoQuery: message_code="NOT_CREATED", data=None, mongo=insert_many, - count=0 + count=0, ) def find_or_insert(self, payload, field: str = "id") -> MongoResponse: @@ -120,7 +131,7 @@ class MongoQuery: status=True, message="The document has been created", data=payload, - mongo=mongo + mongo=mongo, ) found_row = self.get_one(match=payload[field], field=field) @@ -130,7 +141,7 @@ class MongoQuery: message_code="ALREADY_EXISTS", message="The document already exists", data=found_row.data, - mongo=found_row.mongo + mongo=found_row.mongo, ) insert_row = self.table.insert_one(document=payload) return MongoResponse( @@ -138,7 +149,7 @@ class MongoQuery: message="The document has been created", message_code="CREATED", data=payload, - mongo=insert_row + mongo=insert_row, ) def update(self, match, payload, field: str = "id"): @@ -150,15 +161,17 @@ class MongoQuery: message="The document has been updated", message_code="UPDATED", data=self.get_one(match=match, field=field).data, - mongo=update_one + mongo=update_one, ) - update_one = self.table.update_one(filter={field: match}, update={"$set": payload}) + update_one = self.table.update_one( + filter={field: match}, update={"$set": payload} + ) return MongoResponse( status=True, message="The document has been updated", message_code="UPDATED", data=self.get_one(match=match, field=field).data, - mongo=update_one + mongo=update_one, ) def get_one(self, match, field: str = "id"): @@ -169,7 +182,7 @@ class MongoQuery: message="The document has been found", message_code="FOUND", data=self.parse_json(data=get_one), - mongo=get_one + mongo=get_one, ) if get_one := self.table.find_one(filter={field: match}): return MongoResponse( @@ -177,14 +190,14 @@ class MongoQuery: message="The document has been found", message_code="FOUND", data=self.parse_json(data=get_one), - mongo=get_one + mongo=get_one, ) return MongoResponse( status=False, message="The document has not been found", message_code="NOT_FOUND", data=None, - mongo=None + mongo=None, ) def filter_by(self, payload, sort_by: str = "_id", sort_direction: str = "asc"): @@ -202,7 +215,7 @@ class MongoQuery: message_code="NOT_FOUND", data=None, mongo=return_, - count=0 + count=0, ) return MongoResponse( status=True, @@ -222,7 +235,7 @@ class MongoQuery: message_code="DELETED", data=None, count=delete_one.deleted_count, - mongo=delete_one + mongo=delete_one, ) delete_one = self.table.delete_one(filter={field: match}) if delete_one.deleted_count: @@ -232,7 +245,7 @@ class MongoQuery: message_code="DELETED", data=None, count=delete_one.deleted_count, - mongo=delete_one + mongo=delete_one, ) return MongoResponse( status=False, @@ -240,7 +253,7 @@ class MongoQuery: message_code="NOT_DELETED", data=None, mongo=None, - count=0 + count=0, ) def delete_all(self, match, field: str = "id"): @@ -253,7 +266,7 @@ class MongoQuery: message_code="DELETED", data=None, count=delete_many.deleted_count, - mongo=delete_many + mongo=delete_many, ) delete_many = self.table.delete_many(filter={field: match}) if delete_many.deleted_count: @@ -263,7 +276,7 @@ class MongoQuery: message_code="DELETED", data=None, count=delete_many.deleted_count, - mongo=delete_many + mongo=delete_many, ) return MongoResponse( status=False, @@ -271,7 +284,7 @@ class MongoQuery: message_code="NOT_DELETED", data=None, mongo=None, - count=0 + count=0, ) def list_all(self, paginate: Paginate): @@ -286,7 +299,7 @@ class MongoQuery: message_code="NOT_FOUND", data=None, mongo=return_, - count=0 + count=0, ) return MongoResponse( status=True, @@ -294,7 +307,7 @@ class MongoQuery: message_code="FOUND", count=self.table.count_documents({}), data=data, - mongo=return_ + mongo=return_, ) def get_all(self): @@ -305,7 +318,7 @@ class MongoQuery: message_code="FOUND", count=self.table.count_documents({}), data=self.parse_json(data=return_), - mongo=return_ + mongo=return_, ) diff --git a/databases/sql_models/account/account.py b/databases/sql_models/account/account.py index bfe4da5..435e718 100644 --- a/databases/sql_models/account/account.py +++ b/databases/sql_models/account/account.py @@ -1,7 +1,3 @@ -from api_validations.validations_request import ListOptions -from databases.language_models.account.account import AccountBooksLanguageModel -from databases.sql_models.core_mixin import CrudCollection - from sqlalchemy.orm import mapped_column, Mapped from sqlalchemy import ( String, @@ -14,6 +10,16 @@ from sqlalchemy import ( Numeric, UUID, ) +from databases.sql_models.core_mixin import CrudCollection +from databases.language_models import ( + AccountBooksLanguageModel, + AccountDetailLanguageModel, + AccountMasterLanguageModel, + AccountRecordExchangesLanguageModel, + AccountCodesLanguageModel, + AccountRecordsLanguageModel, + AccountCodeParserLanguageModel, +) class AccountBooks(CrudCollection): @@ -53,12 +59,11 @@ class AccountBooks(CrudCollection): ) - - class AccountCodes(CrudCollection): __tablename__ = "account_codes" __exclude__fields__ = [] + __language_model__ = AccountCodesLanguageModel account_code: Mapped[str] = mapped_column( String(48), nullable=False, comment="Account Code" @@ -115,6 +120,7 @@ class AccountCodeParser(CrudCollection): __tablename__ = "account_code_parser" __exclude__fields__ = [] + __language_model__ = AccountCodeParserLanguageModel account_code_1: Mapped[str] = mapped_column(String, nullable=False, comment="Order") account_code_2: Mapped[str] = mapped_column(String, nullable=False, comment="Order") @@ -159,6 +165,7 @@ class AccountMaster(CrudCollection): __tablename__ = "account_master" __exclude__fields__ = [] + __language_model__ = AccountMasterLanguageModel doc_date: Mapped[TIMESTAMP] = mapped_column( TIMESTAMP(timezone=True), nullable=False, comment="Document Date" @@ -246,6 +253,7 @@ class AccountDetail(CrudCollection): __tablename__ = "account_detail" __exclude__fields__ = [] __enum_list__ = [("plug_type", "AccountingReceiptTypes", "M")] + __language_model__ = AccountDetailLanguageModel doc_date: Mapped[TIMESTAMP] = mapped_column( TIMESTAMP(timezone=True), nullable=False, comment="Document Date" @@ -385,6 +393,7 @@ class AccountRecords(CrudCollection): ("receive_debit", "DebitTypes", "D"), ("budget_type", "BudgetType", "B"), ] + __language_model__ = AccountRecordsLanguageModel iban: Mapped[str] = mapped_column( String(64), nullable=False, comment="IBAN Number of Bank" @@ -723,8 +732,10 @@ class AccountRecords(CrudCollection): class AccountRecordExchanges(CrudCollection): + __tablename__ = "account_record_exchanges" __exclude__fields__ = [] + __language_model__ = AccountRecordExchangesLanguageModel are_currency: Mapped[str] = mapped_column( String(5), nullable=False, comment="Unit of Currency" diff --git a/databases/sql_models/core_mixin.py b/databases/sql_models/core_mixin.py index 26ef697..70ca01b 100644 --- a/databases/sql_models/core_mixin.py +++ b/databases/sql_models/core_mixin.py @@ -76,7 +76,7 @@ class CrudMixin(Base, SmartQueryMixin, SessionMixin, FilterAttributes): client_arrow: DateTimeLocal = None # The arrow to use in the model. valid_record_dict: dict = {"active": True, "deleted": False} valid_record_args = lambda class_: [class_.active == True, class_.deleted == False] - metadata: dict = {} + meta_data: dict = {} expiry_starts: Mapped[TIMESTAMP] = mapped_column( TIMESTAMP(timezone=True), server_default=func.now(), nullable=False @@ -173,20 +173,20 @@ class CrudMixin(Base, SmartQueryMixin, SessionMixin, FilterAttributes): cls.pre_query = None if already_record: if already_record.deleted: - already_record.metadata = { + already_record.meta_data = { "created": False, "error_case": "DeletedRecord", "message": "", } return already_record elif already_record.is_confirmed: - already_record.metadata = { + already_record.meta_data = { "created": False, "error_case": "IsNotConfirmed", "message": "", } return already_record - already_record.metadata = { + already_record.meta_data = { "created": False, "error_case": "AlreadyExists", "message": "", @@ -202,7 +202,7 @@ class CrudMixin(Base, SmartQueryMixin, SessionMixin, FilterAttributes): cls.created_by_id = cls.creds.get("person_id", None) cls.created_by = cls.creds.get("person_name", None) created_record.flush() - already_record.metadata = {"created": True, "error_case": None, "message": ""} + already_record.meta_data = {"created": True, "error_case": None, "message": ""} return created_record @classmethod @@ -410,6 +410,7 @@ class CrudCollection(BaseMixin, SmartQueryMixin): for i in response_model.__annotations__.keys(): headers_and_validation[i] = getattr(__language_model__, i, "Lang Not found") + # all_arguments = [ # record # for record in self.__class__.__dict__ @@ -431,4 +432,4 @@ class CrudCollection(BaseMixin, SmartQueryMixin): # return_dict[all_argument] = ( # populate_arg.get_dict() if populate_arg else [] # ) -# return dict(sorted(return_dict.items(), reverse=False)) \ No newline at end of file +# return dict(sorted(return_dict.items(), reverse=False))