updated postgres and mongo updated
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
from Controllers.Postgres.database import get_db
|
||||
from Schemas import (
|
||||
Users,
|
||||
Employees,
|
||||
)
|
||||
from Schemas import Users, Employees, BuildLivingSpace
|
||||
from init_service_to_events import init_service_to_event_matches_for_super_user
|
||||
from init_applications import init_applications_for_super_user
|
||||
from init_applications import (
|
||||
init_applications_for_super_user,
|
||||
init_applications_for_general_manager,
|
||||
init_applications_for_build_manager,
|
||||
init_applications_for_owner,
|
||||
init_applications_for_tenant,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -26,3 +29,49 @@ if __name__ == "__main__":
|
||||
init_applications_for_super_user(
|
||||
super_user=super_employee, db_session=db_session
|
||||
)
|
||||
|
||||
with get_db() as db_session:
|
||||
print("Createing GM")
|
||||
if gen_man := Users.filter_one(
|
||||
Users.email == "example.general@evyos.com.tr", db=db_session
|
||||
).data:
|
||||
gen_man_employee = Employees.filter_one(
|
||||
Employees.people_id == gen_man.person_id, db=db_session
|
||||
).data
|
||||
print("General Manager : ", gen_man_employee)
|
||||
init_applications_for_general_manager(
|
||||
super_user=gen_man_employee, db_session=db_session
|
||||
)
|
||||
|
||||
with get_db() as db_session:
|
||||
if build_man := Users.filter_one(
|
||||
Users.email == "example.build.manager@gmail.com", db=db_session
|
||||
).data:
|
||||
build_man_employee = BuildLivingSpace.filter_one(
|
||||
BuildLivingSpace.person_id == build_man.person_id, db=db_session
|
||||
).data
|
||||
init_applications_for_build_manager(
|
||||
super_user=build_man_employee, db_session=db_session
|
||||
)
|
||||
|
||||
with get_db() as db_session:
|
||||
if own_flt := Users.filter_one(
|
||||
Users.email == "example.owner@gmail.com", db=db_session
|
||||
).data:
|
||||
own_flt_employee = BuildLivingSpace.filter_one(
|
||||
BuildLivingSpace.person_id == own_flt.person_id, db=db_session
|
||||
).data
|
||||
init_applications_for_owner(
|
||||
super_user=own_flt_employee, db_session=db_session
|
||||
)
|
||||
|
||||
with get_db() as db_session:
|
||||
if ten_flt := Users.filter_one(
|
||||
Users.email == "example.tenant@gmail.com", db=db_session
|
||||
).data:
|
||||
ten_flt_employee = BuildLivingSpace.filter_one(
|
||||
BuildLivingSpace.person_id == ten_flt.person_id, db=db_session
|
||||
).data
|
||||
init_applications_for_tenant(
|
||||
super_user=ten_flt_employee, db_session=db_session
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user