fix: CameraRecord — reject negative entries/exits via Pydantic Field(ge=0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-14 07:02:51 -07:00
parent 910508194a
commit a8f036f25f
2 changed files with 12 additions and 3 deletions

View File

@@ -11,14 +11,14 @@ import sqlite3
from typing import List
from fastapi import Depends
from pydantic import BaseModel
from pydantic import BaseModel, Field
class CameraRecord(BaseModel):
period_start: int
period_end: int
entries: int
exits: int
entries: int = Field(ge=0)
exits: int = Field(ge=0)
class CameraEventsRequest(BaseModel):