Download models/user.py from anique-1/Medisync: direct link, hf CLI and curl.
- Browser
- Download file 1.74 kB
-
https://huggingface.co/spaces/anique-1/Medisync/resolve/main/models/user.py
- Command line
-
hf download hf://spaces/anique-1/Medisync/models/user.py
-
curl -L -o user.py https://huggingface.co/spaces/anique-1/Medisync/resolve/main/models/user.py
1.74 kB
| from pydantic import BaseModel, EmailStr, Field | |
| from typing import List, Optional | |
| from datetime import datetime, timedelta | |
| from zoneinfo import ZoneInfo # For timezone handling | |
| # Define Pakistan Standard Time (PKT) | |
| PKT = ZoneInfo("Asia/Karachi") | |
| class UserBase(BaseModel): | |
| full_name: str | |
| phone_number: str | |
| email: EmailStr | |
| class UserCreate(UserBase): | |
| password: str | |
| class UserInDB(UserBase): | |
| id: str = Field(default_factory=str, alias="_id") | |
| hashed_password: Optional[str] = None | |
| google_id: Optional[str] = None | |
| is_verified: bool = False | |
| # slots: List[str] = [] # Removed slot system | |
| # Subscription fields | |
| subscription_status: str = "trial" # trial, active, expired, pending_approval | |
| subscription_plan: str = "free_trial" # free_trial, monthly, yearly | |
| trial_start_date: datetime = Field(default_factory=lambda: datetime.now(PKT)) | |
| trial_end_time: datetime = Field(default_factory=lambda: datetime.now(PKT) + timedelta(days=1)) # Set trial to expire in 1 day for testing | |
| subscription_end_date: Optional[datetime] = None | |
| transaction_id: Optional[str] = None | |
| device_id: Optional[str] = None | |
| created_at: datetime = Field(default_factory=lambda: datetime.now(PKT)) | |
| updated_at: datetime = Field(default_factory=lambda: datetime.now(PKT)) | |
| class UserPublic(UserBase): | |
| id: str | |
| is_verified: bool | |
| # slots: List[str] | |
| subscription_status: Optional[str] = "trial" | |
| subscription_plan: Optional[str] = "free_trial" | |
| trial_start_date: Optional[datetime] = None | |
| trial_end_time: Optional[datetime] = None | |
| device_id: Optional[str] = None | |
| created_at: datetime | |
| updated_at: datetime # Added for completeness, if needed by frontend | |