Leonardo 5741e10e28 F6.2 Lote B: triggers schema-aware (rewrite + detach public + attach schemas)
Aplicado como supabase_admin (trigger functions sao owned por supabase_admin).
14 funcoes reescritas pra operar no schema do TG_TABLE_SCHEMA (set_config
search_path dinamico + tenant_id_for_schema p/ tabelas globais audit_logs):
log_audit_change, trg_fn_patient_status_history/timeline/risco,
auto_create_financial_record_from_session, fn_sla_resolve_on_outbound,
fn_clinical_note_version, fn_document_signature_timeline,
fn_documents_timeline_insert, sync_legacy_email/phone_fields,
fn_agenda_regras_semanais_no_overlap, patients_validate_member_consistency.
sync_busy_mirror_agenda_eventos: cross-tenant via tenant_schema_for +
EXECUTE format (espelha "Ocupado" nos schemas das clinicas).
financial_records_inject_tenant: obsoleto, nao anexado nos schemas.

Detach dos 14 schema-aware das tabelas tenant em public (quebrariam la);
attach_schema_aware_triggers recria 22 triggers/schema (defs reais, tenant_id
removido de WHEN/UPDATE OF). agenda_cfg_sync e trg_fn_financial_records_auto_
overdue (agnosticos) ficam em public E nos schemas.

Smoke: sessao->realizado cria financial_record (R$250) no schema + marca billed;
audit roteia tenant_id correto; patient status muda -> timeline no schema.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-13 13:21:00 -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 58 MiB
Languages
Vue 61.1%
PLpgSQL 17.8%
JavaScript 15.9%
HTML 2.6%
TypeScript 2.3%
Other 0.3%