"""
Pydantic schemas for Laboratory entities.
"""

from datetime import datetime
from uuid import UUID

from pydantic import BaseModel, ConfigDict, Field


class LabBase(BaseModel):
    """Base fields for a laboratory entity."""

    name: str = Field(..., min_length=2, max_length=200, description="Lab display name")
    address: str | None = Field(default=None, max_length=1000, description="Physical address")
    logo_url: str | None = Field(default=None, max_length=500, description="Logo storage URL")


class LabCreate(LabBase):
    """Payload to create a new laboratory branch."""


class LabUpdate(BaseModel):
    """Payload to update an existing laboratory."""

    name: str | None = Field(default=None, min_length=2, max_length=200)
    address: str | None = Field(default=None, max_length=1000)
    logo_url: str | None = Field(default=None, max_length=500)


class LabResponse(LabBase):
    """Full representation of a laboratory."""

    model_config = ConfigDict(from_attributes=True)

    id: UUID
    created_at: datetime
    updated_at: datetime
