from datetime import datetime
from typing import Optional, List
from pydantic import BaseModel
from pydantic import Field
from src.apps.base.schemas.common import BaseSchema


# Shared properties
class CustomerSettingBase(BaseSchema):
    key: str = Field(description="Key of the Field")
    value: str = Field(description="Value of the field")


class CustomerSettingSchema(CustomerSettingBase):
    id: int = Field(description="Id of Customer resource")
    created_at: Optional[datetime] = Field(
        description="Created date and time as unix timestamp"
    )
    updated_at: Optional[datetime] = Field(
        description="Updated date and time as unix timestamp"
    )


class CustomerSettingCreateRequestSchema(BaseModel):
    settings: List[CustomerSettingBase] = Field(description="List of settings")


class CustomerSettingUpdateRequestSchema(CustomerSettingBase):
    pass
