trovesuite 1.0.23__py3-none-any.whl → 1.0.25__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,13 +38,11 @@ class Settings:
38
38
  # SHARED TABLES (core_platform schema)
39
39
  # =============================================================================
40
40
  CORE_PLATFORM_TENANTS_TABLE = os.getenv("CORE_PLATFORM_TENANTS_TABLE", "core_platform.cp_tenants")
41
- CORE_PLATFORM_TENANT_RESOURCE_ID_TABLE = os.getenv("CORE_PLATFORM_TENANT_RESOURCE_ID_TABLE", "core_platform.cp_resource_ids")
42
41
  CORE_PLATFORM_SUBSCRIPTIONS_TABLE = os.getenv("CORE_PLATFORM_SUBSCRIPTIONS_TABLE", "core_platform.cp_subscriptions")
43
42
  CORE_PLATFORM_APPS_TABLE = os.getenv("CORE_PLATFORM_APPS_TABLE", "core_platform.cp_apps")
44
43
  CORE_PLATFORM_USERS_TABLE = os.getenv("CORE_PLATFORM_USERS_TABLE", "core_platform.cp_users")
45
44
  CORE_PLATFORM_RESOURCE_TYPES_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_TYPES_TABLE", "core_platform.cp_resource_types")
46
- CORE_PLATFORM_RESOURCE_ID_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_ID_TABLE", "core_platform.cp_shared_resource_ids")
47
- CORE_PLATFORM_RESOURCES_TABLE = os.getenv("CORE_PLATFORM_RESOURCES_TABLE", "core_platform.resources")
45
+ CORE_PLATFORM_RESOURCE_ID_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_ID_TABLE", "core_platform.cp_resource_ids")
48
46
  CORE_PLATFORM_PERMISSIONS_TABLE = os.getenv("CORE_PLATFORM_PERMISSIONS_TABLE", "core_platform.cp_permissions")
49
47
  CORE_PLATFORM_ROLES_TABLE = os.getenv("CORE_PLATFORM_ROLES_TABLE", "core_platform.cp_roles")
50
48
  CORE_PLATFORM_ROLE_PERMISSIONS_TABLE = os.getenv("CORE_PLATFORM_ROLE_PERMISSIONS_TABLE", "core_platform.cp_role_permissions")
@@ -69,7 +67,6 @@ class Settings:
69
67
  CORE_PLATFORM_LOGIN_SETTINGS_TABLE = os.getenv("CORE_PLATFORM_LOGIN_SETTINGS_TABLE", "core_platform.cp_login_settings")
70
68
  CORE_PLATFORM_RESOURCES_TABLE = os.getenv("CORE_PLATFORM_RESOURCES_TABLE", "core_platform.cp_resources")
71
69
  CORE_PLATFORM_ASSIGN_ROLES_TABLE = os.getenv("CORE_PLATFORM_ASSIGN_ROLES_TABLE", "core_platform.cp_assign_roles")
72
- CORE_PLATFORM_RESOURCE_ID_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_ID_TABLE", "core_platform.cp_resource_ids")
73
70
  CORE_PLATFORM_SUBSCRIPTION_HISTORY_TABLE = os.getenv("CORE_PLATFORM_SUBSCRIPTION_HISTORY_TABLE", "core_platform.cp_user_subscription_histories")
74
71
  CORE_PLATFORM_RESOURCE_DELETION_CHAT_HISTORY_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_DELETION_CHAT_HISTORY_TABLE", "core_platform.cp_resource_deletion_chat_histories")
75
72
  CORE_PLATFORM_USER_GROUPS_TABLE = os.getenv("CORE_PLATFORM_USER_GROUPS_TABLE", "core_platform.cp_user_groups")
@@ -81,6 +78,7 @@ class Settings:
81
78
  CORE_PLATFORM_ASSIGN_LOCATIONS_TABLE = os.getenv("CORE_PLATFORM_ASSIGN_LOCATIONS_TABLE", "core_platform.cp_assign_locations")
82
79
  CORE_PLATFORM_UNIT_OF_MEASURE_TABLE = os.getenv("CORE_PLATFORM_UNIT_OF_MEASURE_TABLE", "core_platform.cp_unit_of_measures")
83
80
  CORE_PLATFORM_CURRENCY = os.getenv("CORE_PLATFORM_CURRENCY", "core_platform.cp_currencies")
81
+ CORE_PLATFORM_THEMES_TABLE = os.getenv("CORE_PLATFORM_THEMES_TABLE", "core_platform.cp_themes")
84
82
 
85
83
  # Mail Configurations
86
84
  MAIL_SENDER_EMAIL=os.getenv("MAIL_SENDER_EMAIL")
@@ -96,12 +96,12 @@ class Helper:
96
96
 
97
97
  try:
