feat(deliveries): delivery requests and upload/share evidence
Deploy / deploy (push) Successful in 5m17s

A built package used to become DELIVERED on one click with nothing behind
it, and nothing recorded what a client had asked for.

- Marking delivered is now two recorded steps: Record upload (the link on
  the client's portal, contents confirmed) then Share link (who it was sent
  to). The second is refused until the first is on record.
- Delivery requests log a client's ask by episode, pasted shot codes or a
  Shot Status selection. A line closes only when its shot goes out with
  evidence after the request was logged; a request can otherwise only be
  cancelled with a reason.
- Delivered Outside Pipeline takes an upload link and recipient, required
  for shots on an open request.
- The dashboard gains an Awaiting delivery section listing open requests
  and built packages the client does not have yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
twotalesanimation
2026-09-30 14:21:24 +02:00
parent 326d8cbefa
commit f30acef101
25 changed files with 2241 additions and 52 deletions
@@ -0,0 +1,22 @@
import { NextRequest, NextResponse } from "next/server";
import { toErrorResponse } from "@/lib/render-pipeline/errors";
import { requirePipelineUser } from "@/lib/render-pipeline/session-auth";
import { getRequestOptions } from "@/lib/render-pipeline/delivery-requests";
// ── GET /api/delivery-requests/options?projectId= ────────────────────────────
//
// The episodes a request can be logged against.
export async function GET(req: NextRequest) {
try {
await requirePipelineUser();
const projectId = new URL(req.url).searchParams.get("projectId");
if (!projectId) {
return NextResponse.json({ error: "projectId is required" }, { status: 400 });
}
return NextResponse.json(await getRequestOptions(projectId));
} catch (err) {
const { body, status } = toErrorResponse(err);
return NextResponse.json(body, { status });
}
}