Coverage for src / lexigram / contracts / lifecycle / auditable.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-08-15 18:58 +0800

1from __future__ import annotations 

2 

3from typing import Any, Protocol, runtime_checkable 

4 

5 

6@runtime_checkable 

7class AuditableProtocol(Protocol): 

8 """Protocol for audit logging.""" 

9 

10 async def log_operation( 

11 self, 

12 operation: str, 

13 record_id: Any, 

14 changes: dict[str, Any] | None = None, 

15 user_id: str | None = None, 

16 ) -> None: ... 

17 

18 async def get_audit_log( 

19 self, 

20 record_id: Any | None = None, 

21 user_id: str | None = None, 

22 limit: int | None = None, 

23 ) -> list[dict[str, Any]]: ... 

24 

25 

26__all__ = ["AuditableProtocol"]