"""Relative path layout under ``storage_staging_upload_root``."""
from __future__ import annotations

from uuid import UUID


def build_staging_relative_path(
    workspace_id: UUID,
    project_id: UUID,
    filename: str,
    *,
    ingest_id: UUID,
) -> str:
    safe = filename.replace("\\", "/").split("/")[-1] or "upload.bin"
    return f"{workspace_id}/{project_id}/ingest/{ingest_id}/{safe}"
