from typing import Optional

from pydantic import BaseModel, EmailStr, HttpUrl

# Shared properties
class YTViewsBase(BaseModel):
    email: Optional[EmailStr] = None
    name : Optional[str] = None
    phone : Optional[str] = None
    company: Optional[str] = None
    url: Optional[HttpUrl] = None
    area: Optional[str] = None
    language: Optional[str] = None
    ages: Optional[str] = None
    target: Optional[str] = None
    theme: Optional[str] = None
    taxID: Optional[str] = None
    item: Optional[str] = None
    amount: Optional[str] = None
    
# Properties to receive on video creation
class YTViewsCreate(YTViewsBase):
    email: EmailStr
    name : str
    phone : str
    url: HttpUrl
    area: str
    language: str
    ages: str
    target: str
    theme: str
    item: Optional[str] = None
    amount: Optional[str] = None
    
# Properties to receive on video update
class YTViewsUpdate(YTViewsBase):
    pass

# Properties shared by models stored in DB
class YTViewsInDBBase(YTViewsBase):
    id: int
    email: EmailStr
    name : str
    company: str
    url: HttpUrl
    area: str
    language: str
    ages: str
    target: str
    theme: str
    taxID: str
    item: str
    amount: str
    payment_state: str
    
    class Config:
        orm_mode = True


# Properties to return to client
class YTViews(YTViewsInDBBase):
    pass


# Properties properties stored in DB
class YTViewsInDB(YTViewsInDBBase):
    pass
