177 lines
5.2 KiB
JavaScript
177 lines
5.2 KiB
JavaScript
// src/router/routes.clinic.js
|
||
import AppLayout from '@/layout/AppLayout.vue'
|
||
|
||
export default {
|
||
path: '/admin',
|
||
component: AppLayout,
|
||
|
||
meta: {
|
||
// 🔐 Tudo aqui dentro exige login
|
||
area: 'admin',
|
||
requiresAuth: true,
|
||
|
||
// 👤 Perfil de acesso (tenant-level)
|
||
// tenantStore normaliza tenant_admin -> clinic_admin, mas mantemos compatibilidade
|
||
roles: ['clinic_admin']
|
||
},
|
||
children: [
|
||
// ======================================================
|
||
// 📊 DASHBOARD
|
||
// ======================================================
|
||
{ path: '', name: 'admin.dashboard', component: () => import('@/views/pages/clinic/ClinicDashboard.vue') },
|
||
|
||
// ======================================================
|
||
// 🧩 CLÍNICA — MÓDULOS (tenant_features)
|
||
// ======================================================
|
||
{
|
||
path: 'clinic/features',
|
||
name: 'admin-clinic-features',
|
||
component: () => import('@/views/pages/clinic/clinic/ClinicFeaturesPage.vue'),
|
||
meta: {
|
||
// opcional: restringir apenas para admin canônico
|
||
roles: ['clinic_admin', 'tenant_admin']
|
||
}
|
||
},
|
||
{
|
||
path: 'clinic/professionals',
|
||
name: 'admin-clinic-professionals',
|
||
component: () => import('@/views/pages/clinic/clinic/ClinicProfessionalsPage.vue'),
|
||
meta: {
|
||
requiresAuth: true,
|
||
roles: ['clinic_admin', 'tenant_admin']
|
||
}
|
||
},
|
||
|
||
// ======================================================
|
||
// 💳 MEU PLANO
|
||
// ======================================================
|
||
{
|
||
path: 'meu-plano',
|
||
name: 'admin-meu-plano',
|
||
component: () => import('@/views/pages/billing/ClinicMeuPlanoPage.vue')
|
||
},
|
||
|
||
// ======================================================
|
||
// 📅 AGENDA DA CLÍNICA
|
||
// ======================================================
|
||
|
||
{
|
||
path: 'agenda/clinica',
|
||
name: 'admin-agenda-clinica',
|
||
component: () => import('@/features/agenda/pages/AgendaClinicaPage.vue'),
|
||
meta: {
|
||
feature: 'agenda.view',
|
||
roles: ['clinic_admin', 'tenant_admin']
|
||
}
|
||
},
|
||
|
||
// ✅ NOVO: Compromissos determinísticos (tipos)
|
||
{
|
||
path: 'agenda/compromissos',
|
||
name: 'admin-agenda-compromissos',
|
||
component: () => import('@/features/agenda/pages/CompromissosDeterminados.vue'),
|
||
meta: {
|
||
feature: 'agenda.view',
|
||
roles: ['clinic_admin', 'tenant_admin']
|
||
// ✅ sem tenantScope: a área /admin já está no tenant da clínica pelo fluxo normal
|
||
}
|
||
},
|
||
|
||
// ======================================================
|
||
// 👥 PACIENTES (módulo ativável por clínica)
|
||
// ======================================================
|
||
|
||
// 📋 Lista de pacientes
|
||
{
|
||
path: 'pacientes',
|
||
name: 'admin-pacientes',
|
||
component: () => import('@/features/patients/PatientsListPage.vue'),
|
||
meta: {
|
||
// ✅ depende do tenant_features.patients
|
||
tenantFeature: 'patients'
|
||
}
|
||
},
|
||
|
||
// ➕ Cadastro de paciente (novo)
|
||
{
|
||
path: 'pacientes/cadastro',
|
||
name: 'admin-pacientes-cadastro',
|
||
component: () => import('@/features/patients/cadastro/PatientsCadastroPage.vue'),
|
||
meta: {
|
||
tenantFeature: 'patients'
|
||
}
|
||
},
|
||
|
||
// ✏️ Editar paciente
|
||
{
|
||
path: 'pacientes/cadastro/:id',
|
||
name: 'admin-pacientes-cadastro-edit',
|
||
component: () => import('@/features/patients/cadastro/PatientsCadastroPage.vue'),
|
||
props: true,
|
||
meta: {
|
||
tenantFeature: 'patients'
|
||
}
|
||
},
|
||
|
||
// 👥 Grupos de pacientes
|
||
{
|
||
path: 'pacientes/grupos',
|
||
name: 'admin-pacientes-grupos',
|
||
component: () => import('@/features/patients/grupos/GruposPacientesPage.vue'),
|
||
meta: {
|
||
tenantFeature: 'patients'
|
||
}
|
||
},
|
||
|
||
// 🏷️ Tags de pacientes
|
||
{
|
||
path: 'pacientes/tags',
|
||
name: 'admin-pacientes-tags',
|
||
component: () => import('@/features/patients/tags/TagsPage.vue'),
|
||
meta: {
|
||
tenantFeature: 'patients'
|
||
}
|
||
},
|
||
|
||
// 🔗 Link externo para cadastro
|
||
{
|
||
path: 'pacientes/link-externo',
|
||
name: 'admin-pacientes-link-externo',
|
||
component: () => import('@/features/patients/cadastro/PatientsExternalLinkPage.vue'),
|
||
meta: {
|
||
tenantFeature: 'patients'
|
||
}
|
||
},
|
||
|
||
// 📥 Cadastros recebidos via link externo
|
||
{
|
||
path: 'pacientes/cadastro/recebidos',
|
||
name: 'admin-pacientes-recebidos',
|
||
component: () => import('@/features/patients/cadastro/recebidos/CadastrosRecebidosPage.vue'),
|
||
meta: {
|
||
tenantFeature: 'patients'
|
||
}
|
||
},
|
||
|
||
// ======================================================
|
||
// 🔐 SEGURANÇA
|
||
// ======================================================
|
||
{
|
||
path: 'settings/security',
|
||
name: 'admin-settings-security',
|
||
component: () => import('@/views/pages/auth/SecurityPage.vue')
|
||
},
|
||
|
||
// ======================================================
|
||
// 🔒 MÓDULO PRO — Online Scheduling
|
||
// ======================================================
|
||
{
|
||
path: 'online-scheduling',
|
||
name: 'admin-online-scheduling',
|
||
component: () => import('@/views/pages/clinic/OnlineSchedulingAdminPage.vue'),
|
||
meta: {
|
||
feature: 'online_scheduling.manage'
|
||
}
|
||
}
|
||
]
|
||
} |