@flowselections/floriday-verkoop-module 1.0.173 → 1.0.174

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.
@@ -179,7 +179,7 @@ export declare const createManualOrder: import("@tanstack/start-client-core").Op
179
179
  needs_sticker?: boolean | undefined;
180
180
  vbn_package_code?: string | null | undefined;
181
181
  load_carrier_type?: string | null | undefined;
182
- packing_source?: "product_primary" | "customer" | "chosen" | null | undefined;
182
+ packing_source?: "customer" | "product_primary" | "chosen" | null | undefined;
183
183
  line_note?: string | null | undefined;
184
184
  line_fields?: {
185
185
  key: string;
@@ -84,16 +84,6 @@ export declare const getSalesOrderDetail: import("@tanstack/start-client-core").
84
84
  }, undefined, undefined, undefined>], (d: unknown) => {
85
85
  id: string;
86
86
  }, Promise<SalesOrderDetailResult>>;
87
- export declare const setSalesOrderControlled: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
88
- supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
89
- userId: string;
90
- claims: import("@supabase/auth-js").User;
91
- }, undefined, undefined, undefined>], (d: unknown) => {
92
- floridayId: string;
93
- controlled: boolean;
94
- }, Promise<{
95
- ok: true;
96
- }>>;
97
87
  export type FloridaySyncHealth = {
98
88
  connected: boolean;
99
89
  environment: "staging" | "live" | null;
@@ -1 +1 @@
1
- {"version":3,"file":"salesorders.functions.d.ts","sourceRoot":"","sources":["../../src/lib/salesorders.functions.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,uBAAuB,CAAC;AAkC/B,eAAO,MAAM,kBAAkB;;;;;;;;GAK3B,CAAC;AA6BL,eAAO,MAAM,gBAAgB;;;;6CAEJ,OAAO;;;;;;;;;;;;;GAmC5B,CAAC;AAGL,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDnC,CAAC;AASL,M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B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qEAAqE;IACrE,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAIF,eAAO,MAAM,qBAAqB;;;;6EA4E9B,CAAC"}
@@ -566,23 +566,6 @@ export const getSalesOrderDetail = createServerFn({ method: "POST" })
566
566
  ]);
567
567
  return { order: dto, sellerFallback, environment, bufferId, bufferSiblings, progress, pickupMoment };
568
568
  });
569
- // ─── Handmatige controle na orderpicken ───────────────────────────────────
570
- const ControlInputSchema = z.object({
571
- floridayId: z.string().min(1),
572
- controlled: z.boolean(),
573
- });
574
- export const setSalesOrderControlled = createServerFn({ method: "POST" })
575
- .middleware([requireSupabaseAuth])
576
- .inputValidator((d) => ControlInputSchema.parse(d))
577
- .handler(async ({ data, context }) => {
578
- const { error } = await context.supabase.rpc("mark_salesorder_controlled", {
579
- p_floriday_id: data.floridayId,
580
- p_controlled: data.controlled,
581
- });
582
- if (error)
583
- throw new Error(error.message);
584
- return { ok: true };
585
- });
586
569
  const STALE_MINUTES = 30;
587
570
  export const getFloridaySyncHealth = createServerFn({ method: "POST" })
588
571
  .middleware([requireSupabaseAuth])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowselections/floriday-verkoop-module",
3
- "version": "1.0.173",
3
+ "version": "1.0.174",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -555,23 +555,8 @@ AS $function$
555
555
  BEGIN NEW.updated_at = now(); RETURN NEW; END; $function$
556
556
  ;
557
557
 
558
- CREATE OR REPLACE FUNCTION public.mark_salesorder_controlled(p_floriday_id text, p_controlled boolean)
559
- RETURNS void
560
- LANGUAGE plpgsql
561
- SECURITY DEFINER
562
- SET search_path TO 'public'
563
- AS $function$
564
- BEGIN
565
- IF auth.uid() IS NULL THEN
566
- RAISE EXCEPTION 'Not authenticated';
567
- END IF;
568
- UPDATE public.floriday_salesorders_cache
569
- SET controlled_at = CASE WHEN p_controlled THEN now() ELSE NULL END,
570
- controlled_by = CASE WHEN p_controlled THEN auth.uid() ELSE NULL END
571
- WHERE floriday_id = p_floriday_id;
572
- END;
573
- $function$
574
- ;
558
+ -- mark_salesorder_controlled vervallen (18-11): status 'gecontroleerd' komt uit de tijdlijn van de Engine.
559
+ DROP FUNCTION IF EXISTS public.mark_salesorder_controlled(text, boolean);
575
560
 
576
561
  CREATE OR REPLACE FUNCTION public.mark_shipment_shipped(p_shipment_id uuid)
577
562
  RETURNS void
@@ -2327,7 +2312,6 @@ AS $function$
2327
2312
  ('enqueue_cart_replan_if_unlocked(uuid)', 'keten', NULL, NULL),
2328
2313
  ('replace_order_carts(uuid,uuid,jsonb)', 'ingelogd', NULL, NULL),
2329
2314
  ('mark_shipment_shipped(uuid)', 'ingelogd', NULL, NULL),
2330
- ('mark_salesorder_controlled(text,boolean)', 'ingelogd', NULL, NULL),
2331
2315
  ('reset_cart_layer_positions(uuid)', 'ingelogd', NULL, NULL),
2332
2316
  ('move_cart_layer_position(uuid,integer,numeric,numeric)', 'ingelogd', NULL, NULL),
2333
2317
  ('swap_cart_layer_positions(uuid,uuid)', 'ingelogd', NULL, NULL),
@@ -5327,7 +5311,7 @@ BEGIN
5327
5311
  FROM public.order_items oi
5328
5312
  WHERE oi.order_id = p_reservering_id AND oi.product_id = v_key::uuid AND oi.quarantined_at IS NULL;
5329
5313
  IF v_naam IS NULL THEN
5330
- v_naam := (SELECT p.name FROM public.products p WHERE p.id = v_key::uuid);
5314
+ v_naam := (SELECT p.product FROM public.products p WHERE p.id = v_key::uuid);
5331
5315
  v_tekort := v_tekort || jsonb_build_object('product_id', v_key, 'product_name', v_naam,
5332
5316
  'gevraagd', (v_wens->>v_key)::int, 'restant', 0, 'tekst',
5333
5317
  format('%s staat niet in de reservering', COALESCE(v_naam, 'een artikel')));