@flowselections/floriday-klanten-module 1.0.99 → 1.0.100

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.
Files changed (29) hide show
  1. package/dist-lib/components/klanten/BulkStickerUploadDialog.d.ts +10 -1
  2. package/dist-lib/components/klanten/BulkStickerUploadDialog.d.ts.map +1 -1
  3. package/dist-lib/components/klanten/BulkStickerUploadDialog.js +32 -11
  4. package/dist-lib/components/klanten/CustomerAssortmentTab.d.ts.map +1 -1
  5. package/dist-lib/components/klanten/CustomerAssortmentTab.js +19 -5
  6. package/dist-lib/components/klanten/CustomerStickerCell.d.ts +4 -1
  7. package/dist-lib/components/klanten/CustomerStickerCell.d.ts.map +1 -1
  8. package/dist-lib/components/klanten/CustomerStickerCell.js +6 -4
  9. package/dist-lib/components/klanten/CustomerStickerFormatDialog.d.ts +3 -1
  10. package/dist-lib/components/klanten/CustomerStickerFormatDialog.d.ts.map +1 -1
  11. package/dist-lib/components/klanten/CustomerStickerFormatDialog.js +5 -4
  12. package/dist-lib/components/klanten/StickerSizeLine.d.ts +3 -1
  13. package/dist-lib/components/klanten/StickerSizeLine.d.ts.map +1 -1
  14. package/dist-lib/components/klanten/StickerSizeLine.js +4 -4
  15. package/dist-lib/index.d.ts +1 -1
  16. package/dist-lib/index.d.ts.map +1 -1
  17. package/dist-lib/integrations/supabase/types.d.ts +243 -0
  18. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  19. package/dist-lib/lib/customer-stickers.functions.d.ts +37 -1
  20. package/dist-lib/lib/customer-stickers.functions.d.ts.map +1 -1
  21. package/dist-lib/lib/customer-stickers.functions.js +132 -82
  22. package/dist-lib/lib/pdf-thumbnail.d.ts +4 -0
  23. package/dist-lib/lib/pdf-thumbnail.d.ts.map +1 -0
  24. package/dist-lib/lib/pdf-thumbnail.js +49 -0
  25. package/dist-lib/lib/sticker-soort.d.ts +20 -0
  26. package/dist-lib/lib/sticker-soort.d.ts.map +1 -0
  27. package/dist-lib/lib/sticker-soort.js +20 -0
  28. package/package.json +2 -1
  29. package/schema/klanten.sql +27 -2
@@ -0,0 +1,20 @@
1
+ export const FUST_NIET_BESCHIKBAAR = "Fuststickers zijn hier nog niet beschikbaar. Neem contact op met de beheerder.";
2
+ /** Eén plek die de tabel kiest; productstickers blijven in customer_product_stickers. */
3
+ export function stickerTabel(soort = "product") {
4
+ return soort === "fust" ? "customer_fust_stickers" : "customer_product_stickers";
5
+ }
6
+ /** Opslagpad: fuststickers in een eigen submap, zodat ze productstickers nooit overschrijven. */
7
+ export function stickerDoelpad(klant, product, soort, bestand) {
8
+ return soort === "fust" ? `${klant}/${product}/fust/${bestand}` : `${klant}/${product}/${bestand}`;
9
+ }
10
+ /** Formaat per soort; fust zonder eigen formaat = geen formaat (null). */
11
+ export function formaatVoorSoort(rij, soort = "product") {
12
+ if (!rij)
13
+ return null;
14
+ if (soort === "fust") {
15
+ if (rij.fust_width_mm == null || rij.fust_height_mm == null)
16
+ return null;
17
+ return { width_mm: Number(rij.fust_width_mm), height_mm: Number(rij.fust_height_mm) };
18
+ }
19
+ return { width_mm: Number(rij.width_mm), height_mm: Number(rij.height_mm) };
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowselections/floriday-klanten-module",
3
- "version": "1.0.99",
3
+ "version": "1.0.100",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -142,6 +142,7 @@
142
142
  "@dnd-kit/utilities": "^3.2.2",
143
143
  "@supabase/supabase-js": "^2.105.3",
144
144
  "@xmldom/xmldom": "^0.9.12",
145
+ "pdfjs-dist": "6.5.438",
145
146
  "recharts": "^3.9.1",
146
147
  "xlsx": "^0.18.5"
147
148
  },
@@ -1092,12 +1092,12 @@ BEGIN
1092
1092
  'uitvoerrecht_anon', CASE WHEN _r.oid IS NULL THEN NULL ELSE has_function_privilege('anon', _r.oid, 'execute') END,
