Files
OSIT-AE-API-FastAPI/app/object_definitions/core.py
Scott Idem b8a417a5d7 Key Accomplishments:
1. Badge Model Updates: Added print_count, print_first_datetime, and print_last_datetime to the
      Event_Badge_Basic_Base model.
   2. Soft Delete in V3 CRUD: Implemented a method query parameter (delete, hide, disable) for the DELETE
      endpoints in api_crud_v3.py.
   3. Security Hardening: Populated searchable_fields allowlists for all objects across the V3 CRUD
      definitions (core.py, events.py, orders.py, cms.py, lookups.py, membership.py, other.py).
   4. Shared Documentation: Created /home/scott/agents_sync/Aether/api_v3.md to coordinate these V3 API
      features with the Svelte agent and other tools.
2026-01-05 20:05:33 -05:00

228 lines
8.7 KiB
Python

from app.models.account_models import *
from app.models.account_cfg_models import *
from app.models.activity_log_models import *
from app.models.address_models import *
from app.models.contact_models import *
from app.models.data_store_models import *
from app.models.organization_models import *
from app.models.person_models import *
from app.models.user_models import *
from app.models.user_role_models import *
from app.models.log_client_viewing_models import Log_Client_Viewing_Base
core_obj_li = {
'activity_log': {
'tbl': 'activity_log',
'tbl_default': 'v_activity_log',
'tbl_update': 'activity_log',
'mdl': Activity_Log_Base,
'mdl_default': Activity_Log_Base,
'mdl_in': Activity_Log_Base,
'mdl_out': Activity_Log_Base,
# Legacy V2 keys:
'table_name': 'v_activity_log',
'tbl_name_update': 'activity_log',
'base_name': Activity_Log_Base,
# V3 Search Security:
'searchable_fields': [
'activity_log_id_random', 'account_id_random', 'person_id_random',
'user_id_random', 'external_client_id', 'name', 'description',
'source', 'url_root', 'url_full_path', 'object_type',
'object_id_random', 'action', 'action_with', 'action_on_type',
'action_on_id_random', 'action_on_code', 'code', 'type_name',
'details', 'enable', 'hide', 'priority', 'group', 'created_on', 'updated_on'
],
},
'account': {
'tbl': 'account',
'tbl_default': 'account',
'tbl_update': 'account',
'mdl': Account_Base,
'mdl_default': Account_Base,
'mdl_in': Account_Base,
'mdl_out': Account_Base,
# Legacy V2 keys:
'table_name': 'account',
'tbl_name_update': 'account',
'base_name': Account_Base,
# V3 Search Security:
'searchable_fields': [
'account_id_random', 'code', 'name', 'short_name', 'description',
'enable', 'created_on', 'updated_on'
],
},
'account_cfg': {
'tbl': 'account_cfg',
'tbl_default': 'v_account_cfg',
'tbl_update': 'account_cfg',
'mdl': Account_Cfg_Base,
'mdl_default': Account_Cfg_Base,
'mdl_in': Account_Cfg_Base,
'mdl_out': Account_Cfg_Base,
# Legacy V2 keys:
'table_name': 'v_account_cfg',
'tbl_name_update': 'account_cfg',
'base_name': Account_Cfg_Base,
# V3 Search Security:
'searchable_fields': [
'account_cfg_id_random', 'account_id_random', 'account_code',
'account_name', 'account_short_name', 'default_no_reply_email',
'default_no_reply_name', 'confirm_email', 'help_event_email',
'help_general_email', 'help_tech_email', 'stripe_account_id',
'created_on', 'updated_on'
],
},
'address': {
'tbl': 'address',
'tbl_default': 'v_address',
'tbl_update': 'address',
'mdl': Address_Base,
'mdl_default': Address_Base,
'mdl_in': Address_Base,
'mdl_out': Address_Base,
# Legacy V2 keys:
'table_name': 'v_address',
'tbl_name_update': 'address',
'base_name': Address_Base,
# V3 Search Security:
'searchable_fields': [
'address_id_random', 'account_id_random', 'for_type', 'for_id_random',
'contact_id_random', 'name', 'attention_to', 'organization_name',
'line_1', 'line_2', 'line_3', 'city', 'country_subdivision_code',
'country_subdivision_name', 'state_province', 'postal_code',
'country_alpha_2_code', 'country_name', 'timezone', 'created_on', 'updated_on'
],
},
'contact': {
'tbl': 'contact',
'tbl_default': 'v_contact',
'tbl_update': 'contact',
'mdl': Contact_Base,
'mdl_default': Contact_Base,
'mdl_in': Contact_Base,
'mdl_out': Contact_Base,
# Legacy V2 keys:
'table_name': 'v_contact',
'tbl_name_update': 'contact',
'base_name': Contact_Base,
# V3 Search Security:
'searchable_fields': [
'contact_id_random', 'account_id_random', 'for_type', 'for_id_random',
'name', 'title', 'tagline', 'description', 'timezone_name',
'email', 'email_status', 'phone_mobile', 'phone_office',
'website_url', 'website_name', 'priority', 'group', 'created_on', 'updated_on'
],
},
'data_store': {
'tbl': 'data_store',
'tbl_default': 'v_data_store',
'tbl_update': 'data_store',
'mdl': Data_Store_Base,
'mdl_default': Data_Store_Base,
'mdl_in': Data_Store_Base,
'mdl_out': Data_Store_Base,
# Legacy V2 keys:
'table_name': 'v_data_store',
'tbl_name_update': 'data_store',
'base_name': Data_Store_Base,
# V3 Search Security:
'searchable_fields': [
'data_store_id_random', 'account_id_random', 'for_type', 'for_id_random',
'person_id_random', 'user_id_random', 'code', 'name', 'description',
'type', 'text', 'meta_text', 'access', 'enable', 'hide', 'priority',
'group', 'created_on', 'updated_on'
],
},
'organization': {
'tbl': 'organization',
'tbl_default': 'v_organization',
'tbl_update': 'organization',
'mdl': Organization_Base,
'mdl_default': Organization_Base,
'mdl_in': Organization_Base,
'mdl_out': Organization_Base,
# Legacy V2 keys:
'table_name': 'v_organization',
'tbl_name_update': 'organization',
'base_name': Organization_Base,
# V3 Search Security:
'searchable_fields': [
'organization_id_random', 'account_id_random', 'contact_id_random',
'person_id_random', 'user_id_random', 'name', 'tagline', 'description',
'company', 'nonprofit', 'priority', 'group', 'created_on', 'updated_on'
],
},
'person': {
'tbl': 'v_person',
'tbl_default': 'v_person',
'tbl_alt': 'v_person',
'tbl_update': 'person',
'mdl': Person_Base,
'mdl_default': Person_Base,
'mdl_in': Person_Base,
'mdl_out': Person_Base,
# Legacy V2 keys:
'table_name': 'v_person',
'tbl_name_update': 'person',
'base_name': Person_Base,
'exp_default': [
'person_id_random',
'given_name', 'middle_name', 'family_name', 'full_name',
'primary_email',
'enable', 'hide', 'priority', 'sort', 'group', 'notes', 'created_on', 'updated_on',
],
# V3 Search Security:
'searchable_fields': [
'person_id_random', 'account_id_random', 'contact_id_random',
'organization_id_random', 'user_id_random', 'membership_person_id_random',
'pronouns', 'informal_name', 'title_names', 'given_name', 'middle_name',
'family_name', 'designations', 'professional_title', 'full_name',
'informal_full_name', 'professional_full_name', 'affiliations',
'primary_email', 'tagline', 'lu_gender_name', 'source_code',
'external_id', 'status', 'hide', 'priority', 'group', 'enable',
'created_on', 'updated_on', 'username', 'user_name', 'user_email'
],
},
'user': {
'tbl': 'v_user',
'tbl_default': 'v_user',
'tbl_alt': 'v_user',
'tbl_update': 'user',
'mdl': User_Base,
'mdl_default': User_Base,
'mdl_in': User_New_Base,
'mdl_out': User_Out_Base,
# Legacy V2 keys:
'table_name': 'v_user',
'tbl_name_update': 'user',
'base_name': User_Base,
'exp_default': [
'user_id_random',
'account_id_random',
'username', 'name', 'email',
'enable', 'hide', 'priority', 'sort', 'group', 'notes', 'created_on', 'updated_on',
],
# V3 Search Security:
'searchable_fields': [
'user_id_random', 'account_id_random', 'contact_id_random',
'organization_id_random', 'person_id_random', 'username', 'name',
'email', 'enable', 'super', 'manager', 'administrator', 'public',
'verified', 'status_name', 'group', 'created_on', 'updated_on'
],
},
'user_role': {
'mdl': User_Role_Base,
# Legacy V2 keys:
'table_name': 'v_user_role',
'tbl_name_update': 'user_role',
'base_name': User_Role_Base,
},
'log_client_viewing': {
'mdl': Log_Client_Viewing_Base,
# Legacy V2 keys:
'table_name': 'log_client_viewing',
'tbl_name_update': 'log_client_viewing',
'base_name': Log_Client_Viewing_Base,
},
}