events updated
This commit is contained in:
parent
952d742999
commit
077d264b28
|
|
@ -1,5 +0,0 @@
|
|||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
|
||||
|
||||
class ApiEvents(MethodToEvent): ...
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
import typing
|
||||
|
||||
from databases import (
|
||||
AccountRecords,
|
||||
)
|
||||
|
||||
from api_validations.validations_request import (
|
||||
InsertAccountRecord,
|
||||
UpdateAccountRecord,
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
|
||||
|
||||
class AccountRecordsListEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "SELECT"
|
||||
__event_keys__ = {
|
||||
"": "account_records_list",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def account_records_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
pass
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
pass
|
||||
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Update Build record",
|
||||
result=None
|
||||
)
|
||||
|
||||
|
||||
class AccountRecordsCreateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "CREATE"
|
||||
__event_keys__ = {
|
||||
"": "account_records_create",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def account_records_create(
|
||||
cls,
|
||||
data: InsertAccountRecord,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
pass
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
pass
|
||||
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Update Build record",
|
||||
result=None,
|
||||
)
|
||||
|
||||
|
||||
class AccountRecordsUpdateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "UPDATE"
|
||||
__event_keys__ = {
|
||||
"": "account_records_update",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def build_area_update(
|
||||
cls,
|
||||
build_uu_id: str,
|
||||
data: UpdateAccountRecord,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
pass
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
pass
|
||||
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="Update Build record",
|
||||
result=None,
|
||||
)
|
||||
|
||||
|
||||
class AccountRecordsPatchEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "PATCH"
|
||||
__event_keys__ = {
|
||||
"": "account_records_patch",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def build_area_patch(
|
||||
cls,
|
||||
build_uu_id: str,
|
||||
data,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="Patch Build record",
|
||||
result=None,
|
||||
)
|
||||
|
||||
|
||||
AccountRecordsListEventMethod = AccountRecordsListEventMethods(
|
||||
action=ActionsSchema(endpoint="/account/records/list")
|
||||
)
|
||||
AccountRecordsCreateEventMethod = AccountRecordsCreateEventMethods(
|
||||
action=ActionsSchema(endpoint="/account/records/create")
|
||||
)
|
||||
AccountRecordsUpdateEventMethod = AccountRecordsUpdateEventMethods(
|
||||
action=ActionsSchema(endpoint="/account/records/update")
|
||||
)
|
||||
AccountRecordsPatchEventMethod = AccountRecordsPatchEventMethods(
|
||||
action=ActionsSchema(endpoint="/account/records/patch")
|
||||
)
|
||||
|
|
@ -63,7 +63,7 @@ class AuthenticationLoginEventMethods(MethodToEvent):
|
|||
def authentication_login_with_domain_and_creds(
|
||||
cls,
|
||||
data: Login,
|
||||
request,
|
||||
request: Request,
|
||||
):
|
||||
access_dict = Users.login_user_with_credentials(data=data, request=request)
|
||||
found_user = access_dict.get("user", None)
|
||||
|
|
@ -75,7 +75,7 @@ class AuthenticationLoginEventMethods(MethodToEvent):
|
|||
if not access_object:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="This User has no active role registered. Please contact your administrator."
|
||||
detail="This User has no active role registered. Please contact your administrator.",
|
||||
)
|
||||
|
||||
return JSONResponse(
|
||||
|
|
@ -103,7 +103,6 @@ class AuthenticationSelectEventMethods(MethodToEvent):
|
|||
cls,
|
||||
request: Request,
|
||||
data,
|
||||
token_dict: typing.Union[EmployeeSelection, OccupantSelection],
|
||||
):
|
||||
from api_objects.auth.token_objects import OccupantToken, CompanyToken
|
||||
|
||||
|
|
@ -118,13 +117,13 @@ class AuthenticationSelectEventMethods(MethodToEvent):
|
|||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
)
|
||||
if selected_company := Companies.filter_one(
|
||||
Companies.uu_id==data.company_uu_id,
|
||||
*Companies.valid_record_args(Companies),
|
||||
Companies.uu_id == data.company_uu_id,
|
||||
*Companies.valid_record_args(Companies),
|
||||
).data:
|
||||
department_ids = [
|
||||
department.id
|
||||
for department in Departments.filter_all(
|
||||
Departments.company_id==selected_company.id,
|
||||
Departments.company_id == selected_company.id,
|
||||
*Departments.valid_record_args(Departments),
|
||||
).data
|
||||
]
|
||||
|
|
@ -197,13 +196,17 @@ class AuthenticationSelectEventMethods(MethodToEvent):
|
|||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
elif token_user.user_type == 2:
|
||||
occupant_type = OccupantTypes.filter_by_one(system=True, uu_id=data.occupant_uu_id).data
|
||||
occupant_type = OccupantTypes.filter_by_one(
|
||||
system=True, uu_id=data.occupant_uu_id
|
||||
).data
|
||||
if not occupant_type:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Occupant Type is not found",
|
||||
)
|
||||
build_part = BuildParts.filter_by_one(system=True, uu_id=data.build_part_uu_id).data
|
||||
build_part = BuildParts.filter_by_one(
|
||||
system=True, uu_id=data.build_part_uu_id
|
||||
).data
|
||||
if not build_part:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
|
|
@ -280,7 +283,8 @@ class AuthenticationCheckTokenEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def authentication_login_with_domain_and_creds(
|
||||
cls, request, token_dict: dict = None
|
||||
cls,
|
||||
request,
|
||||
):
|
||||
if get_object_via_access_key(request=request):
|
||||
return JSONResponse(
|
||||
|
|
@ -301,8 +305,10 @@ class AuthenticationRefreshEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def authentication_refresh_user_info(cls, request, token_dict: dict = None):
|
||||
|
||||
def authentication_refresh_user_info(
|
||||
cls,
|
||||
request,
|
||||
):
|
||||
access_token = str(request.headers.get(Auth.ACCESS_TOKEN_TAG))
|
||||
if token_user := get_object_via_access_key(request=request):
|
||||
if found_user := Users.filter_one(
|
||||
|
|
@ -344,7 +350,7 @@ class AuthenticationChangePasswordEventMethods(MethodToEvent):
|
|||
def authentication_change_password(
|
||||
cls,
|
||||
data: ChangePassword,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: typing.Union[EmployeeSelection, OccupantSelection]
|
||||
):
|
||||
if token_dict.user_type == 1:
|
||||
if found_user := Users.filter_one(
|
||||
|
|
@ -381,7 +387,10 @@ class AuthenticationCreatePasswordEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def authentication_create_password(cls, data: CreatePassword):
|
||||
def authentication_create_password(
|
||||
cls,
|
||||
data: CreatePassword,
|
||||
):
|
||||
if not data.re_password == data.password:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_406_NOT_ACCEPTABLE, detail="Password must match"
|
||||
|
|
@ -451,7 +460,7 @@ class AuthenticationDisconnectUserEventMethods(MethodToEvent):
|
|||
token_user = json.loads(redis_cli.get(key) or {})
|
||||
redis_cli.delete(key)
|
||||
selected_user = Users.filter_one(
|
||||
Users.uu_id==token_user.get("uu_id"),
|
||||
Users.uu_id == token_user.get("uu_id"),
|
||||
*Users.valid_record_args(Users),
|
||||
)
|
||||
selected_user.remove_refresher_token(
|
||||
|
|
@ -512,7 +521,7 @@ class AuthenticationLogoutEventMethods(MethodToEvent):
|
|||
if token_dict.domain == data.domain:
|
||||
redis_cli.delete(token_user)
|
||||
selected_user = Users.filter_one(
|
||||
Users.uu_id==token_user.get("uu_id"),
|
||||
Users.uu_id == token_user.get("uu_id"),
|
||||
*Users.valid_record_args(Users),
|
||||
)
|
||||
selected_user.remove_refresher_token(domain=data.domain)
|
||||
|
|
@ -550,7 +559,10 @@ class AuthenticationRefreshTokenEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def authentication_refresher_token(
|
||||
cls, request: Request, data: Remember, token_dict: dict = None
|
||||
cls,
|
||||
request: Request,
|
||||
data: Remember,
|
||||
token_dict: typing.Union[EmployeeSelection, OccupantSelection],
|
||||
):
|
||||
token_refresher = UsersTokens.filter_by_one(
|
||||
system=True, token=data.refresh_token, domain=data.domain
|
||||
|
|
@ -618,7 +630,10 @@ class AuthenticationForgotPasswordEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def authentication_forgot_password(
|
||||
cls, request: Request, data: Forgot, token_dict: dict = None
|
||||
cls,
|
||||
request: Request,
|
||||
data: Forgot,
|
||||
token_dict: typing.Union[EmployeeSelection, OccupantSelection],
|
||||
):
|
||||
found_user: Users = Users.check_user_exits(
|
||||
access_key=data.access_key, domain=data.domain
|
||||
|
|
@ -677,7 +692,10 @@ class AuthenticationDownloadAvatarEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def authentication_download_avatar(
|
||||
cls, request: Request, data: Forgot, token_dict: dict = None
|
||||
cls,
|
||||
request: Request,
|
||||
data: Forgot,
|
||||
token_dict: typing.Union[EmployeeSelection, OccupantSelection],
|
||||
):
|
||||
found_user = Users.check_user_exits(
|
||||
access_key=data.access_key, domain=data.domain
|
||||
|
|
|
|||
|
|
@ -13,10 +13,11 @@ from api_validations.validations_request import (
|
|||
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_events.events.building.building_build import BuildPatchEventMethods
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
|
||||
|
||||
class BuildListEventMethods(MethodToEvent):
|
||||
class BuildAreaListEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "SELECT"
|
||||
__event_keys__ = {
|
||||
|
|
@ -25,9 +26,9 @@ class BuildListEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def build_area_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
build_ids = Build.filter_all(
|
||||
|
|
@ -54,13 +55,11 @@ class BuildListEventMethods(MethodToEvent):
|
|||
*BuildArea.valid_record_args(BuildArea),
|
||||
)
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Update Build record",
|
||||
result=records
|
||||
completed=True, message="Update Build record", result=records
|
||||
)
|
||||
|
||||
|
||||
class BuildCreateEventMethods(MethodToEvent):
|
||||
class BuildAreaCreateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "CREATE"
|
||||
__event_keys__ = {
|
||||
|
|
@ -69,9 +68,9 @@ class BuildCreateEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def build_area_create(
|
||||
cls,
|
||||
data: InsertBuildArea,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
cls,
|
||||
data: InsertBuildArea,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
if not token_dict.selected_occupant.build_uuid == data.build_uu_id:
|
||||
|
|
@ -107,7 +106,8 @@ class BuildCreateEventMethods(MethodToEvent):
|
|||
result=created_build_part,
|
||||
)
|
||||
|
||||
class BuildUpdateEventMethods(MethodToEvent):
|
||||
|
||||
class BuildAreaUpdateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "UPDATE"
|
||||
__event_keys__ = {
|
||||
|
|
@ -115,7 +115,12 @@ class BuildUpdateEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def build_area_update(cls, build_uu_id: str, data: UpdateBuildArea, token_dict):
|
||||
def build_area_update(
|
||||
cls,
|
||||
build_uu_id: str,
|
||||
data: UpdateBuildArea,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="Update Build record",
|
||||
|
|
@ -123,7 +128,7 @@ class BuildUpdateEventMethods(MethodToEvent):
|
|||
)
|
||||
|
||||
|
||||
class BuildPatchEventMethods(MethodToEvent):
|
||||
class BuildAreaPatchEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "PATCH"
|
||||
__event_keys__ = {
|
||||
|
|
@ -131,21 +136,26 @@ class BuildPatchEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def build_area_patch(cls, build_uu_id: str, data, token_dict):
|
||||
def build_area_patch(
|
||||
cls,
|
||||
build_uu_id: str,
|
||||
data,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="Update Build record",
|
||||
message="Patch Build record",
|
||||
result=None,
|
||||
)
|
||||
|
||||
|
||||
BuildListEventMethod = BuildListEventMethods(
|
||||
BuildAreaListEventMethod = BuildAreaListEventMethods(
|
||||
action=ActionsSchema(endpoint="/building/area/list")
|
||||
)
|
||||
BuildCreateEventMethod = BuildCreateEventMethods(
|
||||
BuildAreaCreateEventMethod = BuildAreaCreateEventMethods(
|
||||
action=ActionsSchema(endpoint="/building/area/create")
|
||||
)
|
||||
BuildUpdateEventMethod = BuildUpdateEventMethods(
|
||||
BuildUpdateEventMethod = BuildAreaUpdateEventMethods(
|
||||
action=ActionsSchema(endpoint="/building/area/update")
|
||||
)
|
||||
BuildPatchEventMethod = BuildPatchEventMethods(
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class BuildingBuildPartsListEventMethods(MethodToEvent):
|
|||
employee_id=token_dict.selected_company.employee_id,
|
||||
)
|
||||
build_list_ids = [build.id for build in build_list_query.all()]
|
||||
BuildParts.pre_query = BuildParts.query.filter(
|
||||
BuildParts.pre_query = BuildParts.filter_all(
|
||||
BuildParts.build_id.in_(build_list_ids),
|
||||
*BuildParts.valid_record_args(BuildParts),
|
||||
)
|
||||
).query
|
||||
records = BuildParts.filter_active(
|
||||
*BuildParts.get_smart_query(list_options.query),
|
||||
*BuildParts.valid_record_args(BuildParts),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,162 @@
|
|||
import typing
|
||||
|
||||
from databases import (
|
||||
Build,
|
||||
BuildSites,
|
||||
)
|
||||
|
||||
from api_validations.validations_request import (
|
||||
InsertBuildArea,
|
||||
UpdateBuildArea,
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
|
||||
|
||||
class BuildingBuildSitesEvents(MethodToEvent): ...
|
||||
class BuildSitesListEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "SELECT"
|
||||
__event_keys__ = {
|
||||
"": "build_sites_list",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def build_sites_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
build_ids = Build.filter_all(
|
||||
Build.id == token_dict.selected_occupant.build_id,
|
||||
*Build.valid_record_args(Build),
|
||||
).data
|
||||
build_id_list = [build.id for build in build_ids]
|
||||
BuildSites.pre_query = BuildSites.filter_all(
|
||||
BuildSites.build_id.in_(build_id_list),
|
||||
*BuildSites.valid_record_args(BuildSites),
|
||||
).query
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
build_ids = Build.select_action(
|
||||
employee_id=token_dict.selected_company.employee_id
|
||||
)
|
||||
build_id_list = [build.id for build in build_ids]
|
||||
BuildSites.pre_query = BuildSites.filter_all(
|
||||
BuildSites.build_id.in_(build_id_list),
|
||||
*BuildSites.valid_record_args(BuildSites),
|
||||
).query
|
||||
BuildSites.filter_attr = list_options
|
||||
records = BuildSites.filter_all(
|
||||
*BuildSites.get_smart_query(smart_query=list_options.query),
|
||||
*BuildSites.valid_record_args(BuildSites),
|
||||
)
|
||||
return AlchemyJsonResponse(
|
||||
completed=True, message="Update Build record", result=records
|
||||
)
|
||||
|
||||
|
||||
class BuildSitesCreateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "CREATE"
|
||||
__event_keys__ = {
|
||||
"": "build_sites_create",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def build_area_create(
|
||||
cls,
|
||||
data: InsertBuildArea,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
if not token_dict.selected_occupant.build_uuid == data.build_uu_id:
|
||||
BuildSites.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"Occupant can not create build sites for {data.build_uu_id}",
|
||||
data={
|
||||
"build_uu_id": data.build_uu_id,
|
||||
},
|
||||
)
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
build_ids = Build.select_action(
|
||||
employee_id=token_dict.selected_company.employee_id
|
||||
).all()
|
||||
if not str(data.build_uu_id) in [str(build.uu_id) for build in build_ids]:
|
||||
BuildSites.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"Employee can not create build sites for {data.build_uu_id}",
|
||||
data={
|
||||
"build_uu_id": data.build_uu_id,
|
||||
},
|
||||
)
|
||||
data_dict = data.excluded_dump()
|
||||
created_build_part = BuildSites.find_or_create(**data_dict)
|
||||
created_build_part.save()
|
||||
created_build_part.update(is_confirmed=True)
|
||||
created_build_part.save()
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Update Build record",
|
||||
result=created_build_part,
|
||||
)
|
||||
|
||||
|
||||
class BuildSitesUpdateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "UPDATE"
|
||||
__event_keys__ = {
|
||||
"": "build_sites_update",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def build_area_update(
|
||||
cls,
|
||||
build_uu_id: str,
|
||||
data: UpdateBuildArea,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="Update Build record",
|
||||
result=None,
|
||||
)
|
||||
|
||||
|
||||
class BuildSitesPatchEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "PATCH"
|
||||
__event_keys__ = {
|
||||
"": "build_sites_patch",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def build_area_patch(
|
||||
cls,
|
||||
build_uu_id: str,
|
||||
data,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="Patch Build record",
|
||||
result=None,
|
||||
)
|
||||
|
||||
|
||||
BuildSitesListEventMethod = BuildSitesListEventMethods(
|
||||
action=ActionsSchema(endpoint="/building/sites/list")
|
||||
)
|
||||
BuildSitesCreateEventMethod = BuildSitesCreateEventMethods(
|
||||
action=ActionsSchema(endpoint="/building/sites/create")
|
||||
)
|
||||
BuildSitesUpdateEventMethod = BuildSitesUpdateEventMethods(
|
||||
action=ActionsSchema(endpoint="/building/sites/update")
|
||||
)
|
||||
BuildSitesPatchEventMethod = BuildSitesPatchEventMethods(
|
||||
action=ActionsSchema(endpoint="/building/sites/patch")
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import typing
|
||||
|
||||
from fastapi import status, HTTPException
|
||||
from typing import Union
|
||||
|
||||
from api_events.events.events.events_bind_modules import ModulesBindOccupantEventMethods
|
||||
from databases import (
|
||||
Modules,
|
||||
BuildParts,
|
||||
Build,
|
||||
BuildLivingSpace,
|
||||
|
|
@ -12,70 +11,97 @@ from databases import (
|
|||
)
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from api_validations.validations_request import (
|
||||
InsertBuildLivingSpace,
|
||||
UpdateBuildLivingSpace,
|
||||
ListOptions,
|
||||
)
|
||||
from databases.sql_models.event.event import Modules
|
||||
|
||||
|
||||
class BuildingLivingSpacesPartsListEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "SELECT"
|
||||
__event_keys__ = {
|
||||
"8fd04d94-68fb-4a07-9549-8b47aee3a870": "building_build_parts_list",
|
||||
"2f3041a9-6184-44c2-ac38-8ea934297ed1": "building_build_parts_list_with_expired",
|
||||
"36961d8a-cefa-46cc-9f7c-9d841d6351b6": "building_live_space_list",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def building_build_parts_list(cls, list_options: ListOptions, token_dict):
|
||||
build_id_list_query = Build.select_action(
|
||||
employee_id=token_dict.selected_company.employee_id
|
||||
)
|
||||
Build.filter_attr = list_options
|
||||
build_part_id_list_query = BuildParts.filter_all(
|
||||
BuildParts.build_id.in_([build.id for build in build_id_list_query.all()]),
|
||||
*BuildParts.valid_record_args(BuildParts),
|
||||
).data
|
||||
|
||||
list_options.query.pop("expiry_starts", None)
|
||||
list_options.query.pop("expiry_ends", None)
|
||||
|
||||
records = BuildLivingSpace.filter_all(
|
||||
BuildLivingSpace.build_parts_id.in_(
|
||||
[build_part.id for build_part in build_part_id_list_query]
|
||||
),
|
||||
*BuildLivingSpace.get_smart_query(smart_query=list_options.query),
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
).data
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Building Living Spaces are listed successfully",
|
||||
result=records,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def building_build_parts_list_with_expired(
|
||||
cls, list_options: ListOptions, token_dict
|
||||
def building_build_parts_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
build_id_list_query = Build.select_action(
|
||||
employee_id=token_dict.selected_company.employee_id
|
||||
)
|
||||
Build.filter_attr = list_options
|
||||
build_part_id_list_query = BuildParts.filter_all(
|
||||
BuildParts.build_id.in_([build.id for build in build_id_list_query.all()]),
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
).data
|
||||
|
||||
records = BuildLivingSpace.filter_all(
|
||||
BuildLivingSpace.build_parts_id.in_(
|
||||
[build_part.id for build_part in build_part_id_list_query]
|
||||
),
|
||||
*BuildLivingSpace.get_smart_query(smart_query=list_options.query),
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
).data
|
||||
records, Build.filter_attr = [], None
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
occupants_build_id = Build.filter_one(
|
||||
Build.id == token_dict.selected_occupant.build_id,
|
||||
*Build.valid_record_args(Build),
|
||||
).data
|
||||
if not occupants_build_id:
|
||||
Build.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"Occupant has no build registered in the system. Contact with your company.",
|
||||
data={},
|
||||
)
|
||||
occupants_build_parts = BuildParts.filter_all(
|
||||
BuildParts.build_id.in_(occupants_build_id.id),
|
||||
*BuildParts.valid_record_args(BuildParts),
|
||||
).data
|
||||
if not occupants_build_parts:
|
||||
Build.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"Occupant has no build parts registered in the system. Contact with your company.",
|
||||
data={},
|
||||
)
|
||||
BuildLivingSpace.pre_query = BuildLivingSpace.filter_all(
|
||||
BuildLivingSpace.build_parts_id.in_(
|
||||
[build_part.id for build_part in occupants_build_parts]
|
||||
),
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
).query
|
||||
BuildLivingSpace.filter_attr = list_options
|
||||
records = BuildLivingSpace.filter_all(
|
||||
*BuildLivingSpace.get_smart_query(smart_query=list_options.query),
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
)
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
build_id_list_query = Build.select_action(
|
||||
employee_id=token_dict.selected_company.employee_id
|
||||
)
|
||||
if not build_id_list_query:
|
||||
Build.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"Employee has no build registered in the system. Contact with your supervisor.",
|
||||
data={},
|
||||
)
|
||||
build_part_id_list_query = BuildParts.filter_all(
|
||||
BuildParts.build_id.in_(
|
||||
[build.id for build in build_id_list_query.all()]
|
||||
),
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
).data
|
||||
if not build_part_id_list_query:
|
||||
Build.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"Employee has no build parts registered in the system. Contact with your supervisor.",
|
||||
data={},
|
||||
)
|
||||
BuildLivingSpace.pre_query = BuildLivingSpace.filter_all(
|
||||
BuildLivingSpace.build_parts_id.in_(
|
||||
[build_part.id for build_part in build_part_id_list_query]
|
||||
),
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
).query
|
||||
Build.filter_attr = list_options
|
||||
records = BuildLivingSpace.filter_all(
|
||||
*BuildLivingSpace.get_smart_query(smart_query=list_options.query),
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
)
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Building Living Spaces are listed successfully",
|
||||
|
|
@ -86,15 +112,13 @@ class BuildingLivingSpacesPartsListEventMethods(MethodToEvent):
|
|||
class BuildingLivingSpacesPartsCreateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "CREATE"
|
||||
__event_keys__ = {
|
||||
"b78ca45c-b9f4-41f6-9ddb-2c6f2faa2570": "building_live_space_create"
|
||||
}
|
||||
__event_keys__ = {"46d90119-3b23-4784-8053-fe11da4a3584": "building_live_space_create"}
|
||||
|
||||
@classmethod
|
||||
def building_live_space_create(
|
||||
cls,
|
||||
data: InsertBuildLivingSpace,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
from api_library.date_time_actions.date_functions import system_arrow
|
||||
|
||||
|
|
@ -108,28 +132,36 @@ class BuildingLivingSpacesPartsCreateEventMethods(MethodToEvent):
|
|||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
).data
|
||||
if not build_part:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_418_IM_A_TEAPOT,
|
||||
detail=f"{data.build_parts_uu_id} - Build Part is not found in database. Check build part uu_id",
|
||||
BuildLivingSpace.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"{data.build_parts_uu_id} - Build Part is not found in database. Check build part uu_id",
|
||||
data={
|
||||
"life_person_uu_id": data.life_person_uu_id,
|
||||
},
|
||||
)
|
||||
|
||||
life_person = People.filter_one(
|
||||
People.uu_id == data.person_uu_id or "",
|
||||
*People.valid_record_args(People),
|
||||
).data
|
||||
if not life_person:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_418_IM_A_TEAPOT,
|
||||
detail=f"{data.life_person_uu_id} - Living Person is not found in database. "
|
||||
f"Check build live person uu_id",
|
||||
BuildLivingSpace.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"{data.life_person_uu_id} - Living Person is not found in database.",
|
||||
data={
|
||||
"life_person_uu_id": data.life_person_uu_id,
|
||||
},
|
||||
)
|
||||
|
||||
occupant_type = OccupantTypes.filter_by_one(uu_id=data.occupant_type_uu_id).data
|
||||
if not occupant_type:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_418_IM_A_TEAPOT,
|
||||
detail=f"{data.occupant_type_uu_id} - Occupant Type is not found in database. "
|
||||
f"Check occupant type uu_id",
|
||||
BuildLivingSpace.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"{data.occupant_type_uu_id} - Occupant Type is not found in database. Check occupant type uu_id",
|
||||
data={
|
||||
"occupant_type_uu_id": data.occupant_type_uu_id,
|
||||
},
|
||||
)
|
||||
|
||||
data_dict["occupant_type"] = occupant_type.id
|
||||
|
|
@ -144,8 +176,6 @@ class BuildingLivingSpacesPartsCreateEventMethods(MethodToEvent):
|
|||
BuildLivingSpace.person_id == life_person.id,
|
||||
BuildLivingSpace.occupant_type == occupant_type.id,
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
# str(system_arrow.now()) < BuildLivingSpace.expiry_ends,
|
||||
# str(system_arrow.now()) >= BuildLivingSpace.expiry_starts,
|
||||
select_args=[BuildLivingSpace.id],
|
||||
order_by=BuildLivingSpace.expiry_starts.desc(),
|
||||
limit=1,
|
||||
|
|
@ -181,69 +211,82 @@ class BuildingLivingSpacesPartsUpdateEventMethods(MethodToEvent):
|
|||
|
||||
event_type = "UPDATE"
|
||||
__event_keys__ = {
|
||||
"70b4666f-4ceb-46ec-b89e-24be8712f0e7": "building_live_space_update",
|
||||
"c786e15c-c03e-4e8f-936c-7e5e5ec9bbcc": "building_live_space_update",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def building_live_space_update(cls, build_uu_id: str, data, token_dict):
|
||||
def building_live_space_update(
|
||||
cls,
|
||||
build_uu_id: str,
|
||||
data: UpdateBuildLivingSpace,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
from api_library.date_time_actions.date_functions import system_arrow
|
||||
|
||||
data_dict = data.dump()
|
||||
build_id_list_query = Build.select_action(
|
||||
employee_id=token_dict.selected_company.employee_id
|
||||
)
|
||||
build_part = BuildParts.filter_one(
|
||||
BuildParts.uu_id == data.build_parts_uu_id,
|
||||
BuildParts.build_id.in_([build.id for build in build_id_list_query.all()]),
|
||||
*BuildParts.valid_record_args(BuildParts),
|
||||
).data
|
||||
if not build_part:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_418_IM_A_TEAPOT,
|
||||
detail=f"{data.build_parts_uu_id} - Build Part is not found in database. Check build part uu_id",
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
data_dict = data.dump()
|
||||
build_id_list_query = Build.select_action(
|
||||
employee_id=token_dict.selected_company.employee_id
|
||||
)
|
||||
build_part = BuildParts.filter_one(
|
||||
BuildParts.uu_id == data.build_parts_uu_id,
|
||||
BuildParts.build_id.in_(
|
||||
[build.id for build in build_id_list_query.all()]
|
||||
),
|
||||
*BuildParts.valid_record_args(BuildParts),
|
||||
).data
|
||||
if not build_part:
|
||||
BuildLivingSpace.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"{data.life_person_uu_id} - Living Person is not found in database.",
|
||||
data={
|
||||
"person_uu_id": data.life_person_uu_id,
|
||||
},
|
||||
)
|
||||
life_person = People.filter_one(
|
||||
People.uu_id == data.life_person_uu_id or ""
|
||||
).data
|
||||
if not life_person:
|
||||
BuildLivingSpace.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"{data.life_person_uu_id} - Living Person is not found in database.",
|
||||
data={
|
||||
"person_uu_id": data.life_person_uu_id,
|
||||
},
|
||||
)
|
||||
|
||||
life_person = People.filter_one(
|
||||
People.uu_id == data.life_person_uu_id or ""
|
||||
).data
|
||||
if not life_person:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_418_IM_A_TEAPOT,
|
||||
detail=f"{data.life_person_uu_id} - Living Person is not found in database. "
|
||||
f"Check build live person uu_id",
|
||||
)
|
||||
living_space_id = BuildLivingSpace.select_only(
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
select_args=[BuildLivingSpace.id],
|
||||
order_by=BuildLivingSpace.expiry_starts.desc(),
|
||||
limit=1,
|
||||
).get(1)
|
||||
|
||||
living_space_id = BuildLivingSpace.select_only(
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
select_args=[BuildLivingSpace.id],
|
||||
order_by=BuildLivingSpace.expiry_starts.desc(),
|
||||
limit=1,
|
||||
).get(1)
|
||||
last_living_space = BuildLivingSpace.filter_one(
|
||||
BuildLivingSpace.id == living_space_id if living_space_id else None,
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
).data
|
||||
|
||||
last_living_space = BuildLivingSpace.filter_one(
|
||||
BuildLivingSpace.id == living_space_id if living_space_id else None,
|
||||
*BuildLivingSpace.valid_record_args(BuildLivingSpace),
|
||||
).data
|
||||
|
||||
data_dict["expiry_starts"] = str(system_arrow.now())
|
||||
data_dict["is_tenant_live"] = bool(data.is_tenant_live)
|
||||
data_dict["build_parts_id"] = build_part.id
|
||||
if data_dict["is_tenant_live"]:
|
||||
owner_person = getattr(last_living_space, "owner_person_id", None)
|
||||
if not owner_person:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_418_IM_A_TEAPOT,
|
||||
detail=dict(
|
||||
data_dict["expiry_starts"] = str(system_arrow.now())
|
||||
data_dict["is_tenant_live"] = bool(data.is_tenant_live)
|
||||
data_dict["build_parts_id"] = build_part.id
|
||||
if data_dict["is_tenant_live"]:
|
||||
owner_person = getattr(last_living_space, "owner_person_id", None)
|
||||
if not owner_person:
|
||||
BuildLivingSpace.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
error_case="UNAUTHORIZED",
|
||||
message="Owner person of build part is not defined. Please register owner of part first.",
|
||||
data=build_part.get_dict(),
|
||||
),
|
||||
)
|
||||
data_dict["life_person_id"] = life_person.id
|
||||
data_dict["owner_person_id"] = owner_person
|
||||
else:
|
||||
data_dict["life_person_id"] = life_person.id
|
||||
data_dict["owner_person_id"] = life_person.id
|
||||
del data_dict["build_parts_uu_id"], data_dict["life_person_uu_id"]
|
||||
)
|
||||
data_dict["life_person_id"] = life_person.id
|
||||
data_dict["owner_person_id"] = owner_person
|
||||
else:
|
||||
data_dict["life_person_id"] = life_person.id
|
||||
data_dict["owner_person_id"] = life_person.id
|
||||
del data_dict["build_parts_uu_id"], data_dict["life_person_uu_id"]
|
||||
|
||||
|
||||
BuildingLivingSpacesPartsListEventMethod = BuildingLivingSpacesPartsListEventMethods(
|
||||
|
|
|
|||
|
|
@ -61,18 +61,18 @@ class CompanyCreateEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def company_create(
|
||||
cls, data: InsertCompany, token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
cls,
|
||||
data: InsertCompany,
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
created_company = Companies.create_action(
|
||||
data=data, token=token_dict
|
||||
)
|
||||
created_company = Companies.create_action(data=data, token=token_dict)
|
||||
created_company.related_company = token_dict.selected_company.company_uu_id
|
||||
created_company.save()
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Create Company record",
|
||||
"data": created_company.get_dict()
|
||||
"data": created_company.get_dict(),
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
|
|
@ -86,26 +86,39 @@ class CompanyUpdateEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def company_update(cls, company_uu_id: str, data: UpdateCompany, token_dict):
|
||||
find_one_company = Companies.filter_one(Companies.uu_id == company_uu_id)
|
||||
access_authorized_company = Companies.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
filter_expr=[Companies.id == token_dict.get("")],
|
||||
def company_update(
|
||||
cls,
|
||||
company_uu_id: str,
|
||||
data: UpdateCompany, token_dict: EmployeeTokenObject
|
||||
):
|
||||
Companies.pre_query = Companies.select_action(
|
||||
duty_id_list=[
|
||||
token_dict.selected_company.bulk_duties_id,
|
||||
token_dict.selected_company.duty_id,
|
||||
],
|
||||
)
|
||||
if access_authorized_company.count:
|
||||
updated_company = find_one_company.data.update(**data.excluded_dump())
|
||||
Companies.save()
|
||||
find_one_company = Companies.filter_one(
|
||||
Companies.uu_id == company_uu_id,
|
||||
Companies.valid_record_args(Companies),
|
||||
).data
|
||||
if not find_one_company:
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Update Company record",
|
||||
"data": updated_company,
|
||||
"data": {}
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
status_code=200,
|
||||
)
|
||||
updated_company = find_one_company.update(**data.excluded_dump())
|
||||
Companies.save()
|
||||
return JSONResponse(
|
||||
content={"completed": True, "message": "Update Company record", "data": {}},
|
||||
status_code=status.HTTP_200_OK,
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Update Company record",
|
||||
"data": updated_company,
|
||||
},
|
||||
status_code=200,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -117,11 +130,15 @@ class CompanyPatchEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def company_patch(cls, company_uu_id: str, data: PatchRecord, token_dict):
|
||||
def company_patch(
|
||||
cls, company_uu_id: str, data: PatchRecord, token_dict: EmployeeTokenObject
|
||||
):
|
||||
find_one_company = Companies.find_one_or_abort(uu_id=company_uu_id)
|
||||
access_authorized_company = Companies.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
filter_expr=[Companies.id == find_one_company.id],
|
||||
duty_id_list=[
|
||||
token_dict.selected_company.bulk_duties_id,
|
||||
token_dict.selected_company.duty_id,
|
||||
],
|
||||
)
|
||||
if access_authorized_company.count:
|
||||
action = data.excluded_dump()
|
||||
|
|
@ -152,7 +169,6 @@ class CompanyPatchEventMethods(MethodToEvent):
|
|||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
|
||||
|
||||
CompanyPatchEventMethod = CompanyListEventMethods(
|
||||
action=ActionsSchema(endpoint="/company/list")
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Optional, Union
|
||||
from typing import Optional
|
||||
from fastapi import status
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ from api_validations.validations_request import (
|
|||
from databases import Departments
|
||||
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ class DepartmentListEventMethods(MethodToEvent):
|
|||
def department_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
Departments.filter_attr = list_options
|
||||
records = Departments.filter_active(
|
||||
|
|
@ -58,7 +58,9 @@ class DepartmentCreateEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def super_user_department_create(cls, data: DepartmentsPydantic, token_dict):
|
||||
def super_user_department_create(
|
||||
cls, data: DepartmentsPydantic, token_dict: EmployeeTokenObject,
|
||||
):
|
||||
data_dict = data.excluded_dump()
|
||||
data_dict["company_id"] = token_dict.selected_company.company_id
|
||||
data_dict["company_uu_id"] = token_dict.selected_company.company_uu_id
|
||||
|
|
@ -83,7 +85,7 @@ class DepartmentUpdateEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def department_update(
|
||||
cls, company_uu_id: str, data: DepartmentsPydantic, token_dict
|
||||
cls, company_uu_id: str, data: DepartmentsPydantic, token_dict: EmployeeTokenObject,
|
||||
):
|
||||
find_one_company = Departments.filter_one(Departments.uu_id == company_uu_id)
|
||||
access_authorized_company = Departments.select_action(
|
||||
|
|
@ -116,7 +118,9 @@ class DepartmentPatchEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def department_patch(cls, company_uu_id: str, data: PatchRecord, token_dict):
|
||||
def department_patch(
|
||||
cls, company_uu_id: str, data: PatchRecord, token_dict: EmployeeTokenObject
|
||||
):
|
||||
find_one_company = Departments.find_one_or_abort(uu_id=company_uu_id)
|
||||
access_authorized_company = Departments.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
from typing import Union
|
||||
|
||||
from fastapi import status
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
|
|
@ -14,7 +12,7 @@ from api_validations.validations_request import (
|
|||
from databases import Departments, Duty, Duties
|
||||
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject
|
||||
|
||||
|
||||
class DutiesListEventMethods(MethodToEvent):
|
||||
|
|
@ -28,7 +26,7 @@ class DutiesListEventMethods(MethodToEvent):
|
|||
def duties_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
Duties.filter_attr = list_options
|
||||
records = Duties.filter_all(
|
||||
|
|
@ -53,7 +51,7 @@ class DutiesGetByUUIDEventMethods(MethodToEvent):
|
|||
def duties_get_by_uuid(
|
||||
cls,
|
||||
data: SelectDuties,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
|
||||
duty = Duty.filter_one(Duty.uu_id == data.duty_uu_id).data
|
||||
|
|
@ -98,7 +96,7 @@ class DutiesCreateEventMethods(MethodToEvent):
|
|||
def duties_create(
|
||||
cls,
|
||||
data: InsertDuties,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
duty = Duty.filter_one(Duty.uu_id == data.duties_uu_id).data
|
||||
department = Departments.filter_one(Duty.uu_id == data.department_uu_id).data
|
||||
|
|
@ -144,7 +142,12 @@ class DutiesUpdateEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def duties_update(cls, duties_uu_id: str, data: UpdateDuties, token_dict):
|
||||
def duties_update(
|
||||
cls,
|
||||
duties_uu_id: str,
|
||||
data: UpdateDuties,
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
find_one_duties = Duties.find_one_or_abort(uu_id=duties_uu_id)
|
||||
access_authorized_duties = Duties.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
|
|
@ -174,7 +177,9 @@ class DutiesPatchEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def duties_patch(cls, duties_uu_id: str, data: PatchRecord, token_dict):
|
||||
def duties_patch(
|
||||
cls, duties_uu_id: str, data: PatchRecord, token_dict: EmployeeTokenObject,
|
||||
):
|
||||
find_one_duties = Duties.find_one_or_abort(uu_id=duties_uu_id)
|
||||
access_authorized_duties = Duties.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
from typing import Union
|
||||
|
||||
from fastapi import status
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
|
|
@ -27,7 +25,7 @@ class DutyListEventMethods(MethodToEvent):
|
|||
def duty_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
records = Duty.filter_active(
|
||||
*Duty.get_smart_query(list_options.query),
|
||||
|
|
@ -50,7 +48,7 @@ class DutyCreateEventMethods(MethodToEvent):
|
|||
def duty_create(
|
||||
cls,
|
||||
data: InsertCompanyDuty,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
created_duty = Duty.find_or_create(**data.excluded_dump())
|
||||
Duty.save()
|
||||
|
|
@ -76,7 +74,7 @@ class DutyUpdateEventMethods(MethodToEvent):
|
|||
cls,
|
||||
company_uu_id: str,
|
||||
data,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
find_one_company = Duty.find_one_or_abort(uu_id=company_uu_id)
|
||||
access_authorized_company = Duty.select_action(
|
||||
|
|
@ -109,7 +107,9 @@ class DutyPatchEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def duty_patch(cls, company_uu_id: str, data: PatchRecord, token_dict):
|
||||
def duty_patch(
|
||||
cls, company_uu_id: str, data: PatchRecord, token_dict: EmployeeTokenObject,
|
||||
):
|
||||
find_one_company = Duty.find_one_or_abort(uu_id=company_uu_id)
|
||||
access_authorized_company = Duty.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
from datetime import datetime
|
||||
from typing import Union
|
||||
|
||||
from fastapi import status, HTTPException
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
|
|
@ -30,7 +27,7 @@ class EmployeeListEventMethods(MethodToEvent):
|
|||
def employee_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
Employees.filter_attr = list_options
|
||||
records = Employees.filter_active(
|
||||
|
|
@ -55,7 +52,7 @@ class EmployeeCreateEventMethods(MethodToEvent):
|
|||
def employee_create(
|
||||
cls,
|
||||
data: InsertEmployees,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
person = People.filter_one(
|
||||
People.uu_id == data.people_uu_id,
|
||||
|
|
@ -99,7 +96,9 @@ class EmployeeUpdateEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def employee_update(cls, employee_uu_id: str, data: PatchRecord, token_dict):
|
||||
def employee_update(
|
||||
cls, employee_uu_id: str, data: PatchRecord, token_dict: EmployeeTokenObject,
|
||||
):
|
||||
find_one_employee = Employees.filter_one(
|
||||
Employees.uu_id == employee_uu_id,
|
||||
*Employees.valid_record_args(Employees),
|
||||
|
|
@ -142,7 +141,7 @@ class EmployeePatchEventMethods(MethodToEvent):
|
|||
cls,
|
||||
employee_uu_id: str,
|
||||
data: PatchRecord,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
find_one_employee = Employees.find_one_or_abort(uu_id=employee_uu_id)
|
||||
access_authorized_employee = Employees.select_action(
|
||||
|
|
@ -186,7 +185,9 @@ class Employee2PeopleEmployEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def company_employee_employ(cls, data: BindEmployees2People, token_dict):
|
||||
def company_employee_employ(
|
||||
cls, data: BindEmployees2People, token_dict: EmployeeTokenObject,
|
||||
):
|
||||
selected_staff = Staff.filter_one(
|
||||
Staff.uu_id == data.staff_uu_id,
|
||||
*Staff.valid_record_args(Staff),
|
||||
|
|
@ -248,7 +249,9 @@ class Employee2PeopleFireEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def company_employee_fire(cls, data: BindEmployees2People, token_dict):
|
||||
def company_employee_fire(
|
||||
cls, data: BindEmployees2People, token_dict: EmployeeTokenObject,
|
||||
):
|
||||
selected_people = People.filter_one(
|
||||
People.uu_id == data.people_uu_id,
|
||||
*People.valid_record_args(People),
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from api_validations.validations_request import (
|
|||
from databases import Staff, Duties
|
||||
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
|
||||
|
||||
|
|
@ -23,7 +23,9 @@ class StaffListEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def staff_list(cls, list_options: ListOptions, token_dict):
|
||||
def staff_list(
|
||||
cls, list_options: ListOptions, token_dict: EmployeeTokenObject
|
||||
):
|
||||
Staff.filter_attr = list_options
|
||||
records = Staff.filter_active(
|
||||
*Staff.get_smart_query(smart_query=list_options.query),
|
||||
|
|
@ -42,7 +44,9 @@ class StaffCreateEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def staff_create(cls, data: InsertStaff, token_dict: EmployeeTokenObject):
|
||||
def staff_create(
|
||||
cls, data: InsertStaff, token_dict: EmployeeTokenObject
|
||||
):
|
||||
data_dict = data.excluded_dump()
|
||||
duties = Duties.filter_one(
|
||||
Duties.uu_id == data.duties_uu_id,
|
||||
|
|
@ -74,7 +78,9 @@ class StaffGetByUUIDEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def staff_get_by_uu_id(cls, data: SelectStaff, token_dict):
|
||||
def staff_get_by_uu_id(
|
||||
cls, data: SelectStaff, token_dict: EmployeeTokenObject
|
||||
):
|
||||
if data.duties_uu_id:
|
||||
duties_id = Duties.filter_one(
|
||||
Duties.uu_id == data.duties_uu_id, *Duties.valid_record_args(Duties)
|
||||
|
|
@ -111,7 +117,9 @@ class StaffUpdateEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def staff_update(cls, staff_uu_id: str, data, token_dict):
|
||||
def staff_update(
|
||||
cls, staff_uu_id: str, data, token_dict: EmployeeTokenObject
|
||||
):
|
||||
return JSONResponse(
|
||||
content={"completed": True, "message": "Update Staff record", "data": {}},
|
||||
status_code=status.HTTP_200_OK,
|
||||
|
|
@ -126,7 +134,9 @@ class StaffPatchEventMethods(MethodToEvent):
|
|||
}
|
||||
|
||||
@classmethod
|
||||
def staff_patch(cls, staff_uu_id: str, data: PatchRecord, token_dict):
|
||||
def staff_patch(
|
||||
cls, staff_uu_id: str, data: PatchRecord, token_dict: EmployeeTokenObject
|
||||
):
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": False,
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ from fastapi import status
|
|||
from fastapi.responses import JSONResponse
|
||||
|
||||
from databases import (
|
||||
Build,
|
||||
People,
|
||||
Users,
|
||||
Companies,
|
||||
)
|
||||
|
||||
from api_validations.validations_request import InsertPerson, UpdateUsers
|
||||
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
|
|
@ -22,18 +22,40 @@ class PeopleListEventMethods(MethodToEvent):
|
|||
__event_keys__ = {
|
||||
"0a05f03c-6ed8-4230-a4ff-6e7cf886909b": "super_users_people_list",
|
||||
"b5612538-0445-4a4a-ab13-d2a06037f7a5": "sales_users_people_list",
|
||||
"c81c2cec-d32c-4cf2-9727-d4493e11ee1f": "human_resources_users_people_list",
|
||||
"d1b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b": "people_list_only_occupant_tenant_or_owner",
|
||||
"25cbbaf8-117a-470f-a844-2cfc70f71dde": "human_resources_users_people_list",
|
||||
"cdf62f06-ec50-40de-b19e-adb3dd34bb95": "people_list_only_occupant_tenant_or_owner",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def super_users_people_list(
|
||||
cls, list_options, token_dict: Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
cls,
|
||||
list_options,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
):
|
||||
records = People.filter_all(
|
||||
*People.get_smart_query(smart_query=list_options.query),
|
||||
*People.valid_record_args(People),
|
||||
).data
|
||||
records = []
|
||||
if isinstance(token_dict, EmployeeTokenObject):
|
||||
People.pre_query = People.select_action(
|
||||
duty_id_list=[
|
||||
token_dict.selected_company.duty_id,
|
||||
token_dict.selected_company.bulk_duties_id,
|
||||
],
|
||||
)
|
||||
records = People.filter_all(
|
||||
*People.get_smart_query(smart_query=list_options.query),
|
||||
*People.valid_record_args(People),
|
||||
).data
|
||||
elif isinstance(token_dict, OccupantTokenObject):
|
||||
related_users =Users.filter_all(
|
||||
Users.related_company == token_dict.selected_occupant.responsible_company_id,
|
||||
).data
|
||||
People.pre_query = People.filter_all(
|
||||
People.id.in_([user.person_id for user in related_users]),
|
||||
*People.valid_record_args(People),
|
||||
).query
|
||||
records = People.filter_all(
|
||||
*People.get_smart_query(smart_query=list_options.query),
|
||||
*People.valid_record_args(People),
|
||||
).data
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="People are listed successfully",
|
||||
|
|
@ -42,7 +64,9 @@ class PeopleListEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def sales_users_people_list(
|
||||
cls, list_options, token_dict: Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
cls,
|
||||
list_options,
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
records = People.filter_all(
|
||||
*People.get_smart_query(smart_query=list_options.query),
|
||||
|
|
@ -56,12 +80,15 @@ class PeopleListEventMethods(MethodToEvent):
|
|||
|
||||
@classmethod
|
||||
def human_resources_users_people_list(
|
||||
cls, list_options, token_dict: Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
cls,
|
||||
list_options,
|
||||
token_dict: EmployeeTokenObject,
|
||||
):
|
||||
records = People.filter_all(
|
||||
*People.get_smart_query(smart_query=list_options.query),
|
||||
*People.valid_record_args(People),
|
||||
).data
|
||||
if isinstance(token_dict, EmployeeTokenObject):
|
||||
records = People.filter_all(
|
||||
*People.get_smart_query(smart_query=list_options.query),
|
||||
*People.valid_record_args(People),
|
||||
).data
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="People are listed successfully",
|
||||
|
|
@ -82,8 +109,12 @@ class PeopleCreateEventMethods(MethodToEvent):
|
|||
data: InsertPerson,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
created_user = People.create_action(data=data, token=token_dict)
|
||||
People.save()
|
||||
if isinstance(token_dict, EmployeeTokenObject):
|
||||
created_user = People.create_action(data=data, token=token_dict)
|
||||
People.save()
|
||||
elif isinstance(token_dict, OccupantTokenObject):
|
||||
created_user = People.create_action(data=data, token=token_dict)
|
||||
People.save()
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
|
|
@ -108,26 +139,42 @@ class PeopleUpdateEventMethods(MethodToEvent):
|
|||
user_uu_id: str,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
find_one_user = Users.filter_one(
|
||||
Users.uu_id == user_uu_id,
|
||||
*Users.valid_record_args(Users),
|
||||
).data
|
||||
access_authorized_company = Companies.select_action(
|
||||
duty_id_list=[getattr(token_dict, "duty_id")],
|
||||
filter_expr=[Companies.id == find_one_user.id],
|
||||
)
|
||||
if access_authorized_company.count:
|
||||
data_dict = data.excluded_dump()
|
||||
updated_user = find_one_user.update(**data_dict)
|
||||
Users.save()
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Update User record",
|
||||
"data": updated_user,
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
data_dict = data.excluded_dump()
|
||||
if isinstance(token_dict, EmployeeTokenObject):
|
||||
find_one_user = Users.filter_one(
|
||||
Users.uu_id == user_uu_id,
|
||||
*Users.valid_record_args(Users),
|
||||
).data
|
||||
access_authorized_company = Companies.select_action(
|
||||
duty_id_list=[
|
||||
token_dict.selected_company.duty_id,
|
||||
token_dict.selected_company.bulk_duties_id
|
||||
],
|
||||
)
|
||||
if access_authorized_company.count:
|
||||
updated_user = find_one_user.update(**data_dict)
|
||||
Users.save()
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Update User record",
|
||||
"data": updated_user,
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
elif isinstance(token_dict, OccupantTokenObject):
|
||||
find_one_user = People.filter_one(
|
||||
People.uu_id == user_uu_id,
|
||||
*People.valid_record_args(People),
|
||||
).data
|
||||
access_authorized_company = Companies.select_action(
|
||||
duty_id_list=[getattr(token_dict, "duty_id")],
|
||||
filter_expr=[Companies.id == find_one_user.id],
|
||||
)
|
||||
if access_authorized_company.count:
|
||||
data_dict = data.excluded_dump()
|
||||
updated_user = find_one_user.update(**data_dict)
|
||||
People.save()
|
||||
return JSONResponse(
|
||||
content={"completed": True, "message": "Update User record", "data": {}},
|
||||
status_code=status.HTTP_200_OK,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ def parse_token_object_to_dict(request): # from requests import Request
|
|||
selected_event = Events.filter_all(
|
||||
Events.endpoint_id == endpoint_active.id,
|
||||
Events.id.in_(valid_token.selected_company.reachable_event_list_id),
|
||||
*Events.valid_record_args(Events)
|
||||
*Events.valid_record_args(Events),
|
||||
)
|
||||
if not selected_event.data:
|
||||
raise HTTPException(
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ from .authentication import (
|
|||
OccupantSelection,
|
||||
EmployeeSelection,
|
||||
)
|
||||
from .account_records import (
|
||||
InsertAccountRecord,
|
||||
UpdateAccountRecord,
|
||||
)
|
||||
|
||||
from .build_living_space import (
|
||||
InsertBuildLivingSpace,
|
||||
UpdateBuildLivingSpace,
|
||||
|
|
@ -152,6 +157,8 @@ __all__ = [
|
|||
"CreatePassword",
|
||||
"OccupantSelection",
|
||||
"EmployeeSelection",
|
||||
"InsertAccountRecord",
|
||||
"UpdateAccountRecord",
|
||||
"InsertBuildLivingSpace",
|
||||
"UpdateBuildLivingSpace",
|
||||
"InsertBuildParts",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
from api_validations.core_validations import BaseModelRegular
|
||||
from api_validations.validations_request import (
|
||||
PydanticBaseModel,
|
||||
ListOptions,
|
||||
)
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class InsertAccountRecord(BaseModelRegular):
|
||||
iban: str
|
||||
bank_date: str
|
||||
currency_value: float
|
||||
bank_balance: float
|
||||
currency: str
|
||||
additional_balance: float
|
||||
channel_branch: str
|
||||
process_name: str
|
||||
process_type: str
|
||||
process_comment: str
|
||||
bank_reference_code: str
|
||||
|
||||
add_comment_note: Optional[str] = None
|
||||
is_receipt_mail_send: Optional[bool] = None
|
||||
found_from: Optional[str] = None
|
||||
similarity: Optional[float] = None
|
||||
remainder_balance: Optional[float] = None
|
||||
bank_date_y: Optional[int] = None
|
||||
bank_date_m: Optional[int] = None
|
||||
bank_date_w: Optional[int] = None
|
||||
bank_date_d: Optional[int] = None
|
||||
approving_accounting_record: Optional[bool] = None
|
||||
accounting_receipt_date: Optional[str] = None
|
||||
accounting_receipt_number: Optional[int] = None
|
||||
approved_record: Optional[bool] = None
|
||||
import_file_name: Optional[str] = None
|
||||
receive_debit_uu_id: Optional[str] = None
|
||||
budget_type_uu_id: Optional[str] = None
|
||||
company_uu_id: Optional[str] = None
|
||||
send_company_uu_id: Optional[str] = None
|
||||
customer_id: Optional[str] = None
|
||||
customer_uu_id: Optional[str] = None
|
||||
send_person_uu_id: Optional[str] = None
|
||||
approving_accounting_person_uu_id: Optional[str] = None
|
||||
build_parts_uu_id: Optional[str] = None
|
||||
build_decision_book_uu_id: Optional[str] = None
|
||||
|
||||
|
||||
class UpdateAccountRecord(BaseModelRegular):
|
||||
iban: Optional[str] = None
|
||||
bank_date: Optional[str] = None
|
||||
currency_value: Optional[float] = None
|
||||
bank_balance: Optional[float] = None
|
||||
currency: Optional[str] = None
|
||||
additional_balance: Optional[float] = None
|
||||
channel_branch: Optional[str] = None
|
||||
process_name: Optional[str] = None
|
||||
process_type: Optional[str] = None
|
||||
process_comment: Optional[str] = None
|
||||
bank_reference_code: Optional[str] = None
|
||||
|
||||
add_comment_note: Optional[str] = None
|
||||
is_receipt_mail_send: Optional[bool] = None
|
||||
found_from: Optional[str] = None
|
||||
similarity: Optional[float] = None
|
||||
remainder_balance: Optional[float] = None
|
||||
bank_date_y: Optional[int] = None
|
||||
bank_date_m: Optional[int] = None
|
||||
bank_date_w: Optional[int] = None
|
||||
bank_date_d: Optional[int] = None
|
||||
approving_accounting_record: Optional[bool] = None
|
||||
accounting_receipt_date: Optional[str] = None
|
||||
accounting_receipt_number: Optional[int] = None
|
||||
approved_record: Optional[bool] = None
|
||||
import_file_name: Optional[str] = None
|
||||
receive_debit_uu_id: Optional[str] = None
|
||||
budget_type_uu_id: Optional[str] = None
|
||||
company_uu_id: Optional[str] = None
|
||||
send_company_uu_id: Optional[str] = None
|
||||
customer_id: Optional[str] = None
|
||||
customer_uu_id: Optional[str] = None
|
||||
send_person_uu_id: Optional[str] = None
|
||||
approving_accounting_person_uu_id: Optional[str] = None
|
||||
build_parts_uu_id: Optional[str] = None
|
||||
build_decision_book_uu_id: Optional[str] = None
|
||||
|
|
@ -6,7 +6,7 @@ from api_validations.validations_request import (
|
|||
)
|
||||
|
||||
|
||||
class InsertCompany(PydanticBaseModel):
|
||||
class InsertCompany(BaseModelRegular):
|
||||
formal_name: str
|
||||
company_type: str
|
||||
commercial_type: str
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ class AuthModule(PasswordModule):
|
|||
@classmethod
|
||||
def check_user_exits(cls, access_key, domain):
|
||||
from databases import Users
|
||||
|
||||
found_user = Users.query.filter(
|
||||
or_(
|
||||
Users.email == str(access_key).lower(),
|
||||
|
|
@ -196,13 +197,7 @@ class AuthModule(PasswordModule):
|
|||
join_list = [
|
||||
_ for _ in str(self.password_expires_day).split(",")[0] if _.isdigit()
|
||||
]
|
||||
return float(
|
||||
timedelta(
|
||||
days=int(
|
||||
"".join(join_list)
|
||||
)
|
||||
).seconds
|
||||
)
|
||||
return float(timedelta(days=int("".join(join_list))).seconds)
|
||||
|
||||
|
||||
class UserLoginModule(AuthModule):
|
||||
|
|
|
|||
|
|
@ -69,12 +69,12 @@ class RelationshipDutyCompany(CrudCollection):
|
|||
)
|
||||
list_match_company_id = []
|
||||
send_duties = Duties.filter_one(
|
||||
Duties.uu_id==data.duty_uu_id,
|
||||
Duties.uu_id == data.duty_uu_id,
|
||||
*Duties.valid_record_args(Duties),
|
||||
)
|
||||
send_user_duties = Duties.filter_one(
|
||||
Duties.duties_id==send_duties.id,
|
||||
Duties.company_id==token_duties_id,
|
||||
Duties.duties_id == send_duties.id,
|
||||
Duties.company_id == token_duties_id,
|
||||
*Duties.valid_record_args(Duties),
|
||||
)
|
||||
if not send_user_duties:
|
||||
|
|
@ -84,13 +84,13 @@ class RelationshipDutyCompany(CrudCollection):
|
|||
|
||||
for company_uu_id in list(data.match_company_uu_id):
|
||||
company = Companies.filter_one(
|
||||
Companies.uu_id==company_uu_id,
|
||||
Companies.uu_id == company_uu_id,
|
||||
*Companies.valid_record_args(Companies),
|
||||
)
|
||||
bulk_company = RelationshipDutyCompany.filter_one(
|
||||
RelationshipDutyCompany.owner_id==token_company_id,
|
||||
RelationshipDutyCompany.relationship_type=="Bulk",
|
||||
RelationshipDutyCompany.member_id==company.id,
|
||||
RelationshipDutyCompany.owner_id == token_company_id,
|
||||
RelationshipDutyCompany.relationship_type == "Bulk",
|
||||
RelationshipDutyCompany.member_id == company.id,
|
||||
*RelationshipDutyCompany.valid_record_args(RelationshipDutyCompany),
|
||||
)
|
||||
if not bulk_company:
|
||||
|
|
@ -121,12 +121,12 @@ class RelationshipDutyCompany(CrudCollection):
|
|||
)
|
||||
list_match_company_id = []
|
||||
send_duties = Duties.filter_one(
|
||||
Duties.uu_id==data.duty_uu_id,
|
||||
Duties.uu_id == data.duty_uu_id,
|
||||
*Duties.valid_record_args(Duties),
|
||||
)
|
||||
send_user_duties = Duties.filter_one(
|
||||
Duties.duties_id==send_duties.id,
|
||||
Duties.company_id==token_duties_id,
|
||||
Duties.duties_id == send_duties.id,
|
||||
Duties.company_id == token_duties_id,
|
||||
*Duties.valid_record_args(Duties),
|
||||
)
|
||||
if not send_user_duties:
|
||||
|
|
@ -136,13 +136,13 @@ class RelationshipDutyCompany(CrudCollection):
|
|||
|
||||
for company_uu_id in list(data.match_company_uu_id):
|
||||
company = Companies.filter_one(
|
||||
Companies.uu_id==company_uu_id,
|
||||
Companies.uu_id == company_uu_id,
|
||||
*Companies.valid_record_args(Companies),
|
||||
)
|
||||
bulk_company = RelationshipDutyCompany.filter_one(
|
||||
RelationshipDutyCompany.owner_id==token_company_id,
|
||||
RelationshipDutyCompany.relationship_type=="Bulk",
|
||||
RelationshipDutyCompany.member_id==company.id,
|
||||
RelationshipDutyCompany.owner_id == token_company_id,
|
||||
RelationshipDutyCompany.relationship_type == "Bulk",
|
||||
RelationshipDutyCompany.member_id == company.id,
|
||||
*RelationshipDutyCompany.valid_record_args(RelationshipDutyCompany),
|
||||
)
|
||||
if not bulk_company:
|
||||
|
|
@ -249,7 +249,7 @@ class Companies(CrudCollection, SelectAction):
|
|||
if cls.filter_one(cls.tax_no == str(data.tax_no).strip(), system=True).data:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail="Company already exists. Please ask supervisor to make company visible for your duty."
|
||||
detail="Company already exists. Please ask supervisor to make company visible for your duty.",
|
||||
)
|
||||
|
||||
official_address = Addresses.filter_one(
|
||||
|
|
@ -298,7 +298,7 @@ class Companies(CrudCollection, SelectAction):
|
|||
company_id = token.get("company_id")
|
||||
if data.official_address_uu_id:
|
||||
official_address = Addresses.filter_one(
|
||||
Addresses.uu_id==data.official_address_uu_id,
|
||||
Addresses.uu_id == data.official_address_uu_id,
|
||||
*Addresses.valid_record_args(Addresses),
|
||||
).data
|
||||
data_dict["official_address_id"] = official_address.id
|
||||
|
|
|
|||
|
|
@ -182,7 +182,9 @@ class Duties(CrudCollection):
|
|||
def get_bulk_duties_of_a_company(cls, company_id):
|
||||
duties_id = Duty.filter_by_one(system=True, duty_code="BULK").data
|
||||
if bulk_duties := Duties.filter_by_one(
|
||||
duties_id=getattr(duties_id,'id', None), company_id=company_id, **Duties.valid_record_dict
|
||||
duties_id=getattr(duties_id, "id", None),
|
||||
company_id=company_id,
|
||||
**Duties.valid_record_dict,
|
||||
).data:
|
||||
return bulk_duties
|
||||
raise Exception("Bulk Duty not found. Please contact with supervisor.")
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@ class CrudMixin(Base, SmartQueryMixin, SessionMixin, FilterAttributes):
|
|||
if getattr(cls.creds, "person_id", None) and getattr(
|
||||
cls.creds, "person_name", None
|
||||
):
|
||||
cls.created_by_id = cls.creds.get('person_id', "Unknown")
|
||||
cls.created_by = cls.creds.get('person_name', "Unknown")
|
||||
cls.created_by_id = cls.creds.get("person_id", "Unknown")
|
||||
cls.created_by = cls.creds.get("person_name", "Unknown")
|
||||
created_record.flush()
|
||||
return created_record
|
||||
|
||||
|
|
@ -223,14 +223,14 @@ class CrudMixin(Base, SmartQueryMixin, SessionMixin, FilterAttributes):
|
|||
if getattr(self.creds, "person_id", None) and getattr(
|
||||
self.creds, "person_name", None
|
||||
):
|
||||
self.confirmed_by_id = self.creds.get('person_id', "Unknown")
|
||||
self.confirmed_by = self.creds.get('person_name', "Unknown")
|
||||
self.confirmed_by_id = self.creds.get("person_id", "Unknown")
|
||||
self.confirmed_by = self.creds.get("person_name", "Unknown")
|
||||
else:
|
||||
if getattr(self.creds, "person_id", None) and getattr(
|
||||
self.creds, "person_name", None
|
||||
):
|
||||
self.updated_by_id = self.creds.get('person_id', "Unknown")
|
||||
self.updated_by = self.creds.get('person_id', "Unknown")
|
||||
self.updated_by_id = self.creds.get("person_id", "Unknown")
|
||||
self.updated_by = self.creds.get("person_id", "Unknown")
|
||||
self.flush()
|
||||
return self
|
||||
|
||||
|
|
@ -273,7 +273,11 @@ class CrudMixin(Base, SmartQueryMixin, SessionMixin, FilterAttributes):
|
|||
self.__exclude__fields__ or [] + self.__system_default_model__
|
||||
)
|
||||
columns_list = list(set(self.columns).difference(set(exclude_list)))
|
||||
columns_list = [columns for columns in columns_list if str(columns)[-2:] != "id" and 'uu_id' not in str(columns)]
|
||||
columns_list = [
|
||||
columns
|
||||
for columns in columns_list
|
||||
if str(columns)[-2:] != "id" and "uu_id" not in str(columns)
|
||||
]
|
||||
for key in list(columns_list):
|
||||
val = getattr(self, key)
|
||||
correct, value_of_database = self.iterate_over_variables(val, key)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from .authentication.router import login_route
|
||||
from .account.router import account_records_router
|
||||
from .people.router import people_router
|
||||
from .users.router import user_route
|
||||
|
||||
|
|
@ -34,11 +35,11 @@ from .company.staff.router import staff_route
|
|||
from .company.employee.router import employee_route
|
||||
|
||||
from .events.events.bind_events_router import bind_events_route
|
||||
from .events.models.router import model_route
|
||||
from .events.models.bind_events_router import bind_modules_route
|
||||
|
||||
from .events.modelentities.router import model_entities_route
|
||||
from .events.modules.router import modules_route
|
||||
from service_app.routers.events.modules.bind_events_router import bind_modules_route
|
||||
|
||||
|
||||
from .events.services.bind_services_router import bind_services_route
|
||||
from .events.services.router import services_route
|
||||
|
||||
|
|
@ -53,6 +54,7 @@ from .decision_book.decision_book_invitations.router import (
|
|||
|
||||
|
||||
__all__ = [
|
||||
"account_records_router",
|
||||
"enums_route",
|
||||
"occupant_types_route",
|
||||
"internal_route",
|
||||
|
|
@ -79,8 +81,6 @@ __all__ = [
|
|||
"build_types_route",
|
||||
"bind_events_route",
|
||||
"event_route",
|
||||
"model_route",
|
||||
"model_entities_route",
|
||||
"modules_route",
|
||||
"bind_services_route",
|
||||
"bind_modules_route",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
from fastapi.routing import APIRouter
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
InsertAccountRecord,
|
||||
UpdateAccountRecord,
|
||||
SearchAddress,
|
||||
ListOptions,
|
||||
PatchRecord,
|
||||
)
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
|
||||
|
||||
account_records_router = APIRouter(prefix="/account/records", tags=["Account Records"])
|
||||
account_records_router.include_router(account_records_router, include_in_schema=True)
|
||||
|
||||
|
||||
@account_records_router.post(path="/list", summary="List Active/Delete/Confirm Address")
|
||||
def address_list(request: Request, list_options: ListOptions):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(list_options=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@account_records_router.post(path="/create", summary="Create Address with given auth levels")
|
||||
def address_create(request: Request, data: InsertAccountRecord):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@account_records_router.post(path="/search", summary="Search Address with given auth levels")
|
||||
def address_search(request: Request, data: SearchAddress):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@account_records_router.post(
|
||||
path="/update/{address_uu_id}", summary="Update Address with given auth levels"
|
||||
)
|
||||
def address_update(request: Request, address_uu_id: str, data: UpdateAccountRecord):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(
|
||||
data=data, address_uu_id=address_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
||||
|
||||
@account_records_router.patch(
|
||||
path="/patch/{address_uu_id}", summary="Update Address Active/Delete/Confirm"
|
||||
)
|
||||
def address_patch(request: Request, address_uu_id: str, data: PatchRecord):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(
|
||||
data=data, address_uu_id=address_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
|
@ -29,6 +29,7 @@ from api_events.events import (
|
|||
AuthenticationDownloadAvatarEventMethod,
|
||||
)
|
||||
|
||||
|
||||
login_route = APIRouter(prefix="/authentication", tags=["Authentication"])
|
||||
login_route.include_router(login_route, include_in_schema=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
from fastapi import status
|
||||
from fastapi.routing import APIRouter
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
|
|
@ -11,11 +9,6 @@ from api_validations.validations_request import (
|
|||
)
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from databases import (
|
||||
BuildArea,
|
||||
Build,
|
||||
)
|
||||
|
||||
|
||||
build_area_route = APIRouter(prefix="/building/area", tags=["Building Area"])
|
||||
|
|
@ -25,84 +18,22 @@ build_area_route.include_router(build_area_route, include_in_schema=True)
|
|||
@build_area_route.post(path="/list", summary="List Active/Delete/Confirm Build Parts")
|
||||
def build_area_list(request: Request, list_options: ListOptions):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
Build.filter_attr = list_options
|
||||
records = BuildArea.filter_active(
|
||||
*BuildArea.get_smart_query(smart_query=list_options.query),
|
||||
BuildArea.company_id == token_dict.selected_company.company_id,
|
||||
)
|
||||
return return_json_response_from_alchemy(response=records, pagination=list_options)
|
||||
return token_dict.available_event(list_options=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_area_route.post(
|
||||
path="/create", summary="Create BuildParts with given auth levels"
|
||||
)
|
||||
@build_area_route.post(path="/create", summary="Create BuildParts with given auth levels")
|
||||
def build_area_create(request: Request, data: InsertBuildArea):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
created_build = BuildArea.create_action(data=data, token=token_dict)
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Create BuildParts record",
|
||||
"data": created_build.get_dict(),
|
||||
"build": created_build,
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_area_route.post(
|
||||
path="/update/{build_uu_id}", summary="Update BuildParts with given auth levels"
|
||||
)
|
||||
@build_area_route.post(path="/update/{build_uu_id}", summary="Update BuildParts with given auth levels")
|
||||
def build_area_update(request: Request, build_uu_id: str, data: UpdateBuildArea):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
if updated_build := BuildArea.update_action(
|
||||
data=data, token=token_dict, build_uu_id=build_uu_id
|
||||
):
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Update BuildParts record",
|
||||
"data": updated_build,
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return JSONResponse(
|
||||
content={"completed": True, "message": "Update BuildParts record", "data": {}},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_area_route.patch(
|
||||
path="/patch/{build_uu_id}", summary="Update Active/Delete/Confirm"
|
||||
)
|
||||
@build_area_route.patch(path="/patch/{build_uu_id}", summary="Update Active/Delete/Confirm")
|
||||
def build_area_patch(request: Request, build_uu_id: str, data: PatchRecord):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
find_one_build = BuildArea.find_one_or_abort(uu_id=build_uu_id)
|
||||
access_authorized_build = BuildArea.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
filter_expr=[BuildArea.id == find_one_build.id],
|
||||
)
|
||||
if access_authorized_build.count:
|
||||
action = data.excluded_dump()
|
||||
find_one_build.active = bool(action.get("active", find_one_build.active))
|
||||
find_one_build.is_confirmed = bool(
|
||||
action.get("confirm", find_one_build.is_confirmed)
|
||||
)
|
||||
find_one_build.deleted = bool(action.get("delete", find_one_build.deleted))
|
||||
find_one_build.save()
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Patch BuildParts record completed",
|
||||
"data": find_one_build.get_dict(),
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": False,
|
||||
"message": "Patch BuildParts record failed",
|
||||
"data": {},
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
from fastapi import status
|
||||
from fastapi.routing import APIRouter
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
|
|
@ -11,7 +9,6 @@ from api_validations.validations_request import (
|
|||
)
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
from databases import BuildParts
|
||||
|
||||
|
||||
build_parts_route = APIRouter(prefix="/building/parts", tags=["Building Parts"])
|
||||
|
|
@ -39,21 +36,7 @@ def building_build_part_update(
|
|||
request: Request, build_uu_id: str, data: UpdateBuildParts
|
||||
):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
if updated_build := BuildParts.update_action(
|
||||
data=data, token=token_dict, build_uu_id=build_uu_id
|
||||
):
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Update Build Parts record",
|
||||
"data": updated_build,
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return JSONResponse(
|
||||
content={"completed": True, "message": "Update Build Parts record", "data": {}},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_parts_route.patch(
|
||||
|
|
@ -61,32 +44,4 @@ def building_build_part_update(
|
|||
)
|
||||
def building_build_part_patch(request: Request, build_uu_id: str, data: PatchRecord):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
find_one_build = BuildParts.find_one_or_abort(uu_id=build_uu_id)
|
||||
access_authorized_build = BuildParts.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
filter_expr=[BuildParts.id == find_one_build.id],
|
||||
)
|
||||
if access_authorized_build.count:
|
||||
action = data.excluded_dump()
|
||||
find_one_build.active = bool(action.get("active", find_one_build.active))
|
||||
find_one_build.is_confirmed = bool(
|
||||
action.get("confirm", find_one_build.is_confirmed)
|
||||
)
|
||||
find_one_build.deleted = bool(action.get("delete", find_one_build.deleted))
|
||||
find_one_build.save()
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Patch Build record completed",
|
||||
"data": find_one_build.get_dict(),
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": False,
|
||||
"message": "Patch Build record failed",
|
||||
"data": {},
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
from fastapi import status
|
||||
from fastapi.routing import APIRouter
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.requests import Request
|
||||
|
||||
|
||||
from api_validations.validations_request import (
|
||||
PatchRecord,
|
||||
ListOptions,
|
||||
|
|
@ -11,9 +8,7 @@ from api_validations.validations_request import (
|
|||
UpdateBuildSites,
|
||||
)
|
||||
|
||||
from databases import BuildSites
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
|
||||
|
||||
build_sites_route = APIRouter(prefix="/building/sites", tags=["Building Sites"])
|
||||
|
|
@ -23,12 +18,7 @@ build_sites_route.include_router(build_sites_route, include_in_schema=True)
|
|||
@build_sites_route.post(path="/list", summary="List Active/Delete/Confirm Build Parts")
|
||||
def building_sites_list(request: Request, list_options: ListOptions):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
BuildSites.filter_attr = list_options
|
||||
records = BuildSites.filter_active(
|
||||
*BuildSites.get_smart_query(smart_query=list_options.query),
|
||||
BuildSites.company_id == token_dict.selected_company.company_id,
|
||||
)
|
||||
return return_json_response_from_alchemy(response=records, pagination=list_options)
|
||||
return token_dict.available_event(list_options=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_sites_route.post(
|
||||
|
|
@ -36,16 +26,7 @@ def building_sites_list(request: Request, list_options: ListOptions):
|
|||
)
|
||||
def building_sites_create(request: Request, data: InsertBuildSites):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
created_build = BuildSites.create_action(data=data, token=token_dict)
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Create Build Sites record",
|
||||
"data": created_build.get_dict(),
|
||||
"build": created_build,
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_sites_route.post(
|
||||
|
|
@ -53,21 +34,7 @@ def building_sites_create(request: Request, data: InsertBuildSites):
|
|||
)
|
||||
def building_sites_update(request: Request, build_uu_id: str, data: UpdateBuildSites):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
if updated_build := BuildSites.update_action(
|
||||
data=data, token=token_dict, build_uu_id=build_uu_id
|
||||
):
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Update Build Sites record",
|
||||
"data": updated_build,
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return JSONResponse(
|
||||
content={"completed": True, "message": "Update Build Sites record", "data": {}},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_sites_route.patch(
|
||||
|
|
@ -75,32 +42,4 @@ def building_sites_update(request: Request, build_uu_id: str, data: UpdateBuildS
|
|||
)
|
||||
def building_sites_patch(request: Request, build_uu_id: str, data: PatchRecord):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
find_one_build = BuildSites.find_one_or_abort(uu_id=build_uu_id)
|
||||
access_authorized_build = BuildSites.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
filter_expr=[BuildSites.id == find_one_build.id],
|
||||
)
|
||||
if access_authorized_build.count:
|
||||
action = data.excluded_dump()
|
||||
find_one_build.active = bool(action.get("active", find_one_build.active))
|
||||
find_one_build.is_confirmed = bool(
|
||||
action.get("confirm", find_one_build.is_confirmed)
|
||||
)
|
||||
find_one_build.deleted = bool(action.get("delete", find_one_build.deleted))
|
||||
find_one_build.save()
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Patch Build Sites record completed",
|
||||
"data": find_one_build.get_dict(),
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": False,
|
||||
"message": "Patch Build Sites record failed",
|
||||
"data": {},
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
from fastapi import status
|
||||
from fastapi.routing import APIRouter
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
|
|
@ -11,8 +9,6 @@ from api_validations.validations_request import (
|
|||
)
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from databases import BuildTypes
|
||||
|
||||
|
||||
build_types_route = APIRouter(prefix="/building/types", tags=["Types"])
|
||||
|
|
@ -20,12 +16,9 @@ build_types_route.include_router(build_types_route, include_in_schema=True)
|
|||
|
||||
|
||||
@build_types_route.post(path="/list", summary="List Active/Delete/Confirm Build Parts")
|
||||
def building_types_list(list_options: ListOptions):
|
||||
BuildTypes.filter_attr = list_options
|
||||
records = BuildTypes.filter_active(
|
||||
*BuildTypes.get_smart_query(smart_query=list_options.query),
|
||||
)
|
||||
return return_json_response_from_alchemy(response=records, pagination=list_options)
|
||||
def building_types_list(request: Request, list_options: ListOptions):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(list_options=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_types_route.post(
|
||||
|
|
@ -33,16 +26,7 @@ def building_types_list(list_options: ListOptions):
|
|||
)
|
||||
def building_types_create(request: Request, data: InsertBuildTypes):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
created_build = BuildTypes.create_action(data=data, token=token_dict)
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Create BuildParts record",
|
||||
"data": created_build.get_dict(),
|
||||
"build": created_build,
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_types_route.post(
|
||||
|
|
@ -50,21 +34,7 @@ def building_types_create(request: Request, data: InsertBuildTypes):
|
|||
)
|
||||
def building_types_update(request: Request, build_uu_id: str, data: UpdateBuildTypes):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
if updated_build := BuildTypes.update_action(
|
||||
data=data, token=token_dict, build_uu_id=build_uu_id
|
||||
):
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Update BuildParts record",
|
||||
"data": updated_build,
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return JSONResponse(
|
||||
content={"completed": True, "message": "Update BuildParts record", "data": {}},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_types_route.patch(
|
||||
|
|
@ -72,32 +42,4 @@ def building_types_update(request: Request, build_uu_id: str, data: UpdateBuildT
|
|||
)
|
||||
def building_types_patch(request: Request, build_uu_id: str, data: PatchRecord):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
find_one_build = BuildTypes.find_one_or_abort(uu_id=build_uu_id)
|
||||
access_authorized_build = BuildTypes.select_action(
|
||||
duty_id=getattr(token_dict, "duty_id", 5),
|
||||
filter_expr=[BuildTypes.id == find_one_build.id],
|
||||
)
|
||||
if access_authorized_build.count:
|
||||
action = data.excluded_dump()
|
||||
find_one_build.active = bool(action.get("active", find_one_build.active))
|
||||
find_one_build.is_confirmed = bool(
|
||||
action.get("confirm", find_one_build.is_confirmed)
|
||||
)
|
||||
find_one_build.deleted = bool(action.get("delete", find_one_build.deleted))
|
||||
find_one_build.save()
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Patch BuildParts record completed",
|
||||
"data": find_one_build.get_dict(),
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": False,
|
||||
"message": "Patch BuildParts record failed",
|
||||
"data": {},
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
|
|
|||
|
|
@ -13,17 +13,13 @@ build_living_space = APIRouter(prefix="/building/living_space", tags=["Living Sp
|
|||
build_living_space.include_router(build_living_space, include_in_schema=True)
|
||||
|
||||
|
||||
@build_living_space.post(
|
||||
path="/list", summary="List Active/Delete/Confirm Build Living Space"
|
||||
)
|
||||
@build_living_space.post(path="/list", summary="List Active/Delete/Confirm Build Living Space")
|
||||
def building_living_space_list(request: Request, list_options: ListOptions):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(list_options=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_living_space.post(
|
||||
path="/create", summary="Create Build Living Space with given auth levels"
|
||||
)
|
||||
@build_living_space.post(path="/create", summary="Create Build Living Space with given auth levels")
|
||||
def building_living_space_create(request: Request, data: InsertBuildLivingSpace):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
|
@ -37,16 +33,12 @@ def building_living_space_update(
|
|||
request: Request, build_uu_id: str, data: UpdateBuildLivingSpace
|
||||
):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(
|
||||
data=data, build_uu_id=build_uu_id, token_dict=token_dict
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_living_space.patch(
|
||||
path="/patch/{build_uu_id}", summary="Update Active/Delete/Confirm"
|
||||
path="/patch/{build_uu_id}", summary="Update Build Living Space with given auth levels"
|
||||
)
|
||||
def building_living_space_patch(request: Request, build_uu_id: str, data: PatchRecord):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(
|
||||
data=data, build_uu_id=build_uu_id, token_dict=token_dict
|
||||
)
|
||||
return token_dict.available_event(data=data, build_uu_id=build_uu_id, token_dict=token_dict)
|
||||
|
|
|
|||
|
|
@ -1,62 +0,0 @@
|
|||
from fastapi.routing import APIRouter
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
DepartmentsPydantic,
|
||||
PatchRecord,
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
|
||||
|
||||
model_entities_route = APIRouter(prefix="/model/entities", tags=["Model Entities"])
|
||||
model_entities_route.include_router(model_entities_route, include_in_schema=True)
|
||||
|
||||
|
||||
@model_entities_route.post(path="/list", summary="List Active/Delete/Confirm Events")
|
||||
def model_entities_list(request: Request, list_options: ListOptions):
|
||||
from events.events_model_entities import ModelEntitiesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModelEntitiesEvents, "model_entities_list")
|
||||
return active_function(data=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@model_entities_route.post(
|
||||
path="/create", summary="Create Events with given auth levels"
|
||||
)
|
||||
def model_entities_create(request: Request, data: DepartmentsPydantic):
|
||||
from events.events_model_entities import ModelEntitiesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModelEntitiesEvents, "model_entities_create")
|
||||
return active_function(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@model_entities_route.post(
|
||||
path="/update/{company_uu_id}", summary="Update Events with given auth levels"
|
||||
)
|
||||
def model_entities_update(
|
||||
request: Request, company_uu_id: str, data: DepartmentsPydantic
|
||||
):
|
||||
from events.events_model_entities import ModelEntitiesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModelEntitiesEvents, "model_entities_update")
|
||||
return active_function(
|
||||
data=data, company_uu_id=company_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
||||
|
||||
@model_entities_route.patch(
|
||||
path="/patch/{company_uu_id}", summary="Patch Events with given auth levels"
|
||||
)
|
||||
def model_entities_patch(request: Request, company_uu_id: str, data: PatchRecord):
|
||||
from events.events_model_entities import ModelEntitiesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModelEntitiesEvents, "model_entities_patch")
|
||||
return active_function(
|
||||
data=data, company_uu_id=company_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
from fastapi.routing import APIRouter
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
DepartmentsPydantic,
|
||||
PatchRecord,
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
|
||||
|
||||
model_route = APIRouter(prefix="/model/entities", tags=["Model Entities"])
|
||||
model_route.include_router(model_route, include_in_schema=True)
|
||||
|
||||
|
||||
@model_route.post(path="/list", summary="List Active/Delete/Confirm Events")
|
||||
def model_list(request: Request, list_options: ListOptions):
|
||||
from events.events_models import ModelEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModelEvents, "model_list")
|
||||
return active_function(data=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@model_route.post(path="/create", summary="Create Events with given auth levels")
|
||||
def model_create(request: Request, data: DepartmentsPydantic):
|
||||
from events.events_models import ModelEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModelEvents, "model_create")
|
||||
return active_function(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@model_route.post(
|
||||
path="/update/{company_uu_id}", summary="Update Events with given auth levels"
|
||||
)
|
||||
def model_update(request: Request, company_uu_id: str, data: DepartmentsPydantic):
|
||||
from events.events_models import ModelEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModelEvents, "model_list")
|
||||
return active_function(
|
||||
data=data, company_uu_id=company_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
||||
|
||||
@model_route.patch(
|
||||
path="/patch/{company_uu_id}", summary="Patch Events with given auth levels"
|
||||
)
|
||||
def model_patch(request: Request, company_uu_id: str, data: PatchRecord):
|
||||
from events.events_models import ModelEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModelEvents, "model_list")
|
||||
return active_function(
|
||||
data=data, company_uu_id=company_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
|
@ -2,7 +2,6 @@ from fastapi.routing import APIRouter
|
|||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
DepartmentsPydantic,
|
||||
PatchRecord,
|
||||
ListOptions,
|
||||
)
|
||||
|
|
@ -16,43 +15,30 @@ services_route.include_router(services_route, include_in_schema=True)
|
|||
|
||||
@services_route.post(path="/list", summary="List Active/Delete/Confirm Modules")
|
||||
def services_list(request: Request, list_options: ListOptions):
|
||||
from events.events_services import ServicesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ServicesEvents, "services_list")
|
||||
return active_function(list_options=list_options, token_dict=token_dict)
|
||||
return token_dict.available_event(list_options=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@services_route.post(path="/create", summary="Create Modules with given auth levels")
|
||||
def services_create(request: Request, data: DepartmentsPydantic):
|
||||
from events.events_services import ServicesEvents
|
||||
|
||||
def services_create(request: Request, data):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ServicesEvents, "services_create")
|
||||
return active_function(data=data, token_dict=token_dict)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@services_route.post(
|
||||
path="/update/{service_uu_id}", summary="Update Modules with given auth levels"
|
||||
)
|
||||
def services_update(request: Request, service_uu_id: str, data: DepartmentsPydantic):
|
||||
from events.events_services import ServicesEvents
|
||||
|
||||
def services_update(request: Request, service_uu_id: str, data):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ServicesEvents, "services_update")
|
||||
return active_function(
|
||||
return token_dict.available_event(
|
||||
data=data, service_uu_id=service_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
||||
|
||||
@services_route.patch(
|
||||
path="/patch/{service_uu_id}", summary="Patch Modules with given auth levels"
|
||||
)
|
||||
def services_patch(request: Request, service_uu_id: str, data: PatchRecord):
|
||||
from events.events_services import ServicesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ServicesEvents, "services_patch")
|
||||
return active_function(
|
||||
return token_dict.available_event(
|
||||
data=data, service_uu_id=service_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
from fastapi import status, HTTPException
|
||||
from fastapi.routing import APIRouter
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
|
|
@ -9,10 +7,7 @@ from api_validations.validations_request import (
|
|||
PatchRecord,
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from databases import BuildDecisionBookProjects
|
||||
|
||||
|
||||
build_project_decision_book_route = APIRouter(
|
||||
|
|
@ -28,15 +23,7 @@ build_project_decision_book_route.include_router(
|
|||
)
|
||||
def project_decision_book_list(request: Request, list_options: ListOptions):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
BuildDecisionBookProjects.pre_query = BuildDecisionBookProjects.select_action(
|
||||
duty_id=token_dict.duty_list["duty_id"]
|
||||
)
|
||||
build_decision_book_records = BuildDecisionBookProjects.filter_active(
|
||||
*BuildDecisionBookProjects.get_smart_query(list_options.query)
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=build_decision_book_records, pagination=list_options
|
||||
)
|
||||
return token_dict.available_event(list_options=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_project_decision_book_route.post(
|
||||
|
|
@ -46,21 +33,7 @@ def project_decision_book_create(
|
|||
request: Request, data: InsertBuildDecisionBookProjects
|
||||
):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
if build_decision_book_records := BuildDecisionBookProjects.create_action(
|
||||
data=data, token=token_dict
|
||||
):
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Create Build record",
|
||||
"data": build_decision_book_records.get_dict(),
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
raise HTTPException(
|
||||
status_code=401,
|
||||
detail=f"This user can not access/modify {data.build_uu_id} - building",
|
||||
)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_project_decision_book_route.post(
|
||||
|
|
@ -70,11 +43,17 @@ def project_decision_book_create(
|
|||
def project_decision_book_update(
|
||||
request: Request, book_uu_id: str, data: UpdateBuildDecisionBookProjects
|
||||
):
|
||||
return
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(
|
||||
data=data, book_uu_id=book_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
||||
|
||||
@build_project_decision_book_route.patch(
|
||||
path="/patch/{book_uu_id}", summary="Update Active/Delete/Confirm"
|
||||
)
|
||||
def project_decision_book_patch(request: Request, book_uu_id: str, data: PatchRecord):
|
||||
return
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(
|
||||
data=data, book_uu_id=book_uu_id, token_dict=token_dict
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
from fastapi import status, HTTPException
|
||||
from fastapi.routing import APIRouter
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
|
|
@ -9,10 +7,7 @@ from api_validations.validations_request import (
|
|||
PatchRecord,
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from databases import BuildDecisionBook, Build
|
||||
|
||||
|
||||
build_project_decision_book_person_route = APIRouter(
|
||||
|
|
@ -28,15 +23,7 @@ build_project_decision_book_person_route.include_router(
|
|||
)
|
||||
def project_decision_book_person_list(request: Request, list_options: ListOptions):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
BuildDecisionBook.pre_query = BuildDecisionBook.select_action(
|
||||
duty_id=token_dict.duty_list["duty_id"]
|
||||
)
|
||||
build_decision_book_records = BuildDecisionBook.filter_active(
|
||||
*BuildDecisionBook.get_smart_query(list_options.query)
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=build_decision_book_records, pagination=list_options
|
||||
)
|
||||
return token_dict.available_event(list_options=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_project_decision_book_person_route.post(
|
||||
|
|
@ -44,21 +31,7 @@ def project_decision_book_person_list(request: Request, list_options: ListOption
|
|||
)
|
||||
def project_decision_book_person_create(request: Request, data: InsertDecisionBook):
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
Build.pre_query = Build.select_action(duty_id=token_dict.duty_list["duty_id"])
|
||||
if Build.find_one(uu_id=data.build_uu_id):
|
||||
build_decision_book_records = BuildDecisionBook.create_action(data=data)
|
||||
return JSONResponse(
|
||||
content={
|
||||
"completed": True,
|
||||
"message": "Create Build record",
|
||||
"data": build_decision_book_records.get_dict(),
|
||||
},
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
raise HTTPException(
|
||||
status_code=401,
|
||||
detail=f"This user can not access/modify {data.build_uu_id} - building",
|
||||
)
|
||||
return token_dict.available_event(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_project_decision_book_person_route.post(
|
||||
|
|
@ -68,8 +41,8 @@ def project_decision_book_person_create(request: Request, data: InsertDecisionBo
|
|||
def project_decision_book_person_update(
|
||||
request: Request, book_uu_id: str, data: UpdateDecisionBook
|
||||
):
|
||||
|
||||
return
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(data=data, book_uu_id=book_uu_id, token_dict=token_dict)
|
||||
|
||||
|
||||
@build_project_decision_book_person_route.patch(
|
||||
|
|
@ -78,4 +51,5 @@ def project_decision_book_person_update(
|
|||
def project_decision_book_person_patch(
|
||||
request: Request, book_uu_id: str, data: PatchRecord
|
||||
):
|
||||
return
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
return token_dict.available_event(data=data, book_uu_id=book_uu_id, token_dict=token_dict)
|
||||
|
|
|
|||
|
|
@ -1,144 +1,161 @@
|
|||
from service_app_test.api_configs import BothAPIS
|
||||
from service_app_test.bases import FilterObject
|
||||
from service_app_test.test_application.migrate_old_data.reader_and_alchemy_bulk_actions import (
|
||||
read_json_file,
|
||||
)
|
||||
from api_validations.validations_request import (
|
||||
InsertBuild,
|
||||
InsertBuildArea,
|
||||
InsertBuildParts,
|
||||
InsertBuildLivingSpace,
|
||||
)
|
||||
|
||||
|
||||
requester_dict_build = lambda data: {"endpoint": "/building/build/create", "data": data}
|
||||
requester_dict_build_area = lambda data: {
|
||||
"endpoint": "/building/area/create",
|
||||
"data": data,
|
||||
}
|
||||
requester_dict_build_part = lambda data: {
|
||||
"endpoint": "/building/part/create",
|
||||
"data": data,
|
||||
}
|
||||
requester_dict_build_iban = lambda data: {
|
||||
"endpoint": "/building/iban/create",
|
||||
"data": data,
|
||||
}
|
||||
requester_dict_build_living_space = lambda data: {
|
||||
"endpoint": "/building/living_space/create",
|
||||
"data": data,
|
||||
}
|
||||
|
||||
|
||||
def get_build_from_json():
|
||||
read_files_json, with_pydantic = read_json_file(json_file="build"), []
|
||||
read_files = read_files_json.get("build")
|
||||
for row in read_files:
|
||||
pydantic_row = InsertBuild(**row)
|
||||
with_pydantic.append(pydantic_row.model_dump())
|
||||
if not with_pydantic:
|
||||
raise Exception("No data found")
|
||||
return with_pydantic
|
||||
|
||||
|
||||
def get_build_area_from_json():
|
||||
read_files_json, with_pydantic = read_json_file(json_file="build_area"), []
|
||||
read_files = read_files_json.get("build_area")
|
||||
for row in read_files:
|
||||
pydantic_row = InsertBuildArea(**row)
|
||||
with_pydantic.append(pydantic_row.model_dump())
|
||||
if not with_pydantic:
|
||||
raise Exception("No data found")
|
||||
return with_pydantic
|
||||
|
||||
|
||||
def get_build_part_from_json():
|
||||
read_files_json, with_pydantic = read_json_file(json_file="build_parts"), []
|
||||
read_files = read_files_json.get("build_parts")
|
||||
for row in read_files:
|
||||
pydantic_row = InsertBuildParts(**row)
|
||||
with_pydantic.append(pydantic_row.model_dump())
|
||||
if not with_pydantic:
|
||||
raise Exception("No data found")
|
||||
return with_pydantic
|
||||
|
||||
|
||||
def get_build_iban_from_json():
|
||||
read_files_json, with_pydantic = read_json_file(json_file="build_iban"), []
|
||||
read_files = read_files_json.get("build_iban")
|
||||
for row in read_files:
|
||||
pydantic_row = InsertBuildParts(**row)
|
||||
with_pydantic.append(pydantic_row.model_dump())
|
||||
if not with_pydantic:
|
||||
raise Exception("No data found")
|
||||
return with_pydantic
|
||||
|
||||
|
||||
def get_build_living_space_from_json():
|
||||
read_files_json, with_pydantic = read_json_file(json_file="build_living_space"), []
|
||||
read_files = read_files_json.get("build_living_space")
|
||||
for row in read_files:
|
||||
pydantic_row = InsertBuildLivingSpace(**row)
|
||||
with_pydantic.append(pydantic_row.model_dump())
|
||||
if not with_pydantic:
|
||||
raise Exception("No data found")
|
||||
return with_pydantic
|
||||
|
||||
|
||||
def migrate_build(requester: BothAPIS):
|
||||
# Migrate old data
|
||||
filter_object = FilterObject(
|
||||
page=1,
|
||||
size=100,
|
||||
)
|
||||
response = requester.wag_api.post(
|
||||
endpoint="/building/build/list",
|
||||
data=filter_object.dump(),
|
||||
)
|
||||
response_json = response.json()
|
||||
response_datas = response_json["data"]
|
||||
for response_data in response_datas:
|
||||
new_response_data = dict()
|
||||
for key, value in dict(response_data).items():
|
||||
if value is not None and not str(value) == "None":
|
||||
new_response_data[key] = response_data[key]
|
||||
new_response_data.pop("uu_id", None)
|
||||
print("new_response_data", new_response_data)
|
||||
exit()
|
||||
response = requester.local_api.post(
|
||||
endpoint="/building/build/create",
|
||||
data=new_response_data,
|
||||
)
|
||||
print("response", response.text)
|
||||
for response_data in get_build_from_json():
|
||||
print("response_data", response_data)
|
||||
response = requester.local_api.post(**requester_dict_build(data=response_data))
|
||||
if response.ok:
|
||||
migrate_build_area(
|
||||
requester=requester, build_uu_id=response_data["build_uu_id"]
|
||||
)
|
||||
migrate_build_part(
|
||||
requester=requester, build_uu_id=response_data["build_uu_id"]
|
||||
)
|
||||
migrate_build_iban(
|
||||
requester=requester, build_uu_id=response_data["build_uu_id"]
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
def grab_new_build_uu_id(requester: BothAPIS, build_uu_id: str):
|
||||
response_wag = requester.wag_api.post(
|
||||
endpoint="/building/build/list",
|
||||
data={"page": 1, "size": 1, "query": {"uu_id": build_uu_id}},
|
||||
)
|
||||
build_uu_id = response_wag.json()["data"]["uu_id"]
|
||||
if not build_uu_id:
|
||||
raise Exception("Build UU ID not found")
|
||||
return build_uu_id
|
||||
|
||||
|
||||
def migrate_build_area(requester: BothAPIS, build_uu_id: str):
|
||||
# Migrate old data
|
||||
filter_object = FilterObject(
|
||||
page=1,
|
||||
size=100,
|
||||
)
|
||||
response = requester.wag_api.post(
|
||||
endpoint="/building/area/list",
|
||||
data=filter_object.dump(),
|
||||
)
|
||||
print('response', response.text)
|
||||
exit()
|
||||
response_json = response.json()
|
||||
response_datas = response_json["data"]
|
||||
build_uu_id = grab_new_build_uu_id(requester=requester, build_uu_id=build_uu_id)
|
||||
response_datas = get_build_area_from_json()
|
||||
for response_data in response_datas:
|
||||
new_response_data = dict()
|
||||
for key, value in dict(response_data).items():
|
||||
if value is not None and not str(value) == "None":
|
||||
new_response_data[key] = response_data[key]
|
||||
new_response_data.pop("uu_id", None)
|
||||
new_response_data['build_uu_id'] = str(build_uu_id)
|
||||
exit()
|
||||
print("new_response_data", new_response_data)
|
||||
response_data["build_uu_id"] = build_uu_id
|
||||
print("response_data", response_data)
|
||||
response = requester.local_api.post(
|
||||
endpoint="/building/area/create",
|
||||
data=new_response_data,
|
||||
**requester_dict_build_area(data=response_data)
|
||||
)
|
||||
print("response", response.text)
|
||||
return
|
||||
|
||||
|
||||
def migrate_build_part(requester: BothAPIS, build_uu_id: str):
|
||||
# Migrate old data
|
||||
filter_object = FilterObject(
|
||||
page=1,
|
||||
size=100,
|
||||
)
|
||||
response = requester.wag_api.post(
|
||||
endpoint="/build/list",
|
||||
data=filter_object.dump(),
|
||||
)
|
||||
response_json = response.json()
|
||||
response_datas = response_json["data"]
|
||||
build_uu_id = grab_new_build_uu_id(requester=requester, build_uu_id=build_uu_id)
|
||||
response_datas = get_build_part_from_json()
|
||||
for response_data in response_datas:
|
||||
new_response_data = dict()
|
||||
for key, value in dict(response_data).items():
|
||||
if value is not None and not str(value) == "None":
|
||||
new_response_data[key] = response_data[key]
|
||||
new_response_data.pop("uu_id", None)
|
||||
print("new_response_data", new_response_data)
|
||||
new_response_data['build_uu_id'] = str(build_uu_id)
|
||||
exit()
|
||||
response_data["build_uu_id"] = build_uu_id
|
||||
response = requester.local_api.post(
|
||||
endpoint="/build/create",
|
||||
data=new_response_data,
|
||||
**requester_dict_build_part(data=response_data)
|
||||
)
|
||||
print("response", response.text)
|
||||
return
|
||||
|
||||
|
||||
def migrate_build_iban(requester: BothAPIS):
|
||||
# Migrate old data
|
||||
filter_object = FilterObject(
|
||||
page=1,
|
||||
size=100,
|
||||
)
|
||||
response = requester.wag_api.post(
|
||||
endpoint="/build/list",
|
||||
data=filter_object.dump(),
|
||||
)
|
||||
response_json = response.json()
|
||||
response_datas = response_json["data"]
|
||||
def migrate_build_iban(requester: BothAPIS, build_uu_id: str):
|
||||
build_uu_id = grab_new_build_uu_id(requester=requester, build_uu_id=build_uu_id)
|
||||
response_datas = get_build_iban_from_json()
|
||||
for response_data in response_datas:
|
||||
new_response_data = dict()
|
||||
for key, value in dict(response_data).items():
|
||||
if value is not None and not str(value) == "None":
|
||||
new_response_data[key] = response_data[key]
|
||||
new_response_data.pop("uu_id", None)
|
||||
print("new_response_data", new_response_data)
|
||||
response_data["build_uu_id"] = build_uu_id
|
||||
response = requester.local_api.post(
|
||||
endpoint="/build/create",
|
||||
data=new_response_data,
|
||||
**requester_dict_build_part(data=response_data)
|
||||
)
|
||||
print("response", response.text)
|
||||
return
|
||||
|
||||
|
||||
def migrate_build_living_space(requester: BothAPIS):
|
||||
# Migrate old data
|
||||
filter_object = FilterObject(
|
||||
page=1,
|
||||
size=100,
|
||||
)
|
||||
response = requester.wag_api.post(
|
||||
endpoint="/build/list",
|
||||
data=filter_object.dump(),
|
||||
)
|
||||
response_json = response.json()
|
||||
response_datas = response_json["data"]
|
||||
def migrate_build_living_space(requester: BothAPIS, build_uu_id: str):
|
||||
build_uu_id = grab_new_build_uu_id(requester=requester, build_uu_id=build_uu_id)
|
||||
response_datas = get_build_iban_from_json()
|
||||
for response_data in response_datas:
|
||||
new_response_data = dict()
|
||||
for key, value in dict(response_data).items():
|
||||
if value is not None and not str(value) == "None":
|
||||
new_response_data[key] = response_data[key]
|
||||
new_response_data.pop("uu_id", None)
|
||||
print("new_response_data", new_response_data)
|
||||
response_data["build_uu_id"] = build_uu_id
|
||||
response = requester.local_api.post(
|
||||
endpoint="/build/create",
|
||||
data=new_response_data,
|
||||
**requester_dict_build_living_space(data=response_data)
|
||||
)
|
||||
print("response", response.text)
|
||||
return
|
||||
|
|
|
|||
|
|
@ -1,30 +1,27 @@
|
|||
from service_app_test.api_configs import BothAPIS
|
||||
from service_app_test.bases import FilterObject
|
||||
from service_app_test.test_application.migrate_old_data.reader_and_alchemy_bulk_actions import (
|
||||
read_json_file,
|
||||
)
|
||||
from api_validations.validations_request import InsertCompany
|
||||
|
||||
|
||||
requester_dict = lambda data: {"endpoint": "/company/create", "data": data}
|
||||
|
||||
|
||||
def get_company_from_json():
|
||||
read_files_json, with_pydantic = read_json_file(json_file="companies"), []
|
||||
read_files = read_files_json.get("companies")
|
||||
for row in read_files:
|
||||
pydantic_row = InsertCompany(**row)
|
||||
with_pydantic.append(pydantic_row.model_dump())
|
||||
if not with_pydantic:
|
||||
raise Exception("No data found")
|
||||
return with_pydantic
|
||||
|
||||
|
||||
def migrate_company(requester: BothAPIS):
|
||||
filter_object = FilterObject(
|
||||
page=1,
|
||||
size=100,
|
||||
)
|
||||
response = requester.wag_api.post(
|
||||
endpoint="/company/list",
|
||||
data=filter_object.dump(),
|
||||
)
|
||||
response_json = response.json()
|
||||
print("response_json", response_json)
|
||||
response_datas = response_json["data"]
|
||||
for response_data in response_datas:
|
||||
new_response_data = dict()
|
||||
for key, value in dict(response_data).items():
|
||||
if value is not None and not str(value) == "None":
|
||||
new_response_data[key] = response_data[key]
|
||||
new_response_data.pop("uu_id", None)
|
||||
print("new_response_data", new_response_data)
|
||||
new_response_data["company_tag"] = response_data["formal_name"]
|
||||
response = requester.local_api.post(
|
||||
endpoint="/company/create",
|
||||
data=new_response_data,
|
||||
)
|
||||
for response_data in get_company_from_json():
|
||||
response_data["company_tag"] = response_data["formal_name"]
|
||||
response = requester.local_api.post(**requester_dict(data=response_data))
|
||||
print("response", response.text)
|
||||
return
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"build": [
|
||||
{
|
||||
"gov_address_code" : "101818797",
|
||||
"build_name" : "Güneş Apt",
|
||||
"build_no" : "11",
|
||||
"max_floor" : 3,
|
||||
"underground_floor" : 0,
|
||||
"build_date" : "1969-12-31T22:00:00.000Z",
|
||||
"decision_period_date" : "1974-06-30T21:00:00.000Z",
|
||||
"tax_no" : "5",
|
||||
"lift_count" : 0,
|
||||
"heating_system" : true,
|
||||
"cooling_system" : false,
|
||||
"hot_water_system" : false,
|
||||
"block_service_man_count" : 0,
|
||||
"security_service_man_count" : 0,
|
||||
"garage_count" : 2,
|
||||
"management_room_id" : 50,
|
||||
"site_id" : null,
|
||||
"site_uu_id" : null,
|
||||
"address_id" : 3,
|
||||
"address_uu_id" : "2f159fad-75e0-4adc-9ba6-f9e152f5e464",
|
||||
"build_types_id" : 5,
|
||||
"build_types_uu_id" : "cb6fb0cd-f9fe-4d00-a592-ce02d26c2b8d",
|
||||
"id" : 1,
|
||||
"uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T09:12:12.158Z",
|
||||
"updated_at" : "2024-11-06T09:12:12.158Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:12:12.158Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
}
|
||||
]}
|
||||
|
|
@ -0,0 +1,377 @@
|
|||
{
|
||||
"build_area": [
|
||||
{
|
||||
"area_name" : "OTOPARK ARKA AGAC ARASI",
|
||||
"area_code" : "PARK_ARKA_AGAC",
|
||||
"area_type" : "APT_APRK",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 16,
|
||||
"uu_id" : "577e02b0-00f0-467d-ae21-3b8de4eea895",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:49:10.008Z",
|
||||
"updated_at" : "2024-11-06T11:49:10.008Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:49:10.008Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 104,
|
||||
"part_type_uu_id" : "f4bf777c-c1e2-465d-b7dc-c3027e41d280"
|
||||
},
|
||||
{
|
||||
"area_name" : "OTOPARK ON SAG",
|
||||
"area_code" : "PARK_ON_SAG",
|
||||
"area_type" : "APT_APRK",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 12,
|
||||
"uu_id" : "fb7c0dd2-c702-407d-add1-1df6f476dd83",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:49:10.008Z",
|
||||
"updated_at" : "2024-11-06T11:49:10.008Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:49:10.008Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 104,
|
||||
"part_type_uu_id" : "f4bf777c-c1e2-465d-b7dc-c3027e41d280"
|
||||
},
|
||||
{
|
||||
"area_name" : "OTOPARK ON SOL",
|
||||
"area_code" : "PARK_ON_SOL",
|
||||
"area_type" : "APT_APRK",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 13,
|
||||
"uu_id" : "e90cce4a-723a-46d9-9b1b-34bdfba57e39",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:49:10.008Z",
|
||||
"updated_at" : "2024-11-06T11:49:10.008Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:49:10.008Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 104,
|
||||
"part_type_uu_id" : "f4bf777c-c1e2-465d-b7dc-c3027e41d280"
|
||||
},
|
||||
{
|
||||
"area_name" : "OTOPARK ARKA DUVAR",
|
||||
"area_code" : "PARK_ARKA_DUVAR",
|
||||
"area_type" : "APT_APRK",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 14,
|
||||
"uu_id" : "13aea5f4-a6f6-438e-abf4-5582b219a4f2",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:49:10.008Z",
|
||||
"updated_at" : "2024-11-06T11:49:10.008Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:49:10.008Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 104,
|
||||
"part_type_uu_id" : "f4bf777c-c1e2-465d-b7dc-c3027e41d280"
|
||||
},
|
||||
{
|
||||
"area_name" : "YEŞİL ALAN ARKA",
|
||||
"area_code" : "GREEN_ARKA",
|
||||
"area_type" : "APT_YSL",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 2,
|
||||
"uu_id" : "b36cda1e-a51c-4d24-b0d8-40d31d5baa0f",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:49:10.008Z",
|
||||
"updated_at" : "2024-11-06T11:49:10.008Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:49:10.008Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 104,
|
||||
"part_type_uu_id" : "7c36cdd6-86ca-4d51-8698-b96a71f60a05"
|
||||
},
|
||||
{
|
||||
"area_name" : "YEŞİL ALAN SOL",
|
||||
"area_code" : "GREEN_SOL",
|
||||
"area_type" : "APT_YSL",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 6,
|
||||
"uu_id" : "580d76f9-c80a-4cb3-9d79-5931aa599876",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:49:10.008Z",
|
||||
"updated_at" : "2024-11-06T11:49:10.008Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:49:10.008Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 104,
|
||||
"part_type_uu_id" : "7c36cdd6-86ca-4d51-8698-b96a71f60a05"
|
||||
},
|
||||
{
|
||||
"area_name" : "YEŞİL ALAN ON SOL",
|
||||
"area_code" : "GREEN_ON_SOL",
|
||||
"area_type" : "APT_YSL",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 7,
|
||||
"uu_id" : "16e37efa-cb82-488b-a366-4a2da7344ee4",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:49:10.008Z",
|
||||
"updated_at" : "2024-11-06T11:49:10.008Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:49:10.008Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 104,
|
||||
"part_type_uu_id" : "7c36cdd6-86ca-4d51-8698-b96a71f60a05"
|
||||
},
|
||||
{
|
||||
"area_name" : "YEŞİL ALAN ON SAG",
|
||||
"area_code" : "GREEN_ON_SAG",
|
||||
"area_type" : "APT_YSL",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 8,
|
||||
"uu_id" : "3d5f0d12-2bb9-4edb-95d8-0c4c2552f3bd",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:49:10.008Z",
|
||||
"updated_at" : "2024-11-06T11:49:10.008Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:49:10.008Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 104,
|
||||
"part_type_uu_id" : "7c36cdd6-86ca-4d51-8698-b96a71f60a05"
|
||||
},
|
||||
{
|
||||
"area_name" : "KAPALI GARAJ D:09",
|
||||
"area_code" : "GARAJ_D09",
|
||||
"area_type" : "APT_KGR",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 18,
|
||||
"uu_id" : "9db9bc45-0b16-450c-b94b-b34cc11e8544",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:58:51.382Z",
|
||||
"updated_at" : "2024-11-06T11:58:51.382Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:58:51.382Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 2,
|
||||
"part_type_uu_id" : "4a5c9f89-18ef-42aa-93a6-7c1880d5ac3f"
|
||||
},
|
||||
{
|
||||
"area_name" : "KAPALI GARAJ D:07",
|
||||
"area_code" : "GARAJ_D07",
|
||||
"area_type" : "APT_KGR",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 17,
|
||||
"uu_id" : "f39c0cf2-a409-4b5d-84f0-53f1cd5371e4",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:58:51.382Z",
|
||||
"updated_at" : "2024-11-06T11:58:51.382Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:58:51.382Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 2,
|
||||
"part_type_uu_id" : "4a5c9f89-18ef-42aa-93a6-7c1880d5ac3f"
|
||||
},
|
||||
{
|
||||
"area_name" : "BIN YAN YOL",
|
||||
"area_code" : "ROAD_SOL",
|
||||
"area_type" : "APT_YOL",
|
||||
"area_direction" : "NN",
|
||||
"area_gross_size" : 0.000000,
|
||||
"area_net_size" : 0.000000,
|
||||
"width" : 0,
|
||||
"size" : 0,
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 1,
|
||||
"uu_id" : "09e0b4e6-caa2-4e69-994e-1f52844feffe",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T11:44:13.619Z",
|
||||
"updated_at" : "2024-11-06T11:44:13.619Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T11:44:13.619Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z",
|
||||
"part_type_id" : 105,
|
||||
"part_type_uu_id" : "8af4fb10-d275-4fd8-95ad-f5c6caee08a3"
|
||||
}
|
||||
]}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"build_ibans": [
|
||||
{
|
||||
"iban" : "TR400006400000142450093333",
|
||||
"start_date" : "1989-12-31T22:00:00.000Z",
|
||||
"stop_date" : "2899-12-31T21:00:00.000Z",
|
||||
"bank_code" : "TR0000000000000",
|
||||
"xcomment" : "Guneş Apt Vadesi IBAN",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"id" : 2,
|
||||
"uu_id" : "42c1e38f-d8f7-49ac-8f70-c1b0c22c4253",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-06T12:03:00.548Z",
|
||||
"updated_at" : "2024-11-06T12:03:00.548Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : false,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : false,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T12:03:00.548Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
}
|
||||
]}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,484 @@
|
|||
{
|
||||
"build_parts": [
|
||||
{
|
||||
"address_gov_code" : "1512400605",
|
||||
"part_no" : 11,
|
||||
"part_level" : 3,
|
||||
"part_code" : "DAIRE_11",
|
||||
"part_gross_size" : 95,
|
||||
"part_net_size" : 90,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 26,
|
||||
"uu_id" : "d99c1e9b-4b48-460b-9eb5-09c76fa7141d",
|
||||
"ref_id" : "ae96420b-1190-4bb2-9767-773b9f54f04d",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1451502635",
|
||||
"part_no" : 5,
|
||||
"part_level" : 1,
|
||||
"part_code" : "DAIRE_05",
|
||||
"part_gross_size" : 95,
|
||||
"part_net_size" : 90,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 27,
|
||||
"uu_id" : "c543316c-faf4-4173-9f79-f8457f2aa8ae",
|
||||
"ref_id" : "34ef8d56-8b34-4109-89db-4205c7c7e7bd",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1200411005",
|
||||
"part_no" : 3,
|
||||
"part_level" : 0,
|
||||
"part_code" : "DAIRE_03",
|
||||
"part_gross_size" : 85,
|
||||
"part_net_size" : 80,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 28,
|
||||
"uu_id" : "a511f4d3-8cef-4a4c-be2b-14faf3801612",
|
||||
"ref_id" : "4529757c-05de-4788-8e2c-c139ae680ef7",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1200710992",
|
||||
"part_no" : 2,
|
||||
"part_level" : 0,
|
||||
"part_code" : "DAIRE_02",
|
||||
"part_gross_size" : 85,
|
||||
"part_net_size" : 80,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 29,
|
||||
"uu_id" : "e87e56dd-d8c7-49b4-bd15-f7e317448e78",
|
||||
"ref_id" : "72f96615-3aab-455c-a4d0-006da95d0e67",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1200111019",
|
||||
"part_no" : 4,
|
||||
"part_level" : 1,
|
||||
"part_code" : "DAIRE_04",
|
||||
"part_gross_size" : 95,
|
||||
"part_net_size" : 90,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 30,
|
||||
"uu_id" : "426cb5ce-fa69-42fe-9475-6abd0285643f",
|
||||
"ref_id" : "75721e32-55a6-4309-9a0e-065f5c59cec8",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1512100619",
|
||||
"part_no" : 6,
|
||||
"part_level" : 1,
|
||||
"part_code" : "DAIRE_06",
|
||||
"part_gross_size" : 95,
|
||||
"part_net_size" : 90,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 31,
|
||||
"uu_id" : "77aefc66-8e04-4298-b7de-1d37b1e512ed",
|
||||
"ref_id" : "789d1c26-bd85-4cee-b5a5-4722fa890eb5",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1174911857",
|
||||
"part_no" : 7,
|
||||
"part_level" : 2,
|
||||
"part_code" : "DAIRE_07",
|
||||
"part_gross_size" : 95,
|
||||
"part_net_size" : 90,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 32,
|
||||
"uu_id" : "d57838df-cb2c-4f13-8ec3-84e30e52a437",
|
||||
"ref_id" : "b134371a-75ee-4d34-8d67-58a588a05074",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1199811025",
|
||||
"part_no" : 8,
|
||||
"part_level" : 2,
|
||||
"part_code" : "DAIRE_08",
|
||||
"part_gross_size" : 95,
|
||||
"part_net_size" : 90,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 33,
|
||||
"uu_id" : "e39e0228-05c2-4de7-a295-89eadc2f8189",
|
||||
"ref_id" : "b3dd0991-e10b-4b7c-81e9-1371fee5809d",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1451802621",
|
||||
"part_no" : 10,
|
||||
"part_level" : 3,
|
||||
"part_code" : "DAIRE_10",
|
||||
"part_gross_size" : 95,
|
||||
"part_net_size" : 90,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 34,
|
||||
"uu_id" : "12e79811-1d65-4ea2-9f52-530bb41d47c3",
|
||||
"ref_id" : "bdf585e8-06f7-45bd-9a4a-3d8a844a4bf5",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1175211844",
|
||||
"part_no" : 12,
|
||||
"part_level" : 3,
|
||||
"part_code" : "DAIRE_12",
|
||||
"part_gross_size" : 95,
|
||||
"part_net_size" : 90,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 25,
|
||||
"uu_id" : "5603db9e-b1f8-4d31-b4f2-2b3baa5508e7",
|
||||
"ref_id" : "89700cab-02c3-40eb-bfc6-a2565421b33d",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1395104514",
|
||||
"part_no" : 9,
|
||||
"part_level" : 2,
|
||||
"part_code" : "DAIRE_09",
|
||||
"part_gross_size" : 95,
|
||||
"part_net_size" : 90,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 35,
|
||||
"uu_id" : "1289c918-a12d-4d29-8b0d-34f20cc5c7c8",
|
||||
"ref_id" : "c223b2fa-fa74-4646-81bd-2f00139575e8",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1292507934",
|
||||
"part_no" : 1,
|
||||
"part_level" : 0,
|
||||
"part_code" : "DAIRE_01",
|
||||
"part_gross_size" : 85,
|
||||
"part_net_size" : 80,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "d3e0e1e0-4679-43bb-b8c4-25ff01bd2122",
|
||||
"id" : 36,
|
||||
"uu_id" : "ed6ae015-268b-47ad-8af6-0b1025844413",
|
||||
"ref_id" : "ef93d9a9-d25a-4fb5-bd0e-f9f97138ca3e",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"address_gov_code" : "1200",
|
||||
"part_no" : 0,
|
||||
"part_level" : 1,
|
||||
"part_code" : "APT_YON",
|
||||
"part_gross_size" : 30,
|
||||
"part_net_size" : 25,
|
||||
"default_accessory" : "0",
|
||||
"human_livable" : true,
|
||||
"due_part_key" : "",
|
||||
"build_id" : 1,
|
||||
"build_uu_id" : "dd11ce48-063d-4b07-8bd9-f1acb0e91113",
|
||||
"part_direction_id" : 33,
|
||||
"part_direction_uu_id" : "8b499ada-4b70-44c5-b325-af57fc14421f",
|
||||
"part_type_id" : 4,
|
||||
"part_type_uu_id" : "6de1b33d-ebe9-42f6-b4cb-7f4396f13731",
|
||||
"id" : 50,
|
||||
"uu_id" : "426cb5ce-fa69-42fe-9475-6abd0285643e",
|
||||
"ref_id" : "75721e32-55a6-4309-9a0e-065f5c59cec8",
|
||||
"created_at" : "2024-11-06T09:33:42.133Z",
|
||||
"updated_at" : "2024-11-06T09:33:42.133Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:33:42.133Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
}
|
||||
]}
|
||||
|
|
@ -0,0 +1,611 @@
|
|||
{
|
||||
"companies": [
|
||||
{
|
||||
"formal_name" : "DEVRAN SIVACI KİLİT TAŞ",
|
||||
"company_type" : "P",
|
||||
"commercial_type" : "0",
|
||||
"tax_no" : "100940000000021",
|
||||
"public_name" : "DEVRAN SIVACI KİLİT TAŞ",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 7,
|
||||
"uu_id" : "673d1824-dcf9-4b35-afbe-0afe6a29963d",
|
||||
"ref_id" : "100940000000021",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "Evyos LTD",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "LTD",
|
||||
"tax_no" : "123132123132",
|
||||
"public_name" : "Evyos Verimlilik Sistemleri",
|
||||
"company_tag" : "Evyos",
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : true,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 1,
|
||||
"uu_id" : "851a657c-34b6-4741-b577-b51752609708",
|
||||
"ref_id" : null,
|
||||
"created_at" : "2024-11-05T13:16:10.746Z",
|
||||
"updated_at" : "2024-11-05T13:16:10.746Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : "System",
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : "System",
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-05T13:16:10.746Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "A.S.K.İ",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "A.Ş.",
|
||||
"tax_no" : "100940000000016",
|
||||
"public_name" : "A.S.K.İ",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 4,
|
||||
"uu_id" : "c4c9b579-9c64-4b57-adaa-0b82b98825bb",
|
||||
"ref_id" : "100940000000016",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "ENERJİSAPS",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "A.Ş.",
|
||||
"tax_no" : "100940000000017",
|
||||
"public_name" : "ENERJİSAPS",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 5,
|
||||
"uu_id" : "708a932c-be9b-4e5e-a6e0-aeac0ed1830e",
|
||||
"ref_id" : "100940000000017",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "BAŞKENT DOĞAL GAZ",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "A.Ş.",
|
||||
"tax_no" : "100940000000024",
|
||||
"public_name" : "BAŞKENT DOĞALGAZ",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 10,
|
||||
"uu_id" : "527f09ac-7e51-4c41-b588-a263373b8683",
|
||||
"ref_id" : "100940000000024",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "VOLKAN TİCARET",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "LTD.",
|
||||
"tax_no" : "100940000000026",
|
||||
"public_name" : "VOLKAN TİCARET",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 12,
|
||||
"uu_id" : "3fb44160-18e3-4d54-ae1b-13c203ce2eb3",
|
||||
"ref_id" : "100940000000026",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "RECEPOGLU_YAPI",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "LTD.",
|
||||
"tax_no" : "100940000000027",
|
||||
"public_name" : "RECEPOGLU_YAPI",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 13,
|
||||
"uu_id" : "6b3e08b8-3b98-4966-a813-cfcf156642d5",
|
||||
"ref_id" : "100940000000027",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "IPEK_ELEKTRIK",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "LTD.",
|
||||
"tax_no" : "100940000000030",
|
||||
"public_name" : "IPEK_ELEKTRIK",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 29,
|
||||
"uu_id" : "81364a87-e3ab-4cf2-8d0a-d3fba7402bcf",
|
||||
"ref_id" : "100940000000030",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "BAUHOUSE",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "A.Ş.",
|
||||
"tax_no" : "100940000000031",
|
||||
"public_name" : "BAUHOUSE",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 31,
|
||||
"uu_id" : "82946ab2-f386-4d25-a372-9e9328ea73a1",
|
||||
"ref_id" : "100940000000031",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "DURANOĞLU TAŞ KARO",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "LTD.",
|
||||
"tax_no" : "100940000000034",
|
||||
"public_name" : "DURANOĞLU TAŞ KARO",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 34,
|
||||
"uu_id" : "a15ddd83-780e-4346-b17e-f7573be1eb91",
|
||||
"ref_id" : "100940000000034",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "PROFGAZ BEKİR DEMİROĞLU",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "LTD.",
|
||||
"tax_no" : "100940000000019",
|
||||
"public_name" : "PROFGAZ BEKİR DEMİROĞLU",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 44,
|
||||
"uu_id" : "0e09d08a-d76d-4f6f-a14e-38c33f0e4159",
|
||||
"ref_id" : "100940000000019",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "TC. İŞ BANKASI",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "A.Ş.",
|
||||
"tax_no" : "100940000000047",
|
||||
"public_name" : "İŞ BANKASI",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 47,
|
||||
"uu_id" : "c8e1117e-1510-432f-9f9a-700bfba3b2b3",
|
||||
"ref_id" : "100940000000047",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "AV ILAYDA DOĞA KARAMAN",
|
||||
"company_type" : "P",
|
||||
"commercial_type" : "0",
|
||||
"tax_no" : "100940000000056",
|
||||
"public_name" : "AV ILAYDA DOĞA KARAMAN",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 56,
|
||||
"uu_id" : "461d7f3b-f61d-4547-adbd-920d5ed2f505",
|
||||
"ref_id" : "100940000000056",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "MUSTAFA ÖZDEN AYLIK SOZ. TEMIZLIK HIZMET BEDELI",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "LTD.",
|
||||
"tax_no" : "100940000000059",
|
||||
"public_name" : "MUSTAFA ÖZDEN AYLIK SOZ. TEMIZLIK HIZMET BEDELI",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 59,
|
||||
"uu_id" : "6be2ebb4-4aa2-4feb-927e-989816f67d94",
|
||||
"ref_id" : "100940000000059",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "ARMAN ELEKTRONIK",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "LTD.",
|
||||
"tax_no" : "100940000000046",
|
||||
"public_name" : "ARMAN ELEKTRONIK",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 46,
|
||||
"uu_id" : "82b089a8-1238-4e3e-b19a-8db209f72fe4",
|
||||
"ref_id" : "100940000000046",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"formal_name" : "CKM Doğalgaz Mühendislik",
|
||||
"company_type" : "C",
|
||||
"commercial_type" : "LTD.",
|
||||
"tax_no" : "100940000000060",
|
||||
"public_name" : "CKM Doğalgaz Mühendislik",
|
||||
"company_tag" : null,
|
||||
"default_lang_type" : "TR",
|
||||
"default_money_type" : "TL",
|
||||
"is_commercial" : false,
|
||||
"is_blacklist" : false,
|
||||
"parent_id" : null,
|
||||
"workplace_no" : null,
|
||||
"official_address_id" : null,
|
||||
"official_address_uu_id" : null,
|
||||
"top_responsible_company_id" : null,
|
||||
"top_responsible_company_uu_id" : null,
|
||||
"id" : 60,
|
||||
"uu_id" : "b12c22ba-5783-448d-87f0-f78a468f3c2b",
|
||||
"ref_id" : "100940000000060",
|
||||
"created_at" : "2024-11-06T09:04:42.733Z",
|
||||
"updated_at" : "2024-11-06T09:04:42.733Z",
|
||||
"cryp_uu_id" : null,
|
||||
"created_by" : null,
|
||||
"created_by_id" : null,
|
||||
"updated_by" : null,
|
||||
"updated_by_id" : null,
|
||||
"confirmed_by" : null,
|
||||
"confirmed_by_id" : null,
|
||||
"is_confirmed" : true,
|
||||
"replication_id" : 0,
|
||||
"deleted" : false,
|
||||
"active" : true,
|
||||
"is_notification_send" : true,
|
||||
"is_email_send" : false,
|
||||
"expiry_starts" : "2024-11-06T09:04:42.733Z",
|
||||
"expiry_ends" : "2099-12-31T00:00:00.000Z"
|
||||
}
|
||||
]}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -10,8 +10,12 @@ system_default = dict(
|
|||
confirmed_by="System",
|
||||
)
|
||||
|
||||
json_directory = "/home/berkay/git-gitea-evyos/wag-managment-api-service-version-2"
|
||||
json_directory += "/service_app_test/test_application/migrate_old_data/data"
|
||||
print("json_directory", json_directory)
|
||||
|
||||
def read_json_file(json_directory, json_file):
|
||||
|
||||
def read_json_file(json_file):
|
||||
with open(f"{json_directory}/{json_file}.json", "r", encoding="utf-8") as json_file:
|
||||
return loads(json_file.read())
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,6 @@ from service_app_test.api_configs import WagAPI, LocalAPI, BothAPIS
|
|||
from service_app_test.test_application.migrate_old_data.people import migrate_people
|
||||
from service_app_test.test_application.migrate_old_data.building import (
|
||||
migrate_build,
|
||||
migrate_build_area,
|
||||
migrate_build_part,
|
||||
migrate_build_iban,
|
||||
migrate_build_living_space,
|
||||
)
|
||||
from service_app_test.test_application.migrate_old_data.company import migrate_company
|
||||
|
||||
|
|
@ -17,7 +13,7 @@ login_data = {
|
|||
"access_key": "karatay.berkay.sup@evyos.com.tr",
|
||||
"password": "string",
|
||||
"remember_me": False,
|
||||
"password_token": ""
|
||||
"password_token": "",
|
||||
}
|
||||
login_data_wag = {
|
||||
"domain": "evyos.com.tr",
|
||||
|
|
@ -43,12 +39,6 @@ both_apis = BothAPIS()
|
|||
both_apis.wag_api = wag_api
|
||||
both_apis.local_api = local_api
|
||||
|
||||
# migrate_company(requester=both_apis)
|
||||
# migrate_people(requester=both_apis)
|
||||
# migrate_build(requester=both_apis)
|
||||
migrate_build_area(requester=both_apis, build_uu_id="string")
|
||||
exit()
|
||||
|
||||
migrate_build_part(requester=both_apis)
|
||||
migrate_build_iban(requester=both_apis)
|
||||
migrate_build_living_space(requester=both_apis)
|
||||
migrate_company(requester=both_apis)
|
||||
migrate_people(requester=both_apis)
|
||||
migrate_build(requester=both_apis)
|
||||
|
|
|
|||
Loading…
Reference in New Issue