1093
1093
  'uitvoerrecht_authenticated', CASE WHEN _r.oid IS NULL THEN NULL ELSE has_function_privilege('authenticated', _r.oid, 'execute') END);
1094
1094
  END LOOP;
1095
- FOREACH _o IN ARRAY ARRAY['customers_enqueue_twinfield_push|customers','customers_validate_twinfield_required|customers','trg_cms_updated_at|customer_match_suggestions','trg_customer_notes_updated|customer_notes','trg_customer_price_groups_touch|customer_price_groups','trg_customers_refresh_external_grouped|customers','trg_floriday_cache_refresh_ecg|floriday_customers_cache','trg_local_agreements_updated|local_customer_agreements','trg_local_price_groups_updated|local_customer_price_groups','trg_local_sales_strategies_updated|local_customer_sales_strategies','trg_log_customer_changes|customers','trg_twinfield_cache_refresh_ecg|twinfield_customers_cache','update_customer_assortment_items_updated_at|customer_assortment_items','update_customer_product_stickers_updated_at|customer_product_stickers','update_customer_sticker_settings_updated_at|customer_sticker_settings','update_customers_updated_at|customers','update_external_customer_providers_updated_at|external_customer_providers'] LOOP
1095
+ FOREACH _o IN ARRAY ARRAY['customers_enqueue_twinfield_push|customers','customers_validate_twinfield_required|customers','trg_cms_updated_at|customer_match_suggestions','trg_customer_notes_updated|customer_notes','trg_customer_price_groups_touch|customer_price_groups','trg_customers_refresh_external_grouped|customers','trg_floriday_cache_refresh_ecg|floriday_customers_cache','trg_local_agreements_updated|local_customer_agreements','trg_local_price_groups_updated|local_customer_price_groups','trg_local_sales_strategies_updated|local_customer_sales_strategies','trg_log_customer_changes|customers','trg_twinfield_cache_refresh_ecg|twinfield_customers_cache','update_customer_assortment_items_updated_at|customer_assortment_items','update_customer_product_stickers_updated_at|customer_product_stickers','update_customer_sticker_settings_updated_at|customer_sticker_settings','update_customer_fust_stickers_updated_at|customer_fust_stickers','update_customers_updated_at|customers','update_external_customer_providers_updated_at|external_customer_providers'] LOOP
1096
1096
  _t := _t || jsonb_build_object('trigger', split_part(_o,'|',1), 'tabel', split_part(_o,'|',2),
1097
1097
  'aanwezig', EXISTS (SELECT 1 FROM pg_trigger tg JOIN pg_class c ON c.oid = tg.tgrelid
1098
1098
  WHERE tg.tgname = split_part(_o,'|',1) AND c.relname = split_part(_o,'|',2) AND c.relnamespace = 'public'::regnamespace));
1099
1099
  END LOOP;
