from datetime import datetime

from pydantic import BaseModel


class ShareToken(BaseModel):
    id: str | None = None          # token itself (32 hex chars), used as _id
    job_id: str
    organization_id: str
    created_by_user_id: str
    created_by_email: str
    created_at: datetime | None = None
    expires_at: datetime | None = None
    is_active: bool = True
    label: str | None = None       # human-readable note e.g. "Sent to ACME 2026-05-01"


class ShareTokenResponse(BaseModel):
    id: str
    job_id: str
    created_by_email: str
    created_at: datetime
    expires_at: datetime | None = None
    is_active: bool
    label: str | None = None
    share_url: str                     # full public URL, assembled server-side
