| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- from datetime import datetime
- from typing import Optional
- from pydantic import BaseModel, ConfigDict, EmailStr
- class BaseResponse(BaseModel):
- # may define additional fields or config shared across responses
- model_config = ConfigDict(from_attributes=True)
- class BaseObjectResponse(BaseResponse):
- id: str
- created_at: datetime
- updated_at: datetime
- class AccessTokenResponse(BaseResponse):
- token_type: str
- access_token: str
- expires_at: int
- issued_at: int
- refresh_token: str
- refresh_token_expires_at: int
- refresh_token_issued_at: int
- class UserResponse(BaseResponse):
- id: str
- email: EmailStr
- class VolunteerResponse(BaseObjectResponse):
- name: str
- surname: str
- email: str
- phone_number: str
- automatic_sms: bool
- slots_id: list[str] = []
- comment: str
- class SlotResponse(BaseObjectResponse):
- title: str
- starting_time: datetime
- ending_time: datetime
- required_volunteers: int
- volunteers_id: list[str] = []
- template_id: Optional[str]
- class SMSResponse(BaseObjectResponse):
- volunteer_id: Optional[str]
- content: str
- phone_number: str
- sending_time: datetime
- send_time: Optional[datetime]
- class TemplateResponse(BaseObjectResponse):
- title: str
- description: str
- place: str
- responsible_contact: str
- tags_id: list[str] = []
- comment: str
- class TagResponse(BaseObjectResponse):
- title: str
- templates_id: list[str] = []
- class ProjectResponse(BaseObjectResponse):
- name: str
- volunteers: list[VolunteerResponse]
- sms: list[SMSResponse]
- slots: list[SlotResponse]
- tags: list[TagResponse]
- templates: list[TemplateResponse]
- is_public: bool
- class ProjectListResponse(BaseResponse):
- id: str
- created_at: datetime
- updated_at: datetime
- name: str
- is_public: bool
|