Fix: Change Customer schema datetime fields to str for proper serialization
This commit is contained in:
parent
c9af509e1c
commit
f6303fa804
@ -2,7 +2,7 @@
|
|||||||
Pydantic Models and Schemas
|
Pydantic Models and Schemas
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel, ConfigDict
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@ -23,11 +23,10 @@ class CustomerCreate(CustomerBase):
|
|||||||
class Customer(CustomerBase):
|
class Customer(CustomerBase):
|
||||||
"""Full customer schema"""
|
"""Full customer schema"""
|
||||||
id: int
|
id: int
|
||||||
created_at: datetime
|
created_at: str # Changed from datetime to str for serialization
|
||||||
updated_at: Optional[datetime] = None
|
updated_at: Optional[str] = None # Changed from datetime to str for serialization
|
||||||
|
|
||||||
class Config:
|
model_config = ConfigDict(from_attributes=True)
|
||||||
from_attributes = True
|
|
||||||
|
|
||||||
|
|
||||||
class HardwareBase(BaseModel):
|
class HardwareBase(BaseModel):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user