"""
File Schemas
"""
from datetime import datetime
from typing import Optional
from uuid import UUID
from pydantic import BaseModel, ConfigDict, Field


class FileBase(BaseModel):
    """Base file schema"""
    filename: str = Field(..., min_length=1, max_length=255)
    file_type: str = Field(..., max_length=50)
    size: Optional[int] = None


class FileCreate(FileBase):
    """File create schema"""
    project_id: UUID
    file_path: Optional[str] = None
    status: str = "pending"


class FileUpdate(BaseModel):
    """File update schema"""
    status: Optional[str] = None


class FileResponse(FileBase):
    """File response schema"""
    model_config = ConfigDict(from_attributes=True)

    id: UUID
    project_id: UUID
    file_path: Optional[str]
    status: str
    created_at: datetime
    updated_at: datetime


# Alias for CRUD
FileCreateSchema = FileCreate
FileUpdateSchema = FileUpdate
