diff --git a/src/layout/melissa/MelissaPerfil.vue b/src/layout/melissa/MelissaPerfil.vue index 52bf63a..ea43cad 100644 --- a/src/layout/melissa/MelissaPerfil.vue +++ b/src/layout/melissa/MelissaPerfil.vue @@ -31,7 +31,29 @@ const toast = useToast(); const confirm = useConfirm(); const router = useRouter(); const tenantStore = useTenantStore(); -const { layoutConfig, setVariant } = useLayout(); +const { layoutConfig, setVariant, isDarkTheme, toggleDarkMode } = useLayout(); + +// Opções do CHECK constraint da migration 20260521000003 (CFP #5) +const REGISTRATION_TYPE_OPTIONS = [ + { value: '', label: '— Não informado —' }, + { value: 'CRP', label: 'CRP — Psicólogo(a)' }, + { value: 'CRM', label: 'CRM — Médico(a)' }, + { value: 'CRFa', label: 'CRFa — Fonoaudiólogo(a)' }, + { value: 'CREFITO', label: 'CREFITO — Fisioterapeuta / T.O.' }, + { value: 'CRESS', label: 'CRESS — Assistente Social' }, + { value: 'CRN', label: 'CRN — Nutricionista' }, + { value: 'RMS', label: 'RMS — Residência Multiprofissional' }, + { value: 'outro', label: 'Outro' } +]; + +const UF_OPTIONS = [ + 'AC','AL','AP','AM','BA','CE','DF','ES','GO','MA','MT','MS','MG','PA','PB', + 'PR','PE','PI','RJ','RN','RS','RO','RR','SC','SP','SE','TO' +].map(uf => ({ value: uf, label: uf })); + +function goSeguranca() { + router.push('/account/security'); +} // Troca de layout variant (classic/rail/melissa). Confirma + persiste + // hard reload — sair do shell Melissa requer reload pq AppLayout não tem @@ -134,7 +156,11 @@ const form = reactive({ social_instagram: '', social_youtube: '', social_facebook: '', - social_x: '' + social_x: '', + // Registro profissional (CFP #5 — exigido pra emissão de recibos/laudos) + professional_registration_type: '', + professional_registration_number: '', + professional_registration_uf: '' }); const customSocials = ref([]); @@ -345,7 +371,7 @@ async function loadProfile() { const { data: prof, error: pErr } = await supabase .from('profiles') .select( - 'role, full_name, avatar_url, phone, bio, nickname, work_description, work_description_other, site_url, social_instagram, social_youtube, social_facebook, social_x, social_custom' + 'role, full_name, avatar_url, phone, bio, nickname, work_description, work_description_other, site_url, social_instagram, social_youtube, social_facebook, social_x, social_custom, professional_registration_type, professional_registration_number, professional_registration_uf' ) .eq('id', user.id) .maybeSingle(); @@ -364,6 +390,9 @@ async function loadProfile() { form.social_youtube = prof.social_youtube ?? ''; form.social_facebook = prof.social_facebook ?? ''; form.social_x = prof.social_x ?? ''; + form.professional_registration_type = prof.professional_registration_type ?? ''; + form.professional_registration_number = prof.professional_registration_number ?? ''; + form.professional_registration_uf = prof.professional_registration_uf ?? ''; customSocials.value = Array.isArray(prof.social_custom) ? prof.social_custom : []; ui.avatarPreview = form.avatar_url; } @@ -430,7 +459,11 @@ async function saveAll() { social_youtube: String(form.social_youtube || '').trim() || null, social_facebook: String(form.social_facebook || '').trim() || null, social_x: String(form.social_x || '').trim() || null, - social_custom: customSocials.value.filter((s) => s.name || s.url) + social_custom: customSocials.value.filter((s) => s.name || s.url), + // Registro profissional (CFP) — null se vazio + professional_registration_type: String(form.professional_registration_type || '').trim() || null, + professional_registration_number: String(form.professional_registration_number || '').trim() || null, + professional_registration_uf: String(form.professional_registration_uf || '').trim() || null }; const { data: updatedProfile, error: pErr2 } = await supabase @@ -984,6 +1017,63 @@ onBeforeUnmount(() => { + +
+
+
+
+
Registro profissional
+
Conselho regional — exigido para emissão de recibos, atestados e laudos
+
+
+
+
+
+ + + Estado do conselho. +
+
+
+ Aparecerá nos documentos como: + {{ form.professional_registration_type }} {{ form.professional_registration_number }}{{ form.professional_registration_uf ? '/' + form.professional_registration_uf : '' }} +
+
+
+
+
+
@@ -1041,7 +1131,7 @@ onBeforeUnmount(() => {
Rail
-
Mini rail + painel expansível, full-width
+
Ícones no canto esquerdo + painel expansível. Disponível apenas no desktop.
@@ -1069,6 +1159,93 @@ onBeforeUnmount(() => { + + +
+
+
+
+
Preferências
+
Aparência do sistema — tema e densidade
+
+
+
+
+
+ +
+ + +
+ A preferência é salva no seu perfil e segue você em qualquer navegador. +
+
+
+
+ + +
+
+
+
+
Segurança
+
Senha e proteção da conta
+
+
+
+
+
+
+
+
E-mail de acesso
+
{{ userEmail }}
+
+ Para trocar o e-mail, contate o suporte. +
+
+
+ +
+
+
+