174 lines
5.9 KiB
Python
174 lines
5.9 KiB
Python
import arrow
|
|
|
|
from test_application.evyos.bases import login_via_email_and_password
|
|
from test_application.evyos.company_employee import run_company_and_depends
|
|
from test_application.evyos.address_building import run_address_to_building
|
|
from test_application.evyos.datas.get_type_codes import get_type_codes_key_and_class
|
|
from test_application.evyos.decision_book import (
|
|
run_decision_book_depends,
|
|
list_decision_books,
|
|
)
|
|
from test_application.evyos.decision_book_items import (
|
|
run_decision_book_items,
|
|
send_invitation_to_building_residents,
|
|
collect_invitation_to_building_residents,
|
|
assign_people_to_pre_or_wrt,
|
|
)
|
|
|
|
login_creds_employee = {
|
|
"domain": "evyos.com.tr",
|
|
"access_key": "karatay.berkay.sup@evyos.com.tr",
|
|
"password": "string",
|
|
"remember_me": False,
|
|
"password_token": "",
|
|
}
|
|
access_key_president = "bmanco@example.net"
|
|
login_creds_occupant = {
|
|
"domain": "evyos.com.tr",
|
|
"access_key": access_key_president,
|
|
"password": "string",
|
|
"remember_me": False,
|
|
"password_token": "o_2Y_yXS-cl6MxLbzLrXQetXTlDLD3UBDTQNa_mBMyzSOVIgx3LGbnufLRJjd4g6BWFbwVgJIUxbK-Pi0R5dwxfVJKyoEeDdej40uRHSsElKR16nvnqgFB_BJ4nmyN0KSunZHra5NqHJor17EGExOSmlttZV5dC7vFsrc-GUkg",
|
|
}
|
|
wrt_creds_occupant = {
|
|
"domain": "evyos.com.tr",
|
|
"access_key": access_key_president,
|
|
"password": "string",
|
|
"remember_me": False,
|
|
"password_token": "",
|
|
}
|
|
|
|
add_with_employee = None
|
|
add_with_occupant = True
|
|
assign_people_to_create_item = 3
|
|
|
|
# selection_list = None
|
|
selection_list = [
|
|
"7e370616-7bcf-469f-b9a2-c0da55463939",
|
|
"c2d385d8-b772-4ecd-be89-8c468738654a",
|
|
]
|
|
# selection_list = None
|
|
manager_token = ""
|
|
writers_token = manager_token
|
|
people_uu_id_list = []
|
|
list_of_attendees = []
|
|
|
|
if add_with_employee:
|
|
select_occupant = login_via_email_and_password(
|
|
login_data=login_creds_employee, is_password_valid=False
|
|
)
|
|
print("select_company_uu_id", select_occupant)
|
|
run_company_and_depends(company_uu_id=select_occupant)
|
|
run_address_to_building()
|
|
|
|
if add_with_occupant:
|
|
select_occupant = login_via_email_and_password(
|
|
login_data=login_creds_occupant,
|
|
is_password_valid=False,
|
|
selection_list=selection_list,
|
|
)
|
|
if assign_people_to_create_item == 0:
|
|
selected_decision_book_uu_id = run_decision_book_depends()
|
|
send_invitation = {
|
|
"build_decision_book_uu_id": selected_decision_book_uu_id,
|
|
"message": "Request for a Regular Building Meeting",
|
|
"planned_date": arrow.now().shift(days=2).date().__str__(),
|
|
}
|
|
send_invitation_to_building_residents(send_invitation_dict=send_invitation)
|
|
if assign_people_to_create_item == 1:
|
|
count = 17
|
|
list_of_attendees.insert(0, manager_token)
|
|
collect_invitation_to_building_residents(
|
|
attended_dict_list=list_of_attendees, attend_count=count + 1
|
|
)
|
|
elif assign_people_to_create_item == 2:
|
|
assign_people_to_pre_or_wrt(
|
|
person_uu_id=people_uu_id_list[0],
|
|
manager_token=manager_token,
|
|
occupant_code="MT-VPR",
|
|
)
|
|
assign_people_to_pre_or_wrt(
|
|
person_uu_id=people_uu_id_list[1],
|
|
manager_token=manager_token,
|
|
occupant_code="MT-WRT",
|
|
)
|
|
assign_people_to_pre_or_wrt(
|
|
person_uu_id=people_uu_id_list[2],
|
|
manager_token=manager_token,
|
|
occupant_code="MT-PRS",
|
|
)
|
|
elif assign_people_to_create_item == 3:
|
|
select_occupant = login_via_email_and_password(
|
|
login_data=wrt_creds_occupant,
|
|
is_password_valid=True,
|
|
selection_list=selection_list,
|
|
)
|
|
selected_decision_book_uu_id = list_decision_books()["data"][0]["uu_id"]
|
|
print("select_company_uu_id", select_occupant)
|
|
is_fixed_price = False
|
|
|
|
info_type_d_uu_id = get_type_codes_key_and_class(
|
|
class_name="BuildDuesTypes", key_name="BDT-D"
|
|
)["data"]["uu_id"]
|
|
unit_price = 15.90
|
|
run_decision_book_items(
|
|
writers_token=writers_token,
|
|
unit_price=unit_price,
|
|
is_fixed=is_fixed_price,
|
|
info_type_uu_id=info_type_d_uu_id,
|
|
)
|
|
is_fixed_price = True
|
|
|
|
info_type_a_uu_id = get_type_codes_key_and_class(
|
|
class_name="BuildDuesTypes", key_name="BDT-A"
|
|
)["data"]["uu_id"]
|
|
start_date, end_date = "2024-11-01", "2025-02-01"
|
|
unit_price = 850
|
|
run_decision_book_items(
|
|
writers_token=writers_token,
|
|
unit_price=unit_price,
|
|
is_fixed=is_fixed_price,
|
|
info_type_uu_id=info_type_a_uu_id,
|
|
start_date=start_date,
|
|
end_date=end_date,
|
|
)
|
|
|
|
info_type_a_uu_id = get_type_codes_key_and_class(
|
|
class_name="BuildDuesTypes", key_name="BDT-R"
|
|
)["data"]["uu_id"]
|
|
unit_price = 5000
|
|
run_decision_book_items(
|
|
writers_token=writers_token,
|
|
unit_price=unit_price,
|
|
is_fixed=is_fixed_price,
|
|
info_type_uu_id=info_type_a_uu_id,
|
|
start_date=start_date,
|
|
end_date=end_date,
|
|
)
|
|
|
|
info_type_a_uu_id = get_type_codes_key_and_class(
|
|
class_name="BuildDuesTypes", key_name="BDT-R"
|
|
)["data"]["uu_id"]
|
|
unit_price = 2000
|
|
run_decision_book_items(
|
|
writers_token=writers_token,
|
|
unit_price=unit_price,
|
|
is_fixed=is_fixed_price,
|
|
info_type_uu_id=info_type_a_uu_id,
|
|
start_date=start_date,
|
|
end_date=end_date,
|
|
)
|
|
|
|
info_type_a_uu_id = get_type_codes_key_and_class(
|
|
class_name="BuildDuesTypes", key_name="BDT-L"
|
|
)["data"]["uu_id"]
|
|
unit_price = 750
|
|
run_decision_book_items(
|
|
writers_token=writers_token,
|
|
unit_price=unit_price,
|
|
is_fixed=is_fixed_price,
|
|
info_type_uu_id=info_type_a_uu_id,
|
|
start_date=start_date,
|
|
end_date=end_date,
|
|
)
|