File size: 1,192 Bytes
7781557 3bb94b1 7781557 3bb94b1 c63a1e8 3bb94b1 7781557 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
from pydantic import BaseModel, EmailStr
from bson import ObjectId
from typing import Optional
from datetime import datetime
class User(BaseModel):
username: str
email: EmailStr
password: str
class TokenData(BaseModel):
username: Optional[str] = None
class Token(BaseModel):
access_token: str
token_type: str
class FileUpload(BaseModel):
filename: str
content: list[dict]
created_at: Optional[datetime] = None
updated_at: Optional[datetime] = None
class Opportunity(BaseModel):
username:str
activity: str
closeDate: Optional[datetime] = None
customerContact: str
customerContactRole: str
customerName: str
nextSteps: str
opportunityDescription: str
opportunityId: str
opportunityName: str
opportunityState: str
opportunityValue: str
created_at: Optional[datetime] = None
updated_at: Optional[datetime] = None
class Config:
json_encoders = {
datetime: lambda v: v.isoformat(),
ObjectId: lambda v: str(v)
}
allow_population_by_field_name = True
class ChatMessage(BaseModel):
message: str
timestamp: datetime
sender: str |