Adicionada compressão Brotli/Gzip, auto-import de Vue e PrimeVue, e análise visual do bundle para otimização de produção e Remove AppLayout duplicado de cada área (therapist, admin, configuracoes, account, supervisor, billing, features) e consolida sob um único pai no router/index.js. Adiciona RouterPassthrough para grupos de rota sem layout intermediário. Remove debug ativo (console.trace em router.push e queries Supabase em todo watch de rota) que degradava performance para todos os usuários.
This commit is contained in:
+153
-162
@@ -14,173 +14,164 @@
|
||||
| © 2026 — Todos os direitos reservados
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
import AppLayout from '@/layout/AppLayout.vue';
|
||||
import RouterPassthrough from '@/layout/RouterPassthrough.vue';
|
||||
|
||||
export default [
|
||||
// ======================================================
|
||||
// 🚀 SETUP WIZARD — fora do AppLayout (fullscreen)
|
||||
// ======================================================
|
||||
// ── Rotas fullscreen — ficam fora do AppLayout compartilhado ──────────────
|
||||
export const therapistStandalone = [
|
||||
{
|
||||
path: '/therapist/setup',
|
||||
name: 'therapist.setup',
|
||||
component: () => import('@/features/setup/SetupWizardPage.vue'),
|
||||
meta: { area: 'therapist', requiresAuth: true, roles: ['therapist'], fullscreen: true }
|
||||
},
|
||||
|
||||
{
|
||||
path: '/therapist',
|
||||
component: AppLayout,
|
||||
|
||||
meta: { area: 'therapist', requiresAuth: true, roles: ['therapist'] },
|
||||
|
||||
children: [
|
||||
// ======================================================
|
||||
// 📊 DASHBOARD
|
||||
// ======================================================
|
||||
{ path: '', name: 'therapist.dashboard', component: () => import('@/views/pages/therapist/TherapistDashboard.vue') },
|
||||
|
||||
// ======================================================
|
||||
// 📅 AGENDA
|
||||
// ======================================================
|
||||
{
|
||||
path: 'agenda',
|
||||
name: 'therapist-agenda',
|
||||
component: () => import('@/features/agenda/pages/AgendaTerapeutaPage.vue'),
|
||||
meta: {
|
||||
feature: 'agenda.view'
|
||||
}
|
||||
},
|
||||
|
||||
// Recorrências
|
||||
{
|
||||
path: 'agenda/recorrencias',
|
||||
name: 'therapist-agenda-recorrencias',
|
||||
component: () => import('@/features/agenda/pages/AgendaRecorrenciasPage.vue'),
|
||||
meta: { feature: 'agenda.view', mode: 'therapist' }
|
||||
},
|
||||
|
||||
// ✅ Compromissos determinísticos
|
||||
{
|
||||
path: 'agenda/compromissos',
|
||||
name: 'therapist-agenda-compromissos',
|
||||
component: () => import('@/features/agenda/pages/CompromissosDeterminados.vue'),
|
||||
meta: {
|
||||
feature: 'agenda.view',
|
||||
roles: ['therapist']
|
||||
// ✅ sem tenantScope
|
||||
}
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 💳 MEU PLANO
|
||||
// ======================================================
|
||||
{
|
||||
path: 'meu-plano',
|
||||
name: 'therapist-meu-plano',
|
||||
component: () => import('@/views/pages/billing/TherapistMeuPlanoPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'upgrade',
|
||||
name: 'therapist-upgrade',
|
||||
component: () => import('@/views/pages/billing/TherapistUpgradePage.vue')
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 👥 PATIENTS
|
||||
// ======================================================
|
||||
{
|
||||
path: 'patients',
|
||||
name: 'therapist-patients',
|
||||
component: () => import('@/features/patients/PatientsListPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/cadastro',
|
||||
name: 'therapist-patients-create',
|
||||
component: () => import('@/features/patients/cadastro/PatientsCadastroPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/cadastro/:id',
|
||||
name: 'therapist-patients-edit',
|
||||
component: () => import('@/features/patients/cadastro/PatientsCadastroPage.vue'),
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: 'patients/grupos',
|
||||
name: 'therapist-patients-groups',
|
||||
component: () => import('@/features/patients/grupos/GruposPacientesPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/tags',
|
||||
name: 'therapist-patients-tags',
|
||||
component: () => import('@/features/patients/tags/TagsPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/link-externo',
|
||||
name: 'therapist-patients-link-externo',
|
||||
component: () => import('@/features/patients/cadastro/PatientsExternalLinkPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/cadastro/recebidos',
|
||||
name: 'therapist-patients-recebidos',
|
||||
component: () => import('@/features/patients/cadastro/recebidos/CadastrosRecebidosPage.vue')
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 🔒 PRO — Online Scheduling
|
||||
// ======================================================
|
||||
{
|
||||
path: 'online-scheduling',
|
||||
name: 'therapist-online-scheduling',
|
||||
component: () => import('@/views/pages/therapist/OnlineSchedulingPage.vue'),
|
||||
meta: {
|
||||
feature: 'online_scheduling.manage'
|
||||
}
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 🔒 PRO — Agendamentos Recebidos
|
||||
// ======================================================
|
||||
{
|
||||
path: 'agendamentos-recebidos',
|
||||
name: 'therapist-agendamentos-recebidos',
|
||||
component: () => import('@/features/agenda/pages/AgendamentosRecebidosPage.vue'),
|
||||
meta: {
|
||||
feature: 'online_scheduling.manage'
|
||||
}
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 💰 FINANCEIRO
|
||||
// ======================================================
|
||||
{
|
||||
path: 'financeiro',
|
||||
name: 'therapist-financeiro',
|
||||
component: () => import('@/features/financeiro/pages/FinanceiroDashboardPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'financeiro/lancamentos',
|
||||
name: 'therapist-financeiro-lancamentos',
|
||||
component: () => import('@/features/financeiro/pages/FinanceiroPage.vue')
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 📈 RELATÓRIOS
|
||||
// ======================================================
|
||||
{
|
||||
path: 'relatorios',
|
||||
name: 'therapist-relatorios',
|
||||
component: () => import('@/views/pages/therapist/RelatoriosPage.vue'),
|
||||
meta: { feature: 'agenda.view' }
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 🔐 SECURITY
|
||||
// ======================================================
|
||||
{
|
||||
path: 'settings/security',
|
||||
name: 'therapist-settings-security',
|
||||
component: () => import('@/views/pages/auth/SecurityPage.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// ── Rotas de app — serão filhas do AppLayout compartilhado no index.js ────
|
||||
export default {
|
||||
path: 'therapist',
|
||||
component: RouterPassthrough,
|
||||
meta: { area: 'therapist', requiresAuth: true, roles: ['therapist'] },
|
||||
|
||||
children: [
|
||||
// ======================================================
|
||||
// 📊 DASHBOARD
|
||||
// ======================================================
|
||||
{ path: '', name: 'therapist.dashboard', component: () => import('@/views/pages/therapist/TherapistDashboard.vue') },
|
||||
|
||||
// ======================================================
|
||||
// 📅 AGENDA
|
||||
// ======================================================
|
||||
{
|
||||
path: 'agenda',
|
||||
name: 'therapist-agenda',
|
||||
component: () => import('@/features/agenda/pages/AgendaTerapeutaPage.vue'),
|
||||
meta: { feature: 'agenda.view' }
|
||||
},
|
||||
|
||||
// Recorrências
|
||||
{
|
||||
path: 'agenda/recorrencias',
|
||||
name: 'therapist-agenda-recorrencias',
|
||||
component: () => import('@/features/agenda/pages/AgendaRecorrenciasPage.vue'),
|
||||
meta: { feature: 'agenda.view', mode: 'therapist' }
|
||||
},
|
||||
|
||||
// ✅ Compromissos determinísticos
|
||||
{
|
||||
path: 'agenda/compromissos',
|
||||
name: 'therapist-agenda-compromissos',
|
||||
component: () => import('@/features/agenda/pages/CompromissosDeterminados.vue'),
|
||||
meta: {
|
||||
feature: 'agenda.view',
|
||||
roles: ['therapist']
|
||||
}
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 💳 MEU PLANO
|
||||
// ======================================================
|
||||
{
|
||||
path: 'meu-plano',
|
||||
name: 'therapist-meu-plano',
|
||||
component: () => import('@/views/pages/billing/TherapistMeuPlanoPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'upgrade',
|
||||
name: 'therapist-upgrade',
|
||||
component: () => import('@/views/pages/billing/TherapistUpgradePage.vue')
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 👥 PATIENTS
|
||||
// ======================================================
|
||||
{
|
||||
path: 'patients',
|
||||
name: 'therapist-patients',
|
||||
component: () => import('@/features/patients/PatientsListPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/cadastro',
|
||||
name: 'therapist-patients-create',
|
||||
component: () => import('@/features/patients/cadastro/PatientsCadastroPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/cadastro/:id',
|
||||
name: 'therapist-patients-edit',
|
||||
component: () => import('@/features/patients/cadastro/PatientsCadastroPage.vue'),
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: 'patients/grupos',
|
||||
name: 'therapist-patients-groups',
|
||||
component: () => import('@/features/patients/grupos/GruposPacientesPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/tags',
|
||||
name: 'therapist-patients-tags',
|
||||
component: () => import('@/features/patients/tags/TagsPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/link-externo',
|
||||
name: 'therapist-patients-link-externo',
|
||||
component: () => import('@/features/patients/cadastro/PatientsExternalLinkPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'patients/cadastro/recebidos',
|
||||
name: 'therapist-patients-recebidos',
|
||||
component: () => import('@/features/patients/cadastro/recebidos/CadastrosRecebidosPage.vue')
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 🔒 PRO — Online Scheduling
|
||||
// ======================================================
|
||||
{
|
||||
path: 'online-scheduling',
|
||||
name: 'therapist-online-scheduling',
|
||||
component: () => import('@/views/pages/therapist/OnlineSchedulingPage.vue'),
|
||||
meta: { feature: 'online_scheduling.manage' }
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 🔒 PRO — Agendamentos Recebidos
|
||||
// ======================================================
|
||||
{
|
||||
path: 'agendamentos-recebidos',
|
||||
name: 'therapist-agendamentos-recebidos',
|
||||
component: () => import('@/features/agenda/pages/AgendamentosRecebidosPage.vue'),
|
||||
meta: { feature: 'online_scheduling.manage' }
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 💰 FINANCEIRO
|
||||
// ======================================================
|
||||
{
|
||||
path: 'financeiro',
|
||||
name: 'therapist-financeiro',
|
||||
component: () => import('@/features/financeiro/pages/FinanceiroDashboardPage.vue')
|
||||
},
|
||||
{
|
||||
path: 'financeiro/lancamentos',
|
||||
name: 'therapist-financeiro-lancamentos',
|
||||
component: () => import('@/features/financeiro/pages/FinanceiroPage.vue')
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 📈 RELATÓRIOS
|
||||
// ======================================================
|
||||
{
|
||||
path: 'relatorios',
|
||||
name: 'therapist-relatorios',
|
||||
component: () => import('@/views/pages/therapist/RelatoriosPage.vue'),
|
||||
meta: { feature: 'agenda.view' }
|
||||
},
|
||||
|
||||
// ======================================================
|
||||
// 🔐 SECURITY
|
||||
// ======================================================
|
||||
{
|
||||
path: 'settings/security',
|
||||
name: 'therapist-settings-security',
|
||||
component: () => import('@/views/pages/auth/SecurityPage.vue')
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user