feat(ai): add tenant-safe hierarchical expense learning

This commit is contained in:
caoxiaozhu
2026-07-16 14:30:41 +08:00
parent 6bdf65bc24
commit ee88a36baf
65 changed files with 6909 additions and 232 deletions

View File

@@ -26,6 +26,7 @@ class CurrentUserContext:
is_admin: bool
tenant_id: str = "default"
department_name: str = ""
department_id: str = ""
cost_center: str = ""
position: str = ""
grade: str = ""
@@ -74,6 +75,7 @@ def _authenticate_bearer_user(db: Session, authorization: str | None) -> Current
is_admin=user.is_admin,
tenant_id=user.tenant_id,
department_name=user.department,
department_id=user.department_id or "",
cost_center=user.cost_center,
position=user.position,
grade=user.grade,