98
98
  if tenant_id:
99
- # For tenant-specific resource IDs, check shared schema with tenant_id filter
100
- # Note: TENANT_RESOURCE_ID_TABLE needs to be defined in settings
101
- tenant_resource_table = getattr(db_settings, 'TENANT_RESOURCE_ID_TABLE', None)
102
- if tenant_resource_table:
99
+ # For tenant-specific resource IDs, use CORE_PLATFORM_RESOURCE_ID_TABLE
100
+ # This table has tenant_id column for filtering
101
+ resource_table = getattr(db_settings, 'CORE_PLATFORM_RESOURCE_ID_TABLE', None)
102
+ if resource_table:
103
103
  resource_exists = DatabaseManager.execute_scalar(
104
- f"""SELECT COUNT(1) FROM {tenant_resource_table}
104
+ f"""SELECT COUNT(1) FROM {resource_table}
105
105
  WHERE tenant_id = %s AND id = %s""",
106
106
  (tenant_id, candidate,),
107
107
  )
@@ -109,8 +109,8 @@ class Helper:
109
109
  # Fallback: assume no conflict if table not configured
110
110
  resource_exists = 0
111
111
  else:
112
- # For main schema resource IDs
113
- main_resource_table = getattr(db_settings, 'MAIN_RESOURCE_ID_TABLE', None)
112
+ # For main/shared schema resource IDs (no tenant_id)
113
+ main_resource_table = getattr(db_settings, 'CORE_PLATFORM_RESOURCE_ID_TABLE', None)
114
114
  if main_resource_table:
115
115
  resource_exists = DatabaseManager.execute_scalar(
116
116
  f"""SELECT COUNT(1) FROM {main_resource_table}
@@ -236,9 +236,9 @@ class Helper:
236
236
 
237
237
  try:
238
238
  # Check if table name is set
239
- tenant_activity_logs_table = getattr(db_settings, 'TENANT_ACTIVITY_LOGS_TABLE', None)
239
+ tenant_activity_logs_table = getattr(db_settings, 'CORE_PLATFORM_ACTIVITY_LOGS_TABLE', None)
240
240
  if not tenant_activity_logs_table:
241
- logger.error("TENANT_ACTIVITY_LOGS_TABLE is not configured in settings")
241
+ logger.error("CORE_PLATFORM_ACTIVITY_LOGS_TABLE is not configured in settings")
242
242
  return
243
243
 
244
244
  log_id = Helper.generate_unique_identifier(prefix="alog")
@@ -263,7 +263,7 @@ class Helper:
263
263
  if user_id:
264
264
  try:
265
265
  logger.debug(f"Fetching user information for user_id={user_id}")
266
- main_users_table = getattr(db_settings, 'MAIN_USERS_TABLE', 'main.cp_users')
266
+ main_users_table = getattr(db_settings, 'CORE_PLATFORM_USERS_TABLE', 'core_platform.cp_users')
267
267
  user_data = DatabaseManager.execute_query(
268
268
  f"""SELECT email, contact, fullname
269
269
  FROM {main_users_table}
@@ -414,10 +414,10 @@ class Helper:
414
414
  """
415
415
  try:
416
416
  # Get table names from settings with fallbacks
417
- main_users_table = getattr(db_settings, 'MAIN_USERS_TABLE', 'main.users')
418
- main_roles_table = getattr(db_settings, 'MAIN_ROLES_TABLE', 'main.roles')
419
- tenant_assign_roles_table = getattr(db_settings, 'TENANT_ASSIGN_ROLES_TABLE', 'main.tenant_assign_roles')
420
- tenant_user_groups_table = getattr(db_settings, 'TENANT_USER_GROUPS_TABLE', 'main.tenant_user_groups')
417
+ main_users_table = getattr(db_settings, 'CORE_PLATFORM_USERS_TABLE', 'core_platform.cp_users')
418
+ main_roles_table = getattr(db_settings, 'CORE_PLATFORM_ROLES_TABLE', 'core_platform.cp_roles')
419
+ tenant_assign_roles_table = getattr(db_settings, 'CORE_PLATFORM_ASSIGN_ROLES_TABLE', 'core_platform.cp_assign_roles')
420
+ tenant_user_groups_table = getattr(db_settings, 'CORE_PLATFORM_USER_GROUPS_TABLE', 'core_platform.cp_user_groups')
421
421
 
422
422
  # Query to get users with admin roles - both direct and through groups
423
423
  query = f"""
@@ -568,7 +568,7 @@ class Helper:
568
568
  actor_email = "no-reply@trovesuite.com"
569
569
 
570
570
  if actor_user_id:
571
- main_users_table = getattr(db_settings, 'MAIN_USERS_TABLE', 'main.cp_users')
571
+ main_users_table = getattr(db_settings, 'CORE_PLATFORM_USERS_TABLE', 'core_platform.cp_users')
572
572
  actor_details = DatabaseManager.execute_query(
573
573
  f"""SELECT fullname, email
574
574
  FROM {main_users_table}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trovesuite
3
- Version: 1.0.23
3
+ Version: 1.0.25
4
4
  Summary: TroveSuite services package providing authentication, authorization, notifications, Azure Storage, and other enterprise services for TroveSuite applications
5
5
  Home-page: https://dev.azure.com/brightgclt/trovesuite/_git/packages
6
6
  Author: Bright Debrah Owusu
@@ -8,7 +8,7 @@ trovesuite/auth/auth_write_dto.py,sha256=rdwI7w6-9QZGv1H0PAGrjkLBCzaMHjgPIXeLb9R
8
8
  trovesuite/configs/__init__.py,sha256=h1mSZOaZ3kUy1ZMO_m9O9KklsxywM0RfMVZLh9h9WvQ,328
9
9
  trovesuite/configs/database.py,sha256=IPSu8fXjxyYeJ3bFknJG06Qm2L2ub6Ht19xhKv8g7nA,11731
10
10
  trovesuite/configs/logging.py,sha256=mGjR2d4urVNry9l5_aXycMMtcY2RAFIpEL35hw33KZg,9308
11
- trovesuite/configs/settings.py,sha256=2S1zPHJiYWaK6xT-tnZBfT2gJ-C0O6qXMtVQt_Xtyi4,7200
11
+ trovesuite/configs/settings.py,sha256=r3wyLdlLtnPzrTPV5Z4BytItLtfvQoP860waAfdecLA,6941
12
12
  trovesuite/entities/__init__.py,sha256=Dbl_03Bueyh2vOP2hykd40MmNMrl5nNHSRGP-kqwwNo,160
13
13
  trovesuite/entities/health.py,sha256=KaW7yxTQdymIPlnkJJkDqEebBXkD0a7A66i5GgNZLoE,2700
14
14
  trovesuite/entities/sh_response.py,sha256=1_sw3PpVaDxWsNiBU0W9YLHZgTFxEj4JJBLBfSY63Ho,1579
@@ -25,10 +25,10 @@ trovesuite/storage/storage_read_dto.py,sha256=o7EVJdwrwVZAaeyGU9O01WMECGVaytkvLR
25
25
  trovesuite/storage/storage_service.py,sha256=V7LIePIV6b_iuhm-9x8r4zwpZHgeRPL1YIe5IBnxhco,19768
26
26
  trovesuite/storage/storage_write_dto.py,sha256=vl1iCZ93bpFmpvkCrn587QtMtOA_TPDseXSoTuj9RTQ,1355
27
27
  trovesuite/utils/__init__.py,sha256=mDZuY77BphvQFYLmcWxjP5Tcq9ZZ3WXJWBKB1v6wzHU,185
28
- trovesuite/utils/helper.py,sha256=NySt18kl4Dc78tN5HiB7SpsCH5DWy3QvG1AMtl-ASBM,26951
28
+ trovesuite/utils/helper.py,sha256=28KjFtiDS4IxuO13QBQUmU4dq9xUJDll9ewWetCrOcc,27061
29
29
  trovesuite/utils/templates.py,sha256=_92k4-EkqWs-h0LNJxPgorbspmp24kDngS7O3qWIFyQ,20388
30
- trovesuite-1.0.23.dist-info/licenses/LICENSE,sha256=EJT35ct-Q794JYPdAQy3XNczQGKkU1HzToLeK1YVw2s,1070
31
- trovesuite-1.0.23.dist-info/METADATA,sha256=jkuPAVvbn9wDBw_R2Yvk-m7HlhaN7NSnBHpiGQjLXYw,21737
32
- trovesuite-1.0.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
- trovesuite-1.0.23.dist-info/top_level.txt,sha256=GzKhG_-MTaxeHrIgkGkBH_nof2vroGFBrjeHKWUIwNc,11
34
- trovesuite-1.0.23.dist-info/RECORD,,
30
+ trovesuite-1.0.25.dist-info/licenses/LICENSE,sha256=EJT35ct-Q794JYPdAQy3XNczQGKkU1HzToLeK1YVw2s,1070
31
+ trovesuite-1.0.25.dist-info/METADATA,sha256=nO2O8YvC6rbuh8vClhrEUdrSn6RaYI9es6NjVLEv0oE,21737
32
+ trovesuite-1.0.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
+ trovesuite-1.0.25.dist-info/top_level.txt,sha256=GzKhG_-MTaxeHrIgkGkBH_nof2vroGFBrjeHKWUIwNc,11
34
+ trovesuite-1.0.25.dist-info/RECORD,,