feat: update queries and client dashboard improvements

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 13:28:53 -04:00
parent 8641100a18
commit c5b377e788
4 changed files with 109 additions and 44 deletions

View File

@@ -460,6 +460,14 @@ ${buildHeader({ role: role, userName: user.nome, activePage: 'cliente', permissi
<button class="export-btn" onclick="window.location.href='/admin/api/export/clients-excel'" title="Export Top Clients to Excel">Export Excel</button>
</div>
<!-- CambioPay label (merchant only) -->
<div class="checkout-section" id="cambioPayLabel">
<div class="section-title">
<span class="icon">&#x1F4B1;</span>
CambioPay (Transfers)
</div>
</div>
<!-- Hero KPIs (6) -->
<div class="hero-grid" id="heroGrid">
<div class="hero-card volume"><div class="hero-label">Volume USD</div><div class="hero-value" id="kpiVolume"><div class="skel skel-value"></div></div><span class="hero-badge neutral" id="kpiVolBadge"><div class="skel skel-badge"></div></span></div>
@@ -967,6 +975,19 @@ function renderProfile(p) {
document.querySelectorAll('.checkout-section').forEach(function(el) {
el.classList.toggle('visible', isMerchant);
});
// Relabel hero cards for merchants to clarify CambioPay-only
var heroLabels = document.querySelectorAll('#heroGrid .hero-label');
heroLabels.forEach(function(lbl) {
if (isMerchant) {
if (lbl.textContent === 'Volume USD') lbl.textContent = 'CambioPay Volume';
else if (lbl.textContent === 'Transacoes') lbl.textContent = 'CambioPay Ops';
else if (lbl.textContent === 'Receita USD') lbl.textContent = 'Receita CambioPay';
} else {
if (lbl.textContent === 'CambioPay Volume') lbl.textContent = 'Volume USD';
else if (lbl.textContent === 'CambioPay Ops') lbl.textContent = 'Transacoes';
else if (lbl.textContent === 'Receita CambioPay') lbl.textContent = 'Receita USD';
}
});
}
function renderChurnRisk(churn) {