from pydantic import BaseModel from typing import Optional, Dict, Any, List # Request Schemas class RegisterUserRequest(BaseModel): phoneNumber: str password: str profile: Optional[str] = "2mbps_profile" class LoginRequest(BaseModel): phone: str password: str mac_address: str ip_address: str class SetUserStatusRequest(BaseModel): phone: str disabled: bool # Response Schemas class UserUsage(BaseModel): bytes_in: int bytes_out: int total_bytes: int download_mb: float upload_mb: float total_mb: float class ActiveUser(BaseModel): phone: str uptime: str mac_address: str ip_address: str usage: UserUsage class UserStats(BaseModel): phone: str profile: str status: str uptime: str usage: UserUsage class UserListItem(BaseModel): phone: str profile: str status: str disabled: bool comment: str usage: UserUsage # Base Response Schema class APIResponse(BaseModel): success: bool message: str data: Optional[Dict[str, Any]] = None error: Optional[str] = None # Specific Response Schemas class RegisterUserResponse(APIResponse): data: Optional[Dict[str, Any]] = None class LoginResponse(APIResponse): data: Optional[Dict[str, Any]] = None class LogoutResponse(APIResponse): data: Optional[Dict[str, Any]] = None class UserStatusResponse(APIResponse): data: Optional[Dict[str, Any]] = None class ActiveUsersResponse(APIResponse): data: Optional[List[ActiveUser]] = None class UsersListResponse(APIResponse): data: Optional[List[UserListItem]] = None class UserStatsResponse(APIResponse): data: Optional[List[UserStats]] = None