Adding more detail messages for seat blocking

This commit is contained in:
Mulu Mehari
2026-08-03 11:37:16 +03:00
parent f0295f401a
commit 8594d75164
7 changed files with 74 additions and 68 deletions

View File

@@ -5,12 +5,9 @@ import { BlockedSeatRevenueLossStat } from '@edr/types';
import { PrismaService } from '../../common/prisma.service';
import { ReportsService } from '../reports/reports.service';
/** Window the dashboard's blocked-seat loss roll-up covers. Matches the report's default. */
const BLOCKED_SEAT_LOSS_PERIOD_DAYS = 30;
/** Shown when nothing is blocked, or when the loss roll-up could not be computed. */
const EMPTY_BLOCKED_SEAT_LOSS: BlockedSeatRevenueLossStat = {
periodDays: BLOCKED_SEAT_LOSS_PERIOD_DAYS,
periodDays: null,
lossByCurrency: [],
schedulesAffected: 0,
blockedSeatCount: 0,
@@ -85,7 +82,7 @@ export class DashboardService {
}
/**
* Compact roll-up of the Blocked Seat Revenue Loss report over the last 30 days.
* Compact roll-up of the Blocked Seat Revenue Loss report over its full history.
*
* Reuses the report service rather than re-deriving the rule — there is exactly one
* definition of what a blocked seat costs. A failure here degrades to zeroes instead of
@@ -98,7 +95,7 @@ export class DashboardService {
const { summary } = report;
return {
periodDays: BLOCKED_SEAT_LOSS_PERIOD_DAYS,
periodDays: null,
lossByCurrency: summary.lossByCurrency,
schedulesAffected: summary.schedulesAffected,
blockedSeatCount: summary.blockedSeatCount,