@fayz-ai/plugin-crm 0.31.6 → 0.31.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -60,6 +60,7 @@ export declare const MIGRATION_059_A_EMPRESA_MOSTRA_O_INSTAGRAM_QUE_ELA_GUARDA =
|
|
|
60
60
|
export declare const MIGRATION_060_O_FUNIL_SABE_DE_QUEM_ELE_E = "-- ---------------------------------------------------------------------------\n-- 060_o_funil_sabe_de_quem_ele_e.sql \u2014 o funil deixa de ser um s\u00F3, para todos.\n-- ---------------------------------------------------------------------------\n-- `plg_crm_pipelines` j\u00E1 aceita mais de uma linha e a tela j\u00E1 troca entre elas.\n-- O que n\u00E3o existia era o RECORTE: um funil valia para a conta inteira, ent\u00E3o\n-- abrir dois significava mostrar os dois a todo mundo e torcer para que cada um\n-- clicasse no seu. Numa casa com duas marcas e duas equipes de venda isso n\u00E3o \u00E9\n-- inconveni\u00EAncia, \u00E9 o funil errado carregado por padr\u00E3o todo dia.\n--\n-- \u2500\u2500 duas tabelas de v\u00EDnculo, e n\u00E3o duas colunas \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- Um funil pode servir duas unidades (a marca que vende nas duas pra\u00E7as) e duas\n-- equipes (SDR e closer trabalhando o mesmo pipe). Coluna `unit_id` no funil\n-- responderia \"uma\", e a segunda casa chegaria no m\u00EAs seguinte.\n--\n-- \u2500\u2500 e o vazio quer dizer TODOS \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- Funil sem v\u00EDnculo nenhum vale para a conta inteira. \u00C9 o oposto do\n-- deny-by-default que a RLS de unidade usa, e de prop\u00F3sito: ali o vazio \u00E9 \"n\u00E3o\n-- disse quem pode ver\" e o risco \u00E9 vazar; aqui o vazio \u00E9 \"n\u00E3o disse para quem\n-- serve\" e o risco \u00E9 a conta acordar sem funil nenhum na tela depois de uma\n-- migration. O recorte \u00E9 de APRESENTA\u00C7\u00C3O \u2014 quem pode LER o funil continua sendo\n-- pergunta da RLS, que n\u00E3o muda aqui.\n--\n-- A equipe \u00E9 a categoria `staff_team` da 139 do espinha. Sem FK para\n-- `categories` porque a tabela \u00E9 do n\u00FAcleo e o v\u00EDnculo \u00E9 do plugin: o mesmo\n-- motivo pelo qual `plg_crm_deals.assigned_to_id` n\u00E3o referencia `auth.users`.\n-- O ON DELETE que importa \u00E9 o do funil, e esse existe.\n-- ---------------------------------------------------------------------------\n\nCREATE TABLE IF NOT EXISTS public.plg_crm_pipeline_units (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n tenant_id uuid NOT NULL,\n pipeline_id uuid NOT NULL,\n unit_id uuid NOT NULL,\n created_at timestamptz DEFAULT now() NOT NULL,\n CONSTRAINT plg_crm_pipeline_units_pkey PRIMARY KEY (id),\n CONSTRAINT plg_crm_pipeline_units_pair_key UNIQUE (pipeline_id, unit_id)\n);\n\nCREATE TABLE IF NOT EXISTS public.plg_crm_pipeline_teams (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n tenant_id uuid NOT NULL,\n pipeline_id uuid NOT NULL,\n team_id uuid NOT NULL,\n created_at timestamptz DEFAULT now() NOT NULL,\n CONSTRAINT plg_crm_pipeline_teams_pkey PRIMARY KEY (id),\n CONSTRAINT plg_crm_pipeline_teams_pair_key UNIQUE (pipeline_id, team_id)\n);\n\n-- \u2500\u2500 constraints \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nALTER TABLE public.plg_crm_pipeline_units\n DROP CONSTRAINT IF EXISTS plg_crm_pipeline_units_tenant_fkey;\nALTER TABLE public.plg_crm_pipeline_units\n ADD CONSTRAINT plg_crm_pipeline_units_tenant_fkey\n FOREIGN KEY (tenant_id) REFERENCES public.tenants(id) ON DELETE CASCADE;\n\nALTER TABLE public.plg_crm_pipeline_units\n DROP CONSTRAINT IF EXISTS plg_crm_pipeline_units_pipeline_fkey;\nALTER TABLE public.plg_crm_pipeline_units\n ADD CONSTRAINT plg_crm_pipeline_units_pipeline_fkey\n FOREIGN KEY (pipeline_id) REFERENCES public.plg_crm_pipelines(id) ON DELETE CASCADE;\n\nALTER TABLE public.plg_crm_pipeline_teams\n DROP CONSTRAINT IF EXISTS plg_crm_pipeline_teams_tenant_fkey;\nALTER TABLE public.plg_crm_pipeline_teams\n ADD CONSTRAINT plg_crm_pipeline_teams_tenant_fkey\n FOREIGN KEY (tenant_id) REFERENCES public.tenants(id) ON DELETE CASCADE;\n\nALTER TABLE public.plg_crm_pipeline_teams\n DROP CONSTRAINT IF EXISTS plg_crm_pipeline_teams_pipeline_fkey;\nALTER TABLE public.plg_crm_pipeline_teams\n ADD CONSTRAINT plg_crm_pipeline_teams_pipeline_fkey\n FOREIGN KEY (pipeline_id) REFERENCES public.plg_crm_pipelines(id) ON DELETE CASCADE;\n\n-- \u2500\u2500 index \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nCREATE INDEX IF NOT EXISTS plg_crm_pipeline_units_pipeline_idx\n ON public.plg_crm_pipeline_units (tenant_id, pipeline_id);\nCREATE INDEX IF NOT EXISTS plg_crm_pipeline_units_unit_idx\n ON public.plg_crm_pipeline_units (tenant_id, unit_id);\nCREATE INDEX IF NOT EXISTS plg_crm_pipeline_teams_pipeline_idx\n ON public.plg_crm_pipeline_teams (tenant_id, pipeline_id);\nCREATE INDEX IF NOT EXISTS plg_crm_pipeline_teams_team_idx\n ON public.plg_crm_pipeline_teams (tenant_id, team_id);\n\n-- \u2500\u2500 RLS \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- Ler o v\u00EDnculo \u00E9 ler a configura\u00E7\u00E3o do funil: `sales.read`. Escrev\u00EA-lo \u00E9\n-- configurar, e configura\u00E7\u00E3o de funil segue o mesmo verbo que criar a etapa.\n\nALTER TABLE public.plg_crm_pipeline_units ENABLE ROW LEVEL SECURITY;\nALTER TABLE public.plg_crm_pipeline_units FORCE ROW LEVEL SECURITY;\nALTER TABLE public.plg_crm_pipeline_teams ENABLE ROW LEVEL SECURITY;\nALTER TABLE public.plg_crm_pipeline_teams FORCE ROW LEVEL SECURITY;\n\nDROP POLICY IF EXISTS plg_crm_pipeline_units_authz_select ON public.plg_crm_pipeline_units;\nCREATE POLICY plg_crm_pipeline_units_authz_select ON public.plg_crm_pipeline_units\n FOR SELECT TO authenticated USING (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.read', NULL::uuid)));\n\nDROP POLICY IF EXISTS plg_crm_pipeline_units_authz_insert ON public.plg_crm_pipeline_units;\nCREATE POLICY plg_crm_pipeline_units_authz_insert ON public.plg_crm_pipeline_units\n FOR INSERT TO authenticated WITH CHECK (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.edit', NULL::uuid)));\n\nDROP POLICY IF EXISTS plg_crm_pipeline_units_authz_update ON public.plg_crm_pipeline_units;\nCREATE POLICY plg_crm_pipeline_units_authz_update ON public.plg_crm_pipeline_units\n FOR UPDATE TO authenticated USING (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.edit', NULL::uuid)))\n WITH CHECK (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.edit', NULL::uuid)));\n\nDROP POLICY IF EXISTS plg_crm_pipeline_units_authz_delete ON public.plg_crm_pipeline_units;\nCREATE POLICY plg_crm_pipeline_units_authz_delete ON public.plg_crm_pipeline_units\n FOR DELETE TO authenticated USING (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.edit', NULL::uuid)));\n\nDROP POLICY IF EXISTS plg_crm_pipeline_teams_authz_select ON public.plg_crm_pipeline_teams;\nCREATE POLICY plg_crm_pipeline_teams_authz_select ON public.plg_crm_pipeline_teams\n FOR SELECT TO authenticated USING (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.read', NULL::uuid)));\n\nDROP POLICY IF EXISTS plg_crm_pipeline_teams_authz_insert ON public.plg_crm_pipeline_teams;\nCREATE POLICY plg_crm_pipeline_teams_authz_insert ON public.plg_crm_pipeline_teams\n FOR INSERT TO authenticated WITH CHECK (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.edit', NULL::uuid)));\n\nDROP POLICY IF EXISTS plg_crm_pipeline_teams_authz_update ON public.plg_crm_pipeline_teams;\nCREATE POLICY plg_crm_pipeline_teams_authz_update ON public.plg_crm_pipeline_teams\n FOR UPDATE TO authenticated USING (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.edit', NULL::uuid)))\n WITH CHECK (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.edit', NULL::uuid)));\n\nDROP POLICY IF EXISTS plg_crm_pipeline_teams_authz_delete ON public.plg_crm_pipeline_teams;\nCREATE POLICY plg_crm_pipeline_teams_authz_delete ON public.plg_crm_pipeline_teams\n FOR DELETE TO authenticated USING (\n tenant_id = (SELECT app.current_tenant_id())\n AND (SELECT app.has_permission('sales.edit', NULL::uuid)));\n\nGRANT SELECT, INSERT, UPDATE, DELETE ON public.plg_crm_pipeline_units TO authenticated;\nGRANT SELECT, INSERT, UPDATE, DELETE ON public.plg_crm_pipeline_teams TO authenticated;\nGRANT ALL ON public.plg_crm_pipeline_units TO service_role;\nGRANT ALL ON public.plg_crm_pipeline_teams TO service_role;\n\n-- \u2500\u2500 a vista que a tela l\u00EA \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- O funil com os v\u00EDnculos J\u00C1 AGREGADOS: sem ela o quadro faria tr\u00EAs consultas\n-- para responder \"qual funil \u00E9 meu\" \u2014 e faria isso a cada montagem, antes de\n-- poder sequer come\u00E7ar a buscar os cards.\n--\n-- `security_invoker`: a RLS acima \u00E9 que decide as linhas. Uma vista definidora\n-- aqui devolveria o funil de outra casa para quem soubesse o id.\nCREATE OR REPLACE VIEW public.v_crm_pipelines WITH (security_invoker = true) AS\n SELECT p.id, p.tenant_id, p.name, p.is_default, p.is_active,\n p.created_at, p.updated_at,\n coalesce((SELECT array_agg(u.unit_id)\n FROM public.plg_crm_pipeline_units u\n WHERE u.pipeline_id = p.id), '{}'::uuid[]) AS unit_ids,\n coalesce((SELECT array_agg(t.team_id)\n FROM public.plg_crm_pipeline_teams t\n WHERE t.pipeline_id = p.id), '{}'::uuid[]) AS team_ids\n FROM public.plg_crm_pipelines p;\n\nGRANT SELECT ON public.v_crm_pipelines TO authenticated;\nGRANT SELECT ON public.v_crm_pipelines TO service_role;\n";
|
|
61
61
|
export declare const MIGRATION_061_A_CONVERSAO_RESPEITA_O_FILTRO_DO_QUADRO = "-- 061 \u2014 The conversion chart answers the question the filter asked.\n--\n-- \u2500\u2500 The bug \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- Board, List and Conversion are three modes of one screen, and the board's\n-- filters are persisted (`crm.board.owner`, `crm.board.period`, the tag chips).\n-- The board is honest: `getDealsByStage` asks the database once per stage with\n-- `count: 'exact'` and every predicate applied, so its column numbers shrink\n-- with the filter.\n--\n-- `crm_funnel(p_pipeline_id uuid)` takes ONE argument. It never saw a filter.\n-- So: filter the board, switch to Conversion, and the chart counts the whole\n-- funnel while the filter bar above it still says otherwise. Switch back and\n-- the numbers are right again. That is why it was reported as real and could\n-- not be reproduced on demand \u2014 through the board's SEARCH box it never fails\n-- (the header count has a special case for it), and through the filter menu it\n-- fails every time, but only after changing mode.\n--\n-- \u2500\u2500 Why an overload and not a wider signature \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- Replacing `crm_funnel(uuid)` with a wider one is not replay-safe: the chain\n-- is replayed, 034 creates the 1-arg version, and a later DROP/CREATE of a\n-- different signature leaves two functions anyway. So the 1-arg stays exactly\n-- as 034 left it \u2014 untouched, still correct for a caller with no filter \u2014 and\n-- the filtered read is a second, 2-arg function. No DEFAULT on the new one:\n-- `crm_funnel(uuid)` and `crm_funnel(uuid, jsonb DEFAULT \u2026)` would be ambiguous\n-- for a one-argument call and Postgres would refuse to choose.\n--\n-- \u2500\u2500 The filter is jsonb on purpose \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- `BoardFilter` has grown twice already (tags, then search+searchTags, then the\n-- period, then the owner). A positional signature would need a migration each\n-- time and would break every caller on the way. A bag costs one cast per key\n-- and the shape stays the board's to decide.\n\nCREATE OR REPLACE FUNCTION public.crm_funnel(p_pipeline_id uuid, p_filter jsonb)\nRETURNS TABLE(stage_id uuid, deals bigint, total_value numeric)\nLANGUAGE plpgsql\nSTABLE\nSECURITY DEFINER\nSET search_path TO ''\nAS $function$\ndeclare\n v_tenant uuid := app.current_tenant_id();\n v_foco uuid := nullif(app.current_unit_id(), '00000000-0000-0000-0000-000000000000'::uuid);\n v_negado boolean := app.current_unit_id() = '00000000-0000-0000-0000-000000000000'::uuid;\n v_unidades uuid[];\n v_sem_unidade boolean;\n v_dono boolean;\n v_uid uuid := auth.uid();\n -- O recorte, lido do saco. Tudo opcional: um `{}` devolve o mesmo que a\n -- fun\u00E7\u00E3o de um argumento.\n v_tags text[] := case when p_filter ? 'tags'\n then array(select jsonb_array_elements_text(p_filter->'tags')) end;\n v_busca text := nullif(trim(coalesce(p_filter->>'search', '')), '');\n v_busca_tags text[] := case when p_filter ? 'searchTags'\n then array(select jsonb_array_elements_text(p_filter->'searchTags')) end;\n v_de timestamptz := nullif(p_filter->>'createdFrom', '')::timestamptz;\n v_ate timestamptz := nullif(p_filter->>'createdTo', '')::timestamptz;\n v_dono_f text := nullif(p_filter->>'assignedToId', '');\nbegin\n if v_tenant is null or v_negado then\n return;\n end if;\n\n select coalesce(array_agg(a.unit_id), '{}'::uuid[])\n into v_unidades\n from app.user_unit_access a\n where a.tenant_id = v_tenant\n and a.user_id = v_uid\n and (v_foco is null or a.unit_id = v_foco)\n and app.has_permission('crm.pipeline.read', a.unit_id);\n\n v_sem_unidade := app.has_permission('crm.pipeline.read', null::uuid);\n v_dono := app.owner_scoped('crm.deal');\n\n return query\n -- A TABELA para a cerca, a VISTA para o texto.\n --\n -- `v_deals` n\u00E3o exp\u00F5e `unit_id` nem `owner_id` \u2014 s\u00E3o exatamente as duas\n -- colunas de que a permiss\u00E3o depende, e ler a permiss\u00E3o de uma linha que n\u00E3o\n -- as tem seria escrever uma cerca que n\u00E3o fecha. Ent\u00E3o a base continua sendo\n -- `plg_crm_deals`, como na 034, e a vista entra s\u00F3 para dar ao termo de busca\n -- as mesmas colunas que a coluna do quadro procura.\n select d.stage_id, count(*), coalesce(sum(d.value), 0)\n from public.plg_crm_deals d\n join public.v_deals v on v.id = d.id\n where d.tenant_id = v_tenant\n and d.pipeline_id = p_pipeline_id\n and d.status = 'open'\n and ( (d.unit_id is null and v_sem_unidade)\n or (d.unit_id = any (v_unidades)))\n and (not v_dono or d.owner_id is null or d.owner_id = v_uid)\n -- Os MESMOS predicados que `getDealsByStage` aplica, para que a coluna e\n -- o gr\u00E1fico n\u00E3o possam divergir por um detalhe.\n and (v_tags is null or d.tags && v_tags)\n and (v_de is null or d.created_at >= v_de)\n and (v_ate is null or d.created_at <= v_ate)\n and (v_dono_f is null\n or (v_dono_f = 'none' and d.assigned_to_id is null)\n or (v_dono_f <> 'none' and d.assigned_to_id = v_dono_f::uuid))\n -- A busca \u00E9 um OU entre as colunas do quadro e as etiquetas resolvidas no\n -- cliente \u2014 alternativa ao texto, n\u00E3o afunilamento dele.\n and (v_busca is null\n or v.title ilike '%' || v_busca || '%'\n or v.contact_name ilike '%' || v_busca || '%'\n or v.company_name ilike '%' || v_busca || '%'\n or v.notes ilike '%' || v_busca || '%'\n or v.lost_reason ilike '%' || v_busca || '%'\n or v.stage_name ilike '%' || v_busca || '%'\n or v.contact_status_name ilike '%' || v_busca || '%'\n or (v_busca_tags is not null and d.tags && v_busca_tags))\n group by d.stage_id;\nend\n$function$;\n\nREVOKE ALL ON FUNCTION public.crm_funnel(uuid, jsonb) FROM public;\nGRANT EXECUTE ON FUNCTION public.crm_funnel(uuid, jsonb) TO authenticated;\nGRANT EXECUTE ON FUNCTION public.crm_funnel(uuid, jsonb) TO service_role;\n";
|
|
62
62
|
export declare const MIGRATION_062_THE_WHOLE_CRM_SAYS_WHICH_UNIT_IT_IS = "-- ---------------------------------------------------------------------------\n-- 062_the_whole_crm_says_which_unit_it_is.sql\n--\n-- The CRM was the last module blind to units. Two brands selling out of one\n-- tenant shared a single board: 335 cards of one brand on the screen of\n-- whoever runs the other, with no way to say \"only mine\".\n--\n-- Most of the fence already existed and nobody had noticed: `plg_crm_deals.\n-- unit_id` and `people.unit_id` have carried a restrictive policy since 052 and\n-- the spine's 042, and `app.has_unit` narrows to `app.current_unit_id()`. Three\n-- things were missing, and each one hid the other two:\n--\n-- 1. the COLUMN on the two tables that lacked it \u2014 company and activity;\n-- 2. the column reaching the VIEWS, which is where the screens read: none of\n-- them returned `unit_id`, so the client had nothing to narrow by;\n-- 3. the row in `scoped_resources`, which is how the visibility screen and\n-- the generic CRUD learn that these rows carry a unit.\n--\n-- Activity stays OUT of `scoped_resources`, same call as 055: that registry\n-- serves the resource the visibility screen offers and wants `owner_id`. An\n-- activity has `created_by` \u2014 who logged it, not who owns it \u2014 and inherits its\n-- unit from the deal or lead it reports. Its fence is the policy below.\n--\n-- A company is born shared (`unit_id` null = the whole house) and every existing\n-- one stays that way. Deliberate, and the opposite of the unit's usual\n-- deny-by-default: the same restaurant chain is a customer of both brands, and\n-- pinning it to one branch would hide a book of business from the people\n-- working it.\n--\n-- Idempotent and replay-safe. Views grow by CREATE OR REPLACE with the new\n-- column LAST, which is what spares the CASCADE and recreating\n-- `plg_crm_rep_deals` by hand.\n-- ---------------------------------------------------------------------------\n\n-- \u2500\u2500 the column \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nALTER TABLE public.plg_crm_companies ADD COLUMN IF NOT EXISTS unit_id uuid;\nALTER TABLE public.plg_crm_activities ADD COLUMN IF NOT EXISTS unit_id uuid;\n\n-- SET NULL, not CASCADE: closing a branch must not delete its book of business\n-- or 551 logged calls. The row going back to shared is the acceptable worst\n-- case; losing the history is not.\nALTER TABLE public.plg_crm_companies DROP CONSTRAINT IF EXISTS plg_crm_companies_unit_fk;\nALTER TABLE public.plg_crm_companies\n ADD CONSTRAINT plg_crm_companies_unit_fk\n FOREIGN KEY (tenant_id, unit_id) REFERENCES app.units(tenant_id, id) ON DELETE SET NULL;\n\nALTER TABLE public.plg_crm_activities DROP CONSTRAINT IF EXISTS plg_crm_activities_unit_fk;\nALTER TABLE public.plg_crm_activities\n ADD CONSTRAINT plg_crm_activities_unit_fk\n FOREIGN KEY (tenant_id, unit_id) REFERENCES app.units(tenant_id, id) ON DELETE SET NULL;\n\n-- (tenant, unit) in the order the query asks: the policy filters the tenant\n-- first, and that prefix is what keeps the predicate out of a row-by-row loop.\nCREATE INDEX IF NOT EXISTS plg_crm_companies_unit_idx\n ON public.plg_crm_companies (tenant_id, unit_id);\nCREATE INDEX IF NOT EXISTS plg_crm_activities_unit_idx\n ON public.plg_crm_activities (tenant_id, unit_id);\n\n-- \u2500\u2500 the activity inherits the unit of what it reports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- A loose activity (no deal, no lead) stays null: inventing its branch would\n-- hide somebody's phone call on a guess.\nUPDATE public.plg_crm_activities a\n SET unit_id = d.unit_id\n FROM public.plg_crm_deals d\n WHERE a.unit_id IS NULL AND a.deal_id = d.id AND d.unit_id IS NOT NULL;\n\nUPDATE public.plg_crm_activities a\n SET unit_id = p.unit_id\n FROM public.people p\n WHERE a.unit_id IS NULL AND a.deal_id IS NULL\n AND a.lead_id = p.id AND p.unit_id IS NOT NULL;\n\n-- \u2500\u2500 the fence \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- Same shape as the deal's policy (052): null passes, a unit asks\n-- `app.has_unit`. Additive \u2014 no row that was readable stops being readable.\n--\n-- The verb does not change here. Company stays on `sales.read`, activity stays\n-- on the tenant cut 012 wrote: widening permission and unit in one migration\n-- would be two changes with one test.\n\nDROP POLICY IF EXISTS plg_crm_companies_authz_select ON public.plg_crm_companies;\nCREATE POLICY plg_crm_companies_authz_select ON public.plg_crm_companies\n FOR SELECT TO authenticated USING (\n tenant_id = (SELECT app.current_tenant_id())\n AND (unit_id IS NULL OR (SELECT app.has_unit(plg_crm_companies.unit_id)))\n AND (SELECT app.has_permission('sales.read', NULL::uuid)));\n\nDROP POLICY IF EXISTS plg_crm_activities_select ON public.plg_crm_activities;\nCREATE POLICY plg_crm_activities_select ON public.plg_crm_activities\n FOR SELECT TO authenticated USING (\n tenant_id IN (SELECT user_tenant_ids())\n AND (unit_id IS NULL OR (SELECT app.has_unit(plg_crm_activities.unit_id))));\n\n-- \u2500\u2500 the column reaches the view \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- Columns below are what 058 (v_deals), 054 (v_crm_leads) and 059\n-- (v_crm_companies_enriched) left, in the same order, plus `unit_id`.\n\nCREATE OR REPLACE VIEW public.v_deals WITH (security_invoker = true) AS\n SELECT d.id,\n d.tenant_id,\n d.status,\n d.value,\n COALESCE(d.title, d.notes) AS title,\n d.contact_id,\n d.assigned_to_id,\n d.tags,\n COALESCE(pc.name, d.metadata ->> 'contactName'::text) AS contact_name,\n d.created_at,\n d.updated_at,\n d.pipeline_id,\n d.stage_id,\n d.probability,\n d.expected_close_date,\n d.lead_id,\n d.lost_reason,\n ps.name AS stage_name,\n ps.color AS stage_color,\n ps.\"order\" AS stage_order,\n ps.name AS stage,\n d.won_at,\n d.lost_at,\n d.company_id,\n d.contact_status,\n d.contact_status_at,\n cs.name AS contact_status_name,\n cs.color AS contact_status_color,\n d.notes,\n cs.derived_from AS contact_status_derived_from,\n emp.name AS company_name,\n emp.document_number AS company_document,\n grp.group_id,\n grp.group_name,\n grp.group_companies,\n -- On the table since 052 and never here, so the board had no way to narrow\n -- without a second query per card.\n d.unit_id\n FROM plg_crm_deals d\n LEFT JOIN plg_crm_companies emp ON emp.id = d.company_id\n LEFT JOIN people pc ON pc.id = d.contact_id\n LEFT JOIN plg_crm_pipeline_stages ps ON ps.id = d.stage_id\n LEFT JOIN LATERAL ( SELECT s.name,\n s.color,\n s.derived_from\n FROM plg_crm_deal_statuses s\n WHERE s.tenant_id = d.tenant_id AND s.key = d.contact_status AND (s.stage_id IS NULL OR s.stage_id = d.stage_id)\n ORDER BY (s.stage_id IS NOT NULL) DESC\n LIMIT 1) cs ON true\n LEFT JOIN LATERAL ( SELECT g.id AS group_id,\n g.name AS group_name,\n ( SELECT count(*)::integer AS count\n FROM plg_crm_company_group_members m2\n WHERE m2.group_id = g.id) AS group_companies\n FROM plg_crm_company_group_members m\n JOIN plg_crm_company_groups g ON g.id = m.group_id\n WHERE m.company_id = d.company_id AND m.tenant_id = d.tenant_id AND g.is_active\n ORDER BY m.created_at, m.id\n LIMIT 1) grp ON true;\n\nGRANT SELECT ON public.v_deals TO authenticated, service_role;\n\nCREATE OR REPLACE VIEW public.v_crm_leads WITH (security_invoker = true) AS\n SELECT l.id,\n l.tenant_id,\n l.name,\n l.email,\n l.phone,\n l.notes,\n l.tags,\n l.is_active,\n l.company,\n l.source_id,\n l.source_name,\n l.lead_status,\n l.lead_value,\n l.assigned_to_id,\n l.created_at,\n l.updated_at,\n l.form_id,\n l.custom_fields,\n l.utm,\n l.status,\n l.attachments,\n cp.company_id,\n cp.role AS company_role,\n c.name AS company_name,\n c.legal_name AS company_legal_name,\n c.document_number AS company_document,\n pess.instagram,\n pess.metadata ->> 'credential_company'::text AS credential_company,\n pess.metadata ->> 'phone_raw'::text AS phone_raw,\n pess.city,\n pess.state,\n -- From `people`, not `v_leads`: the spine's view does not expose it and is\n -- not this plugin's to widen \u2014 the reason 013 wrapped it instead.\n pess.unit_id\n FROM v_leads l\n LEFT JOIN people pess ON pess.id = l.id\n LEFT JOIN LATERAL ( SELECT x.company_id,\n x.role\n FROM plg_crm_company_people x\n WHERE x.person_id = l.id\n ORDER BY x.is_primary DESC, x.created_at\n LIMIT 1) cp ON true\n LEFT JOIN plg_crm_companies c ON c.id = cp.company_id;\n\nGRANT SELECT ON public.v_crm_leads TO authenticated, service_role;\n\nCREATE OR REPLACE VIEW public.v_crm_companies_enriched WITH (security_invoker = true) AS\n SELECT c.id,\n c.tenant_id,\n c.name,\n c.legal_name,\n c.document_number,\n c.document_kind,\n c.document_root,\n c.document_valid,\n c.email,\n c.phone,\n c.website,\n c.address,\n c.city,\n c.state,\n c.country,\n c.postal_code,\n c.tags,\n c.notes,\n c.metadata,\n c.custom_fields,\n c.owner_id,\n c.is_active,\n c.created_at,\n c.updated_at,\n COALESCE(p.people_count, 0) AS people_count,\n COALESCE(d.open_deals, 0) AS open_deals,\n COALESCE(d.won_value, 0::numeric) AS won_value,\n CASE\n WHEN c.document_root IS NULL THEN 0\n ELSE COALESCE(g.group_size, 1) - 1\n END AS group_siblings,\n c.instagram,\n c.unit_id\n FROM plg_crm_companies c\n LEFT JOIN LATERAL ( SELECT count(*)::integer AS people_count\n FROM plg_crm_company_people cp\n JOIN people pe ON pe.id = cp.person_id\n WHERE cp.company_id = c.id) p ON true\n LEFT JOIN LATERAL ( SELECT count(*) FILTER (WHERE dl.status = 'open'::text)::integer AS open_deals,\n COALESCE(sum(dl.value) FILTER (WHERE dl.status = 'won'::text), 0::numeric) AS won_value\n FROM plg_crm_deals dl\n WHERE dl.company_id = c.id) d ON true\n LEFT JOIN LATERAL ( SELECT count(*)::integer AS group_size\n FROM plg_crm_companies s\n WHERE s.tenant_id = c.tenant_id AND s.document_root = c.document_root) g ON true;\n\nGRANT SELECT ON public.v_crm_companies_enriched TO authenticated, service_role;\n\n-- \u2500\u2500 the row the visibility screen reads \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n--\n-- `shareable` on both: a book of business and a funnel cross branches on\n-- purpose. `default_visibility` is what the screen OFFERS on create \u2014 unit for\n-- the deal, which is born where somebody is selling; the whole tenant for the\n-- company, which is the same chain for both brands.\nINSERT INTO public.scoped_resources (resource_table, unit_column, owner_column, shareable, default_visibility, label)\nVALUES\n ('plg_crm_deals', 'unit_id', 'owner_id', true, 'unit', 'Neg\u00F3cios'),\n ('plg_crm_companies', 'unit_id', 'owner_id', true, 'tenant', 'Empresas')\nON CONFLICT (resource_table) DO UPDATE\n SET unit_column = EXCLUDED.unit_column,\n owner_column = EXCLUDED.owner_column,\n shareable = EXCLUDED.shareable,\n default_visibility = EXCLUDED.default_visibility,\n label = EXCLUDED.label;\n";
|
|
63
|
+
export declare const MIGRATION_063_THE_ROTA_ENGINE_IS_SERVER_ONLY = "-- 063_the_rota_engine_is_server_only.sql\n--\n-- 009 and 018 meant the rota engine to be service_role only and wrote\n-- `REVOKE ALL ... FROM PUBLIC`. The pool's default privileges grant EXECUTE to\n-- `authenticated` on every new function in public, so live, any signed-in user\n-- of any tenant could offer another tenant's lead, forge a lead_created event\n-- into the handler, or sweep every tenant's offers at once \u2014 all SECURITY\n-- DEFINER with no caller check.\n--\n-- Every caller is server-side and runs as the owner: `event_runner_tick`\n-- (pg_cron) \u2192 `crm_offers_sweep`, `consume_event_log` \u2192 the handler, and the\n-- definer functions `crm_offer_decline` / `crm_offer_backlog` \u2192 `crm_offer_lead`.\n-- No screen, edge function or agent tool calls these three.\n\nREVOKE ALL ON FUNCTION public.crm_offer_lead(uuid, uuid, uuid, integer, boolean) FROM PUBLIC, anon, authenticated;\nGRANT EXECUTE ON FUNCTION public.crm_offer_lead(uuid, uuid, uuid, integer, boolean) TO service_role;\n\nREVOKE ALL ON FUNCTION public.crm_offers_sweep(integer) FROM PUBLIC, anon, authenticated;\nGRANT EXECUTE ON FUNCTION public.crm_offers_sweep(integer) TO service_role;\n\nREVOKE ALL ON FUNCTION public.plg_crm_on_lead_created_offer(jsonb) FROM PUBLIC, anon, authenticated;\nGRANT EXECUTE ON FUNCTION public.plg_crm_on_lead_created_offer(jsonb) TO service_role;\n";
|
|
63
64
|
export declare const MIGRATIONS: Array<{
|
|
64
65
|
id: string;
|
|
65
66
|
sql: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,0+/EAykDlC,CAAA;AAED,eAAO,MAAM,yCAAyC,8qYAkOrD,CAAA;AAED,eAAO,MAAM,+CAA+C,0onBAwT3D,CAAA;AAED,eAAO,MAAM,oDAAoD,8jpBAsYhE,CAAA;AAED,eAAO,MAAM,8CAA8C,gp4BAugB1D,CAAA;AAED,eAAO,MAAM,iDAAiD,47QA4J7D,CAAA;AAED,eAAO,MAAM,wCAAwC,gpYAiOpD,CAAA;AAED,eAAO,MAAM,uCAAuC,6sdA0RnD,CAAA;AAED,eAAO,MAAM,qCAAqC,m/vBAmcjD,CAAA;AAED,eAAO,MAAM,sCAAsC,gmEA4ClD,CAAA;AAED,eAAO,MAAM,qCAAqC,u6LA0GjD,CAAA;AAED,eAAO,MAAM,wCAAwC,o1KA6GpD,CAAA;AAED,eAAO,MAAM,0CAA0C,k+oDA4/BtD,CAAA;AAED,eAAO,MAAM,gDAAgD,+puBAub5D,CAAA;AAED,eAAO,MAAM,iDAAiD,iupBAwU7D,CAAA;AAED,eAAO,MAAM,kDAAkD,qqpBAyY9D,CAAA;AAED,eAAO,MAAM,2DAA2D,wzpBAwYvE,CAAA;AAED,eAAO,MAAM,oEAAoE,65oBA4Yh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
|
-
"version": "0.31.
|
|
7
|
+
"version": "0.31.7",
|
|
8
8
|
"description": "Fayz SDK — plugin-crm plugin",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"sideEffects": false,
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@tanstack/react-table": "^8.20.0",
|
|
40
40
|
"@fayz-ai/core": "^0.36.1",
|
|
41
|
-
"@fayz-ai/ui": "^0.
|
|
42
|
-
"@fayz-ai/admin": "^0.
|
|
43
|
-
"@fayz-ai/db": "^0.22.
|
|
41
|
+
"@fayz-ai/ui": "^0.37.0",
|
|
42
|
+
"@fayz-ai/admin": "^0.37.0",
|
|
43
|
+
"@fayz-ai/db": "^0.22.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/react": "^18.3.0",
|