import typing
import pydantic

class user_login_request(pydantic.BaseModel):
    nick: str
    password: str

    model_config = {
        "json_schema_extra": {
            "excamples": [
                {
                    "nick": "test",
                    "password": "QWERTYZ"
                }
            ]
        }
    }

class reservation_request(pydantic.BaseModel):
    apikey: str
    target_name: typing.Optional[str] = None
    target_barcode: typing.Optional[str] = None
    email: typing.Optional[str] = None
    phone_number: typing.Optional[str] = None

    model_config = {
        "json_schema_extra": {
            "excamples": [
                {
                    "target_barcode": "123456789012",
                    "email": "sample@noreply"
                },
                {
                    "target_name": "Sample",
                    "phone_number": "+48 123456789"
                }
            ]
        }
    }

class user_get_request(pydantic.BaseModel):
    apikey: str
    
    model_config = {
        "json_schema_extra": {
            "excamples": [
                {
                    "apikey": "af...699",
                }
            ]
        }
    }

class product_update_request(pydantic.BaseModel):
    apikey: str
    name: str
    description: str
    author: str
    stock_count: int
    barcode: str
    
    model_config = {
        "json_schema_extra": {
            "excamples": [
                {
                    "apikey": "af...69",
                    "name": "Product Name",
                    "description": "Product description.",
                    "author": "Product author.",
                    "stocik_count": 10,
                    "barcode": "509282819938"
                }
            ]
        }
    }

class product_create_request(pydantic.BaseModel):
    apikey: str
    name: str
    description: str
    author: str
    image: str
    stock_count: str
    barcode: str

    model_config = {
        "json_schema_extra": {
            "examples": [
                {
                    "apikey": "af...69",
                    "name": "Product Name",
                    "description": "Product description.",
                    "author": "Product author.",
                    "image": "ddshfgiuhiugde... base64 encoded image",
                    "stocik_count": 10,
                    "barcode": "509282819938"
                }
            ]
        }
    }

class product_update_image_request(pydantic.BaseModel):
    apikey: str
    image: str

    model_config = {
        "json_schema_extra": {
            "examples": [
                {
                    "apikey": "af...69",
                    "image": "lfjskhgshgkfj base64 encoded image"
                }
            ]
        }
    }

class apikey_request(pydantic.BaseModel):
    apikey: str
    
    model_config = {
        "json_schema_extra": {
            "excamples": [
                {
                    "apikey": "af...699",
                }
            ]
        }
    }


