from typing import Literal, Optional
from pydantic import Field
from app.utils.schemas_utils import CustomModel

class InfoTechCreate(CustomModel):
    
    type : Literal["Cash Tills/POS Equipment", "Scanner", "Computer"]
    units : int
    cost_per_unit : int
    store_formate_type : Literal["Store Formate A", "Store Formate B"]= Field(default="Store Formate A")
    category : Literal["Software", "Hardware", "Physical Component"]
    remark : str
    group_id : int
    
    
class InfoTechResponses(InfoTechCreate):
    infotech_id : int
    # type : Literal["Cash Tills/POS Equipment", "Scanner", "Computer"]
    # units : int
    # cost_per_unit : int
    # total : int 
    # store_formate_type : Literal["Store Formate A", "Store Formate B"] = Field(default="Store Formate A")
    # remark : str
    # group_id : int
    
class InfoTechUpdate(CustomModel):
    infotech_id : Optional[int] = None
    type : Optional[Literal["Cash Tills/POS Equipment", "Scanner", "Computer"]]
    units : Optional[int] = None
    cost_per_unit : Optional[int] = None
    store_formate_type : Optional[Literal["Store Formate A", "Store Formate B"]] = Field(default="Store Formate A")
    category : Optional[Literal["Software", "Hardware", "Physical Component"]]
    remark : Optional[str] = None
    group_id : Optional[int] = None
    
class InfoTechSum(CustomModel):
    group_id: int
    store_formate_type: str
    total_sum: Optional[int] = None
    