from pydantic import BaseModel, EmailStr, Field
from typing import Optional, Dict,List
from datetime import datetime
from src.constants import CompanyUserRoleEnum,DepartmentEnum,ApplicationUserRoleEnum, FontSizeEnum, TicketPriorityEnum



# company user schemas
class AddCompanyUser(BaseModel):
    full_name: str
    user_email: EmailStr
    user_department: DepartmentEnum
    user_role: CompanyUserRoleEnum 


class DeleteCompanyUser(BaseModel):
    user_id:str



class UpdateCompanyUser(BaseModel):
    user_id: str
    full_name:Optional[str]=None
    user_email: Optional[EmailStr] = None
    user_department: Optional[DepartmentEnum] = None
    user_role: Optional[CompanyUserRoleEnum] = None
    reset_password: Optional[bool] = None  


class UpdatedCompanyUserResponse(BaseModel):
    user_id: str
    user_email: EmailStr
    user_department: DepartmentEnum
    user_role: CompanyUserRoleEnum
    password: Optional[str] = None  # optional field

    class Config:
        from_attributes = True

class ThemeSchema(BaseModel):
    
    font_size: FontSizeEnum = Field(default="small", description="Font size of the theme")
    font_color: str
    background_color: str
    font_family: str
    primary_color: str
   
class CompanyIpAddressSchema(BaseModel):
     allowed_ipaddress:str



class TicketUSerSchema(BaseModel):
    
    issue_type:str
    title:str
    description:str
    priority: TicketPriorityEnum

class UpdateTicketUSerSchema(BaseModel):
    
    issue_type:Optional[str]
    title:Optional[str]
    description:Optional[str]
    priority:Optional[TicketPriorityEnum]
    
class SettingsNotificationsSchema(BaseModel):
    transaction_alert:bool
    report_ready:bool
    system_update:bool
    weekly_summary:bool