6a7802c870
Add BillingService.generatePayouts: idempotent per-partner/month/currency snapshot of gross MRR x marginPct into Payout rows (never rewrites a paid row), plus platformPayouts(). A PayoutWorker generates the current month daily (and on boot; PAYOUTS_AUTOGEN=false to disable). Operator endpoints GET /billing/payouts + POST /billing/payouts/generate, an operator payouts ledger table with a Generate button, and the proxy routes. The partner Payouts tab now shows real data.
5 lines
206 B
TypeScript
5 lines
206 B
TypeScript
import { platformApi } from '~~/server/utils/platform-api'
|
|
|
|
// Platform-wide partner-payout ledger. Operator-only.
|
|
export default defineEventHandler(async (event) => platformApi(event, '/billing/payouts'))
|