Using pydantic instead of dataclasses

This commit is contained in:
Jonas Linter
2025-10-07 16:06:53 +02:00
parent e5a295faba
commit e605af1231
5 changed files with 319 additions and 35 deletions

View File

@@ -75,9 +75,9 @@ class HotelReservationIdData(BaseModel):
"""Validated hotel reservation ID data."""
res_id_type: str = Field(..., pattern=r"^[0-9]+$") # Must be numeric string
res_id_value: str | None = None
res_id_source: str | None = None
res_id_source_context: str | None = None
res_id_value: str | None = Field(None, min_length=1, max_length=64)
res_id_source: str | None = Field(None, min_length=1, max_length=64)
res_id_source_context: str | None = Field(None, min_length=1, max_length=64)
@field_validator(
"res_id_value", "res_id_source", "res_id_source_context", mode="before"