@flowselections/floriday-verkoop-module 1.0.32 → 1.0.34

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 (41) hide show
  1. package/dist-lib/components/karindeling/AfmetingenTab.js +1 -1
  2. package/dist-lib/components/karindeling/KarindelingPage.js +11 -2
  3. package/dist-lib/components/verkoop/CreateOrderPage.d.ts.map +1 -1
  4. package/dist-lib/components/verkoop/CreateOrderPage.js +65 -15
  5. package/dist-lib/integrations/supabase/auth-middleware.d.ts +6 -0
  6. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  7. package/dist-lib/integrations/supabase/client.d.ts +6 -0
  8. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  9. package/dist-lib/integrations/supabase/client.server.d.ts +6 -0
  10. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  11. package/dist-lib/integrations/supabase/types.d.ts +6 -0
  12. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  13. package/dist-lib/lib/cart-lock.functions.d.ts +6 -0
  14. package/dist-lib/lib/cart-lock.functions.d.ts.map +1 -1
  15. package/dist-lib/lib/cart-planning-settings.functions.d.ts +70 -0
  16. package/dist-lib/lib/cart-planning-settings.functions.d.ts.map +1 -1
  17. package/dist-lib/lib/cart-planning-settings.functions.js +38 -5
  18. package/dist-lib/lib/cart-replan.functions.d.ts +18 -0
  19. package/dist-lib/lib/cart-replan.functions.d.ts.map +1 -1
  20. package/dist-lib/lib/create-order.functions.d.ts +13913 -0
  21. package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
  22. package/dist-lib/lib/create-order.functions.js +121 -0
  23. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts +18 -0
  24. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts.map +1 -1
  25. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts +6 -0
  26. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/floriday-mirror.functions.d.ts +6 -0
  28. package/dist-lib/lib/floriday-mirror.functions.d.ts.map +1 -1
  29. package/dist-lib/lib/floriday-public.functions.d.ts +42 -0
  30. package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
  31. package/dist-lib/lib/floriday-writes.functions.d.ts +30 -0
  32. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  33. package/dist-lib/lib/order-buffers.functions.d.ts +18 -0
  34. package/dist-lib/lib/order-buffers.functions.d.ts.map +1 -1
  35. package/dist-lib/lib/order-shipments.functions.d.ts +24 -0
  36. package/dist-lib/lib/order-shipments.functions.d.ts.map +1 -1
  37. package/dist-lib/lib/salesorders.functions.d.ts +30 -0
  38. package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
  39. package/dist-lib/lib/tradeitems.functions.d.ts +6 -0
  40. package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -1
  41. package/package.json +1 -1
@@ -33,6 +33,8 @@ export const getCartPlanningBundle = createServerFn({ method: "GET" })
33
33
  pick_time_mode: "per_pot_size",
34
34
  plants_per_hour: 0,
35
35
  plants_per_day: 0,
36
+ uniform_pick_time: false,
37
+ uniform_pick_time_seconds: 0,
36
38
  buffer_grouping_mode: "same_pickup_and_location",
37
39
  }),
38
40
  pickTimes: (pt ?? []),
