from pydantic import BaseModel, Field, ConfigDict
from typing import Optional, List

class ContactCreate(BaseModel):
    full_name: str
    email: str
    phone: Optional[str] = None
    contact_type: str = "primary"

class CorpOnboardIn(BaseModel):
    """ Teljes onboarding adatcsomag atomizált címekkel. """
    full_name: str = Field(..., description="Hivatalos cégnév")
    name: str = Field(..., description="Rövid név")
    display_name: str
    
    tax_number: str
    reg_number: Optional[str] = None
    country_code: str = "HU"
    language: str = "hu"
    default_currency: str = "HUF"
    
    # --- ATOMIZÁLT CÍM (Modell szinkron) ---
    address_zip: str
    address_city: str
    address_street_name: str
    address_street_type: str
    address_house_number: str
    address_stairwell: Optional[str] = None
    address_floor: Optional[str] = None
    address_door: Optional[str] = None
    address_hrsz: Optional[str] = None
    
    contacts: List[ContactCreate] = []

class CorpOnboardResponse(BaseModel):
    organization_id: int
    status: str
    model_config = ConfigDict(from_attributes=True)