feat(expenses): add authoritative pre-review workflow
This commit is contained in:
@@ -422,6 +422,13 @@ def test_attachment_association_job_links_receipts_after_conversation_exit(
|
||||
assert claim is not None
|
||||
attached_items = [item for item in claim.items if item.invoice_id]
|
||||
assert len(attached_items) == 2
|
||||
pre_review_flags = [
|
||||
flag
|
||||
for flag in list(claim.risk_flags_json or [])
|
||||
if isinstance(flag, dict) and flag.get("source") == "ai_pre_review"
|
||||
]
|
||||
assert len(pre_review_flags) == 1
|
||||
assert pre_review_flags[0]["created_at"]
|
||||
receipt_links = list(
|
||||
db.scalars(
|
||||
select(ExpenseCaseLink).where(ExpenseCaseLink.resource_type == "receipt")
|
||||
@@ -438,6 +445,13 @@ def test_attachment_association_job_links_receipts_after_conversation_exit(
|
||||
"receipt_received",
|
||||
"attachment_associated",
|
||||
}
|
||||
expense_case = db.scalar(
|
||||
select(ExpenseCase).where(
|
||||
ExpenseCase.id == receipt_links[0].expense_case_id
|
||||
)
|
||||
)
|
||||
assert expense_case is not None
|
||||
assert expense_case.current_stage == "claiming"
|
||||
|
||||
linked_receipts = receipt_service.list_receipts(
|
||||
current_user=current_user, status_filter="linked"
|
||||
|
||||
Reference in New Issue
Block a user