40 lines
874 B
Python
40 lines
874 B
Python
from typing import Optional, List
|
|
from pydantic import BaseModel, ConfigDict
|
|
from datetime import datetime
|
|
from enums import TypeMood, TypeModel
|
|
|
|
class SQuestionAdd(BaseModel):
|
|
email_user: str
|
|
type_mood: TypeMood
|
|
type_model: TypeModel
|
|
question: str
|
|
|
|
class SQuestion(SQuestionAdd):
|
|
id: int
|
|
answer: Optional[str] = None
|
|
question_time: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
class SQuestionId(BaseModel):
|
|
question_id: int
|
|
answer: str
|
|
|
|
class Flight(BaseModel):
|
|
id: int
|
|
departurePoint: str
|
|
destinationPoint: str
|
|
destinationTime: str
|
|
departureTime: str
|
|
distance: float
|
|
countEconomic: int
|
|
countBusiness: int
|
|
|
|
class TripRequest(BaseModel):
|
|
fromPoint: str
|
|
toPoint: str
|
|
countBusiness: int
|
|
countEconomic: int
|
|
departureDate: str
|
|
returnDate: str
|
|
flights: List[Flight] |