1100
- FOREACH _o IN ARRAY ARRAY['Authenticated can delete customer_contacts|customer_contacts','Authenticated can delete customer_delivery_locations|customer_delivery_locations','Authenticated can delete customer_selected_assortment|customer_selected_assortment','Authenticated can delete customer_trade_settings|customer_trade_settings','Authenticated can insert customer_contacts|customer_contacts','Authenticated can insert customer_delivery_locations|customer_delivery_locations','Authenticated can insert customer_selected_assortment|customer_selected_assortment','Authenticated can insert customer_trade_settings|customer_trade_settings','Authenticated can manage customer assortment|customer_assortment_items','Authenticated can read customer_contacts|customer_contacts','Authenticated can read customer_delivery_locations|customer_delivery_locations','Authenticated can read customer_selected_assortment|customer_selected_assortment','Authenticated can read customer_trade_settings|customer_trade_settings','Authenticated can update customer_contacts|customer_contacts','Authenticated can update customer_delivery_locations|customer_delivery_locations','Authenticated can update customer_selected_assortment|customer_selected_assortment','Authenticated can update customer_trade_settings|customer_trade_settings','Authenticated users can delete customers|customers','Authenticated users can insert customers|customers','Authenticated users can read customers|customers','Authenticated users can update customers|customers','External customer providers are readable by authenticated users|external_customer_providers','Ingelogd beoordelen voorstellen|customer_match_suggestions','Ingelogd lezen voorstellen|customer_match_suggestions','Ingelogde gebruikers beheren klantstickers|customer_product_stickers','Ingelogde gebruikers beheren stickerinstellingen|customer_sticker_settings','auth can read cls|customer_logistics_strategy','auth can write cls|customer_logistics_strategy','auth manage customer notes|customer_notes','auth manage local agreements|local_customer_agreements','auth manage local price groups|local_customer_price_groups','auth manage local sales strategies|local_customer_sales_strategies','own pg members - delete|customer_price_group_members','own pg members - insert|customer_price_group_members','own pg members - select|customer_price_group_members','own pg members - update|customer_price_group_members','own price groups - delete|customer_price_groups','own price groups - insert|customer_price_groups','own price groups - select|customer_price_groups','own price groups - update|customer_price_groups','service role only|twinfield_push_log','Beheerders lezen correctielog|klanten_correctie_log'] LOOP
1100
+ FOREACH _o IN ARRAY ARRAY['Authenticated can delete customer_contacts|customer_contacts','Authenticated can delete customer_delivery_locations|customer_delivery_locations','Authenticated can delete customer_selected_assortment|customer_selected_assortment','Authenticated can delete customer_trade_settings|customer_trade_settings','Authenticated can insert customer_contacts|customer_contacts','Authenticated can insert customer_delivery_locations|customer_delivery_locations','Authenticated can insert customer_selected_assortment|customer_selected_assortment','Authenticated can insert customer_trade_settings|customer_trade_settings','Authenticated can manage customer assortment|customer_assortment_items','Authenticated can read customer_contacts|customer_contacts','Authenticated can read customer_delivery_locations|customer_delivery_locations','Authenticated can read customer_selected_assortment|customer_selected_assortment','Authenticated can read customer_trade_settings|customer_trade_settings','Authenticated can update customer_contacts|customer_contacts','Authenticated can update customer_delivery_locations|customer_delivery_locations','Authenticated can update customer_selected_assortment|customer_selected_assortment','Authenticated can update customer_trade_settings|customer_trade_settings','Authenticated users can delete customers|customers','Authenticated users can insert customers|customers','Authenticated users can read customers|customers','Authenticated users can update customers|customers','External customer providers are readable by authenticated users|external_customer_providers','Ingelogd beoordelen voorstellen|customer_match_suggestions','Ingelogd lezen voorstellen|customer_match_suggestions','Ingelogde gebruikers beheren klantstickers|customer_product_stickers','Ingelogde gebruikers beheren stickerinstellingen|customer_sticker_settings','Ingelogde gebruikers beheren fuststickers|customer_fust_stickers','auth can read cls|customer_logistics_strategy','auth can write cls|customer_logistics_strategy','auth manage customer notes|customer_notes','auth manage local agreements|local_customer_agreements','auth manage local price groups|local_customer_price_groups','auth manage local sales strategies|local_customer_sales_strategies','own pg members - delete|customer_price_group_members','own pg members - insert|customer_price_group_members','own pg members - select|customer_price_group_members','own pg members - update|customer_price_group_members','own price groups - delete|customer_price_groups','own price groups - insert|customer_price_groups','own price groups - select|customer_price_groups','own price groups - update|customer_price_groups','service role only|twinfield_push_log','Beheerders lezen correctielog|klanten_correctie_log'] LOOP
1101
1101
  _p := _p || jsonb_build_object('policy', split_part(_o,'|',1), 'tabel', split_part(_o,'|',2),
1102
1102
  'aanwezig', EXISTS (SELECT 1 FROM pg_policies WHERE schemaname='public' AND policyname = split_part(_o,'|',1) AND tablename = split_part(_o,'|',2)));
1103
1103
  END LOOP;
@@ -3464,3 +3464,28 @@ END
3464
3464
  $function$$klanten_stmt$, 'CREATE OR REPLACE FUNCTION public.klanten_prijsgroepen_voor_klanten(p_ids uuid[]) RETURNS TABLE(cust');
3465
3465
  SELECT pg_temp.klanten_try($klanten_stmt$REVOKE ALL ON FUNCTION public.klanten_prijsgroepen_voor_klanten(uuid[]) FROM PUBLIC, anon$klanten_stmt$, 'REVOKE ALL ON FUNCTION public.klanten_prijsgroepen_voor_klanten(uuid[]) FROM PUBLIC, anon');
3466
3466
  SELECT pg_temp.klanten_try($klanten_stmt$GRANT EXECUTE ON FUNCTION public.klanten_prijsgroepen_voor_klanten(uuid[]) TO authenticated, service_role$klanten_stmt$, 'GRANT EXECUTE ON FUNCTION public.klanten_prijsgroepen_voor_klanten(uuid[]) TO authenticated, service');
