Fix: Change Customer schema datetime fields to str for proper serialization

This commit is contained in:
Christian 2025-12-19 16:45:22 +01:00
parent c9af509e1c
commit f6303fa804

View File

@ -2,7 +2,7 @@
Pydantic Models and Schemas
"""
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict
from typing import Optional
from datetime import datetime
@ -23,11 +23,10 @@ class CustomerCreate(CustomerBase):
class Customer(CustomerBase):
"""Full customer schema"""
id: int
created_at: datetime
updated_at: Optional[datetime] = None
created_at: str # Changed from datetime to str for serialization
updated_at: Optional[str] = None # Changed from datetime to str for serialization
class Config:
from_attributes = True
model_config = ConfigDict(from_attributes=True)
class HardwareBase(BaseModel):