from pydantic import BaseModel, Field
from typing import List, Optional

class HRQueryRequest(BaseModel):
    user_id: int = Field(..., description="User ID from HelixtaHR")
    query: str = Field(..., description="HR query or question", min_length=5, max_length=500)
    role: str = Field(..., description="User role: Manager, HR, Executive", min_length=2)
    
    class Config:
        example = {
            "user_id": 123,
            "query": "What skills should a senior accountant have?",
            "role": "HR"
        }

class SkillSet(BaseModel):
    salary_range: str = Field(..., description="Recommended salary range")
    required_skills: List[str] = Field(..., description="List of required skills")
    experience_expectations: str = Field(..., description="Expected years/type of experience")
    hiring_benchmarks: Optional[str] = Field(None, description="Key hiring benchmarks")

class HRQueryResponse(BaseModel):
    query: str
    result: SkillSet
    cached: bool = Field(False, description="Whether response was from cache")
    
    class Config:
        example = {
            "query": "What skills should a senior accountant have?",
            "result": {
                "salary_range": "$60,000 - $85,000 per year",
                "required_skills": ["GAAP", "Financial Analysis", "Excel", "Tax Knowledge", "Communication"],
                "experience_expectations": "5+ years in accounting or finance",
                "hiring_benchmarks": "CPA certification preferred, proficiency in accounting software"
            },
            "cached": False
        }
