From f6303fa8042335e3d187c266c3b00606b573fcb9 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 19 Dec 2025 16:45:22 +0100 Subject: [PATCH] Fix: Change Customer schema datetime fields to str for proper serialization --- app/models/schemas.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/models/schemas.py b/app/models/schemas.py index a412364..f1423e7 100644 --- a/app/models/schemas.py +++ b/app/models/schemas.py @@ -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):