vBot-2.1 / app /schemas.py
Ajit Panday
Fix timestamp handling in customer endpoints
7714b76
raw
history blame contribute delete
985 Bytes
from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime
class CustomerBase(BaseModel):
name: str
company_name: str
email: str
class CustomerCreate(CustomerBase):
pass
class Customer(CustomerBase):
id: int
api_key: str
is_active: bool
created_at: Optional[datetime] = Field(default_factory=datetime.utcnow)
updated_at: Optional[datetime] = Field(default_factory=datetime.utcnow)
class Config:
from_attributes = True
class CallRecordBase(BaseModel):
caller_number: str
called_number: str
file_path: str
transcription: str
summary: str
sentiment: str
class CallRecordCreate(CallRecordBase):
pass
class CallRecord(CallRecordBase):
id: str
customer_id: int
created_at: Optional[datetime] = Field(default_factory=datetime.utcnow)
updated_at: Optional[datetime] = Field(default_factory=datetime.utcnow)
class Config:
from_attributes = True