27 lines
579 B
Python
27 lines
579 B
Python
|
|
"""Entity history schemas — response, list, and restore request."""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from pydantic import BaseModel
|
||
|
|
|
||
|
|
|
||
|
|
class EntityHistoryResponse(BaseModel):
|
||
|
|
id: str
|
||
|
|
entity_type: str
|
||
|
|
entity_id: str
|
||
|
|
action: str
|
||
|
|
snapshot_before: dict | None = None
|
||
|
|
snapshot_after: dict | None = None
|
||
|
|
changes: dict | None = None
|
||
|
|
user_id: str | None = None
|
||
|
|
created_at: str | None = None
|
||
|
|
|
||
|
|
|
||
|
|
class EntityHistoryListResponse(BaseModel):
|
||
|
|
items: list[EntityHistoryResponse]
|
||
|
|
total: int
|
||
|
|
|
||
|
|
|
||
|
|
class RestoreRequest(BaseModel):
|
||
|
|
history_id: str
|