Reject coerced consequence-preview inputs

Declare child_id as StrictInt and is_present as StrictBool on the
consequence request model so a JSON true is not accepted as child id 1
and a numeric or string status is not coerced to a bool (NQ-201-1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-23 21:59:36 -04:00
co-authored by Claude Opus 5.5
parent b51310eb74
commit 86b551fe21
2 changed files with 39 additions and 2 deletions
+3 -2
View File
@@ -681,12 +681,13 @@ class AdminPresenceOverrideConsequenceRequest(BaseModel):
``is_present`` bool are enforced by the SAME
:class:`~nestquest_core.presence.PresenceOverride` constructor the
create route's core path builds; this model only guards the SHAPE.
Strict fields: a JSON ``true`` is not child id 1, nor ``1`` a bool.
"""
child_id: int
child_id: StrictInt
start_date: str
end_date: str
is_present: bool
is_present: StrictBool
class AdminPresenceOverrideConsequenceResponse(BaseModel):