Phase2: Invoicecomputation/AdminpricingUI/Ainvoicemgnt
All checks were successful
Build and Push / build (push) Successful in 1m34s

This commit is contained in:
2026-05-24 16:38:41 +02:00
parent 11d7dbb06e
commit cd15b391ac
11 changed files with 369 additions and 52 deletions

View File

@@ -24,6 +24,9 @@ import { safeError } from "@/lib/errors";
const upsertSchema = z.object({
skillId: z.string().min(1).max(100),
dailyPriceChf: z.number().min(0).max(1_000_000),
// Optional with default 0 so existing API callers keep working.
// Setup fee fires once per (tenant, skill); see billing.ts.
setupFeeChf: z.number().min(0).max(1_000_000).optional().default(0),
});
export async function GET() {
@@ -63,7 +66,8 @@ export async function PUT(request: Request) {
try {
const row = await setSkillPricing(
parsed.data.skillId,
parsed.data.dailyPriceChf
parsed.data.dailyPriceChf,
parsed.data.setupFeeChf
);
return NextResponse.json(row);
} catch (e) {