@flowselections/floriday-afhandeling-module 1.0.18 → 1.0.20

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 (52) hide show
  1. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1581 -310
  2. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  3. package/dist-lib/integrations/supabase/client.d.ts +1581 -310
  4. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  5. package/dist-lib/integrations/supabase/client.js +7 -26
  6. package/dist-lib/integrations/supabase/client.server.d.ts +1581 -310
  7. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  8. package/dist-lib/integrations/supabase/types.d.ts +1620 -310
  9. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  10. package/dist-lib/integrations/supabase/types.js +11 -9
  11. package/dist-lib/lib/afhandelingSettings.functions.d.ts +4141 -1599
  12. package/dist-lib/lib/afhandelingSettings.functions.d.ts.map +1 -1
  13. package/dist-lib/lib/carriers.functions.d.ts +7829 -1474
  14. package/dist-lib/lib/carriers.functions.d.ts.map +1 -1
  15. package/dist-lib/lib/cartAssignments.functions.d.ts +7829 -1474
  16. package/dist-lib/lib/cartAssignments.functions.d.ts.map +1 -1
  17. package/dist-lib/lib/cartControl.functions.d.ts +16184 -3474
  18. package/dist-lib/lib/cartControl.functions.d.ts.map +1 -1
  19. package/dist-lib/lib/floriday.functions.d.ts +1581 -310
  20. package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
  21. package/dist-lib/lib/logisticsEngine/capacity.functions.d.ts +6158 -1074
  22. package/dist-lib/lib/logisticsEngine/capacity.functions.d.ts.map +1 -1
  23. package/dist-lib/lib/logisticsEngine/evaluate.functions.d.ts +1581 -310
  24. package/dist-lib/lib/logisticsEngine/evaluate.functions.d.ts.map +1 -1
  25. package/dist-lib/lib/logisticsEngine/formulas.functions.d.ts +4141 -1599
  26. package/dist-lib/lib/logisticsEngine/formulas.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/logisticsEngine/strategies.functions.d.ts +12842 -2674
  28. package/dist-lib/lib/logisticsEngine/strategies.functions.d.ts.map +1 -1
  29. package/dist-lib/lib/logisticsEngine/wizard.functions.d.ts +6158 -1074
  30. package/dist-lib/lib/logisticsEngine/wizard.functions.d.ts.map +1 -1
  31. package/dist-lib/lib/pickstationOrders.server.d.ts +4 -3
  32. package/dist-lib/lib/pickstationOrders.server.d.ts.map +1 -1
  33. package/dist-lib/lib/pickstationOrders.server.js +6 -6
  34. package/dist-lib/lib/serverRoutes/dispatchCarrierSignups.handler.d.ts +3 -0
  35. package/dist-lib/lib/serverRoutes/dispatchCarrierSignups.handler.d.ts.map +1 -0
  36. package/dist-lib/lib/serverRoutes/dispatchCarrierSignups.handler.js +321 -0
  37. package/dist-lib/lib/serverRoutes/index.d.ts +6 -0
  38. package/dist-lib/lib/serverRoutes/index.d.ts.map +1 -0
  39. package/dist-lib/lib/serverRoutes/index.js +8 -0
  40. package/dist-lib/lib/serverRoutes/logisticsTick.handler.d.ts +3 -0
  41. package/dist-lib/lib/serverRoutes/logisticsTick.handler.d.ts.map +1 -0
  42. package/dist-lib/lib/serverRoutes/logisticsTick.handler.js +37 -0
  43. package/dist-lib/lib/serverRoutes/pickstationOrders.handler.d.ts +3 -0
  44. package/dist-lib/lib/serverRoutes/pickstationOrders.handler.d.ts.map +1 -0
  45. package/dist-lib/lib/serverRoutes/pickstationOrders.handler.js +58 -0
  46. package/dist-lib/lib/serverRoutes/pickstationPrint.handler.d.ts +3 -0
  47. package/dist-lib/lib/serverRoutes/pickstationPrint.handler.d.ts.map +1 -0
  48. package/dist-lib/lib/serverRoutes/pickstationPrint.handler.js +116 -0
  49. package/dist-lib/lib/serverRoutes/pickstationStatus.handler.d.ts +3 -0
  50. package/dist-lib/lib/serverRoutes/pickstationStatus.handler.d.ts.map +1 -0
  51. package/dist-lib/lib/serverRoutes/pickstationStatus.handler.js +28 -0
  52. package/package.json +32 -2
@@ -247,12 +247,100 @@ export type Database = {
247
247
  };
248
248
  Relationships: [];
249
249
  };
