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