| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 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] = []
- 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] = []
- 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
|