@flowselections/floriday-verkoop-module 1.0.24 → 1.0.26

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 (51) hide show
  1. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1057 -17
  2. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  3. package/dist-lib/integrations/supabase/client.d.ts +1057 -17
  4. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  5. package/dist-lib/integrations/supabase/client.server.d.ts +1057 -17
  6. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  7. package/dist-lib/integrations/supabase/types.d.ts +1079 -14
  8. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  9. package/dist-lib/integrations/supabase/types.js +9 -1
  10. package/dist-lib/lib/cart-lock.functions.d.ts +1057 -17
  11. package/dist-lib/lib/cart-lock.functions.d.ts.map +1 -1
  12. package/dist-lib/lib/cart-planning-settings.functions.d.ts +11506 -66
  13. package/dist-lib/lib/cart-planning-settings.functions.d.ts.map +1 -1
  14. package/dist-lib/lib/cart-replan.functions.d.ts +3138 -18
  15. package/dist-lib/lib/cart-replan.functions.d.ts.map +1 -1
  16. package/dist-lib/lib/create-order.functions.d.ts +12552 -72
  17. package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
  18. package/dist-lib/lib/cron/index.d.ts +5 -0
  19. package/dist-lib/lib/cron/index.d.ts.map +1 -0
  20. package/dist-lib/lib/cron/index.js +4 -0
  21. package/dist-lib/lib/cron/mirror-floriday-orders.d.ts +4 -0
  22. package/dist-lib/lib/cron/mirror-floriday-orders.d.ts.map +1 -0
  23. package/dist-lib/lib/cron/mirror-floriday-orders.js +23 -0
  24. package/dist-lib/lib/cron/replan-carts.d.ts +4 -0
  25. package/dist-lib/lib/cron/replan-carts.d.ts.map +1 -0
  26. package/dist-lib/lib/cron/replan-carts.js +18 -0
  27. package/dist-lib/lib/cron/sync-salesorders.d.ts +4 -0
  28. package/dist-lib/lib/cron/sync-salesorders.d.ts.map +1 -0
  29. package/dist-lib/lib/cron/sync-salesorders.js +18 -0
  30. package/dist-lib/lib/cron/sync-tradeitems.d.ts +4 -0
  31. package/dist-lib/lib/cron/sync-tradeitems.d.ts.map +1 -0
  32. package/dist-lib/lib/cron/sync-tradeitems.js +18 -0
  33. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts +3138 -18
  34. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts.map +1 -1
  35. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts +1057 -17
  36. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts.map +1 -1
  37. package/dist-lib/lib/floriday-mirror.functions.d.ts +1057 -17
  38. package/dist-lib/lib/floriday-mirror.functions.d.ts.map +1 -1
  39. package/dist-lib/lib/floriday-public.functions.d.ts +7322 -42
  40. package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
  41. package/dist-lib/lib/floriday-writes.functions.d.ts +5230 -30
  42. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  43. package/dist-lib/lib/order-buffers.functions.d.ts +3138 -18
  44. package/dist-lib/lib/order-buffers.functions.d.ts.map +1 -1
  45. package/dist-lib/lib/order-shipments.functions.d.ts +4184 -24
  46. package/dist-lib/lib/order-shipments.functions.d.ts.map +1 -1
  47. package/dist-lib/lib/salesorders.functions.d.ts +5230 -30
  48. package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
  49. package/dist-lib/lib/tradeitems.functions.d.ts +1057 -17
  50. package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -1
  51. package/package.json +24 -2
@@ -277,6 +277,57 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
277
277
  referencedColumns: ["id"];
278
278
  }];
279
279
  };
280
+ ai_call_log: {
281
+ Row: {
282
+ consumer_module_id: string;
283
+ cost_usd: number | null;
284
+ created_at: string;
285
+ created_by: string | null;
286
+ duration_ms: number | null;
287
+ error_code: string | null;
288
+ error_message: string | null;
289
+ id: string;
290
+ input_tokens: number;
291
+ model_slug: string | null;
292
+ output_tokens: number;
293
+ provider_slug: string | null;
294
+ status: string;
295
+ total_tokens: number;
296
+ };
297
+ Insert: {
298
+ consumer_module_id: string;
299
+ cost_usd?: number | null;
300
+ created_at?: string;
301
+ created_by?: string | null;
302
+ duration_ms?: number | null;
303
+ error_code?: string | null;
304
+ error_message?: string | null;
305
+ id?: string;
306
+ input_tokens?: number;
307
+ model_slug?: string | null;
308
+ output_tokens?: number;
309
+ provider_slug?: string | null;
310
+ status: string;
311
+ total_tokens?: number;
312
+ };
313
+ Update: {
314
+ consumer_module_id?: string;
315
+ cost_usd?: number | null;
316
+ created_at?: string;
317
+ created_by?: string | null;
318
+ duration_ms?: number | null;
319
+ error_code?: string | null;
320
+ error_message?: string | null;
321
+ id?: string;
322
+ input_tokens?: number;
323
+ model_slug?: string | null;
324
+ output_tokens?: number;
325
+ provider_slug?: string | null;
326
+ status?: string;
327
+ total_tokens?: number;
328
+ };
329
+ Relationships: [];
330
+ };
280
331
  ai_credentials: {
281
332
  Row: {
282
333
  active: boolean;
@@ -313,6 +364,36 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
313
364
  referencedColumns: ["id"];
314
365
  }];
315
366
  };
367
+ ai_goals: {
368
+ Row: {
369
+ active: boolean;
370
+ created_at: string;
371
+ description: string | null;
372
+ key: string;
373
+ label: string;
374
+ sort_order: number;
375
+ updated_at: string;
376
+ };
377
+ Insert: {
378
+ active?: boolean;
379
+ created_at?: string;
380
+ description?: string | null;
381
+ key: string;
382
+ label: string;
383
+ sort_order?: number;
384
+ updated_at?: string;
385
+ };
386
+ Update: {
387
+ active?: boolean;
388
+ created_at?: string;
389
+ description?: string | null;
390
+ key?: string;
391
+ label?: string;
392
+ sort_order?: number;
393
+ updated_at?: string;
394
+ };
395
+ Relationships: [];
396
+ };
316
397
  ai_model_pricing: {
317
398
  Row: {
318
399
  created_at: string;
@@ -6457,6 +6538,285 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
6457
6538
  };
6458
6539
  Relationships: [];
6459
6540
  };
6541
+ logistics_capacity_events: {
6542
+ Row: {
6543
+ available_carts: number;
6544
+ created_at: string;
6545
+ id: string;
6546
+ measures: import("../integrations/supabase/types").Json;
6547
+ note: string | null;
6548
+ outcome: string;
6549
+ required_carts: number;
6550
+ reserve_minutes: number;
6551
+ shortage_carts: number;
6552
+ status: string;
6553
+ user_id: string;
6554
+ };
6555
+ Insert: {
6556
+ available_carts?: number;
6557
+ created_at?: string;
6558
+ id?: string;
6559
+ measures?: import("../integrations/supabase/types").Json;
6560
+ note?: string | null;
6561
+ outcome?: string;
6562
+ required_carts?: number;
6563
+ reserve_minutes?: number;
6564
+ shortage_carts?: number;
6565
+ status: string;
6566
+ user_id: string;
6567
+ };
6568
+ Update: {
6569
+ available_carts?: number;
6570
+ created_at?: string;
6571
+ id?: string;
6572
+ measures?: import("../integrations/supabase/types").Json;
6573
+ note?: string | null;
6574
+ outcome?: string;
6575
+ required_carts?: number;
6576
+ reserve_minutes?: number;
6577
+ shortage_carts?: number;
6578
+ status?: string;
6579
+ user_id?: string;
6580
+ };
6581
+ Relationships: [];
6582
+ };
6583
+ logistics_capacity_settings: {
6584
+ Row: {
6585
+ created_at: string;
6586
+ settings: import("../integrations/supabase/types").Json;
6587
+ updated_at: string;
6588
+ user_id: string;
6589
+ };
6590
+ Insert: {
6591
+ created_at?: string;
6592
+ settings?: import("../integrations/supabase/types").Json;
6593
+ updated_at?: string;
6594
+ user_id: string;
6595
+ };
6596
+ Update: {
6597
+ created_at?: string;
6598
+ settings?: import("../integrations/supabase/types").Json;
6599
+ updated_at?: string;
6600
+ user_id?: string;
6601
+ };
6602
+ Relationships: [];
6603
+ };
6604
+ logistics_decisions: {
6605
+ Row: {
6606
+ created_at: string;
6607
+ explanation: string | null;
6608
+ id: string;
6609
+ input_snapshot: import("../integrations/supabase/types").Json;
6610
+ result: import("../integrations/supabase/types").Json;
6611
+ slot: string;
6612
+ strategy_id: string | null;
6613
+ subject_id: string;
6614
+ subject_type: string;
6615
+ user_id: string;
6616
+ };
6617
+ Insert: {
6618
+ created_at?: string;
6619
+ explanation?: string | null;
6620
+ id?: string;
6621
+ input_snapshot?: import("../integrations/supabase/types").Json;
6622
+ result?: import("../integrations/supabase/types").Json;
6623
+ slot: string;
6624
+ strategy_id?: string | null;
6625
+ subject_id: string;
6626
+ subject_type: string;
6627
+ user_id: string;
6628
+ };
6629
+ Update: {
6630
+ created_at?: string;
6631
+ explanation?: string | null;
6632
+ id?: string;
6633
+ input_snapshot?: import("../integrations/supabase/types").Json;
6634
+ result?: import("../integrations/supabase/types").Json;
6635
+ slot?: string;
6636
+ strategy_id?: string | null;
6637
+ subject_id?: string;
6638
+ subject_type?: string;
6639
+ user_id?: string;
6640
+ };
6641
+ Relationships: [{
6642
+ foreignKeyName: "logistics_decisions_strategy_id_fkey";
6643
+ columns: ["strategy_id"];
6644
+ isOneToOne: false;
6645
+ referencedRelation: "logistics_strategies";
6646
+ referencedColumns: ["id"];
6647
+ }];
6648
+ };
6649
+ logistics_formulas: {
6650
+ Row: {
6651
+ created_at: string;
6652
+ expression: string;
6653
+ id: string;
6654
+ notes: string | null;
6655
+ slot: string;
6656
+ strategy_id: string;
6657
+ updated_at: string;
6658
+ user_id: string;
6659
+ version: number;
6660
+ };
6661
+ Insert: {
6662
+ created_at?: string;
6663
+ expression?: string;
6664
+ id?: string;
6665
+ notes?: string | null;
6666
+ slot: string;
6667
+ strategy_id: string;
6668
+ updated_at?: string;
6669
+ user_id: string;
6670
+ version?: number;
6671
+ };
6672
+ Update: {
6673
+ created_at?: string;
6674
+ expression?: string;
6675
+ id?: string;
6676
+ notes?: string | null;
6677
+ slot?: string;
6678
+ strategy_id?: string;
6679
+ updated_at?: string;
6680
+ user_id?: string;
6681
+ version?: number;
6682
+ };
6683
+ Relationships: [{
6684
+ foreignKeyName: "logistics_formulas_strategy_id_fkey";
6685
+ columns: ["strategy_id"];
6686
+ isOneToOne: false;
6687
+ referencedRelation: "logistics_strategies";
6688
+ referencedColumns: ["id"];
6689
+ }];
6690
+ };
6691
+ logistics_strategies: {
6692
+ Row: {
6693
+ color: string;
6694
+ created_at: string;
6695
+ description: string | null;
6696
+ id: string;
6697
+ is_active: boolean;
6698
+ name: string;
6699
+ priority: number;
6700
+ updated_at: string;
6701
+ updated_by: string | null;
6702
+ user_id: string;
6703
+ version: number;
6704
+ };
6705
+ Insert: {
6706
+ color?: string;
6707
+ created_at?: string;
6708
+ description?: string | null;
6709
+ id?: string;
6710
+ is_active?: boolean;
6711
+ name: string;
6712
+ priority?: number;
6713
+ updated_at?: string;
6714
+ updated_by?: string | null;
6715
+ user_id: string;
6716
+ version?: number;
6717
+ };
6718
+ Update: {
6719
+ color?: string;
6720
+ created_at?: string;
6721
+ description?: string | null;
6722
+ id?: string;
6723
+ is_active?: boolean;
6724
+ name?: string;
6725
+ priority?: number;
6726
+ updated_at?: string;
6727
+ updated_by?: string | null;
6728
+ user_id?: string;
6729
+ version?: number;
6730
+ };
6731
+ Relationships: [];
6732
+ };
6733
+ logistics_strategy_schedules: {
6734
+ Row: {
6735
+ condition_expression: string | null;
6736
+ created_at: string;
6737
+ end_date: string | null;
6738
+ id: string;
6739
+ is_enabled: boolean;
6740
+ priority: number;
6741
+ rule_type: string;
6742
+ start_date: string | null;
6743
+ strategy_id: string;
6744
+ updated_at: string;
6745
+ user_id: string;
6746
+ };
6747
+ Insert: {
6748
+ condition_expression?: string | null;
6749
+ created_at?: string;
6750
+ end_date?: string | null;
6751
+ id?: string;
6752
+ is_enabled?: boolean;
6753
+ priority?: number;
6754
+ rule_type: string;
6755
+ start_date?: string | null;
6756
+ strategy_id: string;
6757
+ updated_at?: string;
6758
+ user_id: string;
6759
+ };
6760
+ Update: {
6761
+ condition_expression?: string | null;
6762
+ created_at?: string;
6763
+ end_date?: string | null;
6764
+ id?: string;
6765
+ is_enabled?: boolean;
6766
+ priority?: number;
6767
+ rule_type?: string;
6768
+ start_date?: string | null;
6769
+ strategy_id?: string;
6770
+ updated_at?: string;
6771
+ user_id?: string;
6772
+ };
6773
+ Relationships: [{
6774
+ foreignKeyName: "logistics_strategy_schedules_strategy_id_fkey";
6775
+ columns: ["strategy_id"];
6776
+ isOneToOne: false;
6777
+ referencedRelation: "logistics_strategies";
6778
+ referencedColumns: ["id"];
6779
+ }];
6780
+ };
6781
+ logistics_variables: {
6782
+ Row: {
6783
+ created_at: string;
6784
+ default_value: string | null;
6785
+ description: string | null;
6786
+ id: string;
6787
+ is_builtin: boolean;
6788
+ key: string;
6789
+ label: string;
6790
+ updated_at: string;
6791
+ user_id: string;
6792
+ value_type: string;
6793
+ };
6794
+ Insert: {
6795
+ created_at?: string;
6796
+ default_value?: string | null;
6797
+ description?: string | null;
6798
+ id?: string;
6799
+ is_builtin?: boolean;
6800
+ key: string;
6801
+ label: string;
6802
+ updated_at?: string;
6803
+ user_id: string;
6804
+ value_type: string;
6805
+ };
6806
+ Update: {
6807
+ created_at?: string;
6808
+ default_value?: string | null;
6809
+ description?: string | null;
6810
+ id?: string;
6811
+ is_builtin?: boolean;
6812
+ key?: string;
6813
+ label?: string;
6814
+ updated_at?: string;
6815
+ user_id?: string;
6816
+ value_type?: string;
6817
+ };
6818
+ Relationships: [];
6819
+ };
6460
6820
  mailbox_messages: {
6461
6821
  Row: {
6462
6822
  body_html: string | null;
@@ -8230,6 +8590,138 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8230
8590
  };
8231
8591
  Relationships: [];
8232
8592
  };
