Leonardo 64005a5b07 MelissaPaciente: fix openWhatsapp + dialog inline novo lancamento financeiro
DOIS BUGS DE COMPORTAMENTO:

1. openWhatsapp nao abria o drawer
   conversationDrawerStore.openForPatient(patientId) espera STRING id,
   nao objeto. Eu passava { id, name, phone, avatar_url } — store
   ignorava e drawer nunca abria.
   FIX: passar String(props.patientId) (mesmo pattern que MelissaPacientes).
   BONUS: a store seta this.error sem dar throw quando paciente nao tem
   telefone cadastrado. Detectamos com `if (err && !isOpen)` e mostramos
   toast warn com a mensagem da store ("Paciente sem telefone cadastrado").
   Funcao virou async pra aguardar o openForPatient.

2. addFinancial era placeholder "Em breve"
   User correto: o sistema ja tem suporte (composables/useFinancialRecords
   tem createManualRecord). Implementado dialog inline simples no
   prontuario.

NOVO em src/features/patients/composables/usePatientFinancial.js
- createRecord(patientId, payload) — INSERT financial_records com
  type='receita', resolve owner_id (auth.getUser) e tenant_id (lazy
  import tenantStore pra evitar circular). Auto-reload via _lastPatientId.
  Retorna {ok, data?, error?}.

NOVO em MelissaPaciente.vue
- Refs novoLancOpen + novoLancForm (description/amount/due_date/payment_method)
- PAYMENT_METHODS array (Pix/Cartao/Dinheiro/Transferencia/Boleto/Convenio)
- addFinancial() agora abre o dialog (era toast "em breve")
- salvarLancamento() handler com validacao (valor > 0, due_date obrigatorio)
- <Dialog> v-model:visible 420px com form: descricao + grid 2-col
  (valor InputNumber BRL + vencimento date input) + select forma
- CSS .mpa-novo-lanc + responsive (1-col em <540px)

ESLint: 0 errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 11:12:22 -03:00
2024-07-29 10:14:47 +03:00
2024-07-25 16:41:34 +03:00
2026-02-18 22:36:45 -03:00
2026-03-06 06:37:13 -03:00
2024-07-29 10:14:47 +03:00
2024-07-25 16:41:34 +03:00
2026-02-18 22:36:45 -03:00
2026-03-06 06:37:13 -03:00
2024-07-25 16:41:34 +03:00
2022-12-28 14:04:39 +03:00
2024-08-03 11:36:25 +03:00
2026-03-12 08:58:36 -03:00
2024-03-18 10:33:41 +03:00

Sakai is an application template for Vue based on the create-vue, the recommended way to start a Vite-powered Vue projects.

Visit the documentation to get started.

S
Description
No description provided
Readme 56 MiB
Languages
Vue 61.3%
PLpgSQL 17.4%
JavaScript 16%
HTML 2.7%
TypeScript 2.3%
Other 0.3%