feat(frontend): Billing > Consumo (platform) + Sistema > Configurações — zera "em breve"

GET /billing/consumo agrega o mesmo uso bruto de /reports/consumo (tenant), só que
em loop por todos os tenants — nunca dinheiro, só quantidade (dinheiro é Billing >
Relatórios, já existia).

GET /platform/system-config: "Sistema > Configurações" nunca teve escopo definido na
especificação. Decisão desta implementação: painel somente leitura das flags de
segurança/infra que já existem como variável de ambiente (DIALER_SIMULATION/
ALLOW_REAL_OUTBOUND_CALLS, ESL configurado, storage provider, NODE_ENV) — nunca
editável por aqui, mudar exige editar o .env e reiniciar o serviço. Nunca expõe
segredo nenhum.

Com isto, todo item dos menus Platform e Tenant tem uma tela real por trás — zero
"em breve" restando em nav-data.ts nos dois lados.

Testado ponta a ponta: /billing/consumo batendo com os mesmos números já vistos em
Relatórios > Consumo/Quotas, /platform/system-config confirmado mostrando o valor
real do .env desta VM.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFaBaBSQGhyXGEgtTYZGV8
This commit is contained in:
2026-08-30 09:01:10 -03:00
parent cc80310cb5
commit fcf334c7c0
14 changed files with 347 additions and 2 deletions

View File

@@ -93,6 +93,25 @@ export interface BillingStatement {
items?: BillingStatementItem[];
}
export interface TenantConsumo {
tenantId: string;
legalName: string;
usage: {
callCount: number;
callSeconds: number;
extensionActiveDays: number;
agentActiveDays: number;
trunkActiveDays: number;
recordingBytes: number;
};
aiUsage: {
transcriptionSeconds: number;
analysisRequests: number;
inputTokens: number;
outputTokens: number;
};
}
export interface PlanVersion {
id: string;
planId: string;

View File

@@ -101,6 +101,16 @@ export interface FreeswitchNodes {
gateways: unknown;
}
export interface SystemConfig {
nodeEnv: string;
dialerSimulation: boolean;
allowRealOutboundCalls: boolean;
realOutboundCallsActive: boolean;
storageProvider: string;
eslConfigured: boolean;
corsOrigin: string | null;
}
export interface TenantAiUsage {
tenantId: string;
legalName: string;