Synaplan
開源 AI 平台,供企業使用:自行託管的 AI 代理、符合 GDPR 的聊天機器人小工具、RAG 知識庫、WhatsApp 與 Outlook AI、MCP、多模型路由。Docker、Kubernetes 或託管於 Germ
AI 翻譯
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Plataforma de getão de Consorcio
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗“Planeje hoje, conquiste sempre.” — O propósito da Autentika não é vender consórcio, é construir liberdade com método. Cada linha de código, cada atendimento e cada automação deve refletir isso.
Esta seção descreve a modelagem multi-tenant do ContemplaHub, usando Supabase (Postgres + RLS) como base operacional e Drizzle apenas como tooling histórico de schema e migrations no pacote packages/database.
org_id): cada corretora visualiza apenas seus dados.auth.org_id() e auth.uid()).log_lead, log_job, log_consentimento).create or replace function auth.org_id()
returns uuid language sql stable as $$
select nullif(current_setting('request.jwt.claims', true)::jsonb->>'org_id','')::uuid
$$;
create or replace function auth.uid()
returns uuid language sql stable as $$
select nullif(current_setting('request.jwt.claims', true)::jsonb->>'sub','')::uuid
$$;
create or replace function app_is_manager()
returns boolean language sql stable as $$
select coalesce((current_setting('request.jwt.claims', true)::jsonb->>'role') = 'manager', false)
$$;
alter table leads enable row level security;
create policy "Leitura restrita ao org_id"
on leads for select using (org_id = auth.org_id());
create policy "Inserção restrita ao org_id"
on leads for insert with check (org_id = auth.org_id());
create policy "Atualização restrita"
on leads for update using (org_id = auth.org_id());
create policy "Gestores podem excluir"
on leads for delete using (app_is_manager() and org_id = auth.org_id());
alter table simulacoes enable row level security;
create policy "Simulações visíveis apenas ao org"
on simulacoes for select using (org_id = auth.org_id());
create policy "Inserção segura"
on simulacoes for insert with check (org_id = auth.org_id());
alter table cotas enable row level security;
create policy "Cotas por organização" on cotas for all using (org_id = auth.org_id());
alter table event_outbox enable row level security;
create policy "Event outbox por org" on event_outbox for all using (org_id = auth.org_id());
create or replace view lead_view as
select l.id as lead_id, l.org_id, l.nome, l.telefone, l.email,
l.valor_carta, l.prazo, l.etapa,
s.id as simulacao_id, s.tipo,
s.resultado->>'lance_min' as lance_min,
s.resultado->>'lance_max' as lance_max,
s.resultado->>'confianca' as confianca,
(now() - l.created_at) as tempo_desde_captura
from leads l
left join simulacoes s on s.lead_id = l.id;
create or replace view simulacao_view as
select s.id, s.org_id, s.tipo, s.valor_carta, s.prazo,
s.resultado->>'confianca' as confianca,
s.resultado->>'lance_min' as lance_min,
s.resultado->>'lance_max' as lance_max,
l.perfil_psico, c.administradora, c.grupo
from simulacoes s
left join leads l on l.id = s.lead_id
left join cotas c on c.org_id = s.org_id;
import { pgTable, uuid, text, numeric, timestamp, jsonb, boolean } from "drizzle-orm/pg-core";
export const leads = pgTable("leads", {
id: uuid("id").defaultRandom().primaryKey(),
orgId: uuid("org_id").notNull(),
nome: text("nome"),
telefone: text("telefone"),
email: text("email"),
origem: text("origem"),
perfilPsico: text("perfil_psico"),
valorCarta: numeric("valor_carta"),
prazo: numeric("prazo"),
consentimento: boolean("consentimento"),
etapa: text("etapa").default("novo"),
createdAt: timestamp("created_at").defaultNow(),
});
insert into orgs (id, nome) values
('11111111-1111-1111-1111-111111111111', 'Autentika Seguros');
insert into profiles (id, org_id, nome, role) values
('22222222-2222-2222-2222-222222222222', '11111111-1111-1111-1111-111111111111', 'Marco França', 'manager');
insert into leads (org_id, nome, telefone, email, valor_carta, prazo)
values ('11111111-1111-1111-1111-111111111111', 'João da Silva', '+55 21 99999-8888', '[email protected]', 300000, 120);
create index if not exists idx_leads_org on leads(org_id);
create index if not exists idx_simulacoes_org on simulacoes(org_id);
create index if not exists idx_event_outbox_status on event_outbox(status);
Com este modelo, o ContemplaHub garante segurança multi-tenant, auditoria completa e compatibilidade total com Drizzle ORM, mantendo a performance ideal para CRM, IA e automações.
MIT © Autentika Seguros — 2025