Enhance API robustness: Add model validators, view-field filtering, and test suite.

- Added validators to Person_Base, Journal_Base, Journal_Entry_Base, Address_Base, and Contact_Base to handle null values and unsafe lookups.
- Implemented 'fields_to_exclude_from_db' ClassVar in Journal models to prevent view-only fields from causing DB errors.
- Updated Contact object map to align with DB schema.
- Added comprehensive test suite in 'tests/' directory (model validation, filtering logic).
- Updated GEMINI.md with progress.
This commit is contained in:
Scott Idem
2026-01-09 15:36:28 -05:00
parent 29b4d5ae4b
commit 1c0922ace2
11 changed files with 472 additions and 17 deletions

36
tests/verify_imports.py Normal file
View File

@@ -0,0 +1,36 @@
import sys
import os
# Add current directory to path
sys.path.append(os.getcwd())
print("Attempting to import app.lib_general_v3...")
try:
import app.lib_general_v3
print("Success: app.lib_general_v3")
except Exception as e:
print(f"Failed: app.lib_general_v3 - {e}")
import traceback
traceback.print_exc()
print("-" * 20)
print("Attempting to import app.routers.api_crud_v3...")
try:
import app.routers.api_crud_v3
print("Success: app.routers.api_crud_v3")
except Exception as e:
print(f"Failed: app.routers.api_crud_v3 - {e}")
import traceback
traceback.print_exc()
print("-" * 20)
print("Attempting to import app.routers.agent_bridge...")
try:
import app.routers.agent_bridge
print("Success: app.routers.agent_bridge")
except Exception as e:
print(f"Failed: app.routers.agent_bridge - {e}")
import traceback
traceback.print_exc()