updated postgres and mongo updated
This commit is contained in:
@@ -50,6 +50,16 @@ def create_application_defaults(db_session):
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(execution)
|
||||
gen_man = Departments.find_or_create(
|
||||
department_name="General Manager Example",
|
||||
department_code="GM001",
|
||||
company_id=company_id,
|
||||
company_uu_id=str(company_uu_id),
|
||||
**active_row,
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(gen_man)
|
||||
|
||||
it_dept = Departments.find_or_create(
|
||||
department_name="IT Department",
|
||||
department_code="ITD001",
|
||||
@@ -59,6 +69,16 @@ def create_application_defaults(db_session):
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(it_dept)
|
||||
|
||||
gen_duty = Duty.find_or_create(
|
||||
duty_name="General Manager",
|
||||
duty_code="GM0001",
|
||||
duty_description="General Manager",
|
||||
**active_row,
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(gen_duty)
|
||||
|
||||
bm_duty = Duty.find_or_create(
|
||||
duty_name="Business Manager",
|
||||
duty_code="BM0001",
|
||||
@@ -91,6 +111,19 @@ def create_application_defaults(db_session):
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(occu_duty)
|
||||
|
||||
duties_gen_man = Duties.find_or_create(
|
||||
company_id=company_id,
|
||||
company_uu_id=str(company_uu_id),
|
||||
duties_id=gen_duty.id,
|
||||
duties_uu_id=str(gen_duty.uu_id),
|
||||
department_id=gen_man.id,
|
||||
department_uu_id=str(gen_man.uu_id),
|
||||
**active_row,
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(duties_gen_man)
|
||||
|
||||
duties_created_bm = Duties.find_or_create(
|
||||
company_id=company_id,
|
||||
company_uu_id=str(company_uu_id),
|
||||
@@ -292,6 +325,24 @@ def create_application_defaults(db_session):
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(sup_manager)
|
||||
gen_manager_people = People.find_or_create(
|
||||
**{
|
||||
"person_tag": "BM-System",
|
||||
"firstname": "Example General Manager",
|
||||
"surname": "Example",
|
||||
"sex_code": "M",
|
||||
"middle_name": "",
|
||||
"father_name": "Father",
|
||||
"mother_name": "Mother",
|
||||
"country_code": "TR",
|
||||
"national_identity_id": "12312312314",
|
||||
"birth_place": "Ankara",
|
||||
"birth_date": "01.07.1990",
|
||||
"tax_no": "1231231233",
|
||||
},
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(gen_manager_people)
|
||||
application_manager_staff = Staff.find_or_create(
|
||||
staff_description="Application Manager",
|
||||
staff_name="Application Manager Employee",
|
||||
@@ -318,6 +369,32 @@ def create_application_defaults(db_session):
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(super_user_staff)
|
||||
gen_man_staff = Staff.find_or_create(
|
||||
staff_description="General Manager",
|
||||
staff_name="General Manager Employee",
|
||||
staff_code="GME",
|
||||
duties_id=duties_gen_man.id,
|
||||
duties_uu_id=str(gen_duty.uu_id),
|
||||
is_confirmed=True,
|
||||
active=True,
|
||||
deleted=False,
|
||||
is_notification_send=True,
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(gen_man_staff)
|
||||
gen_man_employee = Employees.find_or_create(
|
||||
staff_id=gen_man_staff.id,
|
||||
staff_uu_id=str(gen_man_staff.uu_id),
|
||||
people_id=gen_manager_people.id,
|
||||
people_uu_id=str(gen_manager_people.uu_id),
|
||||
is_confirmed=True,
|
||||
active=True,
|
||||
deleted=False,
|
||||
is_notification_send=True,
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(gen_man_employee)
|
||||
|
||||
app_manager_employee = Employees.find_or_create(
|
||||
staff_id=application_manager_staff.id,
|
||||
staff_uu_id=str(application_manager_staff.uu_id),
|
||||
@@ -344,6 +421,38 @@ def create_application_defaults(db_session):
|
||||
)
|
||||
created_list.append(super_user_employee)
|
||||
|
||||
gen_manager_user = Users.find_or_create(
|
||||
person_id=gen_manager_people.id,
|
||||
person_uu_id=str(gen_manager_people.uu_id),
|
||||
user_tag=gen_manager_people.person_tag,
|
||||
email="example.general@evyos.com.tr",
|
||||
phone_number="+901111111111",
|
||||
avatar="https://s.tmimgcdn.com/scr/800x500/276800/building-home-nature-logo-vector-template-3_276851-original.jpg",
|
||||
related_company=str(company_management.uu_id),
|
||||
is_confirmed=True,
|
||||
active=True,
|
||||
deleted=False,
|
||||
is_notification_send=True,
|
||||
db=db_session,
|
||||
)
|
||||
created_list.append(gen_manager_user)
|
||||
gen_manager_user.password_expiry_begins = str(arrow.now())
|
||||
gen_manager_user.password_token = PasswordModule.generate_refresher_token()
|
||||
|
||||
main_domain, collection_name = (
|
||||
"evyos.com.tr",
|
||||
f"{str(company_management.uu_id)}*Domain",
|
||||
)
|
||||
with mongo_handler.collection(collection_name) as mongo_engine:
|
||||
mongo_engine.insert_one(
|
||||
document={
|
||||
"user_uu_id": str(gen_manager_user.uu_id),
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}
|
||||
)
|
||||
|
||||
app_manager_user = Users.find_or_create(
|
||||
person_id=app_manager.id,
|
||||
person_uu_id=str(app_manager.uu_id),
|
||||
@@ -362,10 +471,6 @@ def create_application_defaults(db_session):
|
||||
app_manager_user.password_expiry_begins = str(arrow.now())
|
||||
app_manager_user.password_token = PasswordModule.generate_refresher_token()
|
||||
|
||||
main_domain, collection_name = (
|
||||
"evyos.com.tr",
|
||||
f"{str(company_management.uu_id)}*Domain",
|
||||
)
|
||||
with mongo_handler.collection(collection_name) as mongo_engine:
|
||||
mongo_engine.insert_one(
|
||||
document={
|
||||
|
||||
Reference in New Issue
Block a user