2024-06-02 19:27:25 +04:00
|
|
|
from typing import Optional, List
|
2024-05-25 16:11:52 +04:00
|
|
|
from pydantic import BaseModel, ConfigDict
|
2024-06-02 15:51:14 +04:00
|
|
|
from datetime import datetime
|
2024-06-02 16:38:08 +04:00
|
|
|
from enums import TypeMood, TypeModel
|
2024-05-25 16:11:52 +04:00
|
|
|
|
2024-05-25 16:51:34 +04:00
|
|
|
class SQuestionAdd(BaseModel):
|
2024-06-02 15:51:14 +04:00
|
|
|
email_user: str
|
2024-06-02 16:38:08 +04:00
|
|
|
type_mood: TypeMood
|
|
|
|
type_model: TypeModel
|
2024-05-25 16:51:34 +04:00
|
|
|
question: str
|
2024-05-25 16:11:52 +04:00
|
|
|
|
2024-05-25 16:51:34 +04:00
|
|
|
class SQuestion(SQuestionAdd):
|
2024-05-25 16:11:52 +04:00
|
|
|
id: int
|
2024-05-25 16:51:34 +04:00
|
|
|
answer: Optional[str] = None
|
2024-06-02 15:51:14 +04:00
|
|
|
question_time: datetime
|
2024-05-25 16:11:52 +04:00
|
|
|
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
2024-05-25 16:51:34 +04:00
|
|
|
class SQuestionId(BaseModel):
|
|
|
|
question_id: int
|
2024-06-03 20:05:19 +04:00
|
|
|
answer: str
|
2024-06-02 19:27:25 +04:00
|
|
|
|
|
|
|
class Flight(BaseModel):
|
|
|
|
id: int
|
|
|
|
departurePoint: str
|
|
|
|
destinationPoint: str
|
|
|
|
destinationTime: str
|
|
|
|
departureTime: str
|
|
|
|
distance: float
|
|
|
|
countEconomic: int
|
|
|
|
countBusiness: int
|
|
|
|
|
|
|
|
class TripRequest(BaseModel):
|
2024-06-02 21:07:40 +04:00
|
|
|
fromPoint: str
|
|
|
|
toPoint: str
|
2024-06-02 19:27:25 +04:00
|
|
|
countBusiness: int
|
|
|
|
countEconomic: int
|
|
|
|
departureDate: str
|
2024-06-05 00:38:13 +04:00
|
|
|
returnDate: Optional[str] = None
|
|
|
|
flightsTo: List[Flight]
|
2024-06-06 23:37:38 +04:00
|
|
|
flightsBack: List[Flight]
|
|
|
|
|
|
|
|
class Review(BaseModel):
|
|
|
|
city: str
|
2024-06-08 00:01:29 +04:00
|
|
|
airport: str
|
2024-06-06 23:37:38 +04:00
|
|
|
address: str
|
2024-06-07 23:29:55 +04:00
|
|
|
name_ru: str
|
|
|
|
|
|
|
|
class FlightSegment(BaseModel):
|
2024-06-09 16:42:05 +04:00
|
|
|
id: int
|
2024-06-07 23:29:55 +04:00
|
|
|
departurePoint: str
|
|
|
|
destinationPoint: str
|
|
|
|
|
|
|
|
class TripOption(BaseModel):
|
|
|
|
to: List[FlightSegment]
|
2024-06-07 23:47:13 +04:00
|
|
|
back: List[FlightSegment]
|