feat(platform): close AI expense value loop

Add tenant-safe value, telemetry, connector, commercial, and production-readiness foundations.
This commit is contained in:
caoxiaozhu
2026-07-17 14:14:08 +08:00
parent 242d68c36f
commit 787bc3a481
507 changed files with 82072 additions and 6344 deletions

View File

@@ -51,8 +51,12 @@ def build_client() -> TestClient:
def test_notification_state_service_persists_user_scoped_read_and_hidden_state() -> None:
with build_session() as db:
service = NotificationStateService(db)
user = CurrentUserContext(username="alice", name="Alice", role_codes=[], is_admin=False)
other_user = CurrentUserContext(username="bob", name="Bob", role_codes=[], is_admin=False)
user = CurrentUserContext(
tenant_id="default", username="alice", name="Alice", role_codes=[], is_admin=False
)
other_user = CurrentUserContext(
tenant_id="default", username="bob", name="Bob", role_codes=[], is_admin=False
)
saved = service.patch_states(
NotificationStateBatchPatch(
@@ -90,7 +94,9 @@ def test_notification_state_service_persists_user_scoped_read_and_hidden_state()
def test_notification_state_storage_ready_runs_once_per_database_bind(monkeypatch) -> None:
with build_session() as db:
service = NotificationStateService(db)
user = CurrentUserContext(username="alice", name="Alice", role_codes=[], is_admin=False)
user = CurrentUserContext(
tenant_id="default", username="alice", name="Alice", role_codes=[], is_admin=False
)
calls: list[object] = []
original_create_all = Base.metadata.create_all