event and service sendpoints added

This commit is contained in:
2025-04-30 18:19:31 +03:00
parent 36e63960f8
commit e815251123
24 changed files with 441 additions and 79 deletions

View File

@@ -239,7 +239,9 @@ def create_occupant_defaults(db_session):
user_tenant.password_token = PasswordModule.generate_refresher_token()
with mongo_handler.collection(collection_name) as mongo_engine:
existing_record = mongo_engine.find_one({"user_uu_id": str(user_build_manager.uu_id)})
existing_record = mongo_engine.find_one(
{"user_uu_id": str(user_build_manager.uu_id)}
)
if not existing_record:
mongo_engine.insert_one(
document={
@@ -252,11 +254,13 @@ def create_occupant_defaults(db_session):
else:
mongo_engine.update_one(
{"user_uu_id": str(user_build_manager.uu_id)},
{"$set": {
"other_domains_list": [main_domain],
"main_domain": main_domain,
"modified_at": arrow.now().timestamp(),
}}
{
"$set": {
"other_domains_list": [main_domain],
"main_domain": main_domain,
"modified_at": arrow.now().timestamp(),
}
},
)
with mongo_handler.collection(collection_name) as mongo_engine:
@@ -273,11 +277,13 @@ def create_occupant_defaults(db_session):
else:
mongo_engine.update_one(
{"user_uu_id": str(user_owner.uu_id)},
{"$set": {
"other_domains_list": [main_domain],
"main_domain": main_domain,
"modified_at": arrow.now().timestamp(),
}}
{
"$set": {
"other_domains_list": [main_domain],
"main_domain": main_domain,
"modified_at": arrow.now().timestamp(),
}
},
)
with mongo_handler.collection(collection_name) as mongo_engine:
@@ -294,11 +300,13 @@ def create_occupant_defaults(db_session):
else:
mongo_engine.update_one(
{"user_uu_id": str(user_tenant.uu_id)},
{"$set": {
"other_domains_list": [main_domain],
"main_domain": main_domain,
"modified_at": arrow.now().timestamp(),
}}
{
"$set": {
"other_domains_list": [main_domain],
"main_domain": main_domain,
"modified_at": arrow.now().timestamp(),
}
},
)
created_build_living_space_prs = BuildLivingSpace.find_or_create(