# app/schemas/guest.py
from pydantic import BaseModel, Field


class GuestLoginRequest(BaseModel):
    device_unique_id: str
    device_token: str
    device_type: str
    device_name: str
    app_version: str
    
    
class EncryptedGuestLoginRequest(BaseModel):
    """
    The request body that your API receives.
    `payload` is a base64 string produced by AES-CBC encryption.
    """
    payload: str = Field(..., description="Base64 AES-CBC encrypted JSON body")

class GuestLoginPayload(BaseModel):
    """
    The decrypted JSON that MUST be present inside the encrypted payload.
    """
    device_unique_id: str = Field(..., min_length=3, max_length=255)
    device_name: str = Field(..., min_length=1, max_length=255)
    device_token: str = Field("", max_length=255)  # can be empty
    device_type: str = Field(..., min_length=1, max_length=1, description="I=iOS, A=Android, M=Misc")
    app_version: str = Field(..., min_length=1, max_length=50)
