/billing mit Tabs Offen/Abgerechnet/Storniert, Filtern und Mehrfachdruck; /billing/[id] mit Abrechnungsblatt und Aktionen (abgerechnet mit Rechnungsnummer, PDF, Rechnungsnummer ändern, stornieren); /billing/print; Auftrags-Tab „Meilensteine & Abrechnung“; mobiler Abschnitt „Erreicht melden“ (offline); Dashboard-Kachel „Bereit zur Abrechnung“; /api/v1/billing*, Meilenstein-Endpunkte und OpenAPI. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
11 lines
547 B
TypeScript
11 lines
547 B
TypeScript
import { requireApiContext } from "@/server/api/context";
|
|
import { json, withApi } from "@/server/api/respond";
|
|
import { getBillingRecordDetail } from "@/server/services/billing/queries";
|
|
|
|
/** GET /api/v1/billing/:id — billing record with its statement (frozen snapshot once billed). */
|
|
export const GET = withApi(async (_req: Request, { params }: { params: Promise<{ id: string }> }) => {
|
|
const ctx = await requireApiContext("billing", "billing:read");
|
|
const { id } = await params;
|
|
return json(await getBillingRecordDetail(ctx, id));
|
|
});
|