"""Typed identifier wrappers.

Pydantic v2 ``Annotated[str, ...]`` aliases that prevent accidentally
passing a ``VesselId`` where a ``ProjectId`` is expected (mypy-enforced).
At runtime they are plain strings — UUID v4 hex by default.
"""

from __future__ import annotations

import uuid
from typing import NewType

ProjectId = NewType("ProjectId", str)
"""Unique identifier of a customer project (one vessel = one project)."""

VesselId = NewType("VesselId", str)
"""Unique identifier of a vessel within a project."""


def new_project_id() -> ProjectId:
    """Generate a fresh, random ``ProjectId`` (UUID v4 hex)."""
    return ProjectId(uuid.uuid4().hex)


def new_vessel_id() -> VesselId:
    """Generate a fresh, random ``VesselId`` (UUID v4 hex)."""
    return VesselId(uuid.uuid4().hex)