250
+ ai_admin_credentials: {
251
+ Row: {
252
+ active: boolean;
253
+ admin_key: string;
254
+ created_at: string;
255
+ id: string;
256
+ label: string;
257
+ provider_id: string;
258
+ updated_at: string;
259
+ };
260
+ Insert: {
261
+ active?: boolean;
262
+ admin_key: string;
263
+ created_at?: string;
264
+ id?: string;
265
+ label: string;
266
+ provider_id: string;
267
+ updated_at?: string;
268
+ };
269
+ Update: {
270
+ active?: boolean;
271
+ admin_key?: string;
272
+ created_at?: string;
273
+ id?: string;
274
+ label?: string;
275
+ provider_id?: string;
276
+ updated_at?: string;
277
+ };
278
+ Relationships: [
279
+ {
280
+ foreignKeyName: "ai_admin_credentials_provider_id_fkey";
281
+ columns: ["provider_id"];
282
+ isOneToOne: true;
283
+ referencedRelation: "ai_providers";
284
+ referencedColumns: ["id"];
285
+ }
286
+ ];
287
+ };
288
+ ai_call_log: {
289
+ Row: {
290
+ consumer_module_id: string;
291
+ cost_usd: number | null;
292
+ created_at: string;
293
+ created_by: string | null;
294
+ duration_ms: number | null;
295
+ error_code: string | null;
296
+ error_message: string | null;
297
+ id: string;
298
+ input_tokens: number;
299
+ model_slug: string | null;
300
+ output_tokens: number;
301
+ provider_slug: string | null;
302
+ status: string;
303
+ total_tokens: number;
304
+ };
305
+ Insert: {
306
+ consumer_module_id: string;
307
+ cost_usd?: number | null;
308
+ created_at?: string;
309
+ created_by?: string | null;
310
+ duration_ms?: number | null;
311
+ error_code?: string | null;
312
+ error_message?: string | null;
313
+ id?: string;
314
+ input_tokens?: number;
315
+ model_slug?: string | null;
316
+ output_tokens?: number;
317
+ provider_slug?: string | null;
318
+ status: string;
319
+ total_tokens?: number;
320
+ };
321
+ Update: {
322
+ consumer_module_id?: string;
323
+ cost_usd?: number | null;
324
+ created_at?: string;
325
+ created_by?: string | null;
326
+ duration_ms?: number | null;
327
+ error_code?: string | null;
328
+ error_message?: string | null;
329
+ id?: string;
330
+ input_tokens?: number;
331
+ model_slug?: string | null;
332
+ output_tokens?: number;
333
+ provider_slug?: string | null;
334
+ status?: string;
335
+ total_tokens?: number;
336
+ };
337
+ Relationships: [];
338
+ };
250
339
  ai_credentials: {
251
340
  Row: {
252
341
  active: boolean;
253
342
  api_key: string;
254
343
  created_at: string;
255
- created_by: string | null;
256
344
  id: string;
257
345
  label: string;
258
346
  provider_id: string;
@@ -262,7 +350,6 @@ export type Database = {
262
350
  active?: boolean;
263
351
  api_key: string;
264
352
  created_at?: string;
265
- created_by?: string | null;
266
353
  id?: string;
267
354
  label: string;
268
355
  provider_id: string;
@@ -272,7 +359,6 @@ export type Database = {
272
359
  active?: boolean;
273
360
  api_key?: string;
274
361
  created_at?: string;
275
- created_by?: string | null;
276
362
  id?: string;
277
363
  label?: string;
278
364
  provider_id?: string;
@@ -288,6 +374,75 @@ export type Database = {
288
374
  }
289
375
  ];
290
376
  };
377
+ ai_goals: {
378
+ Row: {
379
+ active: boolean;
380
+ created_at: string;
381
+ description: string | null;
382
+ key: string;
383
+ label: string;
384
+ sort_order: number;
385
+ updated_at: string;
386
+ };
387
+ Insert: {
388
+ active?: boolean;
389
+ created_at?: string;
390
+ description?: string | null;
391
+ key: string;
392
+ label: string;
393
+ sort_order?: number;
394
+ updated_at?: string;
395
+ };
396
+ Update: {
397
+ active?: boolean;
398
+ created_at?: string;
399
+ description?: string | null;
400
+ key?: string;
401
+ label?: string;
402
+ sort_order?: number;
403
+ updated_at?: string;
404
+ };
405
+ Relationships: [];
406
+ };
407
+ ai_model_pricing: {
408
+ Row: {
409
+ created_at: string;
410
+ currency: string;
411
+ fetched_at: string;
412
+ id: string;
413
+ input_per_mtok: number | null;
414
+ model_slug: string;
415
+ output_per_mtok: number | null;
416
+ provider_slug: string;
417
+ source: string;
418
+ updated_at: string;
419
+ };
420
+ Insert: {
421
+ created_at?: string;
422
+ currency?: string;
423
+ fetched_at?: string;
424
+ id?: string;
425
+ input_per_mtok?: number | null;
426
+ model_slug: string;
427
+ output_per_mtok?: number | null;
428
+ provider_slug: string;
429
+ source?: string;
430
+ updated_at?: string;
431
+ };
432
+ Update: {
433
+ created_at?: string;
434
+ currency?: string;
435
+ fetched_at?: string;
436
+ id?: string;
437
+ input_per_mtok?: number | null;
438
+ model_slug?: string;
439
+ output_per_mtok?: number | null;
440
+ provider_slug?: string;
441
+ source?: string;
442
+ updated_at?: string;
443
+ };
444
+ Relationships: [];
445
+ };
291
446
  ai_models: {
292
447
  Row: {
293
448
  active: boolean;
@@ -1253,6 +1408,69 @@ export type Database = {
1253
1408
  };
1254
1409
  Relationships: [];
1255
1410
  };
1411
+ catalog_articles_cache: {
1412
+ Row: {
1413
+ created_at: string;
1414
+ default_price: number;
1415
+ default_vat_rate_ref: string | null;
1416
+ external_ref: string;
1417
+ id: string;
1418
+ name: string;
1419
+ updated_at: string;
1420
+ user_id: string;
1421
+ };
1422
+ Insert: {
1423
+ created_at?: string;
1424
+ default_price?: number;
1425
+ default_vat_rate_ref?: string | null;
1426
+ external_ref: string;
1427
+ id?: string;
1428
+ name: string;
1429
+ updated_at?: string;
1430
+ user_id: string;
1431
+ };
1432
+ Update: {
1433
+ created_at?: string;
1434
+ default_price?: number;
1435
+ default_vat_rate_ref?: string | null;
1436
+ external_ref?: string;
1437
+ id?: string;
1438
+ name?: string;
1439
+ updated_at?: string;
1440
+ user_id?: string;
1441
+ };
1442
+ Relationships: [];
1443
+ };
1444
+ catalog_vat_rates_cache: {
1445
+ Row: {
1446
+ created_at: string;
1447
+ external_ref: string;
1448
+ id: string;
1449
+ label: string;
1450
+ percentage: number;
1451
+ updated_at: string;
1452
+ user_id: string;
1453
+ };
1454
+ Insert: {
1455
+ created_at?: string;
1456
+ external_ref: string;
1457
+ id?: string;
1458
+ label: string;
1459
+ percentage?: number;
1460
+ updated_at?: string;
1461
+ user_id: string;
1462
+ };
1463
+ Update: {
1464
+ created_at?: string;
1465
+ external_ref?: string;
1466
+ id?: string;
1467
+ label?: string;
1468
+ percentage?: number;
1469
+ updated_at?: string;
1470
+ user_id?: string;
1471
+ };
1472
+ Relationships: [];
1473
+ };
1256
1474
  collections: {
1257
1475
  Row: {
1258
1476
  created_at: string;
@@ -1541,6 +1759,107 @@ export type Database = {
1541
1759
  };
1542
1760
  Relationships: [];
1543
1761
  };
1762
+ customer_price_group_members: {
1763
+ Row: {
1764
+ created_at: string;
1765
+ customer_key: string;
1766
+ id: string;
1767
+ owner_id: string;
1768
+ price_group_id: string;
1769
+ };
1770
+ Insert: {
1771
+ created_at?: string;
1772
+ customer_key: string;
1773
+ id?: string;
1774
+ owner_id?: string;
1775
+ price_group_id: string;
1776
+ };
1777
+ Update: {
1778
+ created_at?: string;
1779
+ customer_key?: string;
1780
+ id?: string;
1781
+ owner_id?: string;
1782
+ price_group_id?: string;
1783
+ };
1784
+ Relationships: [
1785
+ {
1786
+ foreignKeyName: "customer_price_group_members_price_group_id_fkey";
1787
+ columns: ["price_group_id"];
1788
+ isOneToOne: false;
1789
+ referencedRelation: "customer_price_groups";
1790
+ referencedColumns: ["id"];
1791
+ }
1792
+ ];
1793
+ };
1794
+ customer_price_groups: {
1795
+ Row: {
1796
+ calc_type: string | null;
1797
+ calc_value: number | null;
1798
+ calc_value_type: string | null;
1799
+ created_at: string;
1800
+ currency: string;
1801
+ distribute_over: string | null;
1802
+ group_type: string;
1803
+ handling_fee: number | null;
1804
+ id: string;
1805
+ include_stickers: boolean;
1806
+ is_active: boolean;
1807
+ name: string;
1808
+ owner_id: string;
1809
+ price_scope: string;
1810
+ pricing_mode: string;
1811
+ rounding: string;
1812
+ rounding_step: number;
1813
+ sort_order: number;
1814
+ unit: string;
1815
+ updated_at: string;
1816
+ };
1817
+ Insert: {
1818
+ calc_type?: string | null;
1819
+ calc_value?: number | null;
1820
+ calc_value_type?: string | null;
1821
+ created_at?: string;
1822
+ currency?: string;
1823
+ distribute_over?: string | null;
1824
+ group_type?: string;
1825
+ handling_fee?: number | null;
1826
+ id?: string;
1827
+ include_stickers?: boolean;
1828
+ is_active?: boolean;
1829
+ name: string;
1830
+ owner_id?: string;
1831
+ price_scope?: string;
1832
+ pricing_mode?: string;
1833
+ rounding?: string;
1834
+ rounding_step?: number;
1835
+ sort_order?: number;
1836
+ unit?: string;
1837
+ updated_at?: string;
1838
+ };
1839
+ Update: {
1840
+ calc_type?: string | null;
1841
+ calc_value?: number | null;
1842
+ calc_value_type?: string | null;
1843
+ created_at?: string;
1844
+ currency?: string;
1845
+ distribute_over?: string | null;
1846
+ group_type?: string;
1847
+ handling_fee?: number | null;
1848
+ id?: string;
1849
+ include_stickers?: boolean;
1850
+ is_active?: boolean;
1851
+ name?: string;
1852
+ owner_id?: string;
1853
+ price_scope?: string;
1854
+ pricing_mode?: string;
1855
+ rounding?: string;
1856
+ rounding_step?: number;
1857
+ sort_order?: number;
1858
+ unit?: string;
1859
+ updated_at?: string;
1860
+ };
1861
+ Relationships: [];
1862
+ };
1544
1863
  customer_selected_assortment: {
1545
1864
  Row: {
1546
1865
  article_number: string | null;
@@ -1698,6 +2017,10 @@ export type Database = {
1698
2017
  sync_error: string | null;
1699
2018
  sync_status: string;
1700
2019
  trade_forms: string[];
2020
+ twinfield_code: string | null;
2021
+ twinfield_last_hash: string | null;
2022
+ twinfield_sync_error: string | null;
2023
+ twinfield_synced_at: string | null;
1701
2024
  updated_at: string;
1702
2025
  vat_display: string | null;
1703
2026
  vat_number: string | null;
@@ -1765,6 +2088,10 @@ export type Database = {
1765
2088
  sync_error?: string | null;
1766
2089
  sync_status?: string;
1767
2090
  trade_forms?: string[];
2091
+ twinfield_code?: string | null;
2092
+ twinfield_last_hash?: string | null;
2093
+ twinfield_sync_error?: string | null;
2094
+ twinfield_synced_at?: string | null;
1768
2095
  updated_at?: string;
1769
2096
  vat_display?: string | null;
1770
2097
  vat_number?: string | null;
@@ -1832,6 +2159,10 @@ export type Database = {
1832
2159
  sync_error?: string | null;
1833
2160
  sync_status?: string;
1834
2161
  trade_forms?: string[];
2162
+ twinfield_code?: string | null;
2163
+ twinfield_last_hash?: string | null;
2164
+ twinfield_sync_error?: string | null;
2165
+ twinfield_synced_at?: string | null;
1835
2166
  updated_at?: string;
1836
2167
  vat_display?: string | null;
1837
2168
  vat_number?: string | null;
@@ -3690,37 +4021,49 @@ export type Database = {
3690
4021
  }
3691
4022
  ];
3692
4023
  };
3693
- floriday_auction_letters_cache: {
4024
+ floriday_agreement_calloffs_cache: {
3694
4025
  Row: {
3695
- auction_letter_code: string;
3696
- clock_supply_id: string;
4026
+ agreement_id: string | null;
3697
4027
  connection_id: string;
3698
- content_type: string;
4028
+ data: Json;
4029
+ delivery_date: string | null;
3699
4030
  fetched_at: string;
4031
+ floriday_id: string;
3700
4032
  id: string;
3701
- storage_path: string;
4033
+ is_deleted: boolean;
4034
+ sequence_number: number;
4035
+ status: string | null;
4036
+ updated_at: string;
3702
4037
  };
3703
4038
  Insert: {
3704
- auction_letter_code: string;
3705
- clock_supply_id: string;
4039
+ agreement_id?: string | null;
3706
4040
  connection_id: string;
3707
- content_type?: string;
4041
+ data?: Json;
4042
+ delivery_date?: string | null;
3708
4043
  fetched_at?: string;
4044
+ floriday_id: string;
3709
4045
  id?: string;
3710
- storage_path: string;
4046
+ is_deleted?: boolean;
4047
+ sequence_number?: number;
4048
+ status?: string | null;
4049
+ updated_at?: string;
3711
4050
  };
3712
4051
  Update: {
3713
- auction_letter_code?: string;
3714
- clock_supply_id?: string;
4052
+ agreement_id?: string | null;
3715
4053
  connection_id?: string;
3716
- content_type?: string;
4054
+ data?: Json;
4055
+ delivery_date?: string | null;
3717
4056
  fetched_at?: string;
4057
+ floriday_id?: string;
3718
4058
  id?: string;
3719
- storage_path?: string;
4059
+ is_deleted?: boolean;
4060
+ sequence_number?: number;
4061
+ status?: string | null;
4062
+ updated_at?: string;
3720
4063
  };
3721
4064
  Relationships: [
3722
4065
  {
3723
- foreignKeyName: "floriday_auction_letters_cache_connection_id_fkey";
4066
+ foreignKeyName: "floriday_agreement_calloffs_cache_connection_id_fkey";
3724
4067
  columns: ["connection_id"];
3725
4068
  isOneToOne: false;
3726
4069
  referencedRelation: "floriday_connections";
@@ -3728,7 +4071,98 @@ export type Database = {
3728
4071
  }
3729
4072
  ];
3730
4073
  };
3731
- floriday_auto_fulfillment_log: {
4074
+ floriday_agreements_cache: {
4075
+ Row: {
4076
+ buyer_organization_id: string | null;
4077
+ connection_id: string;
4078
+ data: Json;
4079
+ fetched_at: string;
4080
+ floriday_id: string;
4081
+ id: string;
4082
+ is_deleted: boolean;
4083
+ sequence_number: number;
4084
+ status: string | null;
4085
+ updated_at: string;
4086
+ valid_from: string | null;
4087
+ valid_until: string | null;
4088
+ };
4089
+ Insert: {
4090
+ buyer_organization_id?: string | null;
4091
+ connection_id: string;
4092
+ data?: Json;
4093
+ fetched_at?: string;
4094
+ floriday_id: string;
4095
+ id?: string;
4096
+ is_deleted?: boolean;
4097
+ sequence_number?: number;
4098
+ status?: string | null;
4099
+ updated_at?: string;
4100
+ valid_from?: string | null;
4101
+ valid_until?: string | null;
4102
+ };
4103
+ Update: {
4104
+ buyer_organization_id?: string | null;
4105
+ connection_id?: string;
4106
+ data?: Json;
4107
+ fetched_at?: string;
4108
+ floriday_id?: string;
4109
+ id?: string;
4110
+ is_deleted?: boolean;
4111
+ sequence_number?: number;
4112
+ status?: string | null;
4113
+ updated_at?: string;
4114
+ valid_from?: string | null;
4115
+ valid_until?: string | null;
4116
+ };
4117
+ Relationships: [
4118
+ {
4119
+ foreignKeyName: "floriday_agreements_cache_connection_id_fkey";
4120
+ columns: ["connection_id"];
4121
+ isOneToOne: false;
4122
+ referencedRelation: "floriday_connections";
4123
+ referencedColumns: ["id"];
4124
+ }
4125
+ ];
4126
+ };
4127
+ floriday_auction_letters_cache: {
4128
+ Row: {
4129
+ auction_letter_code: string;
4130
+ clock_supply_id: string;
4131
+ connection_id: string;
4132
+ content_type: string;
4133
+ fetched_at: string;
4134
+ id: string;
4135
+ storage_path: string;
4136
+ };
4137
+ Insert: {
4138
+ auction_letter_code: string;
4139
+ clock_supply_id: string;
4140
+ connection_id: string;
4141
+ content_type?: string;
4142
+ fetched_at?: string;
4143
+ id?: string;
4144
+ storage_path: string;
4145
+ };
4146
+ Update: {
4147
+ auction_letter_code?: string;
4148
+ clock_supply_id?: string;
4149
+ connection_id?: string;
4150
+ content_type?: string;
4151
+ fetched_at?: string;
4152
+ id?: string;
4153
+ storage_path?: string;
4154
+ };
4155
+ Relationships: [
4156
+ {
4157
+ foreignKeyName: "floriday_auction_letters_cache_connection_id_fkey";
4158
+ columns: ["connection_id"];
4159
+ isOneToOne: false;
4160
+ referencedRelation: "floriday_connections";
4161
+ referencedColumns: ["id"];
4162
+ }
4163
+ ];
4164
+ };
4165
+ floriday_auto_fulfillment_log: {
3732
4166
  Row: {
3733
4167
  attempts: number;
3734
4168
  connection_id: string;
@@ -4208,27 +4642,6 @@ export type Database = {
4208
4642
  }
4209
4643
  ];
4210
4644
  };
4211
- floriday_continuous_stock_cache: {
4212
- Row: {
4213
- connection_id: string;
4214
- fetched_at: string;
4215
- number_of_pieces: number;
4216
- trade_item_id: string;
4217
- };
4218
- Insert: {
4219
- connection_id: string;
4220
- fetched_at?: string;
4221
- number_of_pieces?: number;
4222
- trade_item_id: string;
4223
- };
4224
- Update: {
4225
- connection_id?: string;
4226
- fetched_at?: string;
4227
- number_of_pieces?: number;
4228
- trade_item_id?: string;
4229
- };
4230
- Relationships: [];
4231
- };
4232
4645
  floriday_continuous_stock_queue: {
4233
4646
  Row: {
4234
4647
  attempts: number;
@@ -5032,8 +5445,6 @@ export type Database = {
5032
5445
  Row: {
5033
5446
  buyer_organization_id: string | null;
5034
5447
  connection_id: string;
5035
- controlled_at: string | null;
5036
- controlled_by: string | null;
5037
5448
  created_at: string;
5038
5449
  data: Json;
5039
5450
  floriday_id: string;
@@ -5045,8 +5456,6 @@ export type Database = {
5045
5456
  Insert: {
5046
5457
  buyer_organization_id?: string | null;
5047
5458
  connection_id: string;
5048
- controlled_at?: string | null;
5049
- controlled_by?: string | null;
5050
5459
  created_at?: string;
5051
5460
  data: Json;
5052
5461
  floriday_id: string;
@@ -5058,8 +5467,6 @@ export type Database = {
5058
5467
  Update: {
5059
5468
  buyer_organization_id?: string | null;
5060
5469
  connection_id?: string;
5061
- controlled_at?: string | null;
5062
- controlled_by?: string | null;
5063
5470
  created_at?: string;
5064
5471
  data?: Json;
5065
5472
  floriday_id?: string;
@@ -5251,47 +5658,6 @@ export type Database = {
5251
5658
  }
5252
5659
  ];
5253
5660
  };
5254
- floriday_trade_settings_customers_cache: {
5255
- Row: {
5256
- connection_id: string;
5257
- data: Json;
5258
- fetched_at: string;
5259
- floriday_id: string;
5260
- id: string;
5261
- is_deleted: boolean;
5262
- sequence_number: number;
5263
- updated_at: string;
5264
- };
5265
- Insert: {
5266
- connection_id: string;
5267
- data: Json;
5268
- fetched_at?: string;
5269
- floriday_id: string;
5270
- id?: string;
5271
- is_deleted?: boolean;
5272
- sequence_number?: number;
5273
- updated_at?: string;
5274
- };
5275
- Update: {
5276
- connection_id?: string;
5277
- data?: Json;
5278
- fetched_at?: string;
5279
- floriday_id?: string;
5280
- id?: string;
5281
- is_deleted?: boolean;
5282
- sequence_number?: number;
5283
- updated_at?: string;
5284
- };
5285
- Relationships: [
5286
- {
5287
- foreignKeyName: "floriday_trade_settings_customers_cache_connection_id_fkey";
5288
- columns: ["connection_id"];
5289
- isOneToOne: false;
5290
- referencedRelation: "floriday_connections";
5291
- referencedColumns: ["id"];
5292
- }
5293
- ];
5294
- };
5295
5661
  floriday_trips_cache: {
5296
5662
  Row: {
5297
5663
  carrier_organization_id: string | null;
@@ -5342,27 +5708,6 @@ export type Database = {
5342
5708
  }
5343
5709
  ];
5344
5710
  };
5345
- floriday_vbn_required_characteristics: {
5346
- Row: {
5347
- required_codes: string[];
5348
- updated_at: string;
5349
- updated_by: string | null;
5350
- vbn_code: string;
5351
- };
5352
- Insert: {
5353
- required_codes?: string[];
5354
- updated_at?: string;
5355
- updated_by?: string | null;
5356
- vbn_code: string;
5357
- };
5358
- Update: {
5359
- required_codes?: string[];
5360
- updated_at?: string;
5361
- updated_by?: string | null;
5362
- vbn_code?: string;
5363
- };
5364
- Relationships: [];
5365
- };
5366
5711
  floriday_warehouses_cache: {
5367
5712
  Row: {
5368
5713
  connection_id: string;
@@ -5859,135 +6204,430 @@ export type Database = {
5859
6204
  };
5860
6205
  Relationships: [];
5861
6206
  };
5862
- local_customer_agreements: {
6207
+ itk_contact_persons: {
5863
6208
  Row: {
5864
- base_price: number | null;
5865
6209
  created_at: string;
5866
- currency: string;
5867
6210
  customer_id: string;
6211
+ email: string | null;
5868
6212
  id: string;
5869
- min_quantity: number;
5870
- net_price: number;
5871
- notes: string | null;
5872
- product_category_id: string | null;
5873
- product_id: string | null;
6213
+ name: string;
6214
+ phone: string | null;
6215
+ role: string | null;
5874
6216
  updated_at: string;
5875
- valid_from: string | null;
5876
- valid_until: string | null;
5877
6217
  };
5878
6218
  Insert: {
5879
- base_price?: number | null;
5880
6219
  created_at?: string;
5881
- currency?: string;
5882
6220
  customer_id: string;
6221
+ email?: string | null;
5883
6222
  id?: string;
5884
- min_quantity?: number;
5885
- net_price: number;
5886
- notes?: string | null;
5887
- product_category_id?: string | null;
5888
- product_id?: string | null;
6223
+ name: string;
6224
+ phone?: string | null;
6225
+ role?: string | null;
5889
6226
  updated_at?: string;
5890
- valid_from?: string | null;
5891
- valid_until?: string | null;
5892
6227
  };
5893
6228
  Update: {
5894
- base_price?: number | null;
5895
6229
  created_at?: string;
5896
- currency?: string;
5897
6230
  customer_id?: string;
6231
+ email?: string | null;
5898
6232
  id?: string;
5899
- min_quantity?: number;
5900
- net_price?: number;
5901
- notes?: string | null;
5902
- product_category_id?: string | null;
5903
- product_id?: string | null;
6233
+ name?: string;
6234
+ phone?: string | null;
6235
+ role?: string | null;
5904
6236
  updated_at?: string;
5905
- valid_from?: string | null;
5906
- valid_until?: string | null;
5907
6237
  };
5908
6238
  Relationships: [
5909
6239
  {
5910
- foreignKeyName: "local_customer_agreements_customer_id_fkey";
6240
+ foreignKeyName: "itk_contact_persons_customer_id_fkey";
5911
6241
  columns: ["customer_id"];
5912
6242
  isOneToOne: false;
5913
- referencedRelation: "customers";
5914
- referencedColumns: ["id"];
5915
- },
5916
- {
5917
- foreignKeyName: "local_customer_agreements_product_category_id_fkey";
5918
- columns: ["product_category_id"];
5919
- isOneToOne: false;
5920
- referencedRelation: "product_categories";
5921
- referencedColumns: ["id"];
5922
- },
5923
- {
5924
- foreignKeyName: "local_customer_agreements_product_id_fkey";
5925
- columns: ["product_id"];
5926
- isOneToOne: false;
5927
- referencedRelation: "products";
6243
+ referencedRelation: "itk_customers";
5928
6244
  referencedColumns: ["id"];
5929
6245
  }
5930
6246
  ];
5931
6247
  };
5932
- local_customer_price_groups: {
6248
+ itk_customer_dynamic_values: {
5933
6249
  Row: {
5934
6250
  created_at: string;
5935
- currency: string;
5936
6251
  customer_id: string;
5937
- discount_type: string;
5938
- discount_value: number;
6252
+ field_id: string;
5939
6253
  id: string;
5940
- min_quantity: number;
5941
- notes: string | null;
5942
- product_category_id: string | null;
5943
- product_id: string | null;
5944
6254
  updated_at: string;
5945
- valid_from: string | null;
5946
- valid_until: string | null;
6255
+ value: string | null;
5947
6256
  };
5948
6257
  Insert: {
5949
6258
  created_at?: string;
5950
- currency?: string;
5951
6259
  customer_id: string;
5952
- discount_type: string;
5953
- discount_value: number;
6260
+ field_id: string;
5954
6261
  id?: string;
5955
- min_quantity?: number;
5956
- notes?: string | null;
5957
- product_category_id?: string | null;
5958
- product_id?: string | null;
5959
6262
  updated_at?: string;
5960
- valid_from?: string | null;
5961
- valid_until?: string | null;
6263
+ value?: string | null;
5962
6264
  };
5963
6265
  Update: {
5964
6266
  created_at?: string;
5965
- currency?: string;
5966
6267
  customer_id?: string;
5967
- discount_type?: string;
5968
- discount_value?: number;
6268
+ field_id?: string;
5969
6269
  id?: string;
5970
- min_quantity?: number;
5971
- notes?: string | null;
5972
- product_category_id?: string | null;
5973
- product_id?: string | null;
5974
6270
  updated_at?: string;
5975
- valid_from?: string | null;
5976
- valid_until?: string | null;
6271
+ value?: string | null;
5977
6272
  };
5978
6273
  Relationships: [
5979
6274
  {
5980
- foreignKeyName: "local_customer_price_groups_customer_id_fkey";
6275
+ foreignKeyName: "itk_customer_dynamic_values_customer_id_fkey";
5981
6276
  columns: ["customer_id"];
5982
6277
  isOneToOne: false;
5983
- referencedRelation: "customers";
6278
+ referencedRelation: "itk_customers";
5984
6279
  referencedColumns: ["id"];
5985
6280
  },
5986
6281
  {
5987
- foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
5988
- columns: ["product_category_id"];
6282
+ foreignKeyName: "itk_customer_dynamic_values_field_id_fkey";
6283
+ columns: ["field_id"];
5989
6284
  isOneToOne: false;
5990
- referencedRelation: "product_categories";
6285
+ referencedRelation: "itk_dynamic_fields";
6286
+ referencedColumns: ["id"];
6287
+ }
6288
+ ];
6289
+ };
6290
+ itk_customer_notes: {
6291
+ Row: {
6292
+ body: string;
6293
+ created_at: string;
6294
+ created_by: string | null;
6295
+ customer_id: string;
6296
+ id: string;
6297
+ note_type: string;
6298
+ updated_at: string;
6299
+ };
6300
+ Insert: {
6301
+ body: string;
6302
+ created_at?: string;
6303
+ created_by?: string | null;
6304
+ customer_id: string;
6305
+ id?: string;
6306
+ note_type?: string;
6307
+ updated_at?: string;
6308
+ };
6309
+ Update: {
6310
+ body?: string;
6311
+ created_at?: string;
6312
+ created_by?: string | null;
6313
+ customer_id?: string;
6314
+ id?: string;
6315
+ note_type?: string;
6316
+ updated_at?: string;
6317
+ };
6318
+ Relationships: [
6319
+ {
6320
+ foreignKeyName: "itk_customer_notes_customer_id_fkey";
6321
+ columns: ["customer_id"];
6322
+ isOneToOne: false;
6323
+ referencedRelation: "itk_customers";
6324
+ referencedColumns: ["id"];
6325
+ }
6326
+ ];
6327
+ };
6328
+ itk_customers: {
6329
+ Row: {
6330
+ billing_city: string | null;
6331
+ billing_postcode: string | null;
6332
+ billing_street: string | null;
6333
+ created_at: string;
6334
+ general_email: string | null;
6335
+ general_phone: string | null;
6336
+ id: string;
6337
+ legacy_customer_id: string | null;
6338
+ name: string;
6339
+ segment: Database["public"]["Enums"]["itk_customer_segment"];
6340
+ updated_at: string;
6341
+ };
6342
+ Insert: {
6343
+ billing_city?: string | null;
6344
+ billing_postcode?: string | null;
6345
+ billing_street?: string | null;
6346
+ created_at?: string;
6347
+ general_email?: string | null;
6348
+ general_phone?: string | null;
6349
+ id?: string;
6350
+ legacy_customer_id?: string | null;
6351
+ name: string;
6352
+ segment?: Database["public"]["Enums"]["itk_customer_segment"];
6353
+ updated_at?: string;
6354
+ };
6355
+ Update: {
6356
+ billing_city?: string | null;
6357
+ billing_postcode?: string | null;
6358
+ billing_street?: string | null;
6359
+ created_at?: string;
6360
+ general_email?: string | null;
6361
+ general_phone?: string | null;
6362
+ id?: string;
6363
+ legacy_customer_id?: string | null;
6364
+ name?: string;
6365
+ segment?: Database["public"]["Enums"]["itk_customer_segment"];
6366
+ updated_at?: string;
6367
+ };
6368
+ Relationships: [
6369
+ {
6370
+ foreignKeyName: "itk_customers_legacy_customer_id_fkey";
6371
+ columns: ["legacy_customer_id"];
6372
+ isOneToOne: false;
6373
+ referencedRelation: "customers";
6374
+ referencedColumns: ["id"];
6375
+ }
6376
+ ];
6377
+ };
6378
+ itk_dynamic_fields: {
6379
+ Row: {
6380
+ created_at: string;
6381
+ field_name: string;
6382
+ field_type: Database["public"]["Enums"]["itk_dynamic_field_type"];
6383
+ id: string;
6384
+ options: Json;
6385
+ sort_order: number;
6386
+ updated_at: string;
6387
+ };
6388
+ Insert: {
6389
+ created_at?: string;
6390
+ field_name: string;
6391
+ field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"];
6392
+ id?: string;
6393
+ options?: Json;
6394
+ sort_order?: number;
6395
+ updated_at?: string;
6396
+ };
6397
+ Update: {
6398
+ created_at?: string;
6399
+ field_name?: string;
6400
+ field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"];
6401
+ id?: string;
6402
+ options?: Json;
6403
+ sort_order?: number;
6404
+ updated_at?: string;
6405
+ };
6406
+ Relationships: [];
6407
+ };
6408
+ itk_work_locations: {
6409
+ Row: {
6410
+ city: string | null;
6411
+ created_at: string;
6412
+ customer_id: string;
6413
+ id: string;
6414
+ instructions: string | null;
6415
+ label: string;
6416
+ latitude: number | null;
6417
+ longitude: number | null;
6418
+ postcode: string | null;
6419
+ street: string | null;
6420
+ updated_at: string;
6421
+ };
6422
+ Insert: {
6423
+ city?: string | null;
6424
+ created_at?: string;
6425
+ customer_id: string;
6426
+ id?: string;
6427
+ instructions?: string | null;
6428
+ label: string;
6429
+ latitude?: number | null;
6430
+ longitude?: number | null;
6431
+ postcode?: string | null;
6432
+ street?: string | null;
6433
+ updated_at?: string;
6434
+ };
6435
+ Update: {
6436
+ city?: string | null;
6437
+ created_at?: string;
6438
+ customer_id?: string;
6439
+ id?: string;
6440
+ instructions?: string | null;
6441
+ label?: string;
6442
+ latitude?: number | null;
6443
+ longitude?: number | null;
6444
+ postcode?: string | null;
6445
+ street?: string | null;
6446
+ updated_at?: string;
6447
+ };
6448
+ Relationships: [
6449
+ {
6450
+ foreignKeyName: "itk_work_locations_customer_id_fkey";
6451
+ columns: ["customer_id"];
6452
+ isOneToOne: false;
6453
+ referencedRelation: "itk_customers";
6454
+ referencedColumns: ["id"];
6455
+ }
6456
+ ];
6457
+ };
6458
+ leave_requests: {
6459
+ Row: {
6460
+ created_at: string;
6461
+ end_date: string;
6462
+ id: string;
6463
+ reason: string | null;
6464
+ start_date: string;
6465
+ status: string;
6466
+ tenant_id: string;
6467
+ updated_at: string;
6468
+ user_id: string;
6469
+ };
6470
+ Insert: {
6471
+ created_at?: string;
6472
+ end_date: string;
6473
+ id?: string;
6474
+ reason?: string | null;
6475
+ start_date: string;
6476
+ status?: string;
6477
+ tenant_id?: string;
6478
+ updated_at?: string;
6479
+ user_id: string;
6480
+ };
6481
+ Update: {
6482
+ created_at?: string;
6483
+ end_date?: string;
6484
+ id?: string;
6485
+ reason?: string | null;
6486
+ start_date?: string;
6487
+ status?: string;
6488
+ tenant_id?: string;
6489
+ updated_at?: string;
6490
+ user_id?: string;
6491
+ };
6492
+ Relationships: [
6493
+ {
6494
+ foreignKeyName: "leave_requests_user_id_fkey";
6495
+ columns: ["user_id"];
6496
+ isOneToOne: false;
6497
+ referencedRelation: "monteurs";
6498
+ referencedColumns: ["id"];
6499
+ }
6500
+ ];
6501
+ };
6502
+ local_customer_agreements: {
6503
+ Row: {
6504
+ base_price: number | null;
6505
+ created_at: string;
6506
+ currency: string;
6507
+ customer_id: string;
6508
+ id: string;
6509
+ min_quantity: number;
6510
+ net_price: number;
6511
+ notes: string | null;
6512
+ product_category_id: string | null;
6513
+ product_id: string | null;
6514
+ updated_at: string;
6515
+ valid_from: string | null;
6516
+ valid_until: string | null;
6517
+ };
6518
+ Insert: {
6519
+ base_price?: number | null;
6520
+ created_at?: string;
6521
+ currency?: string;
6522
+ customer_id: string;
6523
+ id?: string;
6524
+ min_quantity?: number;
6525
+ net_price: number;
6526
+ notes?: string | null;
6527
+ product_category_id?: string | null;
6528
+ product_id?: string | null;
6529
+ updated_at?: string;
6530
+ valid_from?: string | null;
6531
+ valid_until?: string | null;
6532
+ };
6533
+ Update: {
6534
+ base_price?: number | null;
6535
+ created_at?: string;
6536
+ currency?: string;
6537
+ customer_id?: string;
6538
+ id?: string;
6539
+ min_quantity?: number;
6540
+ net_price?: number;
6541
+ notes?: string | null;
6542
+ product_category_id?: string | null;
6543
+ product_id?: string | null;
6544
+ updated_at?: string;
6545
+ valid_from?: string | null;
6546
+ valid_until?: string | null;
6547
+ };
6548
+ Relationships: [
6549
+ {
6550
+ foreignKeyName: "local_customer_agreements_customer_id_fkey";
6551
+ columns: ["customer_id"];
6552
+ isOneToOne: false;
6553
+ referencedRelation: "customers";
6554
+ referencedColumns: ["id"];
6555
+ },
6556
+ {
6557
+ foreignKeyName: "local_customer_agreements_product_category_id_fkey";
6558
+ columns: ["product_category_id"];
6559
+ isOneToOne: false;
6560
+ referencedRelation: "product_categories";
6561
+ referencedColumns: ["id"];
6562
+ },
6563
+ {
6564
+ foreignKeyName: "local_customer_agreements_product_id_fkey";
6565
+ columns: ["product_id"];
6566
+ isOneToOne: false;
6567
+ referencedRelation: "products";
6568
+ referencedColumns: ["id"];
6569
+ }
6570
+ ];
6571
+ };
6572
+ local_customer_price_groups: {
6573
+ Row: {
6574
+ created_at: string;
6575
+ currency: string;
6576
+ customer_id: string;
6577
+ discount_type: string;
6578
+ discount_value: number;
6579
+ id: string;
6580
+ min_quantity: number;
6581
+ notes: string | null;
6582
+ product_category_id: string | null;
6583
+ product_id: string | null;
6584
+ updated_at: string;
6585
+ valid_from: string | null;
6586
+ valid_until: string | null;
6587
+ };
6588
+ Insert: {
6589
+ created_at?: string;
6590
+ currency?: string;
6591
+ customer_id: string;
6592
+ discount_type: string;
6593
+ discount_value: number;
6594
+ id?: string;
6595
+ min_quantity?: number;
6596
+ notes?: string | null;
6597
+ product_category_id?: string | null;
6598
+ product_id?: string | null;
6599
+ updated_at?: string;
6600
+ valid_from?: string | null;
6601
+ valid_until?: string | null;
6602
+ };
6603
+ Update: {
6604
+ created_at?: string;
6605
+ currency?: string;
6606
+ customer_id?: string;
6607
+ discount_type?: string;
6608
+ discount_value?: number;
6609
+ id?: string;
6610
+ min_quantity?: number;
6611
+ notes?: string | null;
6612
+ product_category_id?: string | null;
6613
+ product_id?: string | null;
6614
+ updated_at?: string;
6615
+ valid_from?: string | null;
6616
+ valid_until?: string | null;
6617
+ };
6618
+ Relationships: [
6619
+ {
6620
+ foreignKeyName: "local_customer_price_groups_customer_id_fkey";
6621
+ columns: ["customer_id"];
6622
+ isOneToOne: false;
6623
+ referencedRelation: "customers";
6624
+ referencedColumns: ["id"];
6625
+ },
6626
+ {
6627
+ foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
6628
+ columns: ["product_category_id"];
6629
+ isOneToOne: false;
6630
+ referencedRelation: "product_categories";
5991
6631
  referencedColumns: ["id"];
5992
6632
  },
5993
6633
  {
@@ -6790,62 +7430,66 @@ export type Database = {
6790
7430
  };
6791
7431
  manufacture_products: {
6792
7432
  Row: {
6793
- aantal_te_produceren: number;
6794
7433
  created_at: string;
6795
7434
  description: string | null;
6796
7435
  id: string;
6797
7436
  is_active: boolean;
6798
- location_id: string | null;
6799
7437
  name: string;
6800
- partij_nummer: string | null;
6801
- photos: Json;
6802
7438
  produced_stock: number;
6803
7439
  product_code: string;
6804
7440
  tenant_id: string;
6805
- unit: string;
6806
7441
  updated_at: string;
6807
7442
  };
6808
7443
  Insert: {
6809
- aantal_te_produceren?: number;
6810
7444
  created_at?: string;
6811
7445
  description?: string | null;
6812
7446
  id?: string;
6813
7447
  is_active?: boolean;
6814
- location_id?: string | null;
6815
7448
  name: string;
6816
- partij_nummer?: string | null;
6817
- photos?: Json;
6818
7449
  produced_stock?: number;
6819
7450
  product_code: string;
6820
7451
  tenant_id: string;
6821
- unit?: string;
6822
7452
  updated_at?: string;
6823
7453
  };
6824
7454
  Update: {
6825
- aantal_te_produceren?: number;
6826
7455
  created_at?: string;
6827
7456
  description?: string | null;
6828
7457
  id?: string;
6829
7458
  is_active?: boolean;
6830
- location_id?: string | null;
6831
7459
  name?: string;
6832
- partij_nummer?: string | null;
6833
- photos?: Json;
6834
7460
  produced_stock?: number;
6835
7461
  product_code?: string;
6836
7462
  tenant_id?: string;
6837
- unit?: string;
6838
7463
  updated_at?: string;
6839
7464
  };
6840
- Relationships: [
6841
- {
6842
- foreignKeyName: "manufacture_products_location_id_fkey";
6843
- columns: ["location_id"];
6844
- isOneToOne: false;
6845
- referencedRelation: "locations";
6846
- referencedColumns: ["id"];
6847
- }
6848
- ];
7465
+ Relationships: [];
7466
+ };
7467
+ module_permissions: {
7468
+ Row: {
7469
+ created_at: string;
7470
+ id: string;
7471
+ module_id: string;
7472
+ permission: string;
7473
+ role: Database["public"]["Enums"]["app_role"];
7474
+ updated_at: string;
7475
+ };
7476
+ Insert: {
7477
+ created_at?: string;
7478
+ id?: string;
7479
+ module_id: string;
7480
+ permission: string;
7481
+ role: Database["public"]["Enums"]["app_role"];
7482
+ updated_at?: string;
7483
+ };
7484
+ Update: {
7485
+ created_at?: string;
7486
+ id?: string;
7487
+ module_id?: string;
7488
+ permission?: string;
7489
+ role?: Database["public"]["Enums"]["app_role"];
7490
+ updated_at?: string;
7491
+ };
7492
+ Relationships: [];
6849
7493
  };
6850
7494
  monteurs: {
6851
7495
  Row: {
@@ -8210,6 +8854,82 @@ export type Database = {
8210
8854
  };
8211
8855
  Relationships: [];
8212
8856
  };
8857
+ planning_item_assistants: {
8858
+ Row: {
8859
+ created_at: string;
8860
+ created_by: string | null;
8861
+ monteur_id: string;
8862
+ planning_item_id: string;
8863
+ };
8864
+ Insert: {
8865
+ created_at?: string;
8866
+ created_by?: string | null;
8867
+ monteur_id: string;
8868
+ planning_item_id: string;
8869
+ };
8870
+ Update: {
8871
+ created_at?: string;
8872
+ created_by?: string | null;
8873
+ monteur_id?: string;
8874
+ planning_item_id?: string;
8875
+ };
8876
+ Relationships: [
8877
+ {
8878
+ foreignKeyName: "planning_item_assistants_planning_item_id_fkey";
8879
+ columns: ["planning_item_id"];
8880
+ isOneToOne: false;
8881
+ referencedRelation: "planning_items";
8882
+ referencedColumns: ["id"];
8883
+ }
8884
+ ];
8885
+ };
8886
+ planning_items: {
8887
+ Row: {
8888
+ assigned_monteur_id: string;
8889
+ created_at: string;
8890
+ created_by: string | null;
8891
+ end_at: string;
8892
+ id: string;
8893
+ notes: string | null;
8894
+ start_at: string;
8895
+ status: Database["public"]["Enums"]["planning_item_status"];
8896
+ updated_at: string;
8897
+ werkbon_id: string;
8898
+ };
8899
+ Insert: {
8900
+ assigned_monteur_id: string;
8901
+ created_at?: string;
8902
+ created_by?: string | null;
8903
+ end_at: string;
8904
+ id?: string;
8905
+ notes?: string | null;
8906
+ start_at: string;
8907
+ status?: Database["public"]["Enums"]["planning_item_status"];
8908
+ updated_at?: string;
8909
+ werkbon_id: string;
8910
+ };
8911
+ Update: {
8912
+ assigned_monteur_id?: string;
8913
+ created_at?: string;
8914
+ created_by?: string | null;
8915
+ end_at?: string;
8916
+ id?: string;
8917
+ notes?: string | null;
8918
+ start_at?: string;
8919
+ status?: Database["public"]["Enums"]["planning_item_status"];
8920
+ updated_at?: string;
8921
+ werkbon_id?: string;
8922
+ };
8923
+ Relationships: [
8924
+ {
8925
+ foreignKeyName: "planning_items_werkbon_id_fkey";
8926
+ columns: ["werkbon_id"];
8927
+ isOneToOne: false;
8928
+ referencedRelation: "werkbonnen";
8929
+ referencedColumns: ["id"];
8930
+ }
8931
+ ];
8932
+ };
8213
8933
  product_bom_items: {
8214
8934
  Row: {
8215
8935
  component_product_id: string | null;
@@ -8563,8 +9283,6 @@ export type Database = {
8563
9283
  crates_per_layer: number;
8564
9284
  created_at: string;
8565
9285
  custom_fields: Json;
8566
- floriday_active: boolean;
8567
- floriday_payload: Json;
8568
9286
  floriday_trade_item_id: string | null;
8569
9287
  id: string;
8570
9288
  image_url: string | null;
@@ -8582,8 +9300,6 @@ export type Database = {
8582
9300
  trade_item_key: string | null;
8583
9301
  unit: string;
8584
9302
  updated_at: string;
8585
- vat_code: string | null;
8586
- vat_rate: number | null;
8587
9303
  weight: string | null;
8588
9304
  };
8589
9305
  Insert: {
@@ -8593,8 +9309,6 @@ export type Database = {
8593
9309
  crates_per_layer?: number;
8594
9310
  created_at?: string;
8595
9311
  custom_fields?: Json;
8596
- floriday_active?: boolean;
8597
- floriday_payload?: Json;
8598
9312
  floriday_trade_item_id?: string | null;
8599
9313
  id?: string;
8600
9314
  image_url?: string | null;
@@ -8612,8 +9326,6 @@ export type Database = {
8612
9326
  trade_item_key?: string | null;
8613
9327
  unit?: string;
8614
9328
  updated_at?: string;
8615
- vat_code?: string | null;
8616
- vat_rate?: number | null;
8617
9329
  weight?: string | null;
8618
9330
  };
8619
9331
  Update: {
@@ -8623,8 +9335,6 @@ export type Database = {
8623
9335
  crates_per_layer?: number;
8624
9336
  created_at?: string;
8625
9337
  custom_fields?: Json;
8626
- floriday_active?: boolean;
8627
- floriday_payload?: Json;
8628
9338
  floriday_trade_item_id?: string | null;
8629
9339
  id?: string;
8630
9340
  image_url?: string | null;
@@ -8642,8 +9352,6 @@ export type Database = {
8642
9352
  trade_item_key?: string | null;
8643
9353
  unit?: string;
8644
9354
  updated_at?: string;
8645
- vat_code?: string | null;
8646
- vat_rate?: number | null;
8647
9355
  weight?: string | null;
8648
9356
  };
8649
9357
  Relationships: [];
@@ -8651,6 +9359,7 @@ export type Database = {
8651
9359
  profiles: {
8652
9360
  Row: {
8653
9361
  address: string | null;
9362
+ avatar_url: string | null;
8654
9363
  created_at: string;
8655
9364
  display_name: string | null;
8656
9365
  email: string | null;
@@ -8662,6 +9371,7 @@ export type Database = {
8662
9371
  };
8663
9372
  Insert: {
8664
9373
  address?: string | null;
9374
+ avatar_url?: string | null;
8665
9375
  created_at?: string;
8666
9376
  display_name?: string | null;
8667
9377
  email?: string | null;
@@ -8673,6 +9383,7 @@ export type Database = {
8673
9383
  };
8674
9384
  Update: {
8675
9385
  address?: string | null;
9386
+ avatar_url?: string | null;
8676
9387
  created_at?: string;
8677
9388
  display_name?: string | null;
8678
9389
  email?: string | null;
@@ -9569,7 +10280,6 @@ export type Database = {
9569
10280
  order_id: string | null;
9570
10281
  order_item_id: string | null;
9571
10282
  order_source: string | null;
9572
- parent_trade_item_key: string | null;
9573
10283
  physical_after: number | null;
9574
10284
  physical_before: number | null;
9575
10285
  production_batch_id: string | null;
@@ -9588,7 +10298,6 @@ export type Database = {
9588
10298
  order_id?: string | null;
9589
10299
  order_item_id?: string | null;
9590
10300
  order_source?: string | null;
9591
- parent_trade_item_key?: string | null;
9592
10301
  physical_after?: number | null;
9593
10302
  physical_before?: number | null;
9594
10303
  production_batch_id?: string | null;
@@ -9607,7 +10316,6 @@ export type Database = {
9607
10316
  order_id?: string | null;
9608
10317
  order_item_id?: string | null;
9609
10318
  order_source?: string | null;
9610
- parent_trade_item_key?: string | null;
9611
10319
  physical_after?: number | null;
9612
10320
  physical_before?: number | null;
9613
10321
  production_batch_id?: string | null;
@@ -9714,6 +10422,27 @@ export type Database = {
9714
10422
  };
9715
10423
  Relationships: [];
9716
10424
  };
10425
+ technician_rates: {
10426
+ Row: {
10427
+ created_at: string;
10428
+ hourly_rate_cents: number;
10429
+ updated_at: string;
10430
+ user_id: string;
10431
+ };
10432
+ Insert: {
10433
+ created_at?: string;
10434
+ hourly_rate_cents?: number;
10435
+ updated_at?: string;
10436
+ user_id: string;
10437
+ };
10438
+ Update: {
10439
+ created_at?: string;
10440
+ hourly_rate_cents?: number;
10441
+ updated_at?: string;
10442
+ user_id?: string;
10443
+ };
10444
+ Relationships: [];
10445
+ };
9717
10446
  tenants: {
9718
10447
  Row: {
9719
10448
  created_at: string;
@@ -10121,7 +10850,7 @@ export type Database = {
10121
10850
  twinfield_connections: {
10122
10851
  Row: {
10123
10852
  access_token: string | null;
10124
- client_id: string | null;
10853
+ client_id: string;
10125
10854
  client_secret: string | null;
10126
10855
  cluster_uri: string | null;
10127
10856
  company_code: string | null;
@@ -10133,7 +10862,7 @@ export type Database = {
10133
10862
  is_active: boolean;
10134
10863
  label: string | null;
10135
10864
  office_code: string | null;
10136
- redirect_uri: string | null;
10865
+ redirect_uri: string;
10137
10866
  refresh_token: string | null;
10138
10867
  token_expires_at: string | null;
10139
10868
  updated_at: string;
@@ -10141,7 +10870,7 @@ export type Database = {
10141
10870
  };
10142
10871
  Insert: {
10143
10872
  access_token?: string | null;
10144
- client_id?: string | null;
10873
+ client_id: string;
10145
10874
  client_secret?: string | null;
10146
10875
  cluster_uri?: string | null;
10147
10876
  company_code?: string | null;
@@ -10153,7 +10882,7 @@ export type Database = {
10153
10882
  is_active?: boolean;
10154
10883
  label?: string | null;
10155
10884
  office_code?: string | null;
10156
- redirect_uri?: string | null;
10885
+ redirect_uri: string;
10157
10886
  refresh_token?: string | null;
10158
10887
  token_expires_at?: string | null;
10159
10888
  updated_at?: string;
@@ -10161,7 +10890,7 @@ export type Database = {
10161
10890
  };
10162
10891
  Update: {
10163
10892
  access_token?: string | null;
10164
- client_id?: string | null;
10893
+ client_id?: string;
10165
10894
  client_secret?: string | null;
10166
10895
  cluster_uri?: string | null;
10167
10896
  company_code?: string | null;
@@ -10173,7 +10902,7 @@ export type Database = {
10173
10902
  is_active?: boolean;
10174
10903
  label?: string | null;
10175
10904
  office_code?: string | null;
10176
- redirect_uri?: string | null;
10905
+ redirect_uri?: string;
10177
10906
  refresh_token?: string | null;
10178
10907
  token_expires_at?: string | null;
10179
10908
  updated_at?: string;
@@ -10233,6 +10962,7 @@ export type Database = {
10233
10962
  country: string | null;
10234
10963
  created_at: string;
10235
10964
  email: string | null;
10965
+ external_group_key: string | null;
10236
10966
  id: string;
10237
10967
  last_synced_at: string | null;
10238
10968
  name: string;
@@ -10251,6 +10981,7 @@ export type Database = {
10251
10981
  country?: string | null;
10252
10982
  created_at?: string;
10253
10983
  email?: string | null;
10984
+ external_group_key?: string | null;
10254
10985
  id?: string;
10255
10986
  last_synced_at?: string | null;
10256
10987
  name: string;
@@ -10269,6 +11000,7 @@ export type Database = {
10269
11000
  country?: string | null;
10270
11001
  created_at?: string;
10271
11002
  email?: string | null;
11003
+ external_group_key?: string | null;
10272
11004
  id?: string;
10273
11005
  last_synced_at?: string | null;
10274
11006
  name?: string;
@@ -10486,6 +11218,8 @@ export type Database = {
10486
11218
  twinfield_invoice_settings: {
10487
11219
  Row: {
10488
11220
  created_at: string;
11221
+ debtor_gl_account: string;
11222
+ default_credit_invoice_type: string | null;
10489
11223
  default_gl_account: string;
10490
11224
  default_invoice_type: string;
10491
11225
  default_payment_term_days: number;
@@ -10494,11 +11228,15 @@ export type Database = {
10494
11228
  invoice_enabled_fo: boolean;
10495
11229
  invoice_enabled_ho: boolean;
10496
11230
  invoice_enabled_mo: boolean;
11231
+ payment_gl_account: string;
11232
+ payment_journal_code: string;
10497
11233
  updated_at: string;
10498
11234
  user_id: string;
10499
11235
  };
10500
11236
  Insert: {
10501
11237
  created_at?: string;
11238
+ debtor_gl_account?: string;
11239
+ default_credit_invoice_type?: string | null;
10502
11240
  default_gl_account?: string;
10503
11241
  default_invoice_type?: string;
10504
11242
  default_payment_term_days?: number;
@@ -10507,11 +11245,15 @@ export type Database = {
10507
11245
  invoice_enabled_fo?: boolean;
10508
11246
  invoice_enabled_ho?: boolean;
10509
11247
  invoice_enabled_mo?: boolean;
11248
+ payment_gl_account?: string;
11249
+ payment_journal_code?: string;
10510
11250
  updated_at?: string;
10511
11251
  user_id: string;
10512
11252
  };
10513
11253
  Update: {
10514
11254
  created_at?: string;
11255
+ debtor_gl_account?: string;
11256
+ default_credit_invoice_type?: string | null;
10515
11257
  default_gl_account?: string;
10516
11258
  default_invoice_type?: string;
10517
11259
  default_payment_term_days?: number;
@@ -10520,6 +11262,8 @@ export type Database = {
10520
11262
  invoice_enabled_fo?: boolean;
10521
11263
  invoice_enabled_ho?: boolean;
10522
11264
  invoice_enabled_mo?: boolean;
11265
+ payment_gl_account?: string;
11266
+ payment_journal_code?: string;
10523
11267
  updated_at?: string;
10524
11268
  user_id?: string;
10525
11269
  };
@@ -10742,43 +11486,49 @@ export type Database = {
10742
11486
  };
10743
11487
  twinfield_push_queue: {
10744
11488
  Row: {
11489
+ action: string;
10745
11490
  attempts: number;
10746
11491
  connection_id: string;
10747
11492
  created_at: string;
11493
+ customer_id: string | null;
10748
11494
  external_id: string | null;
10749
11495
  id: string;
10750
11496
  idempotency_key: string;
10751
11497
  last_error: string | null;
10752
11498
  next_attempt_at: string;
10753
- office_code: string;
11499
+ office_code: string | null;
10754
11500
  payload: Json;
10755
11501
  status: string;
10756
11502
  updated_at: string;
10757
11503
  };
10758
11504
  Insert: {
11505
+ action?: string;
10759
11506
  attempts?: number;
10760
11507
  connection_id: string;
10761
11508
  created_at?: string;
11509
+ customer_id?: string | null;
10762
11510
  external_id?: string | null;
10763
11511
  id?: string;
10764
11512
  idempotency_key: string;
10765
11513
  last_error?: string | null;
10766
11514
  next_attempt_at?: string;
10767
- office_code: string;
11515
+ office_code?: string | null;
10768
11516
  payload: Json;
10769
11517
  status?: string;
10770
11518
  updated_at?: string;
10771
11519
  };
10772
11520
  Update: {
11521
+ action?: string;
10773
11522
  attempts?: number;
10774
11523
  connection_id?: string;
10775
11524
  created_at?: string;
11525
+ customer_id?: string | null;
10776
11526
  external_id?: string | null;
10777
11527
  id?: string;
10778
11528
  idempotency_key?: string;
10779
11529
  last_error?: string | null;
10780
11530
  next_attempt_at?: string;
10781
- office_code?: string;
11531
+ office_code?: string | null;
10782
11532
  payload?: Json;
10783
11533
  status?: string;
10784
11534
  updated_at?: string;
@@ -10790,6 +11540,13 @@ export type Database = {
10790
11540
  isOneToOne: false;
10791
11541
  referencedRelation: "twinfield_connections";
10792
11542
  referencedColumns: ["id"];
11543
+ },
11544
+ {
11545
+ foreignKeyName: "twinfield_push_queue_customer_id_fkey";
11546
+ columns: ["customer_id"];
11547
+ isOneToOne: false;
11548
+ referencedRelation: "customers";
11549
+ referencedColumns: ["id"];
10793
11550
  }
10794
11551
  ];
10795
11552
  };
@@ -10973,104 +11730,466 @@ export type Database = {
10973
11730
  error_message: string | null;
10974
11731
  filename: string | null;
10975
11732
  id: string;
10976
- idempotency_key: string | null;
10977
- module: string;
10978
- path: string;
10979
- reference_id: string | null;
10980
- request_body_hash: string | null;
10981
- request_timestamp: number | null;
10982
- response_content_type: string | null;
10983
- response_status: number | null;
10984
- size_bytes: number | null;
11733
+ idempotency_key: string | null;
11734
+ module: string;
11735
+ path: string;
11736
+ reference_id: string | null;
11737
+ request_body_hash: string | null;
11738
+ request_timestamp: number | null;
11739
+ response_content_type: string | null;
11740
+ response_status: number | null;
11741
+ size_bytes: number | null;
11742
+ };
11743
+ Insert: {
11744
+ action?: string;
11745
+ attempt_number?: number;
11746
+ caller?: string;
11747
+ client_user_id?: string | null;
11748
+ content_type?: string | null;
11749
+ created_at?: string;
11750
+ environment: string;
11751
+ error_message?: string | null;
11752
+ filename?: string | null;
11753
+ id?: string;
11754
+ idempotency_key?: string | null;
11755
+ module?: string;
11756
+ path: string;
11757
+ reference_id?: string | null;
11758
+ request_body_hash?: string | null;
11759
+ request_timestamp?: number | null;
11760
+ response_content_type?: string | null;
11761
+ response_status?: number | null;
11762
+ size_bytes?: number | null;
11763
+ };
11764
+ Update: {
11765
+ action?: string;
11766
+ attempt_number?: number;
11767
+ caller?: string;
11768
+ client_user_id?: string | null;
11769
+ content_type?: string | null;
11770
+ created_at?: string;
11771
+ environment?: string;
11772
+ error_message?: string | null;
11773
+ filename?: string | null;
11774
+ id?: string;
11775
+ idempotency_key?: string | null;
11776
+ module?: string;
11777
+ path?: string;
11778
+ reference_id?: string | null;
11779
+ request_body_hash?: string | null;
11780
+ request_timestamp?: number | null;
11781
+ response_content_type?: string | null;
11782
+ response_status?: number | null;
11783
+ size_bytes?: number | null;
11784
+ };
11785
+ Relationships: [];
11786
+ };
11787
+ voorraad_publish_attempts: {
11788
+ Row: {
11789
+ action: string;
11790
+ connection_id: string | null;
11791
+ created_at: string;
11792
+ error: string | null;
11793
+ gateway_attempt_id: string | null;
11794
+ gateway_status: number | null;
11795
+ id: string;
11796
+ intent: string;
11797
+ ok: boolean;
11798
+ request_summary: Json | null;
11799
+ trade_item_id: string | null;
11800
+ user_id: string;
11801
+ };
11802
+ Insert: {
11803
+ action: string;
11804
+ connection_id?: string | null;
11805
+ created_at?: string;
11806
+ error?: string | null;
11807
+ gateway_attempt_id?: string | null;
11808
+ gateway_status?: number | null;
11809
+ id?: string;
11810
+ intent: string;
11811
+ ok: boolean;
11812
+ request_summary?: Json | null;
11813
+ trade_item_id?: string | null;
11814
+ user_id: string;
11815
+ };
11816
+ Update: {
11817
+ action?: string;
11818
+ connection_id?: string | null;
11819
+ created_at?: string;
11820
+ error?: string | null;
11821
+ gateway_attempt_id?: string | null;
11822
+ gateway_status?: number | null;
11823
+ id?: string;
11824
+ intent?: string;
11825
+ ok?: boolean;
11826
+ request_summary?: Json | null;
11827
+ trade_item_id?: string | null;
11828
+ user_id?: string;
11829
+ };
11830
+ Relationships: [];
11831
+ };
11832
+ werkbon_package_ai_rules: {
11833
+ Row: {
11834
+ active: boolean;
11835
+ case_sensitive: boolean;
11836
+ created_at: string;
11837
+ id: string;
11838
+ package_id: string;
11839
+ priority: number;
11840
+ rule_type: string;
11841
+ updated_at: string;
11842
+ value: string;
11843
+ };
11844
+ Insert: {
11845
+ active?: boolean;
11846
+ case_sensitive?: boolean;
11847
+ created_at?: string;
11848
+ id?: string;
11849
+ package_id: string;
11850
+ priority?: number;
11851
+ rule_type: string;
11852
+ updated_at?: string;
11853
+ value: string;
11854
+ };
11855
+ Update: {
11856
+ active?: boolean;
11857
+ case_sensitive?: boolean;
11858
+ created_at?: string;
11859
+ id?: string;
11860
+ package_id?: string;
11861
+ priority?: number;
11862
+ rule_type?: string;
11863
+ updated_at?: string;
11864
+ value?: string;
11865
+ };
11866
+ Relationships: [
11867
+ {
11868
+ foreignKeyName: "werkbon_package_ai_rules_package_id_fkey";
11869
+ columns: ["package_id"];
11870
+ isOneToOne: false;
11871
+ referencedRelation: "werkbon_packages";
11872
+ referencedColumns: ["id"];
11873
+ }
11874
+ ];
11875
+ };
11876
+ werkbon_package_categories: {
11877
+ Row: {
11878
+ active: boolean;
11879
+ created_at: string;
11880
+ id: string;
11881
+ kleur: string | null;
11882
+ naam: string;
11883
+ sort_order: number;
11884
+ updated_at: string;
11885
+ };
11886
+ Insert: {
11887
+ active?: boolean;
11888
+ created_at?: string;
11889
+ id?: string;
11890
+ kleur?: string | null;
11891
+ naam: string;
11892
+ sort_order?: number;
11893
+ updated_at?: string;
11894
+ };
11895
+ Update: {
11896
+ active?: boolean;
11897
+ created_at?: string;
11898
+ id?: string;
11899
+ kleur?: string | null;
11900
+ naam?: string;
11901
+ sort_order?: number;
11902
+ updated_at?: string;
11903
+ };
11904
+ Relationships: [];
11905
+ };
11906
+ werkbon_package_lines: {
11907
+ Row: {
11908
+ created_at: string;
11909
+ created_by: string | null;
11910
+ id: string;
11911
+ package_id: string;
11912
+ quantity: number;
11913
+ unit_price_cents_snapshot: number;
11914
+ werkbon_id: string;
11915
+ };
11916
+ Insert: {
11917
+ created_at?: string;
11918
+ created_by?: string | null;
11919
+ id?: string;
11920
+ package_id: string;
11921
+ quantity?: number;
11922
+ unit_price_cents_snapshot?: number;
11923
+ werkbon_id: string;
11924
+ };
11925
+ Update: {
11926
+ created_at?: string;
11927
+ created_by?: string | null;
11928
+ id?: string;
11929
+ package_id?: string;
11930
+ quantity?: number;
11931
+ unit_price_cents_snapshot?: number;
11932
+ werkbon_id?: string;
11933
+ };
11934
+ Relationships: [
11935
+ {
11936
+ foreignKeyName: "werkbon_package_lines_package_id_fkey";
11937
+ columns: ["package_id"];
11938
+ isOneToOne: false;
11939
+ referencedRelation: "werkbon_packages";
11940
+ referencedColumns: ["id"];
11941
+ },
11942
+ {
11943
+ foreignKeyName: "werkbon_package_lines_werkbon_id_fkey";
11944
+ columns: ["werkbon_id"];
11945
+ isOneToOne: false;
11946
+ referencedRelation: "werkbonnen";
11947
+ referencedColumns: ["id"];
11948
+ }
11949
+ ];
11950
+ };
11951
+ werkbon_packages: {
11952
+ Row: {
11953
+ active: boolean;
11954
+ ai_tags: string[];
11955
+ category_id: string | null;
11956
+ code: string;
11957
+ created_at: string;
11958
+ default_quantity: number;
11959
+ description: string | null;
11960
+ duration_minutes: number | null;
11961
+ id: string;
11962
+ mandaat_type: string | null;
11963
+ name: string;
11964
+ sort_order: number;
11965
+ unit_price_cents: number;
11966
+ updated_at: string;
11967
+ };
11968
+ Insert: {
11969
+ active?: boolean;
11970
+ ai_tags?: string[];
11971
+ category_id?: string | null;
11972
+ code: string;
11973
+ created_at?: string;
11974
+ default_quantity?: number;
11975
+ description?: string | null;
11976
+ duration_minutes?: number | null;
11977
+ id?: string;
11978
+ mandaat_type?: string | null;
11979
+ name: string;
11980
+ sort_order?: number;
11981
+ unit_price_cents?: number;
11982
+ updated_at?: string;
11983
+ };
11984
+ Update: {
11985
+ active?: boolean;
11986
+ ai_tags?: string[];
11987
+ category_id?: string | null;
11988
+ code?: string;
11989
+ created_at?: string;
11990
+ default_quantity?: number;
11991
+ description?: string | null;
11992
+ duration_minutes?: number | null;
11993
+ id?: string;
11994
+ mandaat_type?: string | null;
11995
+ name?: string;
11996
+ sort_order?: number;
11997
+ unit_price_cents?: number;
11998
+ updated_at?: string;
11999
+ };
12000
+ Relationships: [
12001
+ {
12002
+ foreignKeyName: "werkbon_packages_category_id_fkey";
12003
+ columns: ["category_id"];
12004
+ isOneToOne: false;
12005
+ referencedRelation: "werkbon_package_categories";
12006
+ referencedColumns: ["id"];
12007
+ }
12008
+ ];
12009
+ };
12010
+ werkbon_photos: {
12011
+ Row: {
12012
+ created_at: string;
12013
+ id: string;
12014
+ storage_path: string;
12015
+ user_id: string;
12016
+ werkbon_id: string;
12017
+ };
12018
+ Insert: {
12019
+ created_at?: string;
12020
+ id?: string;
12021
+ storage_path: string;
12022
+ user_id: string;
12023
+ werkbon_id: string;
12024
+ };
12025
+ Update: {
12026
+ created_at?: string;
12027
+ id?: string;
12028
+ storage_path?: string;
12029
+ user_id?: string;
12030
+ werkbon_id?: string;
12031
+ };
12032
+ Relationships: [
12033
+ {
12034
+ foreignKeyName: "werkbon_photos_werkbon_id_fkey";
12035
+ columns: ["werkbon_id"];
12036
+ isOneToOne: false;
12037
+ referencedRelation: "werkbonnen";
12038
+ referencedColumns: ["id"];
12039
+ }
12040
+ ];
12041
+ };
12042
+ werkbon_time_logs: {
12043
+ Row: {
12044
+ activity: string;
12045
+ created_at: string;
12046
+ ended_at: string | null;
12047
+ id: string;
12048
+ started_at: string;
12049
+ user_id: string;
12050
+ werkbon_id: string;
10985
12051
  };
10986
12052
  Insert: {
10987
- action?: string;
10988
- attempt_number?: number;
10989
- caller?: string;
10990
- client_user_id?: string | null;
10991
- content_type?: string | null;
12053
+ activity: string;
10992
12054
  created_at?: string;
10993
- environment: string;
10994
- error_message?: string | null;
10995
- filename?: string | null;
12055
+ ended_at?: string | null;
10996
12056
  id?: string;
10997
- idempotency_key?: string | null;
10998
- module?: string;
10999
- path: string;
11000
- reference_id?: string | null;
11001
- request_body_hash?: string | null;
11002
- request_timestamp?: number | null;
11003
- response_content_type?: string | null;
11004
- response_status?: number | null;
11005
- size_bytes?: number | null;
12057
+ started_at?: string;
12058
+ user_id: string;
12059
+ werkbon_id: string;
11006
12060
  };
11007
12061
  Update: {
11008
- action?: string;
11009
- attempt_number?: number;
11010
- caller?: string;
11011
- client_user_id?: string | null;
11012
- content_type?: string | null;
12062
+ activity?: string;
11013
12063
  created_at?: string;
11014
- environment?: string;
11015
- error_message?: string | null;
11016
- filename?: string | null;
12064
+ ended_at?: string | null;
11017
12065
  id?: string;
11018
- idempotency_key?: string | null;
11019
- module?: string;
11020
- path?: string;
11021
- reference_id?: string | null;
11022
- request_body_hash?: string | null;
11023
- request_timestamp?: number | null;
11024
- response_content_type?: string | null;
11025
- response_status?: number | null;
11026
- size_bytes?: number | null;
12066
+ started_at?: string;
12067
+ user_id?: string;
12068
+ werkbon_id?: string;
11027
12069
  };
11028
- Relationships: [];
12070
+ Relationships: [
12071
+ {
12072
+ foreignKeyName: "werkbon_time_logs_werkbon_id_fkey";
12073
+ columns: ["werkbon_id"];
12074
+ isOneToOne: false;
12075
+ referencedRelation: "werkbonnen";
12076
+ referencedColumns: ["id"];
12077
+ }
12078
+ ];
11029
12079
  };
11030
- voorraad_publish_attempts: {
12080
+ werkbonnen: {
11031
12081
  Row: {
11032
- action: string;
11033
- connection_id: string | null;
12082
+ assigned_user_id: string | null;
12083
+ budget_mandate_cents: number;
12084
+ complaint_description: string | null;
11034
12085
  created_at: string;
11035
- error: string | null;
11036
- gateway_attempt_id: string | null;
11037
- gateway_status: number | null;
12086
+ created_by: string | null;
12087
+ customer_id: string | null;
12088
+ externe_referentie: string | null;
12089
+ first_time_fix: boolean | null;
11038
12090
  id: string;
11039
- intent: string;
11040
- ok: boolean;
11041
- request_summary: Json | null;
11042
- trade_item_id: string | null;
11043
- user_id: string;
12091
+ internal_notes: string | null;
12092
+ parent_werkbon_id: string | null;
12093
+ parsed_payload: Json | null;
12094
+ planning_status: string;
12095
+ project_number: string | null;
12096
+ room_number: string | null;
12097
+ scheduled_end_time: string | null;
12098
+ scheduled_start_time: string | null;
12099
+ sequence_number: number;
12100
+ source_email_meta: Json | null;
12101
+ source_mailbox_message_id: string | null;
12102
+ source_pdf_path: string | null;
12103
+ source_type: string;
12104
+ status: string;
12105
+ technician_id: string | null;
12106
+ technician_notes: string | null;
12107
+ technician_notes_raw: string | null;
12108
+ technician_task_description: string | null;
12109
+ updated_at: string;
12110
+ version: number;
12111
+ work_address: string | null;
11044
12112
  };
11045
12113
  Insert: {
11046
- action: string;
11047
- connection_id?: string | null;
12114
+ assigned_user_id?: string | null;
12115
+ budget_mandate_cents?: number;
12116
+ complaint_description?: string | null;
11048
12117
  created_at?: string;
11049
- error?: string | null;
11050
- gateway_attempt_id?: string | null;
11051
- gateway_status?: number | null;
12118
+ created_by?: string | null;
12119
+ customer_id?: string | null;
12120
+ externe_referentie?: string | null;
12121
+ first_time_fix?: boolean | null;
11052
12122
  id?: string;
11053
- intent: string;
11054
- ok: boolean;
11055
- request_summary?: Json | null;
11056
- trade_item_id?: string | null;
11057
- user_id: string;
12123
+ internal_notes?: string | null;
12124
+ parent_werkbon_id?: string | null;
12125
+ parsed_payload?: Json | null;
12126
+ planning_status?: string;
12127
+ project_number?: string | null;
12128
+ room_number?: string | null;
12129
+ scheduled_end_time?: string | null;
12130
+ scheduled_start_time?: string | null;
12131
+ sequence_number: number;
12132
+ source_email_meta?: Json | null;
12133
+ source_mailbox_message_id?: string | null;
12134
+ source_pdf_path?: string | null;
12135
+ source_type?: string;
12136
+ status?: string;
12137
+ technician_id?: string | null;
12138
+ technician_notes?: string | null;
12139
+ technician_notes_raw?: string | null;
12140
+ technician_task_description?: string | null;
12141
+ updated_at?: string;
12142
+ version?: number;
12143
+ work_address?: string | null;
11058
12144
  };
11059
12145
  Update: {
11060
- action?: string;
11061
- connection_id?: string | null;
12146
+ assigned_user_id?: string | null;
12147
+ budget_mandate_cents?: number;
12148
+ complaint_description?: string | null;
11062
12149
  created_at?: string;
11063
- error?: string | null;
11064
- gateway_attempt_id?: string | null;
11065
- gateway_status?: number | null;
12150
+ created_by?: string | null;
12151
+ customer_id?: string | null;
12152
+ externe_referentie?: string | null;
12153
+ first_time_fix?: boolean | null;
11066
12154
  id?: string;
11067
- intent?: string;
11068
- ok?: boolean;
11069
- request_summary?: Json | null;
11070
- trade_item_id?: string | null;
11071
- user_id?: string;
12155
+ internal_notes?: string | null;
12156
+ parent_werkbon_id?: string | null;
12157
+ parsed_payload?: Json | null;
12158
+ planning_status?: string;
12159
+ project_number?: string | null;
12160
+ room_number?: string | null;
12161
+ scheduled_end_time?: string | null;
12162
+ scheduled_start_time?: string | null;
12163
+ sequence_number?: number;
12164
+ source_email_meta?: Json | null;
12165
+ source_mailbox_message_id?: string | null;
12166
+ source_pdf_path?: string | null;
12167
+ source_type?: string;
12168
+ status?: string;
12169
+ technician_id?: string | null;
12170
+ technician_notes?: string | null;
12171
+ technician_notes_raw?: string | null;
12172
+ technician_task_description?: string | null;
12173
+ updated_at?: string;
12174
+ version?: number;
12175
+ work_address?: string | null;
11072
12176
  };
11073
- Relationships: [];
12177
+ Relationships: [
12178
+ {
12179
+ foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
12180
+ columns: ["parent_werkbon_id"];
12181
+ isOneToOne: false;
12182
+ referencedRelation: "werkbonnen";
12183
+ referencedColumns: ["id"];
12184
+ },
12185
+ {
12186
+ foreignKeyName: "werkbonnen_source_mailbox_message_id_fkey";
12187
+ columns: ["source_mailbox_message_id"];
12188
+ isOneToOne: false;
12189
+ referencedRelation: "mailbox_messages";
12190
+ referencedColumns: ["id"];
12191
+ }
12192
+ ];
11074
12193
  };
11075
12194
  work_order_monteurs: {
11076
12195
  Row: {
@@ -11248,6 +12367,8 @@ export type Database = {
11248
12367
  created_at: string | null;
11249
12368
  created_by: string | null;
11250
12369
  display_name: string | null;
12370
+ graph_subscription_expires_at: string | null;
12371
+ graph_subscription_id: string | null;
11251
12372
  has_access_token: boolean | null;
11252
12373
  has_client_id: boolean | null;
11253
12374
  has_client_secret: boolean | null;
@@ -11265,6 +12386,7 @@ export type Database = {
11265
12386
  oauth_mode: string | null;
11266
12387
  provider: string | null;
11267
12388
  purpose_assignments: Json | null;
12389
+ realtime_mode: string | null;
11268
12390
  scopes: string[] | null;
11269
12391
  smtp_host: string | null;
11270
12392
  smtp_port: number | null;
@@ -11279,6 +12401,8 @@ export type Database = {
11279
12401
  created_at?: string | null;
11280
12402
  created_by?: string | null;
11281
12403
  display_name?: string | null;
12404
+ graph_subscription_expires_at?: string | null;
12405
+ graph_subscription_id?: string | null;
11282
12406
  has_access_token?: never;
11283
12407
  has_client_id?: never;
11284
12408
  has_client_secret?: never;
@@ -11296,6 +12420,7 @@ export type Database = {
11296
12420
  oauth_mode?: string | null;
11297
12421
  provider?: string | null;
11298
12422
  purpose_assignments?: Json | null;
12423
+ realtime_mode?: string | null;
11299
12424
  scopes?: string[] | null;
11300
12425
  smtp_host?: string | null;
11301
12426
  smtp_port?: number | null;
@@ -11310,6 +12435,8 @@ export type Database = {
11310
12435
  created_at?: string | null;
11311
12436
  created_by?: string | null;
11312
12437
  display_name?: string | null;
12438
+ graph_subscription_expires_at?: string | null;
12439
+ graph_subscription_id?: string | null;
11313
12440
  has_access_token?: never;
11314
12441
  has_client_id?: never;
11315
12442
  has_client_secret?: never;
@@ -11327,6 +12454,7 @@ export type Database = {
11327
12454
  oauth_mode?: string | null;
11328
12455
  provider?: string | null;
11329
12456
  purpose_assignments?: Json | null;
12457
+ realtime_mode?: string | null;
11330
12458
  scopes?: string[] | null;
11331
12459
  smtp_host?: string | null;
11332
12460
  smtp_port?: number | null;
@@ -11437,6 +12565,25 @@ export type Database = {
11437
12565
  };
11438
12566
  Relationships: [];
11439
12567
  };
12568
+ floriday_customer_discounts: {
12569
+ Row: {
12570
+ base_price: number | null;
12571
+ buyer_organization_id: string | null;
12572
+ currency: string | null;
12573
+ discount_type: string | null;
12574
+ discount_value: number | null;
12575
+ min_quantity: number | null;
12576
+ net_price: number | null;
12577
+ product_group_id: string | null;
12578
+ raw: Json | null;
12579
+ source: string | null;
12580
+ source_id: string | null;
12581
+ trade_item_id: string | null;
12582
+ valid_from: string | null;
12583
+ valid_until: string | null;
12584
+ };
12585
+ Relationships: [];
12586
+ };
11440
12587
  local_customer_discounts: {
11441
12588
  Row: {
11442
12589
  base_price: number | null;
@@ -11785,6 +12932,21 @@ export type Database = {
11785
12932
  };
11786
12933
  Returns: string;
11787
12934
  };
12935
+ ai_usage_by_module: {
12936
+ Args: {
12937
+ _from: string;
12938
+ _to: string;
12939
+ };
12940
+ Returns: {
12941
+ calls: number;
12942
+ consumer_module_id: string;
12943
+ cost_usd: number;
12944
+ errors: number;
12945
+ input_tokens: number;
12946
+ output_tokens: number;
12947
+ total_tokens: number;
12948
+ }[];
12949
+ };
11788
12950
  apply_stock_consumption: {
11789
12951
  Args: {
11790
12952
  p_order_id: string;
@@ -11876,6 +13038,33 @@ export type Database = {
11876
13038
  };
11877
13039
  Returns: Json;
11878
13040
  };
13041
+ claim_twinfield_push_batch: {
13042
+ Args: {
13043
+ _limit?: number;
13044
+ };
13045
+ Returns: {
13046
+ action: string;
13047
+ attempts: number;
13048
+ connection_id: string;
13049
+ created_at: string;
13050
+ customer_id: string | null;
13051
+ external_id: string | null;
13052
+ id: string;
13053
+ idempotency_key: string;
13054
+ last_error: string | null;
13055
+ next_attempt_at: string;
13056
+ office_code: string | null;
13057
+ payload: Json;
13058
+ status: string;
13059
+ updated_at: string;
13060
+ }[];
13061
+ SetofOptions: {
13062
+ from: "*";
13063
+ to: "twinfield_push_queue";
13064
+ isOneToOne: false;
13065
+ isSetofReturn: true;
13066
+ };
13067
+ };
11879
13068
  cleanup_old_bookings: {
11880
13069
  Args: never;
11881
13070
  Returns: undefined;
@@ -11934,6 +13123,12 @@ export type Database = {
11934
13123
  Args: never;
11935
13124
  Returns: string;
11936
13125
  };
13126
+ custom_access_token_hook: {
13127
+ Args: {
13128
+ event: Json;
13129
+ };
13130
+ Returns: Json;
13131
+ };
11937
13132
  dashboard_alert_counts: {
11938
13133
  Args: never;
11939
13134
  Returns: Json;
@@ -12130,6 +13325,19 @@ export type Database = {
12130
13325
  resource: string;
12131
13326
  }[];
12132
13327
  };
13328
+ get_floriday_agreements_active: {
13329
+ Args: {
13330
+ p_on_date?: string;
13331
+ };
13332
+ Returns: {
13333
+ buyer_organization_id: string;
13334
+ data: Json;
13335
+ floriday_id: string;
13336
+ status: string;
13337
+ valid_from: string;
13338
+ valid_until: string;
13339
+ }[];
13340
+ };
12133
13341
  get_floriday_clock_supplies_window: {
12134
13342
  Args: {
12135
13343
  p_from: string;
@@ -12290,6 +13498,14 @@ export type Database = {
12290
13498
  };
12291
13499
  Returns: string;
12292
13500
  };
13501
+ has_module_permission: {
13502
+ Args: {
13503
+ _min: string;
13504
+ _module_id: string;
13505
+ _user_id: string;
13506
+ };
13507
+ Returns: boolean;
13508
+ };
12293
13509
  has_role: {
12294
13510
  Args: {
12295
13511
  _role: Database["public"]["Enums"]["app_role"];
@@ -12297,6 +13513,10 @@ export type Database = {
12297
13513
  };
12298
13514
  Returns: boolean;
12299
13515
  };
13516
+ has_twinfield_link: {
13517
+ Args: never;
13518
+ Returns: boolean;
13519
+ };
12300
13520
  is_authenticated: {
12301
13521
  Args: never;
12302
13522
  Returns: boolean;
@@ -12311,6 +13531,37 @@ export type Database = {
12311
13531
  };
12312
13532
  Returns: boolean;
12313
13533
  };
13534
+ jwt_has_role: {
13535
+ Args: {
13536
+ _role: Database["public"]["Enums"]["app_role"];
13537
+ };
13538
+ Returns: boolean;
13539
+ };
13540
+ list_monteurs: {
13541
+ Args: never;
13542
+ Returns: {
13543
+ avatar_url: string;
13544
+ display_name: string;
13545
+ email: string;
13546
+ id: string;
13547
+ }[];
13548
+ };
13549
+ list_my_planning_items: {
13550
+ Args: {
13551
+ _from: string;
13552
+ _to: string;
13553
+ };
13554
+ Returns: {
13555
+ assigned_monteur_id: string;
13556
+ end_at: string;
13557
+ id: string;
13558
+ notes: string;
13559
+ role: string;
13560
+ start_at: string;
13561
+ status: Database["public"]["Enums"]["planning_item_status"];
13562
+ werkbon_id: string;
13563
+ }[];
13564
+ };
12314
13565
  local_effective_price: {
12315
13566
  Args: {
12316
13567
  _customer_id: string;
@@ -12327,6 +13578,22 @@ export type Database = {
12327
13578
  source_id: string;
12328
13579
  }[];
12329
13580
  };
13581
+ log_ai_call: {
13582
+ Args: {
13583
+ _consumer_module_id: string;
13584
+ _cost_usd: number;
13585
+ _duration_ms: number;
13586
+ _error_code: string;
13587
+ _error_message: string;
13588
+ _input_tokens: number;
13589
+ _model_slug: string;
13590
+ _output_tokens: number;
13591
+ _provider_slug: string;
13592
+ _status: string;
13593
+ _total_tokens: number;
13594
+ };
13595
+ Returns: string;
13596
+ };
12330
13597
  mark_offer_clicked: {
12331
13598
  Args: {
12332
13599
  p_code: string;
@@ -12378,6 +13645,10 @@ export type Database = {
12378
13645
  };
12379
13646
  Returns: string;
12380
13647
  };
13648
+ next_twinfield_code: {
13649
+ Args: never;
13650
+ Returns: string;
13651
+ };
12381
13652
  next_work_order_number: {
12382
13653
  Args: {
12383
13654
  p_parent_work_order_id?: string;
@@ -12513,6 +13784,12 @@ export type Database = {
12513
13784
  };
12514
13785
  Returns: number;
12515
13786
  };
13787
+ reorder_customer_price_groups: {
13788
+ Args: {
13789
+ _ids: string[];
13790
+ };
13791
+ Returns: undefined;
13792
+ };
12516
13793
  reset_floriday_sync_cursor: {
12517
13794
  Args: {
12518
13795
  p_connection_id: string;
@@ -12548,6 +13825,12 @@ export type Database = {
12548
13825
  };
12549
13826
  Returns: string;
12550
13827
  };
13828
+ retry_twinfield_push: {
13829
+ Args: {
13830
+ _customer_id: string;
13831
+ };
13832
+ Returns: number;
13833
+ };
12551
13834
  reverse_production: {
12552
13835
  Args: {
12553
13836
  p_connection_id?: string;
@@ -12565,6 +13848,20 @@ export type Database = {
12565
13848
  };
12566
13849
  Returns: number;
12567
13850
  };
13851
+ schedule_floriday_agreement_calloffs_sync: {
13852
+ Args: {
13853
+ p_apikey: string;
13854
+ p_url: string;
13855
+ };
13856
+ Returns: number;
13857
+ };
13858
+ schedule_floriday_agreements_sync: {
13859
+ Args: {
13860
+ p_apikey: string;
13861
+ p_url: string;
13862
+ };
13863
+ Returns: number;
13864
+ };
12568
13865
  schedule_floriday_base_items_sync: {
12569
13866
  Args: {
12570
13867
  p_apikey: string;
@@ -12815,6 +14112,13 @@ export type Database = {
12815
14112
  Args: never;
12816
14113
  Returns: number;
12817
14114
  };
14115
+ set_planning_status: {
14116
+ Args: {
14117
+ _id: string;
14118
+ _status: Database["public"]["Enums"]["planning_item_status"];
14119
+ };
14120
+ Returns: undefined;
14121
+ };
12818
14122
  show_limit: {
12819
14123
  Args: never;
12820
14124
  Returns: number;
@@ -12884,9 +14188,12 @@ export type Database = {
12884
14188
  };
12885
14189
  };
12886
14190
  Enums: {
12887
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";
14191
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
12888
14192
  exact_env: "staging" | "live";
12889
14193
  exact_push_status: "pending" | "sent" | "error";
14194
+ itk_customer_segment: "Business" | "Private";
14195
+ itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
14196
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd" | "concept" | "vrijgegeven";
12890
14197
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
12891
14198
  };
12892
14199
  CompositeTypes: {
@@ -12946,9 +14253,12 @@ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof Defaul
12946
14253
  export declare const Constants: {
12947
14254
  readonly public: {
12948
14255
  readonly Enums: {
12949
- readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer", "receptie", "monteur"];
14256
+ readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin"];
12950
14257
  readonly exact_env: readonly ["staging", "live"];
12951
14258
  readonly exact_push_status: readonly ["pending", "sent", "error"];
14259
+ readonly itk_customer_segment: readonly ["Business", "Private"];
14260
+ readonly itk_dynamic_field_type: readonly ["text", "select", "date", "checkbox"];
14261
+ readonly planning_item_status: readonly ["gepland", "bezig", "afgerond", "geannuleerd", "concept", "vrijgegeven"];
12952
14262
  readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"];
12953
14263
  };
12954
14264
  };