fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-25 15:32:19 +09:00
parent bd7a481803
commit dd7349bb4c
9 changed files with 646 additions and 80 deletions

View File

@@ -0,0 +1,46 @@
from typing import Optional
from uuid import UUID
from pydantic import BaseModel, Field
class EmergencyContactBase(BaseModel):
name: str = Field(..., min_length=1, max_length=100)
phone_number: str = Field(..., min_length=5, max_length=20)
relationship: Optional[str] = Field(None, max_length=50)
notes: Optional[str] = Field(None, max_length=500)
class EmergencyContactCreate(EmergencyContactBase):
pass
class EmergencyContactUpdate(BaseModel):
name: Optional[str] = Field(None, min_length=1, max_length=100)
phone_number: Optional[str] = Field(None, min_length=5, max_length=20)
relationship: Optional[str] = Field(None, max_length=50)
notes: Optional[str] = Field(None, max_length=500)
class EmergencyContactResponse(EmergencyContactBase):
id: int
uuid: UUID
user_id: int
model_config = {
"from_attributes": True,
"populate_by_name": True,
"json_schema_extra": {
"examples": [
{
"name": "John Doe",
"phone_number": "+1234567890",
"relationship": "Father",
"notes": "Call in case of emergency",
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"user_id": 1,
}
]
}
}