8593
+ planning_item_assistants: {
8594
+ Row: {
8595
+ created_at: string;
8596
+ created_by: string | null;
8597
+ monteur_id: string;
8598
+ planning_item_id: string;
8599
+ };
8600
+ Insert: {
8601
+ created_at?: string;
8602
+ created_by?: string | null;
8603
+ monteur_id: string;
8604
+ planning_item_id: string;
8605
+ };
8606
+ Update: {
8607
+ created_at?: string;
8608
+ created_by?: string | null;
8609
+ monteur_id?: string;
8610
+ planning_item_id?: string;
8611
+ };
8612
+ Relationships: [{
8613
+ foreignKeyName: "planning_item_assistants_planning_item_id_fkey";
8614
+ columns: ["planning_item_id"];
8615
+ isOneToOne: false;
8616
+ referencedRelation: "planning_items";
8617
+ referencedColumns: ["id"];
8618
+ }];
8619
+ };
8620
+ planning_items: {
8621
+ Row: {
8622
+ assigned_monteur_id: string;
8623
+ created_at: string;
8624
+ created_by: string | null;
8625
+ end_at: string;
8626
+ id: string;
8627
+ notes: string | null;
8628
+ start_at: string;
8629
+ status: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
8630
+ updated_at: string;
8631
+ werkbon_id: string;
8632
+ };
8633
+ Insert: {
8634
+ assigned_monteur_id: string;
8635
+ created_at?: string;
8636
+ created_by?: string | null;
8637
+ end_at: string;
8638
+ id?: string;
8639
+ notes?: string | null;
8640
+ start_at: string;
8641
+ status?: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
8642
+ updated_at?: string;
8643
+ werkbon_id: string;
8644
+ };
8645
+ Update: {
8646
+ assigned_monteur_id?: string;
8647
+ created_at?: string;
8648
+ created_by?: string | null;
8649
+ end_at?: string;
8650
+ id?: string;
8651
+ notes?: string | null;
8652
+ start_at?: string;
8653
+ status?: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
8654
+ updated_at?: string;
8655
+ werkbon_id?: string;
8656
+ };
8657
+ Relationships: [{
8658
+ foreignKeyName: "planning_items_werkbon_id_fkey";
8659
+ columns: ["werkbon_id"];
8660
+ isOneToOne: false;
8661
+ referencedRelation: "werkbonnen";
8662
+ referencedColumns: ["id"];
8663
+ }];
8664
+ };
8665
+ product_bom_items: {
8666
+ Row: {
8667
+ component_product_id: string | null;
8668
+ component_trade_item_floriday_id: string | null;
8669
+ created_at: string;
8670
+ id: string;
8671
+ notes: string | null;
8672
+ packing_configuration_id: string | null;
8673
+ parent_product_id: string | null;
8674
+ parent_trade_item_floriday_id: string | null;
8675
+ quantity: number;
8676
+ sort_order: number;
8677
+ tenant_id: string;
8678
+ unit: string;
8679
+ updated_at: string;
8680
+ };
8681
+ Insert: {
8682
+ component_product_id?: string | null;
8683
+ component_trade_item_floriday_id?: string | null;
8684
+ created_at?: string;
8685
+ id?: string;
8686
+ notes?: string | null;
8687
+ packing_configuration_id?: string | null;
8688
+ parent_product_id?: string | null;
8689
+ parent_trade_item_floriday_id?: string | null;
8690
+ quantity?: number;
8691
+ sort_order?: number;
8692
+ tenant_id: string;
8693
+ unit?: string;
8694
+ updated_at?: string;
8695
+ };
8696
+ Update: {
8697
+ component_product_id?: string | null;
8698
+ component_trade_item_floriday_id?: string | null;
8699
+ created_at?: string;
8700
+ id?: string;
8701
+ notes?: string | null;
8702
+ packing_configuration_id?: string | null;
8703
+ parent_product_id?: string | null;
8704
+ parent_trade_item_floriday_id?: string | null;
8705
+ quantity?: number;
8706
+ sort_order?: number;
8707
+ tenant_id?: string;
8708
+ unit?: string;
8709
+ updated_at?: string;
8710
+ };
8711
+ Relationships: [{
8712
+ foreignKeyName: "product_bom_items_component_product_id_fkey";
8713
+ columns: ["component_product_id"];
8714
+ isOneToOne: false;
8715
+ referencedRelation: "products";
8716
+ referencedColumns: ["id"];
8717
+ }, {
8718
+ foreignKeyName: "product_bom_items_parent_product_id_fkey";
8719
+ columns: ["parent_product_id"];
8720
+ isOneToOne: false;
8721
+ referencedRelation: "products";
8722
+ referencedColumns: ["id"];
8723
+ }];
8724
+ };
8233
8725
  product_categories: {
8234
8726
  Row: {
8235
8727
  color: string;
@@ -8335,6 +8827,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8335
8827
  id: string;
8336
8828
  product_group_id: string;
8337
8829
  quantity: number;
8830
+ sort_order: number;
8338
8831
  trade_item_id: string;
8339
8832
  };
8340
8833
  Insert: {
@@ -8342,6 +8835,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8342
8835
  id?: string;
8343
8836
  product_group_id: string;
8344
8837
  quantity?: number;
8838
+ sort_order?: number;
8345
8839
  trade_item_id: string;
8346
8840
  };
8347
8841
  Update: {
@@ -8349,6 +8843,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8349
8843
  id?: string;
8350
8844
  product_group_id?: string;
8351
8845
  quantity?: number;
8846
+ sort_order?: number;
8352
8847
  trade_item_id?: string;
8353
8848
  };
8354
8849
  Relationships: [{
@@ -8363,6 +8858,8 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8363
8858
  Row: {
8364
8859
  created_at: string;
8365
8860
  description: string | null;
8861
+ head_product_id: string | null;
8862
+ head_trade_item_floriday_id: string | null;
8366
8863
  id: string;
8367
8864
  is_active: boolean;
8368
8865
  name: string;
@@ -8372,6 +8869,8 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8372
8869
  Insert: {
8373
8870
  created_at?: string;
8374
8871
  description?: string | null;
8872
+ head_product_id?: string | null;
8873
+ head_trade_item_floriday_id?: string | null;
8375
8874
  id?: string;
8376
8875
  is_active?: boolean;
8377
8876
  name: string;
@@ -8381,24 +8880,134 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8381
8880
  Update: {
8382
8881
  created_at?: string;
8383
8882
  description?: string | null;
8883
+ head_product_id?: string | null;
8884
+ head_trade_item_floriday_id?: string | null;
8384
8885
  id?: string;
8385
8886
  is_active?: boolean;
8386
8887
  name?: string;
8387
8888
  tenant_id?: string;
8388
8889
  updated_at?: string;
8389
8890
  };
8891
+ Relationships: [{
8892
+ foreignKeyName: "product_groups_head_product_id_fkey";
8893
+ columns: ["head_product_id"];
8894
+ isOneToOne: false;
8895
+ referencedRelation: "products";
8896
+ referencedColumns: ["id"];
8897
+ }];
8898
+ };
8899
+ product_load_settings: {
8900
+ Row: {
8901
+ created_at: string;
8902
+ id: string;
8903
+ is_package: boolean;
8904
+ label: string | null;
8905
+ layers_per_load_carrier: number | null;
8906
+ load_carrier: string | null;
8907
+ package_id: string | null;
8908
+ package_label: string | null;
8909
+ packages_per_layer: number | null;
8910
+ packing_configuration_id: string;
8911
+ product_id: string | null;
8912
+ tenant_id: string;
8913
+ trade_item_floriday_id: string | null;
8914
+ units_per_package: number | null;
8915
+ updated_at: string;
8916
+ };
8917
+ Insert: {
8918
+ created_at?: string;
8919
+ id?: string;
8920
+ is_package?: boolean;
8921
+ label?: string | null;
8922
+ layers_per_load_carrier?: number | null;
8923
+ load_carrier?: string | null;
8924
+ package_id?: string | null;
8925
+ package_label?: string | null;
8926
+ packages_per_layer?: number | null;
8927
+ packing_configuration_id?: string;
8928
+ product_id?: string | null;
8929
+ tenant_id: string;
8930
+ trade_item_floriday_id?: string | null;
8931
+ units_per_package?: number | null;
8932
+ updated_at?: string;
8933
+ };
8934
+ Update: {
8935
+ created_at?: string;
8936
+ id?: string;
8937
+ is_package?: boolean;
8938
+ label?: string | null;
8939
+ layers_per_load_carrier?: number | null;
8940
+ load_carrier?: string | null;
8941
+ package_id?: string | null;
8942
+ package_label?: string | null;
8943
+ packages_per_layer?: number | null;
8944
+ packing_configuration_id?: string;
8945
+ product_id?: string | null;
8946
+ tenant_id?: string;
8947
+ trade_item_floriday_id?: string | null;
8948
+ units_per_package?: number | null;
8949
+ updated_at?: string;
8950
+ };
8951
+ Relationships: [{
8952
+ foreignKeyName: "product_load_settings_package_id_fkey";
8953
+ columns: ["package_id"];
8954
+ isOneToOne: false;
8955
+ referencedRelation: "packages";
8956
+ referencedColumns: ["id"];
8957
+ }, {
8958
+ foreignKeyName: "product_load_settings_product_id_fkey";
8959
+ columns: ["product_id"];
8960
+ isOneToOne: false;
8961
+ referencedRelation: "products";
8962
+ referencedColumns: ["id"];
8963
+ }];
8964
+ };
8965
+ product_merge_log: {
8966
+ Row: {
8967
+ canonical_product_id: string | null;
8968
+ id: string;
8969
+ merged_at: string;
8970
+ merged_from_id: string;
8971
+ notes: string | null;
8972
+ snapshot: import("../integrations/supabase/types").Json;
8973
+ source_table: string;
8974
+ status: string;
8975
+ };
8976
+ Insert: {
8977
+ canonical_product_id?: string | null;
8978
+ id?: string;
8979
+ merged_at?: string;
8980
+ merged_from_id: string;
8981
+ notes?: string | null;
8982
+ snapshot?: import("../integrations/supabase/types").Json;
8983
+ source_table: string;
8984
+ status?: string;
8985
+ };
8986
+ Update: {
8987
+ canonical_product_id?: string | null;
8988
+ id?: string;
8989
+ merged_at?: string;
8990
+ merged_from_id?: string;
8991
+ notes?: string | null;
8992
+ snapshot?: import("../integrations/supabase/types").Json;
8993
+ source_table?: string;
8994
+ status?: string;
8995
+ };
8390
8996
  Relationships: [];
8391
8997
  };
8392
8998
  products: {
8393
8999
  Row: {
9000
+ article_number: string | null;
8394
9001
  barcode: string | null;
8395
9002
  batch: string;
8396
9003
  crates_per_layer: number;
8397
9004
  created_at: string;
8398
9005
  custom_fields: import("../integrations/supabase/types").Json;
9006
+ floriday_trade_item_id: string | null;
8399
9007
  id: string;
8400
9008
  image_url: string | null;
8401
9009
  incoming_quantity: number;
9010
+ is_layer: boolean;
8402
9011
  layers_per_cart: number;
8403
9012
  location: string;
8404
9013
  min_quantity: number;
@@ -8414,14 +9023,17 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8414
9023
  weight: string | null;
8415
9024
  };
8416
9025
  Insert: {
9026
+ article_number?: string | null;
8417
9027
  barcode?: string | null;
8418
9028
  batch: string;
8419
9029
  crates_per_layer?: number;
8420
9030
  created_at?: string;
8421
9031
  custom_fields?: import("../integrations/supabase/types").Json;
9032
+ floriday_trade_item_id?: string | null;
8422
9033
  id?: string;
8423
9034
  image_url?: string | null;
8424
9035
  incoming_quantity?: number;
9036
+ is_layer?: boolean;
8425
9037
  layers_per_cart?: number;
8426
9038
  location: string;
8427
9039
  min_quantity?: number;
@@ -8437,14 +9049,17 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8437
9049
  weight?: string | null;
8438
9050
  };
8439
9051
  Update: {
9052
+ article_number?: string | null;
8440
9053
  barcode?: string | null;
8441
9054
  batch?: string;
8442
9055
  crates_per_layer?: number;
8443
9056
  created_at?: string;
8444
9057
  custom_fields?: import("../integrations/supabase/types").Json;
9058
+ floriday_trade_item_id?: string | null;
8445
9059
  id?: string;
8446
9060
  image_url?: string | null;
8447
9061
  incoming_quantity?: number;
9062
+ is_layer?: boolean;
8448
9063
  layers_per_cart?: number;
8449
9064
  location?: string;
8450
9065
  min_quantity?: number;
@@ -8464,6 +9079,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8464
9079
  profiles: {
8465
9080
  Row: {
8466
9081
  address: string | null;
9082
+ avatar_url: string | null;
8467
9083
  created_at: string;
8468
9084
  display_name: string | null;
8469
9085
  email: string | null;
@@ -8475,6 +9091,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8475
9091
  };
8476
9092
  Insert: {
8477
9093
  address?: string | null;
9094
+ avatar_url?: string | null;
8478
9095
  created_at?: string;
8479
9096
  display_name?: string | null;
8480
9097
  email?: string | null;
@@ -8486,6 +9103,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
8486
9103
  };
8487
9104
  Update: {
8488
9105
  address?: string | null;
9106
+ avatar_url?: string | null;
8489
9107
  created_at?: string;
8490
9108
  display_name?: string | null;
8491
9109
  email?: string | null;
@@ -9352,6 +9970,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
9352
9970
  order_source: string | null;
9353
9971
  physical_after: number | null;
9354
9972
  physical_before: number | null;
9973
+ production_batch_id: string | null;
9355
9974
  qty_delta: number;
9356
9975
  reason: string | null;
9357
9976
  reserved_after: number | null;
@@ -9369,6 +9988,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
9369
9988
  order_source?: string | null;
9370
9989
  physical_after?: number | null;
9371
9990
  physical_before?: number | null;
9991
+ production_batch_id?: string | null;
9372
9992
  qty_delta: number;
9373
9993
  reason?: string | null;
9374
9994
  reserved_after?: number | null;
@@ -9386,6 +10006,7 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
9386
10006
  order_source?: string | null;
9387
10007
  physical_after?: number | null;
9388
10008
  physical_before?: number | null;
10009
+ production_batch_id?: string | null;
9389
10010
  qty_delta?: number;
9390
10011
  reason?: string | null;
9391
10012
  reserved_after?: number | null;
@@ -9712,6 +10333,48 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
9712
10333
  };
9713
10334
  Relationships: [];
9714
10335
  };
10336
+ trade_item_prices: {
10337
+ Row: {
10338
+ created_at: string;
10339
+ currency: string;
10340
+ id: string;
10341
+ last_push_error: string | null;
10342
+ last_pushed_at: string | null;
10343
+ price_group_id: string | null;
10344
+ price_per_piece: number;
10345
+ supply_line_id: string | null;
10346
+ trade_item_key: string;
10347
+ updated_at: string;
10348
+ user_id: string;
10349
+ };
10350
+ Insert: {
10351
+ created_at?: string;
10352
+ currency?: string;
10353
+ id?: string;
10354
+ last_push_error?: string | null;
10355
+ last_pushed_at?: string | null;
10356
+ price_group_id?: string | null;
10357
+ price_per_piece: number;
10358
+ supply_line_id?: string | null;
10359
+ trade_item_key: string;
10360
+ updated_at?: string;
10361
+ user_id: string;
10362
+ };
10363
+ Update: {
10364
+ created_at?: string;
10365
+ currency?: string;
10366
+ id?: string;
10367
+ last_push_error?: string | null;
10368
+ last_pushed_at?: string | null;
10369
+ price_group_id?: string | null;
10370
+ price_per_piece?: number;
10371
+ supply_line_id?: string | null;
10372
+ trade_item_key?: string;
10373
+ updated_at?: string;
10374
+ user_id?: string;
10375
+ };
10376
+ Relationships: [];
10377
+ };
9715
10378
  trade_item_stock: {
9716
10379
  Row: {
9717
10380
  connection_id: string;
@@ -10177,6 +10840,51 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
10177
10840
  referencedColumns: ["id"];
10178
10841
  }];
10179
10842
  };
10843
+ twinfield_invoice_pdf_cache: {
10844
+ Row: {
10845
+ connection_id: string;
10846
+ created_at: string;
10847
+ fetched_at: string;
10848
+ id: string;
10849
+ invoice_number: string;
10850
+ last_accessed_at: string;
10851
+ object_path: string;
10852
+ office_code: string;
10853
+ size_bytes: number;
10854
+ updated_at: string;
10855
+ };
10856
+ Insert: {
10857
+ connection_id: string;
10858
+ created_at?: string;
10859
+ fetched_at?: string;
10860
+ id?: string;
10861
+ invoice_number: string;
10862
+ last_accessed_at?: string;
10863
+ object_path: string;
10864
+ office_code: string;
10865
+ size_bytes?: number;
10866
+ updated_at?: string;
10867
+ };
10868
+ Update: {
10869
+ connection_id?: string;
10870
+ created_at?: string;
10871
+ fetched_at?: string;
10872
+ id?: string;
10873
+ invoice_number?: string;
10874
+ last_accessed_at?: string;
10875
+ object_path?: string;
10876
+ office_code?: string;
10877
+ size_bytes?: number;
10878
+ updated_at?: string;
10879
+ };
10880
+ Relationships: [{
10881
+ foreignKeyName: "twinfield_invoice_pdf_cache_connection_id_fkey";
10882
+ columns: ["connection_id"];
10883
+ isOneToOne: false;
10884
+ referencedRelation: "twinfield_connections";
10885
+ referencedColumns: ["id"];
10886
+ }];
10887
+ };
10180
10888
  twinfield_invoice_settings: {
10181
10889
  Row: {
10182
10890
  created_at: string;
@@ -10780,6 +11488,78 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
10780
11488
  };
10781
11489
  Relationships: [];
10782
11490
  };
11491
+ werkbon_package_ai_rules: {
11492
+ Row: {
11493
+ active: boolean;
11494
+ case_sensitive: boolean;
11495
+ created_at: string;
11496
+ id: string;
11497
+ package_id: string;
11498
+ priority: number;
11499
+ rule_type: string;
11500
+ updated_at: string;
11501
+ value: string;
11502
+ };
11503
+ Insert: {
11504
+ active?: boolean;
11505
+ case_sensitive?: boolean;
11506
+ created_at?: string;
11507
+ id?: string;
11508
+ package_id: string;
11509
+ priority?: number;
11510
+ rule_type: string;
11511
+ updated_at?: string;
11512
+ value: string;
11513
+ };
11514
+ Update: {
11515
+ active?: boolean;
11516
+ case_sensitive?: boolean;
11517
+ created_at?: string;
11518
+ id?: string;
11519
+ package_id?: string;
11520
+ priority?: number;
11521
+ rule_type?: string;
11522
+ updated_at?: string;
11523
+ value?: string;
11524
+ };
11525
+ Relationships: [{
11526
+ foreignKeyName: "werkbon_package_ai_rules_package_id_fkey";
11527
+ columns: ["package_id"];
11528
+ isOneToOne: false;
11529
+ referencedRelation: "werkbon_packages";
11530
+ referencedColumns: ["id"];
11531
+ }];
11532
+ };
11533
+ werkbon_package_categories: {
11534
+ Row: {
11535
+ active: boolean;
11536
+ created_at: string;
11537
+ id: string;
11538
+ kleur: string | null;
11539
+ naam: string;
11540
+ sort_order: number;
11541
+ updated_at: string;
11542
+ };
11543
+ Insert: {
11544
+ active?: boolean;
11545
+ created_at?: string;
11546
+ id?: string;
11547
+ kleur?: string | null;
11548
+ naam: string;
11549
+ sort_order?: number;
11550
+ updated_at?: string;
11551
+ };
11552
+ Update: {
11553
+ active?: boolean;
11554
+ created_at?: string;
11555
+ id?: string;
11556
+ kleur?: string | null;
11557
+ naam?: string;
11558
+ sort_order?: number;
11559
+ updated_at?: string;
11560
+ };
11561
+ Relationships: [];
11562
+ };
10783
11563
  werkbon_package_lines: {
10784
11564
  Row: {
10785
11565
  created_at: string;
@@ -10825,38 +11605,59 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
10825
11605
  werkbon_packages: {
10826
11606
  Row: {
10827
11607
  active: boolean;
11608
+ ai_tags: string[];
11609
+ category_id: string | null;
10828
11610
  code: string;
10829
11611
  created_at: string;
10830
11612
  default_quantity: number;
10831
11613
  description: string | null;
11614
+ duration_minutes: number | null;
10832
11615
  id: string;
11616
+ mandaat_type: string | null;
10833
11617
  name: string;
11618
+ sort_order: number;
10834
11619
  unit_price_cents: number;
10835
11620
  updated_at: string;
10836
11621
  };
10837
11622
  Insert: {
10838
11623
  active?: boolean;
11624
+ ai_tags?: string[];
11625
+ category_id?: string | null;
10839
11626
  code: string;
10840
11627
  created_at?: string;
10841
11628
  default_quantity?: number;
10842
11629
  description?: string | null;
11630
+ duration_minutes?: number | null;
10843
11631
  id?: string;
11632
+ mandaat_type?: string | null;
10844
11633
  name: string;
11634
+ sort_order?: number;
10845
11635
  unit_price_cents?: number;
10846
11636
  updated_at?: string;
10847
11637
  };
10848
11638
  Update: {
10849
11639
  active?: boolean;
11640
+ ai_tags?: string[];
11641
+ category_id?: string | null;
10850
11642
  code?: string;
10851
11643
  created_at?: string;
10852
11644
  default_quantity?: number;
10853
11645
  description?: string | null;
11646
+ duration_minutes?: number | null;
10854
11647
  id?: string;
11648
+ mandaat_type?: string | null;
10855
11649
  name?: string;
11650
+ sort_order?: number;
10856
11651
  unit_price_cents?: number;
10857
11652
  updated_at?: string;
10858
11653
  };
10859
- Relationships: [];
11654
+ Relationships: [{
11655
+ foreignKeyName: "werkbon_packages_category_id_fkey";
11656
+ columns: ["category_id"];
11657
+ isOneToOne: false;
11658
+ referencedRelation: "werkbon_package_categories";
11659
+ referencedColumns: ["id"];
11660
+ }];
10860
11661
  };
10861
11662
  werkbon_photos: {
10862
11663
  Row: {
@@ -10944,7 +11745,10 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
10944
11745
  scheduled_end_time: string | null;
10945
11746
  scheduled_start_time: string | null;
10946
11747
  sequence_number: number;
11748
+ source_email_meta: import("../integrations/supabase/types").Json | null;
11749
+ source_mailbox_message_id: string | null;
10947
11750
  source_pdf_path: string | null;
11751
+ source_type: string;
10948
11752
  status: string;
10949
11753
  technician_id: string | null;
10950
11754
  technician_notes: string | null;
@@ -10973,7 +11777,10 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
10973
11777
  scheduled_end_time?: string | null;
10974
11778
  scheduled_start_time?: string | null;
10975
11779
  sequence_number: number;
11780
+ source_email_meta?: import("../integrations/supabase/types").Json | null;
11781
+ source_mailbox_message_id?: string | null;
10976
11782
  source_pdf_path?: string | null;
11783
+ source_type?: string;
10977
11784
  status?: string;
10978
11785
  technician_id?: string | null;
10979
11786
  technician_notes?: string | null;
@@ -11002,7 +11809,10 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
11002
11809
  scheduled_end_time?: string | null;
11003
11810
  scheduled_start_time?: string | null;
11004
11811
  sequence_number?: number;
11812
+ source_email_meta?: import("../integrations/supabase/types").Json | null;
11813
+ source_mailbox_message_id?: string | null;
11005
11814
  source_pdf_path?: string | null;
11815
+ source_type?: string;
11006
11816
  status?: string;
11007
11817
  technician_id?: string | null;
11008
11818
  technician_notes?: string | null;
@@ -11019,10 +11829,10 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
11019
11829
  referencedRelation: "werkbonnen";
11020
11830
  referencedColumns: ["id"];
11021
11831
  }, {
11022
- foreignKeyName: "werkbonnen_technician_id_fkey";
11023
- columns: ["technician_id"];
11832
+ foreignKeyName: "werkbonnen_source_mailbox_message_id_fkey";
11833
+ columns: ["source_mailbox_message_id"];
11024
11834
  isOneToOne: false;
11025
- referencedRelation: "monteurs";
11835
+ referencedRelation: "mailbox_messages";
11026
11836
  referencedColumns: ["id"];
11027
11837
  }];
11028
11838
  };
@@ -11716,6 +12526,13 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
11716
12526
  };
11717
12527
  Returns: number;
11718
12528
  };
12529
+ _migrate_rewrite_stock_key: {
12530
+ Args: {
12531
+ _from_key: string;
12532
+ _to_key: string;
12533
+ };
12534
+ Returns: undefined;
12535
+ };
11719
12536
  afh_city_code: {
11720
12537
  Args: {
11721
12538
  _city: string;
@@ -11742,6 +12559,21 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
11742
12559
  };
11743
12560
  Returns: string;
11744
12561
  };
12562
+ ai_usage_by_module: {
12563
+ Args: {
12564
+ _from: string;
12565
+ _to: string;
12566
+ };
12567
+ Returns: {
12568
+ calls: number;
12569
+ consumer_module_id: string;
12570
+ cost_usd: number;
12571
+ errors: number;
12572
+ input_tokens: number;
12573
+ output_tokens: number;
12574
+ total_tokens: number;
12575
+ }[];
12576
+ };
11745
12577
  apply_stock_consumption: {
11746
12578
  Args: {
11747
12579
  p_order_id: string;
@@ -11799,6 +12631,12 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
11799
12631
  processed_items: number;
11800
12632
  }[];
11801
12633
  };
12634
+ calculate_layer_stock: {
12635
+ Args: {
12636
+ p_product_id: string;
12637
+ };
12638
+ Returns: number;
12639
+ };
11802
12640
  call_exact_route: {
11803
12641
  Args: {
11804
12642
  path: string;
@@ -11858,6 +12696,28 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
11858
12696
  Args: never;
11859
12697
  Returns: undefined;
11860
12698
  };
12699
+ consume_bom_for_production: {
12700
+ Args: {
12701
+ p_connection_id: string;
12702
+ p_parent_id: string;
12703
+ p_parent_key: string;
12704
+ p_parent_kind: string;
12705
+ p_quantity: number;
12706
+ p_user_id: string;
12707
+ };
12708
+ Returns: import("../integrations/supabase/types").Json;
12709
+ } | {
12710
+ Args: {
12711
+ p_batch_id?: string;
12712
+ p_connection_id: string;
12713
+ p_parent_id: string;
12714
+ p_parent_key: string;
12715
+ p_parent_kind: string;
12716
+ p_quantity: number;
12717
+ p_user_id: string;
12718
+ };
12719
+ Returns: import("../integrations/supabase/types").Json;
12720
+ };
11861
12721
  consume_floriday_rate_limit: {
11862
12722
  Args: {
11863
12723
  p_bucket: string;
@@ -11890,6 +12750,12 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
11890
12750
  Args: never;
11891
12751
  Returns: string;
11892
12752
  };
12753
+ custom_access_token_hook: {
12754
+ Args: {
12755
+ event: import("../integrations/supabase/types").Json;
12756
+ };
12757
+ Returns: import("../integrations/supabase/types").Json;
12758
+ };
11893
12759
  dashboard_alert_counts: {
11894
12760
  Args: never;
11895
12761
  Returns: import("../integrations/supabase/types").Json;
@@ -11909,6 +12775,13 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
11909
12775
  table_name: string;
11910
12776
  }[];
11911
12777
  };
12778
+ delete_samenstelling: {
12779
+ Args: {
12780
+ p_parent_id: string;
12781
+ p_parent_kind: string;
12782
+ };
12783
+ Returns: import("../integrations/supabase/types").Json;
12784
+ };
11912
12785
  dispatch_carrier_signups_sql: {
11913
12786
  Args: {
11914
12787
  _catchup?: string;
@@ -12164,6 +13037,27 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12164
13037
  minutes_since_success: number;
12165
13038
  }[];
12166
13039
  };
13040
+ get_group_allocation_keys: {
13041
+ Args: {
13042
+ p_product_id: string;
13043
+ };
13044
+ Returns: {
13045
+ k: string;
13046
+ ord: number;
13047
+ }[];
13048
+ };
13049
+ get_group_head_key: {
13050
+ Args: {
13051
+ p_group_id: string;
13052
+ };
13053
+ Returns: string;
13054
+ };
13055
+ get_inventory_stock_for_key: {
13056
+ Args: {
13057
+ p_key: string;
13058
+ };
13059
+ Returns: number;
13060
+ };
12167
13061
  get_offer_by_link_code: {
12168
13062
  Args: {
12169
13063
  p_code: string;
@@ -12194,6 +13088,12 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12194
13088
  };
12195
13089
  Returns: string;
12196
13090
  };
13091
+ get_product_group_available_stock: {
13092
+ Args: {
13093
+ p_group_id: string;
13094
+ };
13095
+ Returns: number;
13096
+ };
12197
13097
  get_room_busy_windows: {
12198
13098
  Args: {
12199
13099
  p_from: string;
@@ -12258,12 +13158,35 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12258
13158
  };
12259
13159
  Returns: boolean;
12260
13160
  };
13161
+ jwt_has_role: {
13162
+ Args: {
13163
+ _role: import("../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
13164
+ };
13165
+ Returns: boolean;
13166
+ };
12261
13167
  list_monteurs: {
12262
13168
  Args: never;
12263
13169
  Returns: {
13170
+ avatar_url: string;
12264
13171
  display_name: string;
12265
13172
  email: string;
12266
- user_id: string;
13173
+ id: string;
13174
+ }[];
13175
+ };
13176
+ list_my_planning_items: {
13177
+ Args: {
13178
+ _from: string;
13179
+ _to: string;
13180
+ };
13181
+ Returns: {
13182
+ assigned_monteur_id: string;
13183
+ end_at: string;
13184
+ id: string;
13185
+ notes: string;
13186
+ role: string;
13187
+ start_at: string;
13188
+ status: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
13189
+ werkbon_id: string;
12267
13190
  }[];
12268
13191
  };
12269
13192
  local_effective_price: {
@@ -12282,6 +13205,22 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12282
13205
  source_id: string;
12283
13206
  }[];
12284
13207
  };
13208
+ log_ai_call: {
13209
+ Args: {
13210
+ _consumer_module_id: string;
13211
+ _cost_usd: number;
13212
+ _duration_ms: number;
13213
+ _error_code: string;
13214
+ _error_message: string;
13215
+ _input_tokens: number;
13216
+ _model_slug: string;
13217
+ _output_tokens: number;
13218
+ _provider_slug: string;
13219
+ _status: string;
13220
+ _total_tokens: number;
13221
+ };
13222
+ Returns: string;
13223
+ };
12285
13224
  mark_offer_clicked: {
12286
13225
  Args: {
12287
13226
  p_code: string;
@@ -12294,12 +13233,32 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12294
13233
  };
12295
13234
  Returns: undefined;
12296
13235
  };
13236
+ mark_salesorder_controlled: {
13237
+ Args: {
13238
+ p_controlled: boolean;
13239
+ p_floriday_id: string;
13240
+ };
13241
+ Returns: undefined;
13242
+ };
12297
13243
  mark_shipment_shipped: {
12298
13244
  Args: {
12299
13245
  p_shipment_id: string;
12300
13246
  };
12301
13247
  Returns: undefined;
12302
13248
  };
13249
+ merge_products: {
13250
+ Args: {
13251
+ _canonical: string;
13252
+ _loser: string;
13253
+ };
13254
+ Returns: undefined;
13255
+ };
13256
+ next_manufacture_partij: {
13257
+ Args: {
13258
+ _tenant_id: string;
13259
+ };
13260
+ Returns: string;
13261
+ };
12303
13262
  next_order_number: {
12304
13263
  Args: {
12305
13264
  p_prefix: string;
@@ -12373,6 +13332,15 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12373
13332
  };
12374
13333
  Returns: undefined;
12375
13334
  };
13335
+ pickstation_resolve_delivery_orders: {
13336
+ Args: {
13337
+ p_sales_order_ids: string[];
13338
+ };
13339
+ Returns: {
13340
+ delivery_order_id: string;
13341
+ sales_order_id: string;
13342
+ }[];
13343
+ };
12376
13344
  pickstation_set_cart_status: {
12377
13345
  Args: {
12378
13346
  p_cart_index: number;
@@ -12382,6 +13350,14 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12382
13350
  };
12383
13351
  Returns: undefined;
12384
13352
  };
13353
+ produce_designed_product: {
13354
+ Args: {
13355
+ p_parent_id: string;
13356
+ p_parent_kind: string;
13357
+ p_quantity: number;
13358
+ };
13359
+ Returns: import("../integrations/supabase/types").Json;
13360
+ };
12385
13361
  promote_trade_item_key: {
12386
13362
  Args: {
12387
13363
  p_new: string;
@@ -12389,6 +13365,10 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12389
13365
  };
12390
13366
  Returns: undefined;
12391
13367
  };
13368
+ recompute_all_reserved_stock: {
13369
+ Args: never;
13370
+ Returns: undefined;
13371
+ };
12392
13372
  recompute_order_status: {
12393
13373
  Args: {
12394
13374
  p_order_id: string;
@@ -12444,18 +13424,50 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12444
13424
  };
12445
13425
  Returns: undefined;
12446
13426
  };
13427
+ resolve_group_allocation: {
13428
+ Args: {
13429
+ _needed: number;
13430
+ _product_group_id: string;
13431
+ };
13432
+ Returns: {
13433
+ allocated: number;
13434
+ trade_item_id: string;
13435
+ }[];
13436
+ };
13437
+ resolve_group_member_stock_key: {
13438
+ Args: {
13439
+ p_trade_item_id: string;
13440
+ };
13441
+ Returns: string;
13442
+ };
12447
13443
  resolve_product_id_for_item: {
12448
13444
  Args: {
12449
13445
  p_product_name: string;
12450
13446
  };
12451
13447
  Returns: string;
12452
13448
  };
13449
+ resolve_stock_trade_item_key: {
13450
+ Args: {
13451
+ p_product_id: string;
13452
+ };
13453
+ Returns: string;
13454
+ };
12453
13455
  retry_twinfield_push: {
12454
13456
  Args: {
12455
13457
  _customer_id: string;
12456
13458
  };
12457
13459
  Returns: number;
12458
13460
  };
13461
+ reverse_production: {
13462
+ Args: {
13463
+ p_connection_id?: string;
13464
+ p_parent_key: string;
13465
+ p_quantity: number;
13466
+ p_reason?: string;
13467
+ p_user_id?: string;
13468
+ };
13469
+ Returns: import("../integrations/supabase/types").Json;
13470
+ };
12459
13471
  schedule_floriday_additional_services_sync: {
12460
13472
  Args: {
12461
13473
  p_apikey: string;
@@ -12723,6 +13735,17 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12723
13735
  };
12724
13736
  Returns: number;
12725
13737
  };
13738
+ self_heal_floriday_links: {
13739
+ Args: never;
13740
+ Returns: number;
13741
+ };
13742
+ set_planning_status: {
13743
+ Args: {
13744
+ _id: string;
13745
+ _status: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
13746
+ };
13747
+ Returns: undefined;
13748
+ };
12726
13749
  show_limit: {
12727
13750
  Args: never;
12728
13751
  Returns: number;
@@ -12733,18 +13756,34 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12733
13756
  };
12734
13757
  Returns: string[];
12735
13758
  };
13759
+ sync_all_layer_stocks: {
13760
+ Args: never;
13761
+ Returns: undefined;
13762
+ };
12736
13763
  sync_cached_packing_from_product: {
12737
13764
  Args: {
12738
13765
  p_product_id: string;
12739
13766
  };
12740
13767
  Returns: undefined;
12741
13768
  };
13769
+ sync_layer_stock: {
13770
+ Args: {
13771
+ p_product_id: string;
13772
+ };
13773
+ Returns: undefined;
13774
+ };
12742
13775
  sync_order_cart_item_packing_from_product: {
12743
13776
  Args: {
12744
13777
  p_product_id: string;
12745
13778
  };
12746
13779
  Returns: undefined;
12747
13780
  };
13781
+ sync_product_group_belading: {
13782
+ Args: {
13783
+ _group_id: string;
13784
+ };
13785
+ Returns: undefined;
13786
+ };
12748
13787
  sync_product_packing_from_floriday_cache: {
12749
13788
  Args: {
12750
13789
  p_floriday_id: string;
@@ -12776,11 +13815,12 @@ export declare const getPreferredWarehouseStatus: import("@tanstack/start-client
12776
13815
  };
12777
13816
  };
12778
13817
  Enums: {
12779
- app_role: "admin" | "planner" | "monteur" | "administratie";
13818
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
12780
13819
  exact_env: "staging" | "live";
12781
13820
  exact_push_status: "pending" | "sent" | "error";
12782
13821
  itk_customer_segment: "Business" | "Private";
12783
13822
  itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
13823
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd" | "concept" | "vrijgegeven";
12784
13824
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
12785
13825
  };
12786
13826
  CompositeTypes: { [_ in never]: never; };
@@ -13072,6 +14112,57 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
13072
14112
  referencedColumns: ["id"];
13073
14113
  }];
13074
14114
  };
14115
+ ai_call_log: {
14116
+ Row: {
14117
+ consumer_module_id: string;
14118
+ cost_usd: number | null;
14119
+ created_at: string;
14120
+ created_by: string | null;
14121
+ duration_ms: number | null;
14122
+ error_code: string | null;
14123
+ error_message: string | null;
14124
+ id: string;
14125
+ input_tokens: number;
14126
+ model_slug: string | null;
14127
+ output_tokens: number;
14128
+ provider_slug: string | null;
14129
+ status: string;
14130
+ total_tokens: number;
14131
+ };
14132
+ Insert: {
14133
+ consumer_module_id: string;
14134
+ cost_usd?: number | null;
14135
+ created_at?: string;
14136
+ created_by?: string | null;
14137
+ duration_ms?: number | null;
14138
+ error_code?: string | null;
14139
+ error_message?: string | null;
14140
+ id?: string;
14141
+ input_tokens?: number;
14142
+ model_slug?: string | null;
14143
+ output_tokens?: number;
14144
+ provider_slug?: string | null;
14145
+ status: string;
14146
+ total_tokens?: number;
14147
+ };
14148
+ Update: {
14149
+ consumer_module_id?: string;
14150
+ cost_usd?: number | null;
14151
+ created_at?: string;
14152
+ created_by?: string | null;
14153
+ duration_ms?: number | null;
14154
+ error_code?: string | null;
14155
+ error_message?: string | null;
14156
+ id?: string;
14157
+ input_tokens?: number;
14158
+ model_slug?: string | null;
14159
+ output_tokens?: number;
14160
+ provider_slug?: string | null;
14161
+ status?: string;
14162
+ total_tokens?: number;
14163
+ };
14164
+ Relationships: [];
14165
+ };
13075
14166
  ai_credentials: {
13076
14167
  Row: {
13077
14168
  active: boolean;
@@ -13108,6 +14199,36 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
13108
14199
  referencedColumns: ["id"];
13109
14200
  }];
13110
14201
  };
14202
+ ai_goals: {
14203
+ Row: {
14204
+ active: boolean;
14205
+ created_at: string;
14206
+ description: string | null;
14207
+ key: string;
14208
+ label: string;
14209
+ sort_order: number;
14210
+ updated_at: string;
14211
+ };
14212
+ Insert: {
14213
+ active?: boolean;
14214
+ created_at?: string;
14215
+ description?: string | null;
14216
+ key: string;
14217
+ label: string;
14218
+ sort_order?: number;
14219
+ updated_at?: string;
14220
+ };
14221
+ Update: {
14222
+ active?: boolean;
14223
+ created_at?: string;
14224
+ description?: string | null;
14225
+ key?: string;
14226
+ label?: string;
14227
+ sort_order?: number;
14228
+ updated_at?: string;
14229
+ };
14230
+ Relationships: [];
14231
+ };
13111
14232
  ai_model_pricing: {
13112
14233
  Row: {
13113
14234
  created_at: string;
@@ -19252,6 +20373,285 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
19252
20373
  };
19253
20374
  Relationships: [];
19254
20375
  };
20376
+ logistics_capacity_events: {
20377
+ Row: {
20378
+ available_carts: number;
20379
+ created_at: string;
20380
+ id: string;
20381
+ measures: import("../integrations/supabase/types").Json;
20382
+ note: string | null;
20383
+ outcome: string;
20384
+ required_carts: number;
20385
+ reserve_minutes: number;
20386
+ shortage_carts: number;
20387
+ status: string;
20388
+ user_id: string;
20389
+ };
20390
+ Insert: {
20391
+ available_carts?: number;
20392
+ created_at?: string;
20393
+ id?: string;
20394
+ measures?: import("../integrations/supabase/types").Json;
20395
+ note?: string | null;
20396
+ outcome?: string;
20397
+ required_carts?: number;
20398
+ reserve_minutes?: number;
20399
+ shortage_carts?: number;
20400
+ status: string;
20401
+ user_id: string;
20402
+ };
20403
+ Update: {
20404
+ available_carts?: number;
20405
+ created_at?: string;
20406
+ id?: string;
20407
+ measures?: import("../integrations/supabase/types").Json;
20408
+ note?: string | null;
20409
+ outcome?: string;
20410
+ required_carts?: number;
20411
+ reserve_minutes?: number;
20412
+ shortage_carts?: number;
20413
+ status?: string;
20414
+ user_id?: string;
20415
+ };
20416
+ Relationships: [];
20417
+ };
20418
+ logistics_capacity_settings: {
20419
+ Row: {
20420
+ created_at: string;
20421
+ settings: import("../integrations/supabase/types").Json;
20422
+ updated_at: string;
20423
+ user_id: string;
20424
+ };
20425
+ Insert: {
20426
+ created_at?: string;
20427
+ settings?: import("../integrations/supabase/types").Json;
20428
+ updated_at?: string;
20429
+ user_id: string;
20430
+ };
20431
+ Update: {
20432
+ created_at?: string;
20433
+ settings?: import("../integrations/supabase/types").Json;
20434
+ updated_at?: string;
20435
+ user_id?: string;
20436
+ };
20437
+ Relationships: [];
20438
+ };
20439
+ logistics_decisions: {
20440
+ Row: {
20441
+ created_at: string;
20442
+ explanation: string | null;
20443
+ id: string;
20444
+ input_snapshot: import("../integrations/supabase/types").Json;
20445
+ result: import("../integrations/supabase/types").Json;
20446
+ slot: string;
20447
+ strategy_id: string | null;
20448
+ subject_id: string;
20449
+ subject_type: string;
20450
+ user_id: string;
20451
+ };
20452
+ Insert: {
20453
+ created_at?: string;
20454
+ explanation?: string | null;
20455
+ id?: string;
20456
+ input_snapshot?: import("../integrations/supabase/types").Json;
20457
+ result?: import("../integrations/supabase/types").Json;
20458
+ slot: string;
20459
+ strategy_id?: string | null;
20460
+ subject_id: string;
20461
+ subject_type: string;
20462
+ user_id: string;
20463
+ };
20464
+ Update: {
20465
+ created_at?: string;
20466
+ explanation?: string | null;
20467
+ id?: string;
20468
+ input_snapshot?: import("../integrations/supabase/types").Json;
20469
+ result?: import("../integrations/supabase/types").Json;
20470
+ slot?: string;
20471
+ strategy_id?: string | null;
20472
+ subject_id?: string;
20473
+ subject_type?: string;
20474
+ user_id?: string;
20475
+ };
20476
+ Relationships: [{
20477
+ foreignKeyName: "logistics_decisions_strategy_id_fkey";
20478
+ columns: ["strategy_id"];
20479
+ isOneToOne: false;
20480
+ referencedRelation: "logistics_strategies";
20481
+ referencedColumns: ["id"];
20482
+ }];
20483
+ };
20484
+ logistics_formulas: {
20485
+ Row: {
20486
+ created_at: string;
20487
+ expression: string;
20488
+ id: string;
20489
+ notes: string | null;
20490
+ slot: string;
20491
+ strategy_id: string;
20492
+ updated_at: string;
20493
+ user_id: string;
20494
+ version: number;
20495
+ };
20496
+ Insert: {
20497
+ created_at?: string;
20498
+ expression?: string;
20499
+ id?: string;
20500
+ notes?: string | null;
20501
+ slot: string;
20502
+ strategy_id: string;
20503
+ updated_at?: string;
20504
+ user_id: string;
20505
+ version?: number;
20506
+ };
20507
+ Update: {
20508
+ created_at?: string;
20509
+ expression?: string;
20510
+ id?: string;
20511
+ notes?: string | null;
20512
+ slot?: string;
20513
+ strategy_id?: string;
20514
+ updated_at?: string;
20515
+ user_id?: string;
20516
+ version?: number;
20517
+ };
20518
+ Relationships: [{
20519
+ foreignKeyName: "logistics_formulas_strategy_id_fkey";
20520
+ columns: ["strategy_id"];
20521
+ isOneToOne: false;
20522
+ referencedRelation: "logistics_strategies";
20523
+ referencedColumns: ["id"];
20524
+ }];
20525
+ };
20526
+ logistics_strategies: {
20527
+ Row: {
20528
+ color: string;
20529
+ created_at: string;
20530
+ description: string | null;
20531
+ id: string;
20532
+ is_active: boolean;
20533
+ name: string;
20534
+ priority: number;
20535
+ updated_at: string;
20536
+ updated_by: string | null;
20537
+ user_id: string;
20538
+ version: number;
20539
+ };
20540
+ Insert: {
20541
+ color?: string;
20542
+ created_at?: string;
20543
+ description?: string | null;
20544
+ id?: string;
20545
+ is_active?: boolean;
20546
+ name: string;
20547
+ priority?: number;
20548
+ updated_at?: string;
20549
+ updated_by?: string | null;
20550
+ user_id: string;
20551
+ version?: number;
20552
+ };
20553
+ Update: {
20554
+ color?: string;
20555
+ created_at?: string;
20556
+ description?: string | null;
20557
+ id?: string;
20558
+ is_active?: boolean;
20559
+ name?: string;
20560
+ priority?: number;
20561
+ updated_at?: string;
20562
+ updated_by?: string | null;
20563
+ user_id?: string;
20564
+ version?: number;
20565
+ };
20566
+ Relationships: [];
20567
+ };
20568
+ logistics_strategy_schedules: {
20569
+ Row: {
20570
+ condition_expression: string | null;
20571
+ created_at: string;
20572
+ end_date: string | null;
20573
+ id: string;
20574
+ is_enabled: boolean;
20575
+ priority: number;
20576
+ rule_type: string;
20577
+ start_date: string | null;
20578
+ strategy_id: string;
20579
+ updated_at: string;
20580
+ user_id: string;
20581
+ };
20582
+ Insert: {
20583
+ condition_expression?: string | null;
20584
+ created_at?: string;
20585
+ end_date?: string | null;
20586
+ id?: string;
20587
+ is_enabled?: boolean;
20588
+ priority?: number;
20589
+ rule_type: string;
20590
+ start_date?: string | null;
20591
+ strategy_id: string;
20592
+ updated_at?: string;
20593
+ user_id: string;
20594
+ };
20595
+ Update: {
20596
+ condition_expression?: string | null;
20597
+ created_at?: string;
20598
+ end_date?: string | null;
20599
+ id?: string;
20600
+ is_enabled?: boolean;
20601
+ priority?: number;
20602
+ rule_type?: string;
20603
+ start_date?: string | null;
20604
+ strategy_id?: string;
20605
+ updated_at?: string;
20606
+ user_id?: string;
20607
+ };
20608
+ Relationships: [{
20609
+ foreignKeyName: "logistics_strategy_schedules_strategy_id_fkey";
20610
+ columns: ["strategy_id"];
20611
+ isOneToOne: false;
20612
+ referencedRelation: "logistics_strategies";
20613
+ referencedColumns: ["id"];
20614
+ }];
20615
+ };
20616
+ logistics_variables: {
20617
+ Row: {
20618
+ created_at: string;
20619
+ default_value: string | null;
20620
+ description: string | null;
20621
+ id: string;
20622
+ is_builtin: boolean;
20623
+ key: string;
20624
+ label: string;
20625
+ updated_at: string;
20626
+ user_id: string;
20627
+ value_type: string;
20628
+ };
20629
+ Insert: {
20630
+ created_at?: string;
20631
+ default_value?: string | null;
20632
+ description?: string | null;
20633
+ id?: string;
20634
+ is_builtin?: boolean;
20635
+ key: string;
20636
+ label: string;
20637
+ updated_at?: string;
20638
+ user_id: string;
20639
+ value_type: string;
20640
+ };
20641
+ Update: {
20642
+ created_at?: string;
20643
+ default_value?: string | null;
20644
+ description?: string | null;
20645
+ id?: string;
20646
+ is_builtin?: boolean;
20647
+ key?: string;
20648
+ label?: string;
20649
+ updated_at?: string;
20650
+ user_id?: string;
20651
+ value_type?: string;
20652
+ };
20653
+ Relationships: [];
20654
+ };
19255
20655
  mailbox_messages: {
19256
20656
  Row: {
19257
20657
  body_html: string | null;
@@ -21025,6 +22425,138 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21025
22425
  };
21026
22426
  Relationships: [];
21027
22427
  };
22428
+ planning_item_assistants: {
22429
+ Row: {
22430
+ created_at: string;
22431
+ created_by: string | null;
22432
+ monteur_id: string;
22433
+ planning_item_id: string;
22434
+ };
22435
+ Insert: {
22436
+ created_at?: string;
22437
+ created_by?: string | null;
22438
+ monteur_id: string;
22439
+ planning_item_id: string;
22440
+ };
22441
+ Update: {
22442
+ created_at?: string;
22443
+ created_by?: string | null;
22444
+ monteur_id?: string;
22445
+ planning_item_id?: string;
22446
+ };
22447
+ Relationships: [{
22448
+ foreignKeyName: "planning_item_assistants_planning_item_id_fkey";
22449
+ columns: ["planning_item_id"];
22450
+ isOneToOne: false;
22451
+ referencedRelation: "planning_items";
22452
+ referencedColumns: ["id"];
22453
+ }];
22454
+ };
22455
+ planning_items: {
22456
+ Row: {
22457
+ assigned_monteur_id: string;
22458
+ created_at: string;
22459
+ created_by: string | null;
22460
+ end_at: string;
22461
+ id: string;
22462
+ notes: string | null;
22463
+ start_at: string;
22464
+ status: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
22465
+ updated_at: string;
22466
+ werkbon_id: string;
22467
+ };
22468
+ Insert: {
22469
+ assigned_monteur_id: string;
22470
+ created_at?: string;
22471
+ created_by?: string | null;
22472
+ end_at: string;
22473
+ id?: string;
22474
+ notes?: string | null;
22475
+ start_at: string;
22476
+ status?: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
22477
+ updated_at?: string;
22478
+ werkbon_id: string;
22479
+ };
22480
+ Update: {
22481
+ assigned_monteur_id?: string;
22482
+ created_at?: string;
22483
+ created_by?: string | null;
22484
+ end_at?: string;
22485
+ id?: string;
22486
+ notes?: string | null;
22487
+ start_at?: string;
22488
+ status?: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
22489
+ updated_at?: string;
22490
+ werkbon_id?: string;
22491
+ };
22492
+ Relationships: [{
22493
+ foreignKeyName: "planning_items_werkbon_id_fkey";
22494
+ columns: ["werkbon_id"];
22495
+ isOneToOne: false;
22496
+ referencedRelation: "werkbonnen";
22497
+ referencedColumns: ["id"];
22498
+ }];
22499
+ };
22500
+ product_bom_items: {
22501
+ Row: {
22502
+ component_product_id: string | null;
22503
+ component_trade_item_floriday_id: string | null;
22504
+ created_at: string;
22505
+ id: string;
22506
+ notes: string | null;
22507
+ packing_configuration_id: string | null;
22508
+ parent_product_id: string | null;
22509
+ parent_trade_item_floriday_id: string | null;
22510
+ quantity: number;
22511
+ sort_order: number;
22512
+ tenant_id: string;
22513
+ unit: string;
22514
+ updated_at: string;
22515
+ };
22516
+ Insert: {
22517
+ component_product_id?: string | null;
22518
+ component_trade_item_floriday_id?: string | null;
22519
+ created_at?: string;
22520
+ id?: string;
22521
+ notes?: string | null;
22522
+ packing_configuration_id?: string | null;
22523
+ parent_product_id?: string | null;
22524
+ parent_trade_item_floriday_id?: string | null;
22525
+ quantity?: number;
22526
+ sort_order?: number;
22527
+ tenant_id: string;
22528
+ unit?: string;
22529
+ updated_at?: string;
22530
+ };
22531
+ Update: {
22532
+ component_product_id?: string | null;
22533
+ component_trade_item_floriday_id?: string | null;
22534
+ created_at?: string;
22535
+ id?: string;
22536
+ notes?: string | null;
22537
+ packing_configuration_id?: string | null;
22538
+ parent_product_id?: string | null;
22539
+ parent_trade_item_floriday_id?: string | null;
22540
+ quantity?: number;
22541
+ sort_order?: number;
22542
+ tenant_id?: string;
22543
+ unit?: string;
22544
+ updated_at?: string;
22545
+ };
22546
+ Relationships: [{
22547
+ foreignKeyName: "product_bom_items_component_product_id_fkey";
22548
+ columns: ["component_product_id"];
22549
+ isOneToOne: false;
22550
+ referencedRelation: "products";
22551
+ referencedColumns: ["id"];
22552
+ }, {
22553
+ foreignKeyName: "product_bom_items_parent_product_id_fkey";
22554
+ columns: ["parent_product_id"];
22555
+ isOneToOne: false;
22556
+ referencedRelation: "products";
22557
+ referencedColumns: ["id"];
22558
+ }];
22559
+ };
21028
22560
  product_categories: {
21029
22561
  Row: {
21030
22562
  color: string;
@@ -21130,6 +22662,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21130
22662
  id: string;
21131
22663
  product_group_id: string;
21132
22664
  quantity: number;
22665
+ sort_order: number;
21133
22666
  trade_item_id: string;
21134
22667
  };
21135
22668
  Insert: {
@@ -21137,6 +22670,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21137
22670
  id?: string;
21138
22671
  product_group_id: string;
21139
22672
  quantity?: number;
22673
+ sort_order?: number;
21140
22674
  trade_item_id: string;
21141
22675
  };
21142
22676
  Update: {
@@ -21144,6 +22678,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21144
22678
  id?: string;
21145
22679
  product_group_id?: string;
21146
22680
  quantity?: number;
22681
+ sort_order?: number;
21147
22682
  trade_item_id?: string;
21148
22683
  };
21149
22684
  Relationships: [{
@@ -21158,6 +22693,8 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21158
22693
  Row: {
21159
22694
  created_at: string;
21160
22695
  description: string | null;
22696
+ head_product_id: string | null;
22697
+ head_trade_item_floriday_id: string | null;
21161
22698
  id: string;
21162
22699
  is_active: boolean;
21163
22700
  name: string;
@@ -21167,6 +22704,8 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21167
22704
  Insert: {
21168
22705
  created_at?: string;
21169
22706
  description?: string | null;
22707
+ head_product_id?: string | null;
22708
+ head_trade_item_floriday_id?: string | null;
21170
22709
  id?: string;
21171
22710
  is_active?: boolean;
21172
22711
  name: string;
@@ -21176,24 +22715,134 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21176
22715
  Update: {
21177
22716
  created_at?: string;
21178
22717
  description?: string | null;
22718
+ head_product_id?: string | null;
22719
+ head_trade_item_floriday_id?: string | null;
21179
22720
  id?: string;
21180
22721
  is_active?: boolean;
21181
22722
  name?: string;
21182
22723
  tenant_id?: string;
21183
22724
  updated_at?: string;
21184
22725
  };
22726
+ Relationships: [{
22727
+ foreignKeyName: "product_groups_head_product_id_fkey";
22728
+ columns: ["head_product_id"];
22729
+ isOneToOne: false;
22730
+ referencedRelation: "products";
22731
+ referencedColumns: ["id"];
22732
+ }];
22733
+ };
22734
+ product_load_settings: {
22735
+ Row: {
22736
+ created_at: string;
22737
+ id: string;
22738
+ is_package: boolean;
22739
+ label: string | null;
22740
+ layers_per_load_carrier: number | null;
22741
+ load_carrier: string | null;
22742
+ package_id: string | null;
22743
+ package_label: string | null;
22744
+ packages_per_layer: number | null;
22745
+ packing_configuration_id: string;
22746
+ product_id: string | null;
22747
+ tenant_id: string;
22748
+ trade_item_floriday_id: string | null;
22749
+ units_per_package: number | null;
22750
+ updated_at: string;
22751
+ };
22752
+ Insert: {
22753
+ created_at?: string;
22754
+ id?: string;
22755
+ is_package?: boolean;
22756
+ label?: string | null;
22757
+ layers_per_load_carrier?: number | null;
22758
+ load_carrier?: string | null;
22759
+ package_id?: string | null;
22760
+ package_label?: string | null;
22761
+ packages_per_layer?: number | null;
22762
+ packing_configuration_id?: string;
22763
+ product_id?: string | null;
22764
+ tenant_id: string;
22765
+ trade_item_floriday_id?: string | null;
22766
+ units_per_package?: number | null;
22767
+ updated_at?: string;
22768
+ };
22769
+ Update: {
22770
+ created_at?: string;
22771
+ id?: string;
22772
+ is_package?: boolean;
22773
+ label?: string | null;
22774
+ layers_per_load_carrier?: number | null;
22775
+ load_carrier?: string | null;
22776
+ package_id?: string | null;
22777
+ package_label?: string | null;
22778
+ packages_per_layer?: number | null;
22779
+ packing_configuration_id?: string;
22780
+ product_id?: string | null;
22781
+ tenant_id?: string;
22782
+ trade_item_floriday_id?: string | null;
22783
+ units_per_package?: number | null;
22784
+ updated_at?: string;
22785
+ };
22786
+ Relationships: [{
22787
+ foreignKeyName: "product_load_settings_package_id_fkey";
22788
+ columns: ["package_id"];
22789
+ isOneToOne: false;
22790
+ referencedRelation: "packages";
22791
+ referencedColumns: ["id"];
22792
+ }, {
22793
+ foreignKeyName: "product_load_settings_product_id_fkey";
22794
+ columns: ["product_id"];
22795
+ isOneToOne: false;
22796
+ referencedRelation: "products";
22797
+ referencedColumns: ["id"];
22798
+ }];
22799
+ };
22800
+ product_merge_log: {
22801
+ Row: {
22802
+ canonical_product_id: string | null;
22803
+ id: string;
22804
+ merged_at: string;
22805
+ merged_from_id: string;
22806
+ notes: string | null;
22807
+ snapshot: import("../integrations/supabase/types").Json;
22808
+ source_table: string;
22809
+ status: string;
22810
+ };
22811
+ Insert: {
22812
+ canonical_product_id?: string | null;
22813
+ id?: string;
22814
+ merged_at?: string;
22815
+ merged_from_id: string;
22816
+ notes?: string | null;
22817
+ snapshot?: import("../integrations/supabase/types").Json;
22818
+ source_table: string;
22819
+ status?: string;
22820
+ };
22821
+ Update: {
22822
+ canonical_product_id?: string | null;
22823
+ id?: string;
22824
+ merged_at?: string;
22825
+ merged_from_id?: string;
22826
+ notes?: string | null;
22827
+ snapshot?: import("../integrations/supabase/types").Json;
22828
+ source_table?: string;
22829
+ status?: string;
22830
+ };
21185
22831
  Relationships: [];
21186
22832
  };
21187
22833
  products: {
21188
22834
  Row: {
22835
+ article_number: string | null;
21189
22836
  barcode: string | null;
21190
22837
  batch: string;
21191
22838
  crates_per_layer: number;
21192
22839
  created_at: string;
21193
22840
  custom_fields: import("../integrations/supabase/types").Json;
22841
+ floriday_trade_item_id: string | null;
21194
22842
  id: string;
21195
22843
  image_url: string | null;
21196
22844
  incoming_quantity: number;
22845
+ is_layer: boolean;
21197
22846
  layers_per_cart: number;
21198
22847
  location: string;
21199
22848
  min_quantity: number;
@@ -21209,14 +22858,17 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21209
22858
  weight: string | null;
21210
22859
  };
21211
22860
  Insert: {
22861
+ article_number?: string | null;
21212
22862
  barcode?: string | null;
21213
22863
  batch: string;
21214
22864
  crates_per_layer?: number;
21215
22865
  created_at?: string;
21216
22866
  custom_fields?: import("../integrations/supabase/types").Json;
22867
+ floriday_trade_item_id?: string | null;
21217
22868
  id?: string;
21218
22869
  image_url?: string | null;
21219
22870
  incoming_quantity?: number;
22871
+ is_layer?: boolean;
21220
22872
  layers_per_cart?: number;
21221
22873
  location: string;
21222
22874
  min_quantity?: number;
@@ -21232,14 +22884,17 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21232
22884
  weight?: string | null;
21233
22885
  };
21234
22886
  Update: {
22887
+ article_number?: string | null;
21235
22888
  barcode?: string | null;
21236
22889
  batch?: string;
21237
22890
  crates_per_layer?: number;
21238
22891
  created_at?: string;
21239
22892
  custom_fields?: import("../integrations/supabase/types").Json;
22893
+ floriday_trade_item_id?: string | null;
21240
22894
  id?: string;
21241
22895
  image_url?: string | null;
21242
22896
  incoming_quantity?: number;
22897
+ is_layer?: boolean;
21243
22898
  layers_per_cart?: number;
21244
22899
  location?: string;
21245
22900
  min_quantity?: number;
@@ -21259,6 +22914,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21259
22914
  profiles: {
21260
22915
  Row: {
21261
22916
  address: string | null;
22917
+ avatar_url: string | null;
21262
22918
  created_at: string;
21263
22919
  display_name: string | null;
21264
22920
  email: string | null;
@@ -21270,6 +22926,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21270
22926
  };
21271
22927
  Insert: {
21272
22928
  address?: string | null;
22929
+ avatar_url?: string | null;
21273
22930
  created_at?: string;
21274
22931
  display_name?: string | null;
21275
22932
  email?: string | null;
@@ -21281,6 +22938,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
21281
22938
  };
21282
22939
  Update: {
21283
22940
  address?: string | null;
22941
+ avatar_url?: string | null;
21284
22942
  created_at?: string;
21285
22943
  display_name?: string | null;
21286
22944
  email?: string | null;
@@ -22147,6 +23805,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
22147
23805
  order_source: string | null;
22148
23806
  physical_after: number | null;
22149
23807
  physical_before: number | null;
23808
+ production_batch_id: string | null;
22150
23809
  qty_delta: number;
22151
23810
  reason: string | null;
22152
23811
  reserved_after: number | null;
@@ -22164,6 +23823,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
22164
23823
  order_source?: string | null;
22165
23824
  physical_after?: number | null;
22166
23825
  physical_before?: number | null;
23826
+ production_batch_id?: string | null;
22167
23827
  qty_delta: number;
22168
23828
  reason?: string | null;
22169
23829
  reserved_after?: number | null;
@@ -22181,6 +23841,7 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
22181
23841
  order_source?: string | null;
22182
23842
  physical_after?: number | null;
22183
23843
  physical_before?: number | null;
23844
+ production_batch_id?: string | null;
22184
23845
  qty_delta?: number;
22185
23846
  reason?: string | null;
22186
23847
  reserved_after?: number | null;
@@ -22507,6 +24168,48 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
22507
24168
  };
22508
24169
  Relationships: [];
22509
24170
  };
24171
+ trade_item_prices: {
24172
+ Row: {
24173
+ created_at: string;
24174
+ currency: string;
24175
+ id: string;
24176
+ last_push_error: string | null;
24177
+ last_pushed_at: string | null;
24178
+ price_group_id: string | null;
24179
+ price_per_piece: number;
24180
+ supply_line_id: string | null;
24181
+ trade_item_key: string;
24182
+ updated_at: string;
24183
+ user_id: string;
24184
+ };
24185
+ Insert: {
24186
+ created_at?: string;
24187
+ currency?: string;
24188
+ id?: string;
24189
+ last_push_error?: string | null;
24190
+ last_pushed_at?: string | null;
24191
+ price_group_id?: string | null;
24192
+ price_per_piece: number;
24193
+ supply_line_id?: string | null;
24194
+ trade_item_key: string;
24195
+ updated_at?: string;
24196
+ user_id: string;
24197
+ };
24198
+ Update: {
24199
+ created_at?: string;
24200
+ currency?: string;
24201
+ id?: string;
24202
+ last_push_error?: string | null;
24203
+ last_pushed_at?: string | null;
24204
+ price_group_id?: string | null;
24205
+ price_per_piece?: number;
24206
+ supply_line_id?: string | null;
24207
+ trade_item_key?: string;
24208
+ updated_at?: string;
24209
+ user_id?: string;
24210
+ };
24211
+ Relationships: [];
24212
+ };
22510
24213
  trade_item_stock: {
22511
24214
  Row: {
22512
24215
  connection_id: string;
@@ -22972,6 +24675,51 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
22972
24675
  referencedColumns: ["id"];
22973
24676
  }];
22974
24677
  };
24678
+ twinfield_invoice_pdf_cache: {
24679
+ Row: {
24680
+ connection_id: string;
24681
+ created_at: string;
24682
+ fetched_at: string;
24683
+ id: string;
24684
+ invoice_number: string;
24685
+ last_accessed_at: string;
24686
+ object_path: string;
24687
+ office_code: string;
24688
+ size_bytes: number;
24689
+ updated_at: string;
24690
+ };
24691
+ Insert: {
24692
+ connection_id: string;
24693
+ created_at?: string;
24694
+ fetched_at?: string;
24695
+ id?: string;
24696
+ invoice_number: string;
24697
+ last_accessed_at?: string;
24698
+ object_path: string;
24699
+ office_code: string;
24700
+ size_bytes?: number;
24701
+ updated_at?: string;
24702
+ };
24703
+ Update: {
24704
+ connection_id?: string;
24705
+ created_at?: string;
24706
+ fetched_at?: string;
24707
+ id?: string;
24708
+ invoice_number?: string;
24709
+ last_accessed_at?: string;
24710
+ object_path?: string;
24711
+ office_code?: string;
24712
+ size_bytes?: number;
24713
+ updated_at?: string;
24714
+ };
24715
+ Relationships: [{
24716
+ foreignKeyName: "twinfield_invoice_pdf_cache_connection_id_fkey";
24717
+ columns: ["connection_id"];
24718
+ isOneToOne: false;
24719
+ referencedRelation: "twinfield_connections";
24720
+ referencedColumns: ["id"];
24721
+ }];
24722
+ };
22975
24723
  twinfield_invoice_settings: {
22976
24724
  Row: {
22977
24725
  created_at: string;
@@ -23575,6 +25323,78 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
23575
25323
  };
23576
25324
  Relationships: [];
23577
25325
  };
25326
+ werkbon_package_ai_rules: {
25327
+ Row: {
25328
+ active: boolean;
25329
+ case_sensitive: boolean;
25330
+ created_at: string;
25331
+ id: string;
25332
+ package_id: string;
25333
+ priority: number;
25334
+ rule_type: string;
25335
+ updated_at: string;
25336
+ value: string;
25337
+ };
25338
+ Insert: {
25339
+ active?: boolean;
25340
+ case_sensitive?: boolean;
25341
+ created_at?: string;
25342
+ id?: string;
25343
+ package_id: string;
25344
+ priority?: number;
25345
+ rule_type: string;
25346
+ updated_at?: string;
25347
+ value: string;
25348
+ };
25349
+ Update: {
25350
+ active?: boolean;
25351
+ case_sensitive?: boolean;
25352
+ created_at?: string;
25353
+ id?: string;
25354
+ package_id?: string;
25355
+ priority?: number;
25356
+ rule_type?: string;
25357
+ updated_at?: string;
25358
+ value?: string;
25359
+ };
25360
+ Relationships: [{
25361
+ foreignKeyName: "werkbon_package_ai_rules_package_id_fkey";
25362
+ columns: ["package_id"];
25363
+ isOneToOne: false;
25364
+ referencedRelation: "werkbon_packages";
25365
+ referencedColumns: ["id"];
25366
+ }];
25367
+ };
25368
+ werkbon_package_categories: {
25369
+ Row: {
25370
+ active: boolean;
25371
+ created_at: string;
25372
+ id: string;
25373
+ kleur: string | null;
25374
+ naam: string;
25375
+ sort_order: number;
25376
+ updated_at: string;
25377
+ };
25378
+ Insert: {
25379
+ active?: boolean;
25380
+ created_at?: string;
25381
+ id?: string;
25382
+ kleur?: string | null;
25383
+ naam: string;
25384
+ sort_order?: number;
25385
+ updated_at?: string;
25386
+ };
25387
+ Update: {
25388
+ active?: boolean;
25389
+ created_at?: string;
25390
+ id?: string;
25391
+ kleur?: string | null;
25392
+ naam?: string;
25393
+ sort_order?: number;
25394
+ updated_at?: string;
25395
+ };
25396
+ Relationships: [];
25397
+ };
23578
25398
  werkbon_package_lines: {
23579
25399
  Row: {
23580
25400
  created_at: string;
@@ -23620,38 +25440,59 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
23620
25440
  werkbon_packages: {
23621
25441
  Row: {
23622
25442
  active: boolean;
25443
+ ai_tags: string[];
25444
+ category_id: string | null;
23623
25445
  code: string;
23624
25446
  created_at: string;
23625
25447
  default_quantity: number;
23626
25448
  description: string | null;
25449
+ duration_minutes: number | null;
23627
25450
  id: string;
25451
+ mandaat_type: string | null;
23628
25452
  name: string;
25453
+ sort_order: number;
23629
25454
  unit_price_cents: number;
23630
25455
  updated_at: string;
23631
25456
  };
23632
25457
  Insert: {
23633
25458
  active?: boolean;
25459
+ ai_tags?: string[];
25460
+ category_id?: string | null;
23634
25461
  code: string;
23635
25462
  created_at?: string;
23636
25463
  default_quantity?: number;
23637
25464
  description?: string | null;
25465
+ duration_minutes?: number | null;
23638
25466
  id?: string;
25467
+ mandaat_type?: string | null;
23639
25468
  name: string;
25469
+ sort_order?: number;
23640
25470
  unit_price_cents?: number;
23641
25471
  updated_at?: string;
23642
25472
  };
23643
25473
  Update: {
23644
25474
  active?: boolean;
25475
+ ai_tags?: string[];
25476
+ category_id?: string | null;
23645
25477
  code?: string;
23646
25478
  created_at?: string;
23647
25479
  default_quantity?: number;
23648
25480
  description?: string | null;
25481
+ duration_minutes?: number | null;
23649
25482
  id?: string;
25483
+ mandaat_type?: string | null;
23650
25484
  name?: string;
25485
+ sort_order?: number;
23651
25486
  unit_price_cents?: number;
23652
25487
  updated_at?: string;
23653
25488
  };
23654
- Relationships: [];
25489
+ Relationships: [{
25490
+ foreignKeyName: "werkbon_packages_category_id_fkey";
25491
+ columns: ["category_id"];
25492
+ isOneToOne: false;
25493
+ referencedRelation: "werkbon_package_categories";
25494
+ referencedColumns: ["id"];
25495
+ }];
23655
25496
  };
23656
25497
  werkbon_photos: {
23657
25498
  Row: {
@@ -23739,7 +25580,10 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
23739
25580
  scheduled_end_time: string | null;
23740
25581
  scheduled_start_time: string | null;
23741
25582
  sequence_number: number;
25583
+ source_email_meta: import("../integrations/supabase/types").Json | null;
25584
+ source_mailbox_message_id: string | null;
23742
25585
  source_pdf_path: string | null;
25586
+ source_type: string;
23743
25587
  status: string;
23744
25588
  technician_id: string | null;
23745
25589
  technician_notes: string | null;
@@ -23768,7 +25612,10 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
23768
25612
  scheduled_end_time?: string | null;
23769
25613
  scheduled_start_time?: string | null;
23770
25614
  sequence_number: number;
25615
+ source_email_meta?: import("../integrations/supabase/types").Json | null;
25616
+ source_mailbox_message_id?: string | null;
23771
25617
  source_pdf_path?: string | null;
25618
+ source_type?: string;
23772
25619
  status?: string;
23773
25620
  technician_id?: string | null;
23774
25621
  technician_notes?: string | null;
@@ -23797,7 +25644,10 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
23797
25644
  scheduled_end_time?: string | null;
23798
25645
  scheduled_start_time?: string | null;
23799
25646
  sequence_number?: number;
25647
+ source_email_meta?: import("../integrations/supabase/types").Json | null;
25648
+ source_mailbox_message_id?: string | null;
23800
25649
  source_pdf_path?: string | null;
25650
+ source_type?: string;
23801
25651
  status?: string;
23802
25652
  technician_id?: string | null;
23803
25653
  technician_notes?: string | null;
@@ -23814,10 +25664,10 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
23814
25664
  referencedRelation: "werkbonnen";
23815
25665
  referencedColumns: ["id"];
23816
25666
  }, {
23817
- foreignKeyName: "werkbonnen_technician_id_fkey";
23818
- columns: ["technician_id"];
25667
+ foreignKeyName: "werkbonnen_source_mailbox_message_id_fkey";
25668
+ columns: ["source_mailbox_message_id"];
23819
25669
  isOneToOne: false;
23820
- referencedRelation: "monteurs";
25670
+ referencedRelation: "mailbox_messages";
23821
25671
  referencedColumns: ["id"];
23822
25672
  }];
23823
25673
  };
@@ -24511,6 +26361,13 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
24511
26361
  };
24512
26362
  Returns: number;
24513
26363
  };
26364
+ _migrate_rewrite_stock_key: {
26365
+ Args: {
26366
+ _from_key: string;
26367
+ _to_key: string;
26368
+ };
26369
+ Returns: undefined;
26370
+ };
24514
26371
  afh_city_code: {
24515
26372
  Args: {
24516
26373
  _city: string;
@@ -24537,6 +26394,21 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
24537
26394
  };
24538
26395
  Returns: string;
24539
26396
  };
26397
+ ai_usage_by_module: {
26398
+ Args: {
26399
+ _from: string;
26400
+ _to: string;
26401
+ };
26402
+ Returns: {
26403
+ calls: number;
26404
+ consumer_module_id: string;
26405
+ cost_usd: number;
26406
+ errors: number;
26407
+ input_tokens: number;
26408
+ output_tokens: number;
26409
+ total_tokens: number;
26410
+ }[];
26411
+ };
24540
26412
  apply_stock_consumption: {
24541
26413
  Args: {
24542
26414
  p_order_id: string;
@@ -24594,6 +26466,12 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
24594
26466
  processed_items: number;
24595
26467
  }[];
24596
26468
  };
26469
+ calculate_layer_stock: {
26470
+ Args: {
26471
+ p_product_id: string;
26472
+ };
26473
+ Returns: number;
26474
+ };
24597
26475
  call_exact_route: {
24598
26476
  Args: {
24599
26477
  path: string;
@@ -24653,6 +26531,28 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
24653
26531
  Args: never;
24654
26532
  Returns: undefined;
24655
26533
  };
26534
+ consume_bom_for_production: {
26535
+ Args: {
26536
+ p_connection_id: string;
26537
+ p_parent_id: string;
26538
+ p_parent_key: string;
26539
+ p_parent_kind: string;
26540
+ p_quantity: number;
26541
+ p_user_id: string;
26542
+ };
26543
+ Returns: import("../integrations/supabase/types").Json;
26544
+ } | {
26545
+ Args: {
26546
+ p_batch_id?: string;
26547
+ p_connection_id: string;
26548
+ p_parent_id: string;
26549
+ p_parent_key: string;
26550
+ p_parent_kind: string;
26551
+ p_quantity: number;
26552
+ p_user_id: string;
26553
+ };
26554
+ Returns: import("../integrations/supabase/types").Json;
26555
+ };
24656
26556
  consume_floriday_rate_limit: {
24657
26557
  Args: {
24658
26558
  p_bucket: string;
@@ -24685,6 +26585,12 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
24685
26585
  Args: never;
24686
26586
  Returns: string;
24687
26587
  };
26588
+ custom_access_token_hook: {
26589
+ Args: {
26590
+ event: import("../integrations/supabase/types").Json;
26591
+ };
26592
+ Returns: import("../integrations/supabase/types").Json;
26593
+ };
24688
26594
  dashboard_alert_counts: {
24689
26595
  Args: never;
24690
26596
  Returns: import("../integrations/supabase/types").Json;
@@ -24704,6 +26610,13 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
24704
26610
  table_name: string;
24705
26611
  }[];
24706
26612
  };
26613
+ delete_samenstelling: {
26614
+ Args: {
26615
+ p_parent_id: string;
26616
+ p_parent_kind: string;
26617
+ };
26618
+ Returns: import("../integrations/supabase/types").Json;
26619
+ };
24707
26620
  dispatch_carrier_signups_sql: {
24708
26621
  Args: {
24709
26622
  _catchup?: string;
@@ -24959,6 +26872,27 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
24959
26872
  minutes_since_success: number;
24960
26873
  }[];
24961
26874
  };
26875
+ get_group_allocation_keys: {
26876
+ Args: {
26877
+ p_product_id: string;
26878
+ };
26879
+ Returns: {
26880
+ k: string;
26881
+ ord: number;
26882
+ }[];
26883
+ };
26884
+ get_group_head_key: {
26885
+ Args: {
26886
+ p_group_id: string;
26887
+ };
26888
+ Returns: string;
26889
+ };
26890
+ get_inventory_stock_for_key: {
26891
+ Args: {
26892
+ p_key: string;
26893
+ };
26894
+ Returns: number;
26895
+ };
24962
26896
  get_offer_by_link_code: {
24963
26897
  Args: {
24964
26898
  p_code: string;
@@ -24989,6 +26923,12 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
24989
26923
  };
24990
26924
  Returns: string;
24991
26925
  };
26926
+ get_product_group_available_stock: {
26927
+ Args: {
26928
+ p_group_id: string;
26929
+ };
26930
+ Returns: number;
26931
+ };
24992
26932
  get_room_busy_windows: {
24993
26933
  Args: {
24994
26934
  p_from: string;
@@ -25053,12 +26993,35 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25053
26993
  };
25054
26994
  Returns: boolean;
25055
26995
  };
26996
+ jwt_has_role: {
26997
+ Args: {
26998
+ _role: import("../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
26999
+ };
27000
+ Returns: boolean;
27001
+ };
25056
27002
  list_monteurs: {
25057
27003
  Args: never;
25058
27004
  Returns: {
27005
+ avatar_url: string;
25059
27006
  display_name: string;
25060
27007
  email: string;
25061
- user_id: string;
27008
+ id: string;
27009
+ }[];
27010
+ };
27011
+ list_my_planning_items: {
27012
+ Args: {
27013
+ _from: string;
27014
+ _to: string;
27015
+ };
27016
+ Returns: {
27017
+ assigned_monteur_id: string;
27018
+ end_at: string;
27019
+ id: string;
27020
+ notes: string;
27021
+ role: string;
27022
+ start_at: string;
27023
+ status: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
27024
+ werkbon_id: string;
25062
27025
  }[];
25063
27026
  };
25064
27027
  local_effective_price: {
@@ -25077,6 +27040,22 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25077
27040
  source_id: string;
25078
27041
  }[];
25079
27042
  };
27043
+ log_ai_call: {
27044
+ Args: {
27045
+ _consumer_module_id: string;
27046
+ _cost_usd: number;
27047
+ _duration_ms: number;
27048
+ _error_code: string;
27049
+ _error_message: string;
27050
+ _input_tokens: number;
27051
+ _model_slug: string;
27052
+ _output_tokens: number;
27053
+ _provider_slug: string;
27054
+ _status: string;
27055
+ _total_tokens: number;
27056
+ };
27057
+ Returns: string;
27058
+ };
25080
27059
  mark_offer_clicked: {
25081
27060
  Args: {
25082
27061
  p_code: string;
@@ -25089,12 +27068,32 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25089
27068
  };
25090
27069
  Returns: undefined;
25091
27070
  };
27071
+ mark_salesorder_controlled: {
27072
+ Args: {
27073
+ p_controlled: boolean;
27074
+ p_floriday_id: string;
27075
+ };
27076
+ Returns: undefined;
27077
+ };
25092
27078
  mark_shipment_shipped: {
25093
27079
  Args: {
25094
27080
  p_shipment_id: string;
25095
27081
  };
25096
27082
  Returns: undefined;
25097
27083
  };
27084
+ merge_products: {
27085
+ Args: {
27086
+ _canonical: string;
27087
+ _loser: string;
27088
+ };
27089
+ Returns: undefined;
27090
+ };
27091
+ next_manufacture_partij: {
27092
+ Args: {
27093
+ _tenant_id: string;
27094
+ };
27095
+ Returns: string;
27096
+ };
25098
27097
  next_order_number: {
25099
27098
  Args: {
25100
27099
  p_prefix: string;
@@ -25168,6 +27167,15 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25168
27167
  };
25169
27168
  Returns: undefined;
25170
27169
  };
27170
+ pickstation_resolve_delivery_orders: {
27171
+ Args: {
27172
+ p_sales_order_ids: string[];
27173
+ };
27174
+ Returns: {
27175
+ delivery_order_id: string;
27176
+ sales_order_id: string;
27177
+ }[];
27178
+ };
25171
27179
  pickstation_set_cart_status: {
25172
27180
  Args: {
25173
27181
  p_cart_index: number;
@@ -25177,6 +27185,14 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25177
27185
  };
25178
27186
  Returns: undefined;
25179
27187
  };
27188
+ produce_designed_product: {
27189
+ Args: {
27190
+ p_parent_id: string;
27191
+ p_parent_kind: string;
27192
+ p_quantity: number;
27193
+ };
27194
+ Returns: import("../integrations/supabase/types").Json;
27195
+ };
25180
27196
  promote_trade_item_key: {
25181
27197
  Args: {
25182
27198
  p_new: string;
@@ -25184,6 +27200,10 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25184
27200
  };
25185
27201
  Returns: undefined;
25186
27202
  };
27203
+ recompute_all_reserved_stock: {
27204
+ Args: never;
27205
+ Returns: undefined;
27206
+ };
25187
27207
  recompute_order_status: {
25188
27208
  Args: {
25189
27209
  p_order_id: string;
@@ -25239,18 +27259,50 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25239
27259
  };
25240
27260
  Returns: undefined;
25241
27261
  };
27262
+ resolve_group_allocation: {
27263
+ Args: {
27264
+ _needed: number;
27265
+ _product_group_id: string;
27266
+ };
27267
+ Returns: {
27268
+ allocated: number;
27269
+ trade_item_id: string;
27270
+ }[];
27271
+ };
27272
+ resolve_group_member_stock_key: {
27273
+ Args: {
27274
+ p_trade_item_id: string;
27275
+ };
27276
+ Returns: string;
27277
+ };
25242
27278
  resolve_product_id_for_item: {
25243
27279
  Args: {
25244
27280
  p_product_name: string;
25245
27281
  };
25246
27282
  Returns: string;
25247
27283
  };
27284
+ resolve_stock_trade_item_key: {
27285
+ Args: {
27286
+ p_product_id: string;
27287
+ };
27288
+ Returns: string;
27289
+ };
25248
27290
  retry_twinfield_push: {
25249
27291
  Args: {
25250
27292
  _customer_id: string;
25251
27293
  };
25252
27294
  Returns: number;
25253
27295
  };
27296
+ reverse_production: {
27297
+ Args: {
27298
+ p_connection_id?: string;
27299
+ p_parent_key: string;
27300
+ p_quantity: number;
27301
+ p_reason?: string;
27302
+ p_user_id?: string;
27303
+ };
27304
+ Returns: import("../integrations/supabase/types").Json;
27305
+ };
25254
27306
  schedule_floriday_additional_services_sync: {
25255
27307
  Args: {
25256
27308
  p_apikey: string;
@@ -25518,6 +27570,17 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25518
27570
  };
25519
27571
  Returns: number;
25520
27572
  };
27573
+ self_heal_floriday_links: {
27574
+ Args: never;
27575
+ Returns: number;
27576
+ };
27577
+ set_planning_status: {
27578
+ Args: {
27579
+ _id: string;
27580
+ _status: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
27581
+ };
27582
+ Returns: undefined;
27583
+ };
25521
27584
  show_limit: {
25522
27585
  Args: never;
25523
27586
  Returns: number;
@@ -25528,18 +27591,34 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25528
27591
  };
25529
27592
  Returns: string[];
25530
27593
  };
27594
+ sync_all_layer_stocks: {
27595
+ Args: never;
27596
+ Returns: undefined;
27597
+ };
25531
27598
  sync_cached_packing_from_product: {
25532
27599
  Args: {
25533
27600
  p_product_id: string;
25534
27601
  };
25535
27602
  Returns: undefined;
25536
27603
  };
27604
+ sync_layer_stock: {
27605
+ Args: {
27606
+ p_product_id: string;
27607
+ };
27608
+ Returns: undefined;
27609
+ };
25537
27610
  sync_order_cart_item_packing_from_product: {
25538
27611
  Args: {
25539
27612
  p_product_id: string;
25540
27613
  };
25541
27614
  Returns: undefined;
25542
27615
  };
27616
+ sync_product_group_belading: {
27617
+ Args: {
27618
+ _group_id: string;
27619
+ };
27620
+ Returns: undefined;
27621
+ };
25543
27622
  sync_product_packing_from_floriday_cache: {
25544
27623
  Args: {
25545
27624
  p_floriday_id: string;
@@ -25571,11 +27650,12 @@ export declare const getAutoFulfillmentStatus: import("@tanstack/start-client-co
25571
27650
  };
25572
27651
  };
25573
27652
  Enums: {
25574
- app_role: "admin" | "planner" | "monteur" | "administratie";
27653
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
25575
27654
  exact_env: "staging" | "live";
25576
27655
  exact_push_status: "pending" | "sent" | "error";
25577
27656
  itk_customer_segment: "Business" | "Private";
25578
27657
  itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
27658
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd" | "concept" | "vrijgegeven";
25579
27659
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
25580
27660
  };
25581
27661
  CompositeTypes: { [_ in never]: never; };
@@ -25876,6 +27956,57 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
25876
27956
  referencedColumns: ["id"];
25877
27957
  }];
25878
27958
  };
27959
+ ai_call_log: {
27960
+ Row: {
27961
+ consumer_module_id: string;
27962
+ cost_usd: number | null;
27963
+ created_at: string;
27964
+ created_by: string | null;
27965
+ duration_ms: number | null;
27966
+ error_code: string | null;
27967
+ error_message: string | null;
27968
+ id: string;
27969
+ input_tokens: number;
27970
+ model_slug: string | null;
27971
+ output_tokens: number;
27972
+ provider_slug: string | null;
27973
+ status: string;
27974
+ total_tokens: number;
27975
+ };
27976
+ Insert: {
27977
+ consumer_module_id: string;
27978
+ cost_usd?: number | null;
27979
+ created_at?: string;
27980
+ created_by?: string | null;
27981
+ duration_ms?: number | null;
27982
+ error_code?: string | null;
27983
+ error_message?: string | null;
27984
+ id?: string;
27985
+ input_tokens?: number;
27986
+ model_slug?: string | null;
27987
+ output_tokens?: number;
27988
+ provider_slug?: string | null;
27989
+ status: string;
27990
+ total_tokens?: number;
27991
+ };
27992
+ Update: {
27993
+ consumer_module_id?: string;
27994
+ cost_usd?: number | null;
27995
+ created_at?: string;
27996
+ created_by?: string | null;
27997
+ duration_ms?: number | null;
27998
+ error_code?: string | null;
27999
+ error_message?: string | null;
28000
+ id?: string;
28001
+ input_tokens?: number;
28002
+ model_slug?: string | null;
28003
+ output_tokens?: number;
28004
+ provider_slug?: string | null;
28005
+ status?: string;
28006
+ total_tokens?: number;
28007
+ };
28008
+ Relationships: [];
28009
+ };
25879
28010
  ai_credentials: {
25880
28011
  Row: {
25881
28012
  active: boolean;
@@ -25912,6 +28043,36 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
25912
28043
  referencedColumns: ["id"];
25913
28044
  }];
25914
28045
  };
28046
+ ai_goals: {
28047
+ Row: {
28048
+ active: boolean;
28049
+ created_at: string;
28050
+ description: string | null;
28051
+ key: string;
28052
+ label: string;
28053
+ sort_order: number;
28054
+ updated_at: string;
28055
+ };
28056
+ Insert: {
28057
+ active?: boolean;
28058
+ created_at?: string;
28059
+ description?: string | null;
28060
+ key: string;
28061
+ label: string;
28062
+ sort_order?: number;
28063
+ updated_at?: string;
28064
+ };
28065
+ Update: {
28066
+ active?: boolean;
28067
+ created_at?: string;
28068
+ description?: string | null;
28069
+ key?: string;
28070
+ label?: string;
28071
+ sort_order?: number;
28072
+ updated_at?: string;
28073
+ };
28074
+ Relationships: [];
28075
+ };
25915
28076
  ai_model_pricing: {
25916
28077
  Row: {
25917
28078
  created_at: string;
@@ -32056,6 +34217,285 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
32056
34217
  };
32057
34218
  Relationships: [];
32058
34219
  };
34220
+ logistics_capacity_events: {
34221
+ Row: {
34222
+ available_carts: number;
34223
+ created_at: string;
34224
+ id: string;
34225
+ measures: import("../integrations/supabase/types").Json;
34226
+ note: string | null;
34227
+ outcome: string;
34228
+ required_carts: number;
34229
+ reserve_minutes: number;
34230
+ shortage_carts: number;
34231
+ status: string;
34232
+ user_id: string;
34233
+ };
34234
+ Insert: {
34235
+ available_carts?: number;
34236
+ created_at?: string;
34237
+ id?: string;
34238
+ measures?: import("../integrations/supabase/types").Json;
34239
+ note?: string | null;
34240
+ outcome?: string;
34241
+ required_carts?: number;
34242
+ reserve_minutes?: number;
34243
+ shortage_carts?: number;
34244
+ status: string;
34245
+ user_id: string;
34246
+ };
34247
+ Update: {
34248
+ available_carts?: number;
34249
+ created_at?: string;
34250
+ id?: string;
34251
+ measures?: import("../integrations/supabase/types").Json;
34252
+ note?: string | null;
34253
+ outcome?: string;
34254
+ required_carts?: number;
34255
+ reserve_minutes?: number;
34256
+ shortage_carts?: number;
34257
+ status?: string;
34258
+ user_id?: string;
34259
+ };
34260
+ Relationships: [];
34261
+ };
34262
+ logistics_capacity_settings: {
34263
+ Row: {
34264
+ created_at: string;
34265
+ settings: import("../integrations/supabase/types").Json;
34266
+ updated_at: string;
34267
+ user_id: string;
34268
+ };
34269
+ Insert: {
34270
+ created_at?: string;
34271
+ settings?: import("../integrations/supabase/types").Json;
34272
+ updated_at?: string;
34273
+ user_id: string;
34274
+ };
34275
+ Update: {
34276
+ created_at?: string;
34277
+ settings?: import("../integrations/supabase/types").Json;
34278
+ updated_at?: string;
34279
+ user_id?: string;
34280
+ };
34281
+ Relationships: [];
34282
+ };
34283
+ logistics_decisions: {
34284
+ Row: {
34285
+ created_at: string;
34286
+ explanation: string | null;
34287
+ id: string;
34288
+ input_snapshot: import("../integrations/supabase/types").Json;
34289
+ result: import("../integrations/supabase/types").Json;
34290
+ slot: string;
34291
+ strategy_id: string | null;
34292
+ subject_id: string;
34293
+ subject_type: string;
34294
+ user_id: string;
34295
+ };
34296
+ Insert: {
34297
+ created_at?: string;
34298
+ explanation?: string | null;
34299
+ id?: string;
34300
+ input_snapshot?: import("../integrations/supabase/types").Json;
34301
+ result?: import("../integrations/supabase/types").Json;
34302
+ slot: string;
34303
+ strategy_id?: string | null;
34304
+ subject_id: string;
34305
+ subject_type: string;
34306
+ user_id: string;
34307
+ };
34308
+ Update: {
34309
+ created_at?: string;
34310
+ explanation?: string | null;
34311
+ id?: string;
34312
+ input_snapshot?: import("../integrations/supabase/types").Json;
34313
+ result?: import("../integrations/supabase/types").Json;
34314
+ slot?: string;
34315
+ strategy_id?: string | null;
34316
+ subject_id?: string;
34317
+ subject_type?: string;
34318
+ user_id?: string;
34319
+ };
34320
+ Relationships: [{
34321
+ foreignKeyName: "logistics_decisions_strategy_id_fkey";
34322
+ columns: ["strategy_id"];
34323
+ isOneToOne: false;
34324
+ referencedRelation: "logistics_strategies";
34325
+ referencedColumns: ["id"];
34326
+ }];
34327
+ };
34328
+ logistics_formulas: {
34329
+ Row: {
34330
+ created_at: string;
34331
+ expression: string;
34332
+ id: string;
34333
+ notes: string | null;
34334
+ slot: string;
34335
+ strategy_id: string;
34336
+ updated_at: string;
34337
+ user_id: string;
34338
+ version: number;
34339
+ };
34340
+ Insert: {
34341
+ created_at?: string;
34342
+ expression?: string;
34343
+ id?: string;
34344
+ notes?: string | null;
34345
+ slot: string;
34346
+ strategy_id: string;
34347
+ updated_at?: string;
34348
+ user_id: string;
34349
+ version?: number;
34350
+ };
34351
+ Update: {
34352
+ created_at?: string;
34353
+ expression?: string;
34354
+ id?: string;
34355
+ notes?: string | null;
34356
+ slot?: string;
34357
+ strategy_id?: string;
34358
+ updated_at?: string;
34359
+ user_id?: string;
34360
+ version?: number;
34361
+ };
34362
+ Relationships: [{
34363
+ foreignKeyName: "logistics_formulas_strategy_id_fkey";
34364
+ columns: ["strategy_id"];
34365
+ isOneToOne: false;
34366
+ referencedRelation: "logistics_strategies";
34367
+ referencedColumns: ["id"];
34368
+ }];
34369
+ };
34370
+ logistics_strategies: {
34371
+ Row: {
34372
+ color: string;
34373
+ created_at: string;
34374
+ description: string | null;
34375
+ id: string;
34376
+ is_active: boolean;
34377
+ name: string;
34378
+ priority: number;
34379
+ updated_at: string;
34380
+ updated_by: string | null;
34381
+ user_id: string;
34382
+ version: number;
34383
+ };
34384
+ Insert: {
34385
+ color?: string;
34386
+ created_at?: string;
34387
+ description?: string | null;
34388
+ id?: string;
34389
+ is_active?: boolean;
34390
+ name: string;
34391
+ priority?: number;
34392
+ updated_at?: string;
34393
+ updated_by?: string | null;
34394
+ user_id: string;
34395
+ version?: number;
34396
+ };
34397
+ Update: {
34398
+ color?: string;
34399
+ created_at?: string;
34400
+ description?: string | null;
34401
+ id?: string;
34402
+ is_active?: boolean;
34403
+ name?: string;
34404
+ priority?: number;
34405
+ updated_at?: string;
34406
+ updated_by?: string | null;
34407
+ user_id?: string;
34408
+ version?: number;
34409
+ };
34410
+ Relationships: [];
34411
+ };
34412
+ logistics_strategy_schedules: {
34413
+ Row: {
34414
+ condition_expression: string | null;
34415
+ created_at: string;
34416
+ end_date: string | null;
34417
+ id: string;
34418
+ is_enabled: boolean;
34419
+ priority: number;
34420
+ rule_type: string;
34421
+ start_date: string | null;
34422
+ strategy_id: string;
34423
+ updated_at: string;
34424
+ user_id: string;
34425
+ };
34426
+ Insert: {
34427
+ condition_expression?: string | null;
34428
+ created_at?: string;
34429
+ end_date?: string | null;
34430
+ id?: string;
34431
+ is_enabled?: boolean;
34432
+ priority?: number;
34433
+ rule_type: string;
34434
+ start_date?: string | null;
34435
+ strategy_id: string;
34436
+ updated_at?: string;
34437
+ user_id: string;
34438
+ };
34439
+ Update: {
34440
+ condition_expression?: string | null;
34441
+ created_at?: string;
34442
+ end_date?: string | null;
34443
+ id?: string;
34444
+ is_enabled?: boolean;
34445
+ priority?: number;
34446
+ rule_type?: string;
34447
+ start_date?: string | null;
34448
+ strategy_id?: string;
34449
+ updated_at?: string;
34450
+ user_id?: string;
34451
+ };
34452
+ Relationships: [{
34453
+ foreignKeyName: "logistics_strategy_schedules_strategy_id_fkey";
34454
+ columns: ["strategy_id"];
34455
+ isOneToOne: false;
34456
+ referencedRelation: "logistics_strategies";
34457
+ referencedColumns: ["id"];
34458
+ }];
34459
+ };
34460
+ logistics_variables: {
34461
+ Row: {
34462
+ created_at: string;
34463
+ default_value: string | null;
34464
+ description: string | null;
34465
+ id: string;
34466
+ is_builtin: boolean;
34467
+ key: string;
34468
+ label: string;
34469
+ updated_at: string;
34470
+ user_id: string;
34471
+ value_type: string;
34472
+ };
34473
+ Insert: {
34474
+ created_at?: string;
34475
+ default_value?: string | null;
34476
+ description?: string | null;
34477
+ id?: string;
34478
+ is_builtin?: boolean;
34479
+ key: string;
34480
+ label: string;
34481
+ updated_at?: string;
34482
+ user_id: string;
34483
+ value_type: string;
34484
+ };
34485
+ Update: {
34486
+ created_at?: string;
34487
+ default_value?: string | null;
34488
+ description?: string | null;
34489
+ id?: string;
34490
+ is_builtin?: boolean;
34491
+ key?: string;
34492
+ label?: string;
34493
+ updated_at?: string;
34494
+ user_id?: string;
34495
+ value_type?: string;
34496
+ };
34497
+ Relationships: [];
34498
+ };
32059
34499
  mailbox_messages: {
32060
34500
  Row: {
32061
34501
  body_html: string | null;
@@ -33829,6 +36269,138 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
33829
36269
  };
33830
36270
  Relationships: [];
33831
36271
  };
36272
+ planning_item_assistants: {
36273
+ Row: {
36274
+ created_at: string;
36275
+ created_by: string | null;
36276
+ monteur_id: string;
36277
+ planning_item_id: string;
36278
+ };
36279
+ Insert: {
36280
+ created_at?: string;
36281
+ created_by?: string | null;
36282
+ monteur_id: string;
36283
+ planning_item_id: string;
36284
+ };
36285
+ Update: {
36286
+ created_at?: string;
36287
+ created_by?: string | null;
36288
+ monteur_id?: string;
36289
+ planning_item_id?: string;
36290
+ };
36291
+ Relationships: [{
36292
+ foreignKeyName: "planning_item_assistants_planning_item_id_fkey";
36293
+ columns: ["planning_item_id"];
36294
+ isOneToOne: false;
36295
+ referencedRelation: "planning_items";
36296
+ referencedColumns: ["id"];
36297
+ }];
36298
+ };
36299
+ planning_items: {
36300
+ Row: {
36301
+ assigned_monteur_id: string;
36302
+ created_at: string;
36303
+ created_by: string | null;
36304
+ end_at: string;
36305
+ id: string;
36306
+ notes: string | null;
36307
+ start_at: string;
36308
+ status: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
36309
+ updated_at: string;
36310
+ werkbon_id: string;
36311
+ };
36312
+ Insert: {
36313
+ assigned_monteur_id: string;
36314
+ created_at?: string;
36315
+ created_by?: string | null;
36316
+ end_at: string;
36317
+ id?: string;
36318
+ notes?: string | null;
36319
+ start_at: string;
36320
+ status?: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
36321
+ updated_at?: string;
36322
+ werkbon_id: string;
36323
+ };
36324
+ Update: {
36325
+ assigned_monteur_id?: string;
36326
+ created_at?: string;
36327
+ created_by?: string | null;
36328
+ end_at?: string;
36329
+ id?: string;
36330
+ notes?: string | null;
36331
+ start_at?: string;
36332
+ status?: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
36333
+ updated_at?: string;
36334
+ werkbon_id?: string;
36335
+ };
36336
+ Relationships: [{
36337
+ foreignKeyName: "planning_items_werkbon_id_fkey";
36338
+ columns: ["werkbon_id"];
36339
+ isOneToOne: false;
36340
+ referencedRelation: "werkbonnen";
36341
+ referencedColumns: ["id"];
36342
+ }];
36343
+ };
36344
+ product_bom_items: {
36345
+ Row: {
36346
+ component_product_id: string | null;
36347
+ component_trade_item_floriday_id: string | null;
36348
+ created_at: string;
36349
+ id: string;
36350
+ notes: string | null;
36351
+ packing_configuration_id: string | null;
36352
+ parent_product_id: string | null;
36353
+ parent_trade_item_floriday_id: string | null;
36354
+ quantity: number;
36355
+ sort_order: number;
36356
+ tenant_id: string;
36357
+ unit: string;
36358
+ updated_at: string;
36359
+ };
36360
+ Insert: {
36361
+ component_product_id?: string | null;
36362
+ component_trade_item_floriday_id?: string | null;
36363
+ created_at?: string;
36364
+ id?: string;
36365
+ notes?: string | null;
36366
+ packing_configuration_id?: string | null;
36367
+ parent_product_id?: string | null;
36368
+ parent_trade_item_floriday_id?: string | null;
36369
+ quantity?: number;
36370
+ sort_order?: number;
36371
+ tenant_id: string;
36372
+ unit?: string;
36373
+ updated_at?: string;
36374
+ };
36375
+ Update: {
36376
+ component_product_id?: string | null;
36377
+ component_trade_item_floriday_id?: string | null;
36378
+ created_at?: string;
36379
+ id?: string;
36380
+ notes?: string | null;
36381
+ packing_configuration_id?: string | null;
36382
+ parent_product_id?: string | null;
36383
+ parent_trade_item_floriday_id?: string | null;
36384
+ quantity?: number;
36385
+ sort_order?: number;
36386
+ tenant_id?: string;
36387
+ unit?: string;
36388
+ updated_at?: string;
36389
+ };
36390
+ Relationships: [{
36391
+ foreignKeyName: "product_bom_items_component_product_id_fkey";
36392
+ columns: ["component_product_id"];
36393
+ isOneToOne: false;
36394
+ referencedRelation: "products";
36395
+ referencedColumns: ["id"];
36396
+ }, {
36397
+ foreignKeyName: "product_bom_items_parent_product_id_fkey";
36398
+ columns: ["parent_product_id"];
36399
+ isOneToOne: false;
36400
+ referencedRelation: "products";
36401
+ referencedColumns: ["id"];
36402
+ }];
36403
+ };
33832
36404
  product_categories: {
33833
36405
  Row: {
33834
36406
  color: string;
@@ -33934,6 +36506,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
33934
36506
  id: string;
33935
36507
  product_group_id: string;
33936
36508
  quantity: number;
36509
+ sort_order: number;
33937
36510
  trade_item_id: string;
33938
36511
  };
33939
36512
  Insert: {
@@ -33941,6 +36514,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
33941
36514
  id?: string;
33942
36515
  product_group_id: string;
33943
36516
  quantity?: number;
36517
+ sort_order?: number;
33944
36518
  trade_item_id: string;
33945
36519
  };
33946
36520
  Update: {
@@ -33948,6 +36522,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
33948
36522
  id?: string;
33949
36523
  product_group_id?: string;
33950
36524
  quantity?: number;
36525
+ sort_order?: number;
33951
36526
  trade_item_id?: string;
33952
36527
  };
33953
36528
  Relationships: [{
@@ -33962,6 +36537,8 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
33962
36537
  Row: {
33963
36538
  created_at: string;
33964
36539
  description: string | null;
36540
+ head_product_id: string | null;
36541
+ head_trade_item_floriday_id: string | null;
33965
36542
  id: string;
33966
36543
  is_active: boolean;
33967
36544
  name: string;
@@ -33971,6 +36548,8 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
33971
36548
  Insert: {
33972
36549
  created_at?: string;
33973
36550
  description?: string | null;
36551
+ head_product_id?: string | null;
36552
+ head_trade_item_floriday_id?: string | null;
33974
36553
  id?: string;
33975
36554
  is_active?: boolean;
33976
36555
  name: string;
@@ -33980,24 +36559,134 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
33980
36559
  Update: {
33981
36560
  created_at?: string;
33982
36561
  description?: string | null;
36562
+ head_product_id?: string | null;
36563
+ head_trade_item_floriday_id?: string | null;
33983
36564
  id?: string;
33984
36565
  is_active?: boolean;
33985
36566
  name?: string;
33986
36567
  tenant_id?: string;
33987
36568
  updated_at?: string;
33988
36569
  };
36570
+ Relationships: [{
36571
+ foreignKeyName: "product_groups_head_product_id_fkey";
36572
+ columns: ["head_product_id"];
36573
+ isOneToOne: false;
36574
+ referencedRelation: "products";
36575
+ referencedColumns: ["id"];
36576
+ }];
36577
+ };
36578
+ product_load_settings: {
36579
+ Row: {
36580
+ created_at: string;
36581
+ id: string;
36582
+ is_package: boolean;
36583
+ label: string | null;
36584
+ layers_per_load_carrier: number | null;
36585
+ load_carrier: string | null;
36586
+ package_id: string | null;
36587
+ package_label: string | null;
36588
+ packages_per_layer: number | null;
36589
+ packing_configuration_id: string;
36590
+ product_id: string | null;
36591
+ tenant_id: string;
36592
+ trade_item_floriday_id: string | null;
36593
+ units_per_package: number | null;
36594
+ updated_at: string;
36595
+ };
36596
+ Insert: {
36597
+ created_at?: string;
36598
+ id?: string;
36599
+ is_package?: boolean;
36600
+ label?: string | null;
36601
+ layers_per_load_carrier?: number | null;
36602
+ load_carrier?: string | null;
36603
+ package_id?: string | null;
36604
+ package_label?: string | null;
36605
+ packages_per_layer?: number | null;
36606
+ packing_configuration_id?: string;
36607
+ product_id?: string | null;
36608
+ tenant_id: string;
36609
+ trade_item_floriday_id?: string | null;
36610
+ units_per_package?: number | null;
36611
+ updated_at?: string;
36612
+ };
36613
+ Update: {
36614
+ created_at?: string;
36615
+ id?: string;
36616
+ is_package?: boolean;
36617
+ label?: string | null;
36618
+ layers_per_load_carrier?: number | null;
36619
+ load_carrier?: string | null;
36620
+ package_id?: string | null;
36621
+ package_label?: string | null;
36622
+ packages_per_layer?: number | null;
36623
+ packing_configuration_id?: string;
36624
+ product_id?: string | null;
36625
+ tenant_id?: string;
36626
+ trade_item_floriday_id?: string | null;
36627
+ units_per_package?: number | null;
36628
+ updated_at?: string;
36629
+ };
36630
+ Relationships: [{
36631
+ foreignKeyName: "product_load_settings_package_id_fkey";
36632
+ columns: ["package_id"];
36633
+ isOneToOne: false;
36634
+ referencedRelation: "packages";
36635
+ referencedColumns: ["id"];
36636
+ }, {
36637
+ foreignKeyName: "product_load_settings_product_id_fkey";
36638
+ columns: ["product_id"];
36639
+ isOneToOne: false;
36640
+ referencedRelation: "products";
36641
+ referencedColumns: ["id"];
36642
+ }];
36643
+ };
36644
+ product_merge_log: {
36645
+ Row: {
36646
+ canonical_product_id: string | null;
36647
+ id: string;
36648
+ merged_at: string;
36649
+ merged_from_id: string;
36650
+ notes: string | null;
36651
+ snapshot: import("../integrations/supabase/types").Json;
36652
+ source_table: string;
36653
+ status: string;
36654
+ };
36655
+ Insert: {
36656
+ canonical_product_id?: string | null;
36657
+ id?: string;
36658
+ merged_at?: string;
36659
+ merged_from_id: string;
36660
+ notes?: string | null;
36661
+ snapshot?: import("../integrations/supabase/types").Json;
36662
+ source_table: string;
36663
+ status?: string;
36664
+ };
36665
+ Update: {
36666
+ canonical_product_id?: string | null;
36667
+ id?: string;
36668
+ merged_at?: string;
36669
+ merged_from_id?: string;
36670
+ notes?: string | null;
36671
+ snapshot?: import("../integrations/supabase/types").Json;
36672
+ source_table?: string;
36673
+ status?: string;
36674
+ };
33989
36675
  Relationships: [];
33990
36676
  };
33991
36677
  products: {
33992
36678
  Row: {
36679
+ article_number: string | null;
33993
36680
  barcode: string | null;
33994
36681
  batch: string;
33995
36682
  crates_per_layer: number;
33996
36683
  created_at: string;
33997
36684
  custom_fields: import("../integrations/supabase/types").Json;
36685
+ floriday_trade_item_id: string | null;
33998
36686
  id: string;
33999
36687
  image_url: string | null;
34000
36688
  incoming_quantity: number;
36689
+ is_layer: boolean;
34001
36690
  layers_per_cart: number;
34002
36691
  location: string;
34003
36692
  min_quantity: number;
@@ -34013,14 +36702,17 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
34013
36702
  weight: string | null;
34014
36703
  };
34015
36704
  Insert: {
36705
+ article_number?: string | null;
34016
36706
  barcode?: string | null;
34017
36707
  batch: string;
34018
36708
  crates_per_layer?: number;
34019
36709
  created_at?: string;
34020
36710
  custom_fields?: import("../integrations/supabase/types").Json;
36711
+ floriday_trade_item_id?: string | null;
34021
36712
  id?: string;
34022
36713
  image_url?: string | null;
34023
36714
  incoming_quantity?: number;
36715
+ is_layer?: boolean;
34024
36716
  layers_per_cart?: number;
34025
36717
  location: string;
34026
36718
  min_quantity?: number;
@@ -34036,14 +36728,17 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
34036
36728
  weight?: string | null;
34037
36729
  };
34038
36730
  Update: {
36731
+ article_number?: string | null;
34039
36732
  barcode?: string | null;
34040
36733
  batch?: string;
34041
36734
  crates_per_layer?: number;
34042
36735
  created_at?: string;
34043
36736
  custom_fields?: import("../integrations/supabase/types").Json;
36737
+ floriday_trade_item_id?: string | null;
34044
36738
  id?: string;
34045
36739
  image_url?: string | null;
34046
36740
  incoming_quantity?: number;
36741
+ is_layer?: boolean;
34047
36742
  layers_per_cart?: number;
34048
36743
  location?: string;
34049
36744
  min_quantity?: number;
@@ -34063,6 +36758,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
34063
36758
  profiles: {
34064
36759
  Row: {
34065
36760
  address: string | null;
36761
+ avatar_url: string | null;
34066
36762
  created_at: string;
34067
36763
  display_name: string | null;
34068
36764
  email: string | null;
@@ -34074,6 +36770,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
34074
36770
  };
34075
36771
  Insert: {
34076
36772
  address?: string | null;
36773
+ avatar_url?: string | null;
34077
36774
  created_at?: string;
34078
36775
  display_name?: string | null;
34079
36776
  email?: string | null;
@@ -34085,6 +36782,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
34085
36782
  };
34086
36783
  Update: {
34087
36784
  address?: string | null;
36785
+ avatar_url?: string | null;
34088
36786
  created_at?: string;
34089
36787
  display_name?: string | null;
34090
36788
  email?: string | null;
@@ -34951,6 +37649,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
34951
37649
  order_source: string | null;
34952
37650
  physical_after: number | null;
34953
37651
  physical_before: number | null;
37652
+ production_batch_id: string | null;
34954
37653
  qty_delta: number;
34955
37654
  reason: string | null;
34956
37655
  reserved_after: number | null;
@@ -34968,6 +37667,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
34968
37667
  order_source?: string | null;
34969
37668
  physical_after?: number | null;
34970
37669
  physical_before?: number | null;
37670
+ production_batch_id?: string | null;
34971
37671
  qty_delta: number;
34972
37672
  reason?: string | null;
34973
37673
  reserved_after?: number | null;
@@ -34985,6 +37685,7 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
34985
37685
  order_source?: string | null;
34986
37686
  physical_after?: number | null;
34987
37687
  physical_before?: number | null;
37688
+ production_batch_id?: string | null;
34988
37689
  qty_delta?: number;
34989
37690
  reason?: string | null;
34990
37691
  reserved_after?: number | null;
@@ -35311,6 +38012,48 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
35311
38012
  };
35312
38013
  Relationships: [];
35313
38014
  };
38015
+ trade_item_prices: {
38016
+ Row: {
38017
+ created_at: string;
38018
+ currency: string;
38019
+ id: string;
38020
+ last_push_error: string | null;
38021
+ last_pushed_at: string | null;
38022
+ price_group_id: string | null;
38023
+ price_per_piece: number;
38024
+ supply_line_id: string | null;
38025
+ trade_item_key: string;
38026
+ updated_at: string;
38027
+ user_id: string;
38028
+ };
38029
+ Insert: {
38030
+ created_at?: string;
38031
+ currency?: string;
38032
+ id?: string;
38033
+ last_push_error?: string | null;
38034
+ last_pushed_at?: string | null;
38035
+ price_group_id?: string | null;
38036
+ price_per_piece: number;
38037
+ supply_line_id?: string | null;
38038
+ trade_item_key: string;
38039
+ updated_at?: string;
38040
+ user_id: string;
38041
+ };
38042
+ Update: {
38043
+ created_at?: string;
38044
+ currency?: string;
38045
+ id?: string;
38046
+ last_push_error?: string | null;
38047
+ last_pushed_at?: string | null;
38048
+ price_group_id?: string | null;
38049
+ price_per_piece?: number;
38050
+ supply_line_id?: string | null;
38051
+ trade_item_key?: string;
38052
+ updated_at?: string;
38053
+ user_id?: string;
38054
+ };
38055
+ Relationships: [];
38056
+ };
35314
38057
  trade_item_stock: {
35315
38058
  Row: {
35316
38059
  connection_id: string;
@@ -35776,6 +38519,51 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
35776
38519
  referencedColumns: ["id"];
35777
38520
  }];
35778
38521
  };
38522
+ twinfield_invoice_pdf_cache: {
38523
+ Row: {
38524
+ connection_id: string;
38525
+ created_at: string;
38526
+ fetched_at: string;
38527
+ id: string;
38528
+ invoice_number: string;
38529
+ last_accessed_at: string;
38530
+ object_path: string;
38531
+ office_code: string;
38532
+ size_bytes: number;
38533
+ updated_at: string;
38534
+ };
38535
+ Insert: {
38536
+ connection_id: string;
38537
+ created_at?: string;
38538
+ fetched_at?: string;
38539
+ id?: string;
38540
+ invoice_number: string;
38541
+ last_accessed_at?: string;
38542
+ object_path: string;
38543
+ office_code: string;
38544
+ size_bytes?: number;
38545
+ updated_at?: string;
38546
+ };
38547
+ Update: {
38548
+ connection_id?: string;
38549
+ created_at?: string;
38550
+ fetched_at?: string;
38551
+ id?: string;
38552
+ invoice_number?: string;
38553
+ last_accessed_at?: string;
38554
+ object_path?: string;
38555
+ office_code?: string;
38556
+ size_bytes?: number;
38557
+ updated_at?: string;
38558
+ };
38559
+ Relationships: [{
38560
+ foreignKeyName: "twinfield_invoice_pdf_cache_connection_id_fkey";
38561
+ columns: ["connection_id"];
38562
+ isOneToOne: false;
38563
+ referencedRelation: "twinfield_connections";
38564
+ referencedColumns: ["id"];
38565
+ }];
38566
+ };
35779
38567
  twinfield_invoice_settings: {
35780
38568
  Row: {
35781
38569
  created_at: string;
@@ -36379,6 +39167,78 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
36379
39167
  };
36380
39168
  Relationships: [];
36381
39169
  };
39170
+ werkbon_package_ai_rules: {
39171
+ Row: {
39172
+ active: boolean;
39173
+ case_sensitive: boolean;
39174
+ created_at: string;
39175
+ id: string;
39176
+ package_id: string;
39177
+ priority: number;
39178
+ rule_type: string;
39179
+ updated_at: string;
39180
+ value: string;
39181
+ };
39182
+ Insert: {
39183
+ active?: boolean;
39184
+ case_sensitive?: boolean;
39185
+ created_at?: string;
39186
+ id?: string;
39187
+ package_id: string;
39188
+ priority?: number;
39189
+ rule_type: string;
39190
+ updated_at?: string;
39191
+ value: string;
39192
+ };
39193
+ Update: {
39194
+ active?: boolean;
39195
+ case_sensitive?: boolean;
39196
+ created_at?: string;
39197
+ id?: string;
39198
+ package_id?: string;
39199
+ priority?: number;
39200
+ rule_type?: string;
39201
+ updated_at?: string;
39202
+ value?: string;
39203
+ };
39204
+ Relationships: [{
39205
+ foreignKeyName: "werkbon_package_ai_rules_package_id_fkey";
39206
+ columns: ["package_id"];
39207
+ isOneToOne: false;
39208
+ referencedRelation: "werkbon_packages";
39209
+ referencedColumns: ["id"];
39210
+ }];
39211
+ };
39212
+ werkbon_package_categories: {
39213
+ Row: {
39214
+ active: boolean;
39215
+ created_at: string;
39216
+ id: string;
39217
+ kleur: string | null;
39218
+ naam: string;
39219
+ sort_order: number;
39220
+ updated_at: string;
39221
+ };
39222
+ Insert: {
39223
+ active?: boolean;
39224
+ created_at?: string;
39225
+ id?: string;
39226
+ kleur?: string | null;
39227
+ naam: string;
39228
+ sort_order?: number;
39229
+ updated_at?: string;
39230
+ };
39231
+ Update: {
39232
+ active?: boolean;
39233
+ created_at?: string;
39234
+ id?: string;
39235
+ kleur?: string | null;
39236
+ naam?: string;
39237
+ sort_order?: number;
39238
+ updated_at?: string;
39239
+ };
39240
+ Relationships: [];
39241
+ };
36382
39242
  werkbon_package_lines: {
36383
39243
  Row: {
36384
39244
  created_at: string;
@@ -36424,38 +39284,59 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
36424
39284
  werkbon_packages: {
36425
39285
  Row: {
36426
39286
  active: boolean;
39287
+ ai_tags: string[];
39288
+ category_id: string | null;
36427
39289
  code: string;
36428
39290
  created_at: string;
36429
39291
  default_quantity: number;
36430
39292
  description: string | null;
39293
+ duration_minutes: number | null;
36431
39294
  id: string;
39295
+ mandaat_type: string | null;
36432
39296
  name: string;
39297
+ sort_order: number;
36433
39298
  unit_price_cents: number;
36434
39299
  updated_at: string;
36435
39300
  };
36436
39301
  Insert: {
36437
39302
  active?: boolean;
39303
+ ai_tags?: string[];
39304
+ category_id?: string | null;
36438
39305
  code: string;
36439
39306
  created_at?: string;
36440
39307
  default_quantity?: number;
36441
39308
  description?: string | null;
39309
+ duration_minutes?: number | null;
36442
39310
  id?: string;
39311
+ mandaat_type?: string | null;
36443
39312
  name: string;
39313
+ sort_order?: number;
36444
39314
  unit_price_cents?: number;
36445
39315
  updated_at?: string;
36446
39316
  };
36447
39317
  Update: {
36448
39318
  active?: boolean;
39319
+ ai_tags?: string[];
39320
+ category_id?: string | null;
36449
39321
  code?: string;
36450
39322
  created_at?: string;
36451
39323
  default_quantity?: number;
36452
39324
  description?: string | null;
39325
+ duration_minutes?: number | null;
36453
39326
  id?: string;
39327
+ mandaat_type?: string | null;
36454
39328
  name?: string;
39329
+ sort_order?: number;
36455
39330
  unit_price_cents?: number;
36456
39331
  updated_at?: string;
36457
39332
  };
36458
- Relationships: [];
39333
+ Relationships: [{
39334
+ foreignKeyName: "werkbon_packages_category_id_fkey";
39335
+ columns: ["category_id"];
39336
+ isOneToOne: false;
39337
+ referencedRelation: "werkbon_package_categories";
39338
+ referencedColumns: ["id"];
39339
+ }];
36459
39340
  };
36460
39341
  werkbon_photos: {
36461
39342
  Row: {
@@ -36543,7 +39424,10 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
36543
39424
  scheduled_end_time: string | null;
36544
39425
  scheduled_start_time: string | null;
36545
39426
  sequence_number: number;
39427
+ source_email_meta: import("../integrations/supabase/types").Json | null;
39428
+ source_mailbox_message_id: string | null;
36546
39429
  source_pdf_path: string | null;
39430
+ source_type: string;
36547
39431
  status: string;
36548
39432
  technician_id: string | null;
36549
39433
  technician_notes: string | null;
@@ -36572,7 +39456,10 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
36572
39456
  scheduled_end_time?: string | null;
36573
39457
  scheduled_start_time?: string | null;
36574
39458
  sequence_number: number;
39459
+ source_email_meta?: import("../integrations/supabase/types").Json | null;
39460
+ source_mailbox_message_id?: string | null;
36575
39461
  source_pdf_path?: string | null;
39462
+ source_type?: string;
36576
39463
  status?: string;
36577
39464
  technician_id?: string | null;
36578
39465
  technician_notes?: string | null;
@@ -36601,7 +39488,10 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
36601
39488
  scheduled_end_time?: string | null;
36602
39489
  scheduled_start_time?: string | null;
36603
39490
  sequence_number?: number;
39491
+ source_email_meta?: import("../integrations/supabase/types").Json | null;
39492
+ source_mailbox_message_id?: string | null;
36604
39493
  source_pdf_path?: string | null;
39494
+ source_type?: string;
36605
39495
  status?: string;
36606
39496
  technician_id?: string | null;
36607
39497
  technician_notes?: string | null;
@@ -36618,10 +39508,10 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
36618
39508
  referencedRelation: "werkbonnen";
36619
39509
  referencedColumns: ["id"];
36620
39510
  }, {
36621
- foreignKeyName: "werkbonnen_technician_id_fkey";
36622
- columns: ["technician_id"];
39511
+ foreignKeyName: "werkbonnen_source_mailbox_message_id_fkey";
39512
+ columns: ["source_mailbox_message_id"];
36623
39513
  isOneToOne: false;
36624
- referencedRelation: "monteurs";
39514
+ referencedRelation: "mailbox_messages";
36625
39515
  referencedColumns: ["id"];
36626
39516
  }];
36627
39517
  };
@@ -37315,6 +40205,13 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37315
40205
  };
37316
40206
  Returns: number;
37317
40207
  };
40208
+ _migrate_rewrite_stock_key: {
40209
+ Args: {
40210
+ _from_key: string;
40211
+ _to_key: string;
40212
+ };
40213
+ Returns: undefined;
40214
+ };
37318
40215
  afh_city_code: {
37319
40216
  Args: {
37320
40217
  _city: string;
@@ -37341,6 +40238,21 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37341
40238
  };
37342
40239
  Returns: string;
37343
40240
  };
40241
+ ai_usage_by_module: {
40242
+ Args: {
40243
+ _from: string;
40244
+ _to: string;
40245
+ };
40246
+ Returns: {
40247
+ calls: number;
40248
+ consumer_module_id: string;
40249
+ cost_usd: number;
40250
+ errors: number;
40251
+ input_tokens: number;
40252
+ output_tokens: number;
40253
+ total_tokens: number;
40254
+ }[];
40255
+ };
37344
40256
  apply_stock_consumption: {
37345
40257
  Args: {
37346
40258
  p_order_id: string;
@@ -37398,6 +40310,12 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37398
40310
  processed_items: number;
37399
40311
  }[];
37400
40312
  };
40313
+ calculate_layer_stock: {
40314
+ Args: {
40315
+ p_product_id: string;
40316
+ };
40317
+ Returns: number;
40318
+ };
37401
40319
  call_exact_route: {
37402
40320
  Args: {
37403
40321
  path: string;
@@ -37457,6 +40375,28 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37457
40375
  Args: never;
37458
40376
  Returns: undefined;
37459
40377
  };
40378
+ consume_bom_for_production: {
40379
+ Args: {
40380
+ p_connection_id: string;
40381
+ p_parent_id: string;
40382
+ p_parent_key: string;
40383
+ p_parent_kind: string;
40384
+ p_quantity: number;
40385
+ p_user_id: string;
40386
+ };
40387
+ Returns: import("../integrations/supabase/types").Json;
40388
+ } | {
40389
+ Args: {
40390
+ p_batch_id?: string;
40391
+ p_connection_id: string;
40392
+ p_parent_id: string;
40393
+ p_parent_key: string;
40394
+ p_parent_kind: string;
40395
+ p_quantity: number;
40396
+ p_user_id: string;
40397
+ };
40398
+ Returns: import("../integrations/supabase/types").Json;
40399
+ };
37460
40400
  consume_floriday_rate_limit: {
37461
40401
  Args: {
37462
40402
  p_bucket: string;
@@ -37489,6 +40429,12 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37489
40429
  Args: never;
37490
40430
  Returns: string;
37491
40431
  };
40432
+ custom_access_token_hook: {
40433
+ Args: {
40434
+ event: import("../integrations/supabase/types").Json;
40435
+ };
40436
+ Returns: import("../integrations/supabase/types").Json;
40437
+ };
37492
40438
  dashboard_alert_counts: {
37493
40439
  Args: never;
37494
40440
  Returns: import("../integrations/supabase/types").Json;
@@ -37508,6 +40454,13 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37508
40454
  table_name: string;
37509
40455
  }[];
37510
40456
  };
40457
+ delete_samenstelling: {
40458
+ Args: {
40459
+ p_parent_id: string;
40460
+ p_parent_kind: string;
40461
+ };
40462
+ Returns: import("../integrations/supabase/types").Json;
40463
+ };
37511
40464
  dispatch_carrier_signups_sql: {
37512
40465
  Args: {
37513
40466
  _catchup?: string;
@@ -37763,6 +40716,27 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37763
40716
  minutes_since_success: number;
37764
40717
  }[];
37765
40718
  };
40719
+ get_group_allocation_keys: {
40720
+ Args: {
40721
+ p_product_id: string;
40722
+ };
40723
+ Returns: {
40724
+ k: string;
40725
+ ord: number;
40726
+ }[];
40727
+ };
40728
+ get_group_head_key: {
40729
+ Args: {
40730
+ p_group_id: string;
40731
+ };
40732
+ Returns: string;
40733
+ };
40734
+ get_inventory_stock_for_key: {
40735
+ Args: {
40736
+ p_key: string;
40737
+ };
40738
+ Returns: number;
40739
+ };
37766
40740
  get_offer_by_link_code: {
37767
40741
  Args: {
37768
40742
  p_code: string;
@@ -37793,6 +40767,12 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37793
40767
  };
37794
40768
  Returns: string;
37795
40769
  };
40770
+ get_product_group_available_stock: {
40771
+ Args: {
40772
+ p_group_id: string;
40773
+ };
40774
+ Returns: number;
40775
+ };
37796
40776
  get_room_busy_windows: {
37797
40777
  Args: {
37798
40778
  p_from: string;
@@ -37857,12 +40837,35 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37857
40837
  };
37858
40838
  Returns: boolean;
37859
40839
  };
40840
+ jwt_has_role: {
40841
+ Args: {
40842
+ _role: import("../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
40843
+ };
40844
+ Returns: boolean;
40845
+ };
37860
40846
  list_monteurs: {
37861
40847
  Args: never;
37862
40848
  Returns: {
40849
+ avatar_url: string;
37863
40850
  display_name: string;
37864
40851
  email: string;
37865
- user_id: string;
40852
+ id: string;
40853
+ }[];
40854
+ };
40855
+ list_my_planning_items: {
40856
+ Args: {
40857
+ _from: string;
40858
+ _to: string;
40859
+ };
40860
+ Returns: {
40861
+ assigned_monteur_id: string;
40862
+ end_at: string;
40863
+ id: string;
40864
+ notes: string;
40865
+ role: string;
40866
+ start_at: string;
40867
+ status: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
40868
+ werkbon_id: string;
37866
40869
  }[];
37867
40870
  };
37868
40871
  local_effective_price: {
@@ -37881,6 +40884,22 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37881
40884
  source_id: string;
37882
40885
  }[];
37883
40886
  };
40887
+ log_ai_call: {
40888
+ Args: {
40889
+ _consumer_module_id: string;
40890
+ _cost_usd: number;
40891
+ _duration_ms: number;
40892
+ _error_code: string;
40893
+ _error_message: string;
40894
+ _input_tokens: number;
40895
+ _model_slug: string;
40896
+ _output_tokens: number;
40897
+ _provider_slug: string;
40898
+ _status: string;
40899
+ _total_tokens: number;
40900
+ };
40901
+ Returns: string;
40902
+ };
37884
40903
  mark_offer_clicked: {
37885
40904
  Args: {
37886
40905
  p_code: string;
@@ -37893,12 +40912,32 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37893
40912
  };
37894
40913
  Returns: undefined;
37895
40914
  };
40915
+ mark_salesorder_controlled: {
40916
+ Args: {
40917
+ p_controlled: boolean;
40918
+ p_floriday_id: string;
40919
+ };
40920
+ Returns: undefined;
40921
+ };
37896
40922
  mark_shipment_shipped: {
37897
40923
  Args: {
37898
40924
  p_shipment_id: string;
37899
40925
  };
37900
40926
  Returns: undefined;
37901
40927
  };
40928
+ merge_products: {
40929
+ Args: {
40930
+ _canonical: string;
40931
+ _loser: string;
40932
+ };
40933
+ Returns: undefined;
40934
+ };
40935
+ next_manufacture_partij: {
40936
+ Args: {
40937
+ _tenant_id: string;
40938
+ };
40939
+ Returns: string;
40940
+ };
37902
40941
  next_order_number: {
37903
40942
  Args: {
37904
40943
  p_prefix: string;
@@ -37972,6 +41011,15 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37972
41011
  };
37973
41012
  Returns: undefined;
37974
41013
  };
41014
+ pickstation_resolve_delivery_orders: {
41015
+ Args: {
41016
+ p_sales_order_ids: string[];
41017
+ };
41018
+ Returns: {
41019
+ delivery_order_id: string;
41020
+ sales_order_id: string;
41021
+ }[];
41022
+ };
37975
41023
  pickstation_set_cart_status: {
37976
41024
  Args: {
37977
41025
  p_cart_index: number;
@@ -37981,6 +41029,14 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37981
41029
  };
37982
41030
  Returns: undefined;
37983
41031
  };
41032
+ produce_designed_product: {
41033
+ Args: {
41034
+ p_parent_id: string;
41035
+ p_parent_kind: string;
41036
+ p_quantity: number;
41037
+ };
41038
+ Returns: import("../integrations/supabase/types").Json;
41039
+ };
37984
41040
  promote_trade_item_key: {
37985
41041
  Args: {
37986
41042
  p_new: string;
@@ -37988,6 +41044,10 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
37988
41044
  };
37989
41045
  Returns: undefined;
37990
41046
  };
41047
+ recompute_all_reserved_stock: {
41048
+ Args: never;
41049
+ Returns: undefined;
41050
+ };
37991
41051
  recompute_order_status: {
37992
41052
  Args: {
37993
41053
  p_order_id: string;
@@ -38043,18 +41103,50 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
38043
41103
  };
38044
41104
  Returns: undefined;
38045
41105
  };
41106
+ resolve_group_allocation: {
41107
+ Args: {
41108
+ _needed: number;
41109
+ _product_group_id: string;
41110
+ };
41111
+ Returns: {
41112
+ allocated: number;
41113
+ trade_item_id: string;
41114
+ }[];
41115
+ };
41116
+ resolve_group_member_stock_key: {
41117
+ Args: {
41118
+ p_trade_item_id: string;
41119
+ };
41120
+ Returns: string;
41121
+ };
38046
41122
  resolve_product_id_for_item: {
38047
41123
  Args: {
38048
41124
  p_product_name: string;
38049
41125
  };
38050
41126
  Returns: string;
38051
41127
  };
41128
+ resolve_stock_trade_item_key: {
41129
+ Args: {
41130
+ p_product_id: string;
41131
+ };
41132
+ Returns: string;
41133
+ };
38052
41134
  retry_twinfield_push: {
38053
41135
  Args: {
38054
41136
  _customer_id: string;
38055
41137
  };
38056
41138
  Returns: number;
38057
41139
  };
41140
+ reverse_production: {
41141
+ Args: {
41142
+ p_connection_id?: string;
41143
+ p_parent_key: string;
41144
+ p_quantity: number;
41145
+ p_reason?: string;
41146
+ p_user_id?: string;
41147
+ };
41148
+ Returns: import("../integrations/supabase/types").Json;
41149
+ };
38058
41150
  schedule_floriday_additional_services_sync: {
38059
41151
  Args: {
38060
41152
  p_apikey: string;
@@ -38322,6 +41414,17 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
38322
41414
  };
38323
41415
  Returns: number;
38324
41416
  };
41417
+ self_heal_floriday_links: {
41418
+ Args: never;
41419
+ Returns: number;
41420
+ };
41421
+ set_planning_status: {
41422
+ Args: {
41423
+ _id: string;
41424
+ _status: import("../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
41425
+ };
41426
+ Returns: undefined;
41427
+ };
38325
41428
  show_limit: {
38326
41429
  Args: never;
38327
41430
  Returns: number;
@@ -38332,18 +41435,34 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
38332
41435
  };
38333
41436
  Returns: string[];
38334
41437
  };
41438
+ sync_all_layer_stocks: {
41439
+ Args: never;
41440
+ Returns: undefined;
41441
+ };
38335
41442
  sync_cached_packing_from_product: {
38336
41443
  Args: {
38337
41444
  p_product_id: string;
38338
41445
  };
38339
41446
  Returns: undefined;
38340
41447
  };
41448
+ sync_layer_stock: {
41449
+ Args: {
41450
+ p_product_id: string;
41451
+ };
41452
+ Returns: undefined;
41453
+ };
38341
41454
  sync_order_cart_item_packing_from_product: {
38342
41455
  Args: {
38343
41456
  p_product_id: string;
38344
41457
  };
38345
41458
  Returns: undefined;
38346
41459
  };
41460
+ sync_product_group_belading: {
41461
+ Args: {
41462
+ _group_id: string;
41463
+ };
41464
+ Returns: undefined;
41465
+ };
38347
41466
  sync_product_packing_from_floriday_cache: {
38348
41467
  Args: {
38349
41468
  p_floriday_id: string;
@@ -38375,11 +41494,12 @@ export declare const retryAutoFulfillment: import("@tanstack/start-client-core")
38375
41494
  };
38376
41495
  };
38377
41496
  Enums: {
38378
- app_role: "admin" | "planner" | "monteur" | "administratie";
41497
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
38379
41498
  exact_env: "staging" | "live";
38380
41499
  exact_push_status: "pending" | "sent" | "error";
38381
41500
  itk_customer_segment: "Business" | "Private";
38382
41501
  itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
41502
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd" | "concept" | "vrijgegeven";
38383
41503
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
38384
41504
  };
38385
41505
  CompositeTypes: { [_ in never]: never; };