"""Pydantic v2 schemas for organizations."""

from __future__ import annotations

import uuid
from datetime import datetime

from pydantic import BaseModel, ConfigDict


class OrganizationOut(BaseModel):
    model_config = ConfigDict(from_attributes=True)

    id: uuid.UUID
    name: str
    slug: str
    org_type: str
    is_transparent: bool
    color: str | None
    icon: str | None
    description: str | None
    created_at: datetime


class OrganizationCreate(BaseModel):
    name: str
    slug: str
    org_type: str = "community"
    is_transparent: bool = False
    color: str | None = None
    icon: str | None = None
    description: str | None = None


class OrgMemberOut(BaseModel):
    model_config = ConfigDict(from_attributes=True)

    id: uuid.UUID
    org_id: uuid.UUID
    identity_id: uuid.UUID
    role: str
    created_at: datetime
