import { adaptWorkflowDetail } from "@/lib/adapters/workflows"; import { backendRequest } from "@/lib/http/backend-client"; import { jsonSuccess, parsePositiveIntegerParam, withErrorHandling, } from "@/lib/http/response"; import type { WorkflowStatusResponseDto } from "@/lib/types/backend"; type RouteContext = { params: Promise<{ orderId: string; }>; }; export async function GET(_request: Request, context: RouteContext) { return withErrorHandling(async () => { const { orderId: rawOrderId } = await context.params; const orderId = parsePositiveIntegerParam(rawOrderId, "orderId"); const response = await backendRequest( `/workflows/${orderId}`, ); return jsonSuccess(adaptWorkflowDetail(response.data), { mode: "proxy", }); }); }