@@ -59,6 +61,8 @@ const settingsSchema = z.object({
59
61
  pick_time_mode: z.enum(["per_pot_size", "plants_per_hour", "plants_per_day"]),
60
62
  plants_per_hour: z.number().int().min(0).max(1000000),
61
63
  plants_per_day: z.number().int().min(0).max(10000000),
64
+ uniform_pick_time: z.boolean().optional().default(false),
65
+ uniform_pick_time_seconds: z.number().int().min(0).max(1000000).optional().default(0),
62
66
  buffer_grouping_mode: z.enum([
63
67
  "same_pickup_and_location",
64
68
  "same_pickup",
@@ -112,9 +116,10 @@ export const listUsedCratePackages = createServerFn({ method: "GET" })
112
116
  .middleware([requireSupabaseAuth])
113
117
  .handler(async ({ context }) => {
114
118
  const supabase = context.supabase;
115
- const [{ data: tradeItems, error: e1 }, { data: carriers, error: e2 }] = await Promise.all([
119
+ const [{ data: tradeItems, error: e1 }, { data: carriers, error: e2 }, { data: ownCrates }] = await Promise.all([
116
120
  supabase.from("floriday_trade_items_cache").select("data").limit(5000),
117
121
  supabase.from("floricode_records").select("data").eq("resource", "LoadCarrier"),
122
+ supabase.from("crate_types").select("id, name, length_cm, width_cm, plants_per_crate"),
118
123
  ]);
119
124
  if (e1)
120
125
  throw new Error(e1.message);
@@ -139,7 +144,8 @@ export const listUsedCratePackages = createServerFn({ method: "GET" })
139
144
  if (!Array.isArray(cfgs))
140
145
  continue;
141
146
  for (const c of cfgs) {
142
- const code = c?.package?.vbnPackageCode ?? c?.package?.customPackageId;
147
+ const vbn = c?.package?.vbnPackageCode;
148
+ const code = vbn ?? c?.package?.customPackageId;
143
149
  const pieces = Number(c?.piecesPerPackage ?? 0);
144
150
  if (!code)
145
151
  continue;
@@ -148,7 +154,7 @@ export const listUsedCratePackages = createServerFn({ method: "GET" })
148
154
  if (e)
149
155
  e.count += 1;
150
156
  else
151
- usage.set(key, { code: String(code), pieces, count: 1 });
157
+ usage.set(key, { code: String(code), pieces, count: 1, custom: !vbn });
152
158
  }
153
159
  }
154
160
  const seenCodes = new Set();
@@ -180,16 +186,43 @@ export const listUsedCratePackages = createServerFn({ method: "GET" })
180
186
  for (const v of usage.values()) {
181
187
  if (seenCodes.has(v.code))
182
188
  continue;
189
+ seenCodes.add(v.code);
190
+ const prefix = v.custom ? "Eigen fust" : `VBN ${v.code}`;
183
191
  result.push({
184
192
  key: `${v.code}-${v.pieces}`,
185
193
  vbn_package_code: v.code,
186
- description: null,
194
+ description: v.custom ? v.code : null,
187
195
  length_cm: null,
188
196
  width_cm: null,
189
197
  height_cm: null,
190
198
  pieces_per_package: v.pieces || null,
191
199
  usage_count: v.count,
192
- label: `VBN ${v.code}${v.pieces ? ` · ${v.pieces} st/fust` : ""}`,
200
+ label: `${prefix}${v.custom ? ` · ${v.code}` : ""}${v.pieces ? ` · ${v.pieces} st/fust` : ""}`,
201
+ });
202
+ }
203
+ // Eigen (handmatig aangemaakte) fusten uit crate_types die geen VBN-fust zijn
204
+ const seenLabels = new Set(result.map((r) => r.label));
205
+ for (const c of (ownCrates ?? [])) {
206
+ const name = (c.name ?? "").trim();
207
+ if (!name || /^vbn\s/i.test(name))
208
+ continue;
209
+ const dims = c.length_cm && c.width_cm ? `${c.length_cm}×${c.width_cm} cm` : null;
210
+ const label = [`Eigen fust`, name, dims, c.plants_per_crate ? `${c.plants_per_crate} st/fust` : null]
211
+ .filter(Boolean)
212
+ .join(" · ");
213
+ if (seenLabels.has(label))
214
+ continue;
215
+ seenLabels.add(label);
216
+ result.push({
217
+ key: `own-${c.id}`,
218
+ vbn_package_code: name,
219
+ description: name,
220
+ length_cm: c.length_cm,
221
+ width_cm: c.width_cm,
222
+ height_cm: null,
223
+ pieces_per_package: c.plants_per_crate,
224
+ usage_count: 0,
225
+ label,
193
226
  });
194
227
  }
195
228
  return result.sort((a, b) => {
@@ -1281,6 +1281,8 @@ export declare const replanOrderCarts: import("@tanstack/start-client-core").Opt
1281
1281
  require_same_crate_type: boolean;
1282
1282
  require_same_delivery_date: boolean;
1283
1283
  require_same_delivery_location: boolean;
1284
+ uniform_pick_time: boolean;
1285
+ uniform_pick_time_seconds: number;
1284
1286
  updated_at: string;
1285
1287
  updated_by: string | null;
1286
1288
  };
@@ -1305,6 +1307,8 @@ export declare const replanOrderCarts: import("@tanstack/start-client-core").Opt
1305
1307
  require_same_crate_type?: boolean;
1306
1308
  require_same_delivery_date?: boolean;
1307
1309
  require_same_delivery_location?: boolean;
1310
+ uniform_pick_time?: boolean;
1311
+ uniform_pick_time_seconds?: number;
1308
1312
  updated_at?: string;
1309
1313
  updated_by?: string | null;
1310
1314
  };
@@ -1329,6 +1333,8 @@ export declare const replanOrderCarts: import("@tanstack/start-client-core").Opt
1329
1333
  require_same_crate_type?: boolean;
1330
1334
  require_same_delivery_date?: boolean;
1331
1335
  require_same_delivery_location?: boolean;
1336
+ uniform_pick_time?: boolean;
1337
+ uniform_pick_time_seconds?: number;
1332
1338
  updated_at?: string;
1333
1339
  updated_by?: string | null;
1334
1340
  };
@@ -15119,6 +15125,8 @@ export declare const listOrderCarts: import("@tanstack/start-client-core").Optio
15119
15125
  require_same_crate_type: boolean;
15120
15126
  require_same_delivery_date: boolean;
15121
15127
  require_same_delivery_location: boolean;
15128
+ uniform_pick_time: boolean;
15129
+ uniform_pick_time_seconds: number;
15122
15130
  updated_at: string;
15123
15131
  updated_by: string | null;
15124
15132
  };
@@ -15143,6 +15151,8 @@ export declare const listOrderCarts: import("@tanstack/start-client-core").Optio
15143
15151
  require_same_crate_type?: boolean;
15144
15152
  require_same_delivery_date?: boolean;
15145
15153
  require_same_delivery_location?: boolean;
15154
+ uniform_pick_time?: boolean;
15155
+ uniform_pick_time_seconds?: number;
15146
15156
  updated_at?: string;
15147
15157
  updated_by?: string | null;
15148
15158
  };
@@ -15167,6 +15177,8 @@ export declare const listOrderCarts: import("@tanstack/start-client-core").Optio
15167
15177
  require_same_crate_type?: boolean;
15168
15178
  require_same_delivery_date?: boolean;
15169
15179
  require_same_delivery_location?: boolean;
15180
+ uniform_pick_time?: boolean;
15181
+ uniform_pick_time_seconds?: number;
15170
15182
  updated_at?: string;
15171
15183
  updated_by?: string | null;
15172
15184
  };
@@ -28968,6 +28980,8 @@ export declare const replanBufferForOrder: import("@tanstack/start-client-core")
28968
28980
  require_same_crate_type: boolean;
28969
28981
  require_same_delivery_date: boolean;
28970
28982
  require_same_delivery_location: boolean;
28983
+ uniform_pick_time: boolean;
28984
+ uniform_pick_time_seconds: number;
28971
28985
  updated_at: string;
28972
28986
  updated_by: string | null;
28973
28987
  };
@@ -28992,6 +29006,8 @@ export declare const replanBufferForOrder: import("@tanstack/start-client-core")
28992
29006
  require_same_crate_type?: boolean;
28993
29007
  require_same_delivery_date?: boolean;
28994
29008
  require_same_delivery_location?: boolean;
29009
+ uniform_pick_time?: boolean;
29010
+ uniform_pick_time_seconds?: number;
28995
29011
  updated_at?: string;
28996
29012
  updated_by?: string | null;
28997
29013
  };
@@ -29016,6 +29032,8 @@ export declare const replanBufferForOrder: import("@tanstack/start-client-core")
29016
29032
  require_same_crate_type?: boolean;
29017
29033
  require_same_delivery_date?: boolean;
29018
29034
  require_same_delivery_location?: boolean;
29035
+ uniform_pick_time?: boolean;
29036
+ uniform_pick_time_seconds?: number;
29019
29037
  updated_at?: string;
29020
29038
  updated_by?: string | null;
29021
29039
  };