diff --git a/package-lock.json b/package-lock.json
index 2b20021..5df8186 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -19,6 +19,7 @@
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.8",
"bootstrap-icons": "^1.13.1",
+ "chart.js": "^4.5.1",
"express": "^5.1.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
@@ -1896,6 +1897,12 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
+ "node_modules/@kurkle/color": {
+ "version": "0.3.4",
+ "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz",
+ "integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==",
+ "license": "MIT"
+ },
"node_modules/@listr2/prompt-adapter-inquirer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@listr2/prompt-adapter-inquirer/-/prompt-adapter-inquirer-3.0.1.tgz",
@@ -4299,6 +4306,18 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/chart.js": {
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.1.tgz",
+ "integrity": "sha512-GIjfiT9dbmHRiYi6Nl2yFCq7kkwdkp1W/lp2J99rX0yo9tgJGn3lKQATztIjb5tVtevcBtIdICNWqlq5+E8/Pw==",
+ "license": "MIT",
+ "dependencies": {
+ "@kurkle/color": "^0.3.0"
+ },
+ "engines": {
+ "pnpm": ">=8"
+ }
+ },
"node_modules/chokidar": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
diff --git a/package.json b/package.json
index 403a9f7..1484e44 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,7 @@
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.8",
"bootstrap-icons": "^1.13.1",
+ "chart.js": "^4.5.1",
"express": "^5.1.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts
index 911db7e..179b507 100644
--- a/src/app/app.routes.ts
+++ b/src/app/app.routes.ts
@@ -8,6 +8,13 @@ import { Mureg } from './pages/mureg/mureg';
import { Faturamento } from './pages/faturamento/faturamento';
import { authGuard } from './guards/auth.guard';
+import { DadosUsuarios } from './pages/dados-usuarios/dados-usuarios';
+import { VigenciaComponent } from './pages/vigencia/vigencia';
+import { TrocaNumero } from './pages/troca-numero/troca-numero';
+import { Parcelamento } from './pages/parcelamento/parcelamento';
+
+// ✅ NOVO: TROCA DE NÚMERO
+
export const routes: Routes = [
{ path: '', component: Home },
@@ -17,6 +24,13 @@ export const routes: Routes = [
{ path: 'geral', component: Geral, canActivate: [authGuard] },
{ path: 'mureg', component: Mureg, canActivate: [authGuard] },
{ path: 'faturamento', component: Faturamento, canActivate: [authGuard] },
+ { path: 'dadosusuarios', component: DadosUsuarios, canActivate: [authGuard] },
+ { path: 'vigencia', component: VigenciaComponent, canActivate: [authGuard] },
+
+ // ✅ NOVO: rota da página Troca de Número
+ { path: 'trocanumero', component: TrocaNumero, canActivate: [authGuard] },
+
+ { path: 'parcelamento', component: Parcelamento, canActivate: [authGuard] },
{ path: '**', redirectTo: '' },
];
diff --git a/src/app/components/header/header.html b/src/app/components/header/header.html
index c3bf37f..c3693c2 100644
--- a/src/app/components/header/header.html
+++ b/src/app/components/header/header.html
@@ -91,15 +91,30 @@
Gerenciar Linhas
-
+
Faturamento
+
+
+ Vigência
+
+
Mureg
+
+
+ Troca de Número
+
+
+
+
+ Parcelamento
+
+
Controle de Contratos
@@ -108,6 +123,11 @@
Gerenciar Clientes
+
+
+ Dados dos Usuários
+
+
Relatórios
diff --git a/src/app/components/header/header.ts b/src/app/components/header/header.ts
index 4d38fa7..2739aca 100644
--- a/src/app/components/header/header.ts
+++ b/src/app/components/header/header.ts
@@ -20,21 +20,35 @@ export class Header {
// ✅ define quando mostrar header “logado”
isLoggedHeader = false;
+ // ✅ rotas internas que usam menu lateral
+ private readonly loggedPrefixes = [
+ '/geral',
+ '/mureg',
+ '/faturamento',
+ '/dadosusuarios',
+ '/vigencia',
+ '/trocanumero',
+ '/parcelamento', // ✅ ADICIONADO: Parcelamento
+ ];
+
constructor(
private router: Router,
@Inject(PLATFORM_ID) private platformId: object
) {
this.router.events.subscribe((event) => {
if (event instanceof NavigationEnd) {
- const url = event.urlAfterRedirects || event.url;
+ const rawUrl = event.urlAfterRedirects || event.url;
+
+ // normaliza (remove query/hash)
+ const url = rawUrl.split('?')[0].split('#')[0];
this.isHome = (url === '/' || url === '');
- // ✅ considera header logado quando está em rotas internas
- // (agora inclui MUREG)
- this.isLoggedHeader =
- url.startsWith('/geral') ||
- url.startsWith('/mureg');
+ // ✅ considera "logado" se a rota começa com qualquer prefixo interno
+ // aceita também subrotas, ex: /parcelamento/detalhes/123
+ this.isLoggedHeader = this.loggedPrefixes.some((p) =>
+ url === p || url.startsWith(p + '/')
+ );
// ✅ ao trocar de rota, fecha o menu
this.menuOpen = false;
diff --git a/src/app/pages/dados-usuarios/dados-usuarios.html b/src/app/pages/dados-usuarios/dados-usuarios.html
new file mode 100644
index 0000000..cc9f1b7
--- /dev/null
+++ b/src/app/pages/dados-usuarios/dados-usuarios.html
@@ -0,0 +1,209 @@
+
+
+
+
+ {{ toastMessage }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Nenhum cliente encontrado.
+
+
+
+
+
+
+
+
+
+ Registros do Cliente
+ Visualização detalhada
+
+
+
+
+
+
+
+
+ | ITEM |
+ LINHA |
+ CPF |
+ E-MAIL |
+ CELULAR |
+ AÇÕES |
+
+
+
+
+ | Nenhum registro encontrado. |
+
+
+ | {{ r.item }} |
+ {{ r.linha }} |
+ {{ r.cpf || '-' }} |
+ {{ r.email || '-' }} |
+ {{ r.celular || '-' }} |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/pages/dados-usuarios/dados-usuarios.scss b/src/app/pages/dados-usuarios/dados-usuarios.scss
new file mode 100644
index 0000000..968cac0
--- /dev/null
+++ b/src/app/pages/dados-usuarios/dados-usuarios.scss
@@ -0,0 +1,272 @@
+/* ========================================================== */
+/* VARIÁVEIS E GERAL */
+/* ========================================================== */
+:host {
+ --brand: #E33DCF;
+ --blue: #030FAA;
+ --text: #111214;
+ --muted: rgba(17, 18, 20, 0.65);
+
+ --success-bg: rgba(25, 135, 84, 0.1);
+ --success-text: #198754;
+ --warn-bg: rgba(255, 193, 7, 0.15);
+ --warn-text: #b58100;
+ --danger-bg: rgba(220, 53, 69, 0.1);
+ --danger-text: #dc3545;
+
+ --radius-xl: 22px;
+ --radius-lg: 16px;
+ --shadow-card: 0 22px 46px rgba(17, 18, 20, 0.10);
+ --glass-bg: rgba(255, 255, 255, 0.82);
+ --glass-border: 1px solid rgba(227, 61, 207, 0.16);
+
+ display: block;
+ font-family: 'Inter', sans-serif;
+ color: var(--text);
+ box-sizing: border-box;
+}
+
+/* LAYOUT PRINCIPAL */
+.users-page {
+ min-height: 100vh;
+ padding: 0 12px;
+ display: flex;
+ align-items: flex-start;
+ justify-content: center;
+ position: relative;
+ overflow-y: auto;
+ background:
+ radial-gradient(900px 420px at 20% 10%, rgba(227, 61, 207, 0.14), transparent 60%),
+ radial-gradient(820px 380px at 80% 30%, rgba(227, 61, 207, 0.08), transparent 60%),
+ linear-gradient(180deg, #ffffff 0%, #f5f5f7 70%);
+
+ &::after {
+ content: ''; position: absolute; inset: 0; pointer-events: none;
+ background: rgba(255, 255, 255, 0.25);
+ }
+}
+
+.page-blob {
+ position: fixed; pointer-events: none; border-radius: 999px;
+ filter: blur(34px); opacity: 0.55; z-index: 0;
+ background: radial-gradient(circle at 30% 30%, rgba(227,61,207,0.55), rgba(227,61,207,0.06));
+ animation: floaty 10s ease-in-out infinite;
+ &.blob-1 { width: 420px; height: 420px; top: -140px; left: -140px; }
+ &.blob-2 { width: 520px; height: 520px; top: -220px; right: -240px; animation-duration: 12s; }
+ &.blob-3 { width: 360px; height: 360px; bottom: -180px; left: 25%; animation-duration: 14s; }
+ &.blob-4 { width: 520px; height: 520px; bottom: -260px; right: -260px; animation-duration: 16s; opacity: .45; }
+}
+
+@keyframes floaty {
+ 0% { transform: translate(0, 0) scale(1); }
+ 50% { transform: translate(18px, 10px) scale(1.03); }
+ 100% { transform: translate(0, 0) scale(1); }
+}
+
+.container-geral-responsive {
+ width: 100%;
+ max-width: 1180px; /* Igual ao Mureg */
+ position: relative;
+ z-index: 1;
+ margin-top: 40px;
+ margin-bottom: 200px;
+}
+
+.geral-card {
+ border-radius: var(--radius-xl);
+ overflow: hidden;
+ background: var(--glass-bg);
+ border: var(--glass-border);
+ backdrop-filter: blur(12px);
+ box-shadow: var(--shadow-card);
+ position: relative;
+ display: flex; flex-direction: column;
+ min-height: 80vh;
+ &::before {
+ content: ''; position: absolute; inset: 1px; border-radius: calc(var(--radius-xl) - 1px);
+ pointer-events: none; border: 1px solid rgba(255, 255, 255, 0.65); opacity: 0.75;
+ }
+}
+
+/* HEADER */
+.geral-header {
+ padding: 16px 24px;
+ border-bottom: 1px solid rgba(17, 18, 20, 0.06);
+ background: linear-gradient(180deg, rgba(227,61,207,0.06), rgba(255,255,255,0.2));
+ flex-shrink: 0;
+}
+
+.header-row-top {
+ display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
+ @media (max-width: 768px) { grid-template-columns: 1fr; text-align: center; gap: 16px; .title-badge { justify-self: center; margin-bottom: 8px; } .header-actions { justify-self: center; } }
+}
+
+.title-badge {
+ justify-self: start; display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px;
+ border-radius: 999px; background: rgba(255, 255, 255, 0.78);
+ border: 1px solid rgba(227, 61, 207, 0.22); backdrop-filter: blur(10px);
+ color: var(--text); font-size: 13px; font-weight: 800;
+ i { color: var(--brand); }
+}
+
+.header-title { justify-self: center; display: flex; flex-direction: column; align-items: center; text-align: center; }
+.title { font-size: 26px; font-weight: 950; letter-spacing: -0.3px; color: var(--text); margin-top: 10px; margin-bottom: 0; }
+.subtitle { color: rgba(17, 18, 20, 0.65); font-weight: 700; }
+.header-actions { justify-self: end; }
+
+/* Buttons */
+.btn-brand {
+ background-color: var(--brand); border-color: var(--brand); color: #fff; font-weight: 900; border-radius: 12px; transition: transform 0.2s, box-shadow 0.2s;
+ &:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(227, 61, 207, 0.25); filter: brightness(1.05); }
+}
+.btn-glass {
+ border-radius: 12px; font-weight: 900; background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(3, 15, 170, 0.25); color: var(--blue);
+ &:hover { transform: translateY(-2px); border-color: var(--brand); background: #fff; }
+}
+
+/* ✅ KPIs (ESTILO MUREG) */
+.users-kpis {
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ gap: 12px;
+ margin-top: 20px;
+ margin-bottom: 16px;
+ width: 100%;
+
+ @media (max-width: 992px) { grid-template-columns: repeat(2, 1fr); }
+ @media (max-width: 576px) { grid-template-columns: 1fr; }
+}
+
+.kpi {
+ background: rgba(255,255,255,0.7);
+ border: 1px solid rgba(17,18,20,0.08);
+ border-radius: 16px;
+ padding: 12px 16px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ backdrop-filter: blur(8px);
+ transition: transform 0.2s, box-shadow 0.2s;
+ box-shadow: 0 2px 5px rgba(0,0,0,0.02);
+
+ &:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 6px 15px rgba(227, 61, 207, 0.1);
+ background: #fff;
+ border-color: var(--brand);
+ }
+
+ .lbl {
+ font-size: 0.72rem;
+ font-weight: 900;
+ letter-spacing: 0.05em;
+ text-transform: uppercase;
+ color: var(--muted);
+ &.text-success { color: var(--success-text) !important; }
+ &.text-brand { color: var(--brand) !important; }
+ }
+
+ .val {
+ font-size: 1.25rem;
+ font-weight: 950;
+ color: var(--text);
+ &.text-success { color: var(--success-text) !important; }
+ &.text-brand { color: var(--brand) !important; }
+ }
+}
+
+/* Controls */
+.controls { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
+.search-group {
+ max-width: 270px; border-radius: 12px; overflow: hidden; display: flex; align-items: stretch; background: #fff; border: 1px solid rgba(17, 18, 20, 0.15); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04); transition: all 0.2s ease;
+ &:focus-within { border-color: var(--brand); box-shadow: 0 4px 12px rgba(227, 61, 207, 0.15); transform: translateY(-1px); }
+ .input-group-text { background: transparent; border: none; color: var(--muted); padding-left: 14px; padding-right: 8px; display: flex; align-items: center; i { font-size: 1rem; } }
+ .form-control { border: none; background: transparent; padding: 10px 0; font-size: 0.9rem; color: var(--text); box-shadow: none; &::placeholder { color: rgba(17, 18, 20, 0.4); font-weight: 500; } &:focus { outline: none; } }
+ .btn-clear { background: transparent; border: none; color: var(--muted); padding: 0 12px; display: flex; align-items: center; cursor: pointer; transition: color 0.2s; &:hover { color: #dc3545; } i { font-size: 1rem; } }
+}
+
+.select-glass {
+ background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(17, 18, 20, 0.15); border-radius: 12px;
+ color: var(--blue); font-weight: 800; font-size: 0.9rem; text-align: left;
+ padding: 8px 36px 8px 14px;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04); cursor: pointer; transition: all 0.2s ease; width: 100%;
+ &:hover { background: #fff; border-color: var(--blue); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(3, 15, 170, 0.1); }
+ &:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(227, 61, 207, 0.15); }
+}
+.select-wrapper { position: relative; display: inline-block; min-width: 90px; }
+.select-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); font-size: 0.75rem; transition: transform 0.2s ease; }
+.select-wrapper:hover .select-icon { color: var(--blue); }
+
+/* Animation */
+.animate-fade-in { animation: simpleFadeIn 0.5s ease-out forwards; }
+@keyframes simpleFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
+
+/* BODY & GROUPS */
+.geral-body { padding: 0; background: transparent; flex: 1; overflow: hidden; display: flex; flex-direction: column; }
+.groups-container { padding: 16px; overflow-y: auto; height: 100%; }
+.group-list { display: flex; flex-direction: column; gap: 12px; }
+.empty-group { background: rgba(255,255,255,0.7); border: 1px dashed rgba(17,18,20,0.12); border-radius: 16px; padding: 18px; text-align: center; font-weight: 800; color: var(--muted); }
+
+.client-group-card {
+ background: #fff; border-radius: 16px; border: 1px solid rgba(17,18,20,0.08); overflow: hidden; transition: all 0.3s ease;
+ &:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(227,61,207,0.1); }
+ &.expanded { border-color: var(--brand); box-shadow: 0 8px 24px rgba(227,61,207,0.12); }
+}
+.group-header { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; background: linear-gradient(180deg, #fff, #fdfdfd); &:hover .group-toggle-icon { color: var(--brand); } }
+.group-info { display: flex; flex-direction: column; gap: 6px; }
+.group-badges { display: flex; gap: 8px; flex-wrap: wrap; }
+.badge-pill { font-size: 0.7rem; padding: 4px 10px; border-radius: 999px; font-weight: 800; text-transform: uppercase;
+ &.total { background: rgba(3,15,170,0.1); color: var(--blue); }
+ &.ok { background: var(--success-bg); color: var(--success-text); }
+}
+.group-toggle-icon { font-size: 1.2rem; color: var(--muted); transition: transform 0.3s ease; }
+.client-group-card.expanded .group-toggle-icon { transform: rotate(180deg); color: var(--brand); }
+.group-body { border-top: 1px solid rgba(17,18,20,0.06); background: #fbfbfc; animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
+@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
+
+.chip-muted { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 800; color: rgba(17,18,20,0.55); padding: 4px 10px; border-radius: 999px; background: rgba(17,18,20,0.04); border: 1px solid rgba(17,18,20,0.06); }
+.inner-table-wrap { max-height: 450px; overflow-y: auto; }
+
+/* TABLE */
+.table-wrap { overflow-x: auto; overflow-y: auto; height: 100%; }
+.table-modern {
+ width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0;
+ thead th { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); border-bottom: 2px solid rgba(227, 61, 207, 0.15); padding: 12px; color: rgba(17, 18, 20, 0.7); font-size: 0.8rem; font-weight: 950; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; cursor: pointer; transition: color 0.2s; text-align: center !important; &:hover { color: var(--brand); } }
+ tbody tr { transition: background-color 0.2s; border-bottom: 1px solid rgba(17,18,20,0.05); &:hover { background-color: rgba(227, 61, 207, 0.05); } td { border-bottom: 1px solid rgba(17,18,20,0.04); } }
+ td { padding: 12px; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.875rem; color: var(--text); text-align: center !important; }
+}
+.text-brand { color: var(--brand) !important; }
+.text-blue { color: var(--blue) !important; }
+.fw-black { font-weight: 950; }
+.td-clip { overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
+.empty-state { background: rgba(255,255,255,0.4); }
+
+.btn-icon {
+ width: 32px; height: 32px; border: none; background: transparent; border-radius: 8px;
+ display: flex; align-items: center; justify-content: center;
+ color: rgba(17,18,20,0.5); transition: all 0.2s; cursor: pointer;
+ &:hover { background: rgba(17,18,20,0.05); color: var(--text); transform: translateY(-1px); }
+ &.primary:hover { color: var(--blue); background: rgba(3,15,170,0.1); }
+}
+
+/* FOOTER */
+.geral-footer { padding: 14px 24px; border-top: 1px solid rgba(17, 18, 20, 0.06); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; flex-shrink: 0; @media (max-width: 768px) { justify-content: center; text-align: center; } }
+.pagination-modern .page-link { color: var(--blue); font-weight: 900; border-radius: 10px; border: 1px solid rgba(17,18,20,0.1); background: rgba(255,255,255,0.6); margin: 0 2px; &:hover { transform: translateY(-1px); border-color: var(--brand); color: var(--brand); } }
+.pagination-modern .page-item.active .page-link { background-color: var(--blue); border-color: var(--blue); color: #fff; }
+
+/* MODALS */
+.modal-backdrop-custom { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 9990; backdrop-filter: blur(4px); }
+.modal-custom { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 9995; padding: 16px; }
+.modal-card { background: #ffffff; border: 1px solid rgba(255,255,255,0.8); border-radius: 20px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); overflow: hidden; display: flex; flex-direction: column; animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); width: min(850px, 100%); max-height: 90vh; }
+@keyframes modalPop { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
+.modal-header { padding: 16px 24px; border-bottom: 1px solid rgba(0,0,0,0.06); background: #fff; display: flex; justify-content: space-between; align-items: center; .modal-title { font-size: 1.1rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 12px; } .icon-bg { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; &.primary-soft { background: rgba(3, 15, 170, 0.1); color: var(--blue); } } .btn-icon { color: var(--muted); background: transparent; font-size: 1.2rem; border:none; cursor: pointer; &:hover { color: var(--brand); } } }
+.modal-body { padding: 24px; overflow-y: auto; &.bg-light-gray { background-color: #f8f9fa; } }
+
+/* FORM & DETAILS */
+.details-dashboard { display: grid; grid-template-columns: 1fr; gap: 20px; }
+div.detail-box { background: #fff; border-radius: 16px; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 2px 8px rgba(0,0,0,0.02); overflow: hidden; height: 100%; display: flex; flex-direction: column; }
+div.box-header { padding: 10px 16px; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid rgba(0,0,0,0.04); background: #fdfdfd; display: flex; align-items: center; }
+div.box-body { padding: 16px; }
+.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; @media (max-width: 600px) { grid-template-columns: 1fr; } }
+.form-field { display: flex; flex-direction: column; gap: 6px; label { font-size: 0.75rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(17,18,20,0.65); } &.span-2 { grid-column: span 2; } }
+.form-control { border-radius: 8px; border: 1px solid rgba(17,18,20,0.15); &:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(227,61,207,0.15); outline: none; } }
\ No newline at end of file
diff --git a/src/app/pages/dados-usuarios/dados-usuarios.spec.ts b/src/app/pages/dados-usuarios/dados-usuarios.spec.ts
new file mode 100644
index 0000000..a079053
--- /dev/null
+++ b/src/app/pages/dados-usuarios/dados-usuarios.spec.ts
@@ -0,0 +1,21 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { DadosUsuarios } from './dados-usuarios';
+
+describe('DadosUsuarios', () => {
+ let component: DadosUsuarios;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [DadosUsuarios], // standalone component
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(DadosUsuarios);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/pages/dados-usuarios/dados-usuarios.ts b/src/app/pages/dados-usuarios/dados-usuarios.ts
new file mode 100644
index 0000000..c236b2c
--- /dev/null
+++ b/src/app/pages/dados-usuarios/dados-usuarios.ts
@@ -0,0 +1,229 @@
+import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { HttpClientModule, HttpErrorResponse } from '@angular/common/http';
+
+import {
+ DadosUsuariosService,
+ UserDataClientGroup,
+ UserDataRow,
+ UserDataGroupResponse,
+ PagedResult
+} from '../../services/dados-usuarios.service';
+
+type ViewMode = 'lines' | 'groups';
+
+@Component({
+ selector: 'app-dados-usuarios',
+ standalone: true,
+ imports: [CommonModule, FormsModule, HttpClientModule],
+ templateUrl: './dados-usuarios.html',
+ styleUrls: ['./dados-usuarios.scss'],
+ providers: [DadosUsuariosService]
+})
+export class DadosUsuarios implements OnInit {
+
+ @ViewChild('successToast', { static: false }) successToast!: ElementRef;
+
+ loading = false;
+ errorMsg = '';
+
+ // Filtros
+ search = '';
+
+ // Paginação
+ page = 1;
+ pageSize = 10;
+ total = 0;
+
+ // Ordenação
+ sortBy = 'cliente';
+ sortDir: 'asc' | 'desc' = 'asc';
+
+ // PADRÃO: GROUPS (Acordeão)
+ viewMode: ViewMode = 'groups';
+
+ // Dados
+ groups: UserDataClientGroup[] = [];
+ rows: UserDataRow[] = [];
+
+ // KPIs
+ kpiTotalRegistros = 0;
+ kpiClientesUnicos = 0;
+ kpiComCpf = 0;
+ kpiComEmail = 0;
+
+ // ACORDEÃO
+ expandedGroup: string | null = null;
+ expandedLoading = false;
+ groupRows: UserDataRow[] = [];
+
+ // Modal / Toast
+ detailsOpen = false;
+ selectedRow: UserDataRow | null = null;
+ toastOpen = false;
+ toastMessage = '';
+ toastType: 'success' | 'danger' = 'success';
+ private toastTimer: any = null;
+ private searchTimer: any = null;
+
+ constructor(private service: DadosUsuariosService) {}
+
+ ngOnInit(): void {
+ this.fetch(1);
+ }
+
+ // Alternar Visualização
+ setView(mode: ViewMode): void {
+ if (this.viewMode === mode) return;
+ this.viewMode = mode;
+ this.page = 1;
+ this.expandedGroup = null;
+ this.groupRows = [];
+ this.sortBy = mode === 'groups' ? 'cliente' : 'item';
+ this.fetch(1);
+ }
+
+ get totalPages(): number {
+ return Math.max(1, Math.ceil((this.total || 0) / (this.pageSize || 10)));
+ }
+
+ get pageStart(): number { return (this.page - 1) * this.pageSize + 1; }
+
+ get pageEnd(): number {
+ const end = this.page * this.pageSize;
+ return end > this.total ? this.total : end;
+ }
+
+ get pageNumbers(): number[] {
+ const total = this.totalPages;
+ const current = this.page;
+ const max = 5;
+ let start = Math.max(1, current - 2);
+ let end = Math.min(total, start + (max - 1));
+ start = Math.max(1, end - (max - 1));
+ const pages: number[] = [];
+ for (let i = start; i <= end; i++) pages.push(i);
+ return pages;
+ }
+
+ fetch(goToPage?: number): void {
+ if (goToPage) this.page = goToPage;
+ this.loading = true;
+
+ if(goToPage && goToPage !== this.page) this.expandedGroup = null;
+
+ if (this.viewMode === 'groups') {
+ this.fetchGroups();
+ } else {
+ this.fetchLines(); // Fallback se quiser usar
+ }
+ }
+
+ refresh() {
+ this.fetch(1);
+ }
+
+ private fetchGroups() {
+ this.service.getGroups({
+ search: this.search?.trim(),
+ page: this.page,
+ pageSize: this.pageSize,
+ sortBy: this.sortBy,
+ sortDir: this.sortDir,
+ }).subscribe({
+ next: (res: UserDataGroupResponse) => {
+ this.groups = res.data.items || [];
+ this.total = res.data.total || 0;
+
+ this.kpiTotalRegistros = res.kpis.totalRegistros;
+ this.kpiClientesUnicos = res.kpis.clientesUnicos;
+ this.kpiComCpf = res.kpis.comCpf;
+ this.kpiComEmail = res.kpis.comEmail;
+
+ this.loading = false;
+ },
+ error: (err: HttpErrorResponse) => {
+ this.loading = false;
+ this.showToast('Erro ao carregar dados.', 'danger');
+ }
+ });
+ }
+
+ private fetchLines() {
+ // Implementação opcional para modo lista plana
+ }
+
+ toggleGroup(g: UserDataClientGroup): void {
+ if (this.expandedGroup === g.cliente) {
+ this.expandedGroup = null;
+ this.groupRows = [];
+ return;
+ }
+
+ this.expandedGroup = g.cliente;
+ this.expandedLoading = true;
+ this.groupRows = [];
+
+ this.service.getRows({
+ client: g.cliente,
+ page: 1,
+ pageSize: 200,
+ sortBy: 'item',
+ sortDir: 'asc'
+ }).subscribe({
+ next: (res: PagedResult) => {
+ this.groupRows = res.items || [];
+ this.expandedLoading = false;
+ },
+ error: (err: HttpErrorResponse) => {
+ this.showToast('Erro ao carregar usuários do cliente.', 'danger');
+ this.expandedLoading = false;
+ }
+ });
+ }
+
+ onSearch() {
+ if (this.searchTimer) clearTimeout(this.searchTimer);
+ this.searchTimer = setTimeout(() => {
+ this.page = 1;
+ this.expandedGroup = null;
+ this.fetch();
+ }, 400);
+ }
+
+ clearFilters() { this.search = ''; this.fetch(1); }
+
+ onPageSizeChange() {
+ this.page = 1;
+ this.fetch();
+ }
+
+ goToPage(p: number) {
+ this.page = p;
+ this.fetch();
+ }
+
+ openDetails(row: UserDataRow) {
+ this.service.getById(row.id).subscribe({
+ next: (fullData: UserDataRow) => {
+ this.selectedRow = fullData;
+ this.detailsOpen = true;
+ },
+ error: (err: HttpErrorResponse) => this.showToast('Erro ao abrir detalhes', 'danger')
+ });
+ }
+
+ closeDetails() { this.detailsOpen = false; }
+
+ trackById(_: number, row: UserDataRow) { return row.id; }
+ trackByCliente(_: number, g: UserDataClientGroup) { return g.cliente; }
+
+ showToast(msg: string, type: 'success' | 'danger') {
+ this.toastMessage = msg; this.toastType = type; this.toastOpen = true;
+ if(this.toastTimer) clearTimeout(this.toastTimer);
+ this.toastTimer = setTimeout(() => this.toastOpen = false, 3000);
+ }
+
+ hideToast() { this.toastOpen = false; }
+}
\ No newline at end of file
diff --git a/src/app/pages/faturamento/faturamento.html b/src/app/pages/faturamento/faturamento.html
index 67a4d45..0beb345 100644
--- a/src/app/pages/faturamento/faturamento.html
+++ b/src/app/pages/faturamento/faturamento.html
@@ -1,121 +1,189 @@
-
+
+
+
+
+
+
+
+ {{ toastMessage }}
+
+
+
+
+