feat(platform): close AI expense value loop
Add tenant-safe value, telemetry, connector, commercial, and production-readiness foundations.
This commit is contained in:
@@ -25,6 +25,7 @@ from app.services.expense_claims import ExpenseClaimService
|
||||
|
||||
def _manager_user() -> CurrentUserContext:
|
||||
return CurrentUserContext(
|
||||
tenant_id="default",
|
||||
username="manager-action@example.com",
|
||||
name="李经理",
|
||||
role_codes=["manager"],
|
||||
@@ -34,6 +35,7 @@ def _manager_user() -> CurrentUserContext:
|
||||
|
||||
def _finance_user() -> CurrentUserContext:
|
||||
return CurrentUserContext(
|
||||
tenant_id="default",
|
||||
username="finance-action@example.com",
|
||||
name="王财务",
|
||||
role_codes=["finance"],
|
||||
@@ -173,9 +175,7 @@ def test_approve_replay_returns_original_snapshot_after_claim_moves_forward(
|
||||
assert replay is not None
|
||||
assert ExpenseClaimRead.model_validate(replay).model_dump(mode="json") == first_json
|
||||
assert replay.approval_stage == "财务审批"
|
||||
assert all(
|
||||
item.get("source") != "future_state" for item in replay.risk_flags_json or []
|
||||
)
|
||||
assert all(item.get("source") != "future_state" for item in replay.risk_flags_json or [])
|
||||
persisted = db.get(ExpenseClaim, claim.id)
|
||||
assert persisted is not None
|
||||
assert persisted.status == "pending_payment"
|
||||
@@ -283,6 +283,7 @@ def test_legacy_stage_repair_cannot_commit_inside_action_protocol(
|
||||
]
|
||||
db.commit()
|
||||
admin_user = CurrentUserContext(
|
||||
tenant_id="default",
|
||||
username="admin-action@example.com",
|
||||
name="审批管理员",
|
||||
role_codes=["admin"],
|
||||
|
||||
Reference in New Issue
Block a user