feat: consolidate ticket domain baseline
This commit is contained in:
@@ -18,3 +18,27 @@ def test_list_operation_logs_returns_recent_logs(admin_client, db):
|
||||
assert len(payload) == 1
|
||||
assert payload[0]["module"] == "system"
|
||||
assert payload[0]["action"] == "health_check"
|
||||
|
||||
|
||||
def test_list_operation_logs_supports_business_object_filters(admin_client, db):
|
||||
OperationAuditLog.objects.create(
|
||||
module="tickets",
|
||||
action="status_transition",
|
||||
target_type="ticket",
|
||||
target_id="42",
|
||||
result="success",
|
||||
)
|
||||
OperationAuditLog.objects.create(
|
||||
module="agents",
|
||||
action="run_started",
|
||||
target_type="agent_run",
|
||||
target_id="run-1",
|
||||
result="success",
|
||||
)
|
||||
|
||||
response = admin_client.get(
|
||||
"/api/audit/operation-logs?module=tickets&target_type=ticket&target_id=42"
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert [item["target_id"] for item in response.json()] == ["42"]
|
||||
|
||||
Reference in New Issue
Block a user