from service_app_test.bases import RequestToApi
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,
)
from service_app_test.test_application.migrate_old_data.company import migrate_company


login_data = {
    "domain": "evyos.com.tr",
    "access_key": "karatay.berkay.sup@evyos.com.tr",
    "password": "string",
    "remember_me": False,
    "password_token": "",
}
login_data_wag = {
    "domain": "evyos.com.tr",
    "access_key": "karatay.berkay.sup@evyos.com.tr",
    "password": "string",
    "remember_me": False,
    "password_token": "",
}

wag_api = RequestToApi()
wag_api.overwrite_base_url(base_url=WagAPI.base_url)
wag_api.selected_object = wag_api.login_via_email_and_password(
    login_data=login_data_wag, is_password_valid=True
)

local_api = RequestToApi()
local_api.overwrite_base_url(base_url=LocalAPI.base_url)
local_api.selected_object = local_api.login_via_email_and_password(
    login_data=login_data, is_password_valid=True
)

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)