3467
+ SELECT pg_temp.klanten_try($klanten_stmt$CREATE TABLE IF NOT EXISTS public.customer_fust_stickers ()$klanten_stmt$, 'CREATE TABLE IF NOT EXISTS public.customer_fust_stickers ()');
3468
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS id uuid DEFAULT gen_random_uuid() NOT NULL$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS id uuid DEFAULT gen_random_uuid()');
3469
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS customer_key text NOT NULL$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS customer_key text NOT NULL');
3470
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS trade_item_key text NOT NULL$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS trade_item_key text NOT NULL');
3471
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS file_path text NOT NULL$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS file_path text NOT NULL');
3472
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS file_name text NOT NULL$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS file_name text NOT NULL');
3473
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS mime_type text$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS mime_type text');
3474
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS file_size bigint$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS file_size bigint');
3475
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS uploaded_by uuid$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS uploaded_by uuid');
3476
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS created_at timestamp with time zone DEFAULT now() NOT NULL$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS created_at timestamp with time zo');
3477
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS updated_at timestamp with time zone DEFAULT now() NOT NULL$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS updated_at timestamp with time zo');
3478
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS source text DEFAULT 'manual'::text NOT NULL$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS source text DEFAULT ''manual''::tex');
3479
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS content_hash text$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS content_hash text');
3480
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS width_mm numeric$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS width_mm numeric');
3481
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS height_mm numeric$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ADD COLUMN IF NOT EXISTS height_mm numeric');
3482
+ SELECT pg_temp.klanten_try($klanten_stmt$DO $c$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname='customer_fust_stickers_pkey' AND conrelid='public.customer_fust_stickers'::regclass) THEN ALTER TABLE public.customer_fust_stickers ADD CONSTRAINT customer_fust_stickers_pkey PRIMARY KEY (id); END IF; END $c$$klanten_stmt$, 'DO $c$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname=''customer_fust_stickers_pkey'' ');
3483
+ SELECT pg_temp.klanten_try($klanten_stmt$DO $c$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname='customer_fust_stickers_customer_key_trade_item_key_key' AND conrelid='public.customer_fust_stickers'::regclass) THEN ALTER TABLE public.customer_fust_stickers ADD CONSTRAINT customer_fust_stickers_customer_key_trade_item_key_key UNIQUE (customer_key, trade_item_key); END IF; END $c$$klanten_stmt$, 'DO $c$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname=''customer_fust_stickers_custom');
3484
+ SELECT pg_temp.klanten_try($klanten_stmt$GRANT SELECT, INSERT, UPDATE, DELETE ON public.customer_fust_stickers TO authenticated$klanten_stmt$, 'GRANT SELECT, INSERT, UPDATE, DELETE ON public.customer_fust_stickers TO authenticated');
3485
+ SELECT pg_temp.klanten_try($klanten_stmt$GRANT ALL ON public.customer_fust_stickers TO service_role$klanten_stmt$, 'GRANT ALL ON public.customer_fust_stickers TO service_role');
3486
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_fust_stickers ENABLE ROW LEVEL SECURITY$klanten_stmt$, 'ALTER TABLE public.customer_fust_stickers ENABLE ROW LEVEL SECURITY');
3487
+ SELECT pg_temp.klanten_try($klanten_stmt$DO $p$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_policies WHERE schemaname='public' AND tablename='customer_fust_stickers' AND policyname='Ingelogde gebruikers beheren fuststickers') THEN CREATE POLICY "Ingelogde gebruikers beheren fuststickers" ON public.customer_fust_stickers AS PERMISSIVE FOR ALL TO authenticated USING (true) WITH CHECK (true); END IF; END $p$$klanten_stmt$, 'DO $p$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_policies WHERE schemaname=''public'' AND tablename=''custo');
3488
+ SELECT pg_temp.klanten_try($klanten_stmt$DROP TRIGGER IF EXISTS update_customer_fust_stickers_updated_at ON public.customer_fust_stickers$klanten_stmt$, 'DROP TRIGGER IF EXISTS update_customer_fust_stickers_updated_at ON public.customer_fust_stickers');
3489
+ SELECT pg_temp.klanten_try($klanten_stmt$CREATE TRIGGER update_customer_fust_stickers_updated_at BEFORE UPDATE ON public.customer_fust_stickers FOR EACH ROW EXECUTE FUNCTION update_updated_at_column()$klanten_stmt$, 'CREATE TRIGGER update_customer_fust_stickers_updated_at BEFORE UPDATE ON public.customer_fust_sticke');
3490
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_sticker_settings ADD COLUMN IF NOT EXISTS fust_width_mm numeric$klanten_stmt$, 'ALTER TABLE public.customer_sticker_settings ADD COLUMN IF NOT EXISTS fust_width_mm numeric');
3491
+ SELECT pg_temp.klanten_try($klanten_stmt$ALTER TABLE public.customer_sticker_settings ADD COLUMN IF NOT EXISTS fust_height_mm numeric$klanten_stmt$, 'ALTER TABLE public.customer_sticker_settings ADD COLUMN IF NOT EXISTS fust_height_mm numeric');