schemas updated
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from fastapi.exceptions import HTTPException
|
||||
|
||||
from databases.sql_models.core_mixin import CrudCollection
|
||||
|
||||
from sqlalchemy import (
|
||||
String,
|
||||
@@ -14,19 +13,19 @@ from sqlalchemy import (
|
||||
)
|
||||
from sqlalchemy.orm import mapped_column, relationship, Mapped
|
||||
|
||||
from api_configs import RelationAccess
|
||||
from databases.extensions import SelectAction
|
||||
from api_validations.validations_request import (
|
||||
# from databases.extensions import SelectAction
|
||||
from ApiValidations.Request import (
|
||||
InsertCompany,
|
||||
UpdateCompany,
|
||||
MatchCompany2Company,
|
||||
)
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject
|
||||
from databases.language_models.company.company import (
|
||||
from LanguageModels.Database.company.company import (
|
||||
RelationshipDutyCompanyLanguageModel,
|
||||
CompaniesLanguageModel,
|
||||
# CompanyDutiesLanguageModel,
|
||||
)
|
||||
from Services.PostgresDb import CrudCollection
|
||||
|
||||
|
||||
class RelationshipDutyCompany(CrudCollection):
|
||||
@@ -44,7 +43,6 @@ class RelationshipDutyCompany(CrudCollection):
|
||||
|
||||
__tablename__ = "relationship_duty_company"
|
||||
__exclude__fields__ = []
|
||||
__access_by__ = RelationAccess.SuperAccessList
|
||||
__language_model__ = RelationshipDutyCompanyLanguageModel
|
||||
|
||||
owner_id: Mapped[int] = mapped_column(
|
||||
@@ -75,7 +73,7 @@ class RelationshipDutyCompany(CrudCollection):
|
||||
|
||||
@classmethod
|
||||
def match_company_to_company_commercial(cls, data: MatchCompany2Company, token):
|
||||
from databases import (
|
||||
from Schemas import (
|
||||
Duties,
|
||||
)
|
||||
|
||||
@@ -123,7 +121,7 @@ class RelationshipDutyCompany(CrudCollection):
|
||||
|
||||
@classmethod
|
||||
def match_company_to_company_organization(cls, data: MatchCompany2Company, token):
|
||||
from databases import (
|
||||
from Schemas import (
|
||||
Duties,
|
||||
)
|
||||
|
||||
@@ -251,7 +249,7 @@ class Companies(CrudCollection, SelectAction):
|
||||
|
||||
@classmethod
|
||||
def create_action(cls, data: InsertCompany, token: EmployeeTokenObject):
|
||||
from databases import Addresses, Duties
|
||||
from Schemas import Addresses, Duties
|
||||
|
||||
data_dict = data.model_dump()
|
||||
if cls.filter_one(cls.tax_no == str(data.tax_no).strip(), system=True).data:
|
||||
@@ -298,7 +296,7 @@ class Companies(CrudCollection, SelectAction):
|
||||
|
||||
@classmethod
|
||||
def update_action(cls, data: UpdateCompany, token):
|
||||
from databases import (
|
||||
from Schemas import (
|
||||
Addresses,
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from sqlalchemy import String, Integer, ForeignKey, Index, Boolean, Identity
|
||||
from sqlalchemy.orm import mapped_column, Mapped
|
||||
|
||||
from databases.sql_models.core_mixin import CrudCollection
|
||||
from Services.PostgresDb import CrudCollection
|
||||
|
||||
|
||||
class Departments(CrudCollection):
|
||||
|
||||
@@ -6,15 +6,15 @@ from sqlalchemy import (
|
||||
)
|
||||
from sqlalchemy.orm import mapped_column, Mapped
|
||||
|
||||
from databases.language_models.company.employee import (
|
||||
from LanguageModels.Database.company.employee import (
|
||||
StaffLanguageModel,
|
||||
EmployeesLanguageModel,
|
||||
EmployeeHistoryLanguageModel,
|
||||
EmployeesSalariesLanguageModel,
|
||||
)
|
||||
from databases.sql_models.core_mixin import CrudCollection
|
||||
from Services.PostgresDb import CrudCollection
|
||||
|
||||
from api_validations.validations_request import InsertCompanyEmployees
|
||||
from ApiValidations.Request import InsertCompanyEmployees
|
||||
|
||||
|
||||
class Staff(CrudCollection):
|
||||
@@ -47,7 +47,7 @@ class Staff(CrudCollection):
|
||||
|
||||
@classmethod
|
||||
def create_action(cls, data: InsertCompanyEmployees):
|
||||
from databases import Duties
|
||||
from Schemas import Duties
|
||||
|
||||
data_dict = data.model_dump()
|
||||
if duty := Duties.find_one(uu_id=data.duty_uu_id):
|
||||
|
||||
Reference in New Issue
Block a user