feat(reports): financial hasData existence flag (service + route)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-02 10:13:42 +02:00
parent 8b7099c4c1
commit 58203ca8ea
2 changed files with 24 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ import {
getRecentPayments,
getRefundLog,
getExpenseLedger,
financialHasData,
} from '@/lib/services/reports/financial.service';
/**
@@ -65,6 +66,7 @@ export const GET = withAuth(
recentPayments,
refundLog,
expenseLedger,
hasData,
] = await Promise.all([
getFinancialKpis(ctx.portId, range),
getRevenueByMonth(ctx.portId, range),
@@ -76,6 +78,7 @@ export const GET = withAuth(
getRecentPayments(ctx.portId, range),
getRefundLog(ctx.portId, range),
getExpenseLedger(ctx.portId, range),
financialHasData(ctx.portId),
]);
return NextResponse.json({
@@ -90,6 +93,7 @@ export const GET = withAuth(
recentPayments,
refundLog,
expenseLedger,
hasData,
range: { from: range.from.toISOString(), to: range.to.toISOString() },
},
});