beanie/odm/models.py
raw| 1 | from pydantic import BaseModel |
| 2 | |
| 3 | from beanie.odm.enums import InspectionStatuses |
| 4 | from beanie.odm.fields import PydanticObjectId |
| 5 | |
| 6 | |
| 7 | class InspectionError(BaseModel): |
| 8 | """ |
| 9 | Inspection error details |
| 10 | """ |
| 11 | |
| 12 | document_id: PydanticObjectId |
| 13 | error: str |
| 14 | |
| 15 | |
| 16 | class InspectionResult(BaseModel): |
| 17 | """ |
| 18 | Collection inspection result |
| 19 | """ |
| 20 | |
| 21 | status: InspectionStatuses = InspectionStatuses.OK |
| 22 | errors: list[InspectionError] = [] |