@fayz-ai/plugin-inventory 0.14.0 → 0.14.1
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 +23 -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
package/dist/index.js
CHANGED
|
@@ -18400,6 +18400,27 @@ BEGIN
|
|
|
18400
18400
|
jsonb_build_object('location_id', p_location, 'unit_id', v_unit, 'lines', v_no, 'document_type', coalesce(v_doc->>'type', 'manual')));
|
|
18401
18401
|
END $function$;
|
|
18402
18402
|
`;
|
|
18403
|
+
var MIGRATION_023_A_RECEITA_SE_ESCREVE_COM_PERMISSAO = `-- ---------------------------------------------------------------------------
|
|
18404
|
+
-- 023 \u2014 a receita se escreve com permiss\xE3o.
|
|
18405
|
+
--
|
|
18406
|
+
-- The baseline kept the pre-authz insert/update/delete policies on recipes and
|
|
18407
|
+
-- product categories next to the *_authz_* ones. Permissive policies are ORed,
|
|
18408
|
+
-- so \`tenant_id IN user_tenant_ids()\` let any member (viewer, staff, kitchen)
|
|
18409
|
+
-- write what inventory.create/edit/delete is supposed to gate.
|
|
18410
|
+
--
|
|
18411
|
+
-- The old SELECT policies stay on purpose: agenda's service kit
|
|
18412
|
+
-- (getServiceKit) reads recipes as reception/professional, who hold no
|
|
18413
|
+
-- inventory.read. Narrowing reads is a separate decision.
|
|
18414
|
+
-- ---------------------------------------------------------------------------
|
|
18415
|
+
|
|
18416
|
+
DROP POLICY IF EXISTS plg_inventory_recipes_insert ON public.plg_inventory_recipes;
|
|
18417
|
+
DROP POLICY IF EXISTS plg_inventory_recipes_update ON public.plg_inventory_recipes;
|
|
18418
|
+
DROP POLICY IF EXISTS plg_inventory_recipes_delete ON public.plg_inventory_recipes;
|
|
18419
|
+
|
|
18420
|
+
DROP POLICY IF EXISTS plg_inventory_product_categories_insert ON public.plg_inventory_product_categories;
|
|
18421
|
+
DROP POLICY IF EXISTS plg_inventory_product_categories_update ON public.plg_inventory_product_categories;
|
|
18422
|
+
DROP POLICY IF EXISTS plg_inventory_product_categories_delete ON public.plg_inventory_product_categories;
|
|
18423
|
+
`;
|
|
18403
18424
|
var MIGRATIONS = [
|
|
18404
18425
|
{ id: "000_baseline", sql: MIGRATION_000_BASELINE },
|
|
18405
18426
|
{ id: "001_the_usage_that_left_stock_can_be_audited", sql: MIGRATION_001_THE_USAGE_THAT_LEFT_STOCK_CAN_BE_AUDITED },
|
|
@@ -18423,7 +18444,8 @@ var MIGRATIONS = [
|
|
|
18423
18444
|
{ id: "019_sem_saldo_nao_se_baixa", sql: MIGRATION_019_SEM_SALDO_NAO_SE_BAIXA },
|
|
18424
18445
|
{ id: "020_o_produto_e_varias_coisas_ao_mesmo_tempo", sql: MIGRATION_020_O_PRODUTO_E_VARIAS_COISAS_AO_MESMO_TEMPO },
|
|
18425
18446
|
{ id: "021_o_razao_diz_de_onde_veio", sql: MIGRATION_021_O_RAZAO_DIZ_DE_ONDE_VEIO },
|
|
18426
|
-
{ id: "022_receber_estoque_volta_a_funcionar", sql: MIGRATION_022_RECEBER_ESTOQUE_VOLTA_A_FUNCIONAR }
|
|
18447
|
+
{ id: "022_receber_estoque_volta_a_funcionar", sql: MIGRATION_022_RECEBER_ESTOQUE_VOLTA_A_FUNCIONAR },
|
|
18448
|
+
{ id: "023_a_receita_se_escreve_com_permissao", sql: MIGRATION_023_A_RECEITA_SE_ESCREVE_COM_PERMISSAO }
|
|
18427
18449
|
];
|
|
18428
18450
|
|
|
18429
18451
|
// src/index.ts
|