from pydantic import BaseModel, EmailStr, Field
from typing import Optional, Dict
from datetime import date

# --- STEP 1: LITE REGISTRATION ---
class UserLiteRegister(BaseModel):
    email: EmailStr
    password: str = Field(..., min_length=8)
    first_name: str
    last_name: str
    region_code: str = "HU"

class UserLogin(BaseModel):
    email: EmailStr
    password: str

# --- STEP 2: KYC & ONBOARDING ---
class ICEContact(BaseModel):
    name: str
    phone: str
    relationship: Optional[str] = None

class DocumentDetail(BaseModel):
    number: str
    expiry_date: date

class UserKYCComplete(BaseModel):
    phone_number: str
    birth_place: str
    birth_date: date
    mothers_name: str
    # Rugalmas okmánytár, pl: {"id_card": {"number": "123", "expiry_date": "2030-01-01"}}
    identity_docs: Dict[str, DocumentDetail]
    ice_contact: ICEContact

# --- COMMON & SECURITY ---
class PasswordResetRequest(BaseModel):
    email: EmailStr

class Token(BaseModel):
    access_token: str
    token_type: str
    is_active: bool # KYC státusz visszajelzés