import { z } from 'zod' import { runCommandRoute } from '../../../lib/commandRoute' /** `POST /api/billing/payments/ignore` — ignore a payment (Spec C). */ export const metadata = { POST: { requireAuth: true, requireFeatures: ['billing.payment.manage'] }, } const bodySchema = z.object({ paymentId: z.string().uuid() }) export async function POST(req: Request) { return runCommandRoute(req, { commandId: 'billing.payments.ignore', bodySchema, resourceKind: 'billing.payment', resourceId: (body) => body.paymentId, logLabel: 'billing/payments/ignore.POST', }) } export const openApi = { methods: { POST: { tags: ['Billing'], summary: 'Ignore a payment', description: 'Excludes an unallocated payment from matching and credit (fees, misdirected transfers). Reversible with restore.', requestBody: { schema: bodySchema }, responses: [{ status: 200, description: 'Updated payment state' }], errors: [ { status: 409, description: '`billing.payment.has_allocations`' }, ], }, }, }