@flowselections/floriday-verkoop-module 1.0.2 → 1.0.4

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.
@@ -97,6 +97,144 @@ export declare const listSalesOrders: import("@tanstack/start-client-core").Opti
97
97
  };
98
98
  Relationships: [];
99
99
  };
100
+ customer_audit_log: {
101
+ Row: {
102
+ action: string;
103
+ changes: import("../../integrations/supabase/types").Json;
104
+ created_at: string;
105
+ customer_id: string;
106
+ id: string;
107
+ user_id: string | null;
108
+ };
109
+ Insert: {
110
+ action: string;
111
+ changes?: import("../../integrations/supabase/types").Json;
112
+ created_at?: string;
113
+ customer_id: string;
114
+ id?: string;
115
+ user_id?: string | null;
116
+ };
117
+ Update: {
118
+ action?: string;
119
+ changes?: import("../../integrations/supabase/types").Json;
120
+ created_at?: string;
121
+ customer_id?: string;
122
+ id?: string;
123
+ user_id?: string | null;
124
+ };
125
+ Relationships: [{
126
+ foreignKeyName: "customer_audit_log_customer_id_fkey";
127
+ columns: ["customer_id"];
128
+ isOneToOne: false;
129
+ referencedRelation: "customers";
130
+ referencedColumns: ["id"];
131
+ }];
132
+ };
133
+ customer_contacts: {
134
+ Row: {
135
+ created_at: string;
136
+ customer_id: string;
137
+ email: string | null;
138
+ floriday_contact_id: string | null;
139
+ full_name: string;
140
+ id: string;
141
+ is_active: boolean;
142
+ job_title: string | null;
143
+ phone: string | null;
144
+ photo_url: string | null;
145
+ raw: import("../../integrations/supabase/types").Json | null;
146
+ updated_at: string;
147
+ };
148
+ Insert: {
149
+ created_at?: string;
150
+ customer_id: string;
151
+ email?: string | null;
152
+ floriday_contact_id?: string | null;
153
+ full_name: string;
154
+ id?: string;
155
+ is_active?: boolean;
156
+ job_title?: string | null;
157
+ phone?: string | null;
158
+ photo_url?: string | null;
159
+ raw?: import("../../integrations/supabase/types").Json | null;
160
+ updated_at?: string;
161
+ };
162
+ Update: {
163
+ created_at?: string;
164
+ customer_id?: string;
165
+ email?: string | null;
166
+ floriday_contact_id?: string | null;
167
+ full_name?: string;
168
+ id?: string;
169
+ is_active?: boolean;
170
+ job_title?: string | null;
171
+ phone?: string | null;
172
+ photo_url?: string | null;
173
+ raw?: import("../../integrations/supabase/types").Json | null;
174
+ updated_at?: string;
175
+ };
176
+ Relationships: [{
177
+ foreignKeyName: "customer_contacts_customer_id_fkey";
178
+ columns: ["customer_id"];
179
+ isOneToOne: false;
180
+ referencedRelation: "customers";
181
+ referencedColumns: ["id"];
182
+ }];
183
+ };
184
+ customer_delivery_locations: {
185
+ Row: {
186
+ address_line: string | null;
187
+ city: string | null;
188
+ country: string | null;
189
+ created_at: string;
190
+ customer_id: string;
191
+ floriday_location_id: string | null;
192
+ gln: string | null;
193
+ id: string;
194
+ is_primary: boolean;
195
+ name: string | null;
196
+ postal_code: string | null;
197
+ raw: import("../../integrations/supabase/types").Json | null;
198
+ updated_at: string;
199
+ };
200
+ Insert: {
201
+ address_line?: string | null;
202
+ city?: string | null;
203
+ country?: string | null;
204
+ created_at?: string;
205
+ customer_id: string;
206
+ floriday_location_id?: string | null;
207
+ gln?: string | null;
208
+ id?: string;
209
+ is_primary?: boolean;
210
+ name?: string | null;
211
+ postal_code?: string | null;
212
+ raw?: import("../../integrations/supabase/types").Json | null;
213
+ updated_at?: string;
214
+ };
215
+ Update: {
216
+ address_line?: string | null;
217
+ city?: string | null;
218
+ country?: string | null;
219
+ created_at?: string;
220
+ customer_id?: string;
221
+ floriday_location_id?: string | null;
222
+ gln?: string | null;
223
+ id?: string;
224
+ is_primary?: boolean;
225
+ name?: string | null;
226
+ postal_code?: string | null;
227
+ raw?: import("../../integrations/supabase/types").Json | null;
228
+ updated_at?: string;
229
+ };
230
+ Relationships: [{
231
+ foreignKeyName: "customer_delivery_locations_customer_id_fkey";
232
+ columns: ["customer_id"];
233
+ isOneToOne: false;
234
+ referencedRelation: "customers";
235
+ referencedColumns: ["id"];
236
+ }];
237
+ };
100
238
  customer_field_options: {
101
239
  Row: {
102
240
  created_at: string;
@@ -160,47 +298,335 @@ export declare const listSalesOrders: import("@tanstack/start-client-core").Opti
160
298
  };
161
299
  Relationships: [];
162
300
  };
301
+ customer_selected_assortment: {
302
+ Row: {
303
+ article_number: string | null;
304
+ created_at: string;
305
+ customer_id: string;
306
+ floriday_item_id: string | null;
307
+ id: string;
308
+ price: number | null;
309
+ product_group: string | null;
310
+ product_name: string;
311
+ raw: import("../../integrations/supabase/types").Json | null;
312
+ unit: string | null;
313
+ updated_at: string;
314
+ };
315
+ Insert: {
316
+ article_number?: string | null;
317
+ created_at?: string;
318
+ customer_id: string;
319
+ floriday_item_id?: string | null;
320
+ id?: string;
321
+ price?: number | null;
322
+ product_group?: string | null;
323
+ product_name: string;
324
+ raw?: import("../../integrations/supabase/types").Json | null;
325
+ unit?: string | null;
326
+ updated_at?: string;
327
+ };
328
+ Update: {
329
+ article_number?: string | null;
330
+ created_at?: string;
331
+ customer_id?: string;
332
+ floriday_item_id?: string | null;
333
+ id?: string;
334
+ price?: number | null;
335
+ product_group?: string | null;
336
+ product_name?: string;
337
+ raw?: import("../../integrations/supabase/types").Json | null;
338
+ unit?: string | null;
339
+ updated_at?: string;
340
+ };
341
+ Relationships: [{
342
+ foreignKeyName: "customer_selected_assortment_customer_id_fkey";
343
+ columns: ["customer_id"];
344
+ isOneToOne: false;
345
+ referencedRelation: "customers";
346
+ referencedColumns: ["id"];
347
+ }];
348
+ };
349
+ customer_trade_settings: {
350
+ Row: {
351
+ category: string;
352
+ created_at: string;
353
+ customer_id: string;
354
+ id: string;
355
+ is_active: boolean;
356
+ raw: import("../../integrations/supabase/types").Json | null;
357
+ setting_key: string;
358
+ setting_label: string;
359
+ updated_at: string;
360
+ };
361
+ Insert: {
362
+ category?: string;
363
+ created_at?: string;
364
+ customer_id: string;
365
+ id?: string;
366
+ is_active?: boolean;
367
+ raw?: import("../../integrations/supabase/types").Json | null;
368
+ setting_key: string;
369
+ setting_label: string;
370
+ updated_at?: string;
371
+ };
372
+ Update: {
373
+ category?: string;
374
+ created_at?: string;
375
+ customer_id?: string;
376
+ id?: string;
377
+ is_active?: boolean;
378
+ raw?: import("../../integrations/supabase/types").Json | null;
379
+ setting_key?: string;
380
+ setting_label?: string;
381
+ updated_at?: string;
382
+ };
383
+ Relationships: [{
384
+ foreignKeyName: "customer_trade_settings_customer_id_fkey";
385
+ columns: ["customer_id"];
386
+ isOneToOne: false;
387
+ referencedRelation: "customers";
388
+ referencedColumns: ["id"];
389
+ }];
390
+ };
163
391
  customers: {
164
392
  Row: {
165
393
  address: string | null;
394
+ bio: string | null;
166
395
  city: string | null;
396
+ commercial_name: string | null;
167
397
  company_name: string;
398
+ connection_status: string;
399
+ contact_person: string | null;
168
400
  country: string | null;
169
401
  created_at: string;
170
402
  custom_fields: import("../../integrations/supabase/types").Json;
403
+ customer_class: string | null;
171
404
  email: string | null;
405
+ external_id: string | null;
406
+ floriday_connection_id: string | null;
407
+ floriday_organization_id: string | null;
408
+ floriday_raw: import("../../integrations/supabase/types").Json | null;
409
+ gln: string | null;
410
+ house_number: string | null;
172
411
  id: string;
412
+ is_active: boolean;
413
+ last_synced_at: string | null;
414
+ logo_url: string | null;
415
+ markets: string[];
173
416
  notes: string | null;
417
+ organization_type: string | null;
418
+ payment_methods: string[];
174
419
  phone: string | null;
175
420
  postal_code: string | null;
421
+ product_groups: string[];
422
+ segments: string[];
423
+ source: string;
424
+ street: string | null;
425
+ sync_error: string | null;
426
+ sync_status: string;
427
+ trade_forms: string[];
176
428
  updated_at: string;
429
+ vat_number: string | null;
430
+ website: string | null;
177
431
  };
178
432
  Insert: {
179
433
  address?: string | null;
434
+ bio?: string | null;
180
435
  city?: string | null;
436
+ commercial_name?: string | null;
181
437
  company_name: string;
438
+ connection_status?: string;
439
+ contact_person?: string | null;
182
440
  country?: string | null;
183
441
  created_at?: string;
184
442
  custom_fields?: import("../../integrations/supabase/types").Json;
443
+ customer_class?: string | null;
185
444
  email?: string | null;
445
+ external_id?: string | null;
446
+ floriday_connection_id?: string | null;
447
+ floriday_organization_id?: string | null;
448
+ floriday_raw?: import("../../integrations/supabase/types").Json | null;
449
+ gln?: string | null;
450
+ house_number?: string | null;
186
451
  id?: string;
452
+ is_active?: boolean;
453
+ last_synced_at?: string | null;
454
+ logo_url?: string | null;
455
+ markets?: string[];
187
456
  notes?: string | null;
457
+ organization_type?: string | null;
458
+ payment_methods?: string[];
188
459
  phone?: string | null;
189
460
  postal_code?: string | null;
461
+ product_groups?: string[];
462
+ segments?: string[];
463
+ source?: string;
464
+ street?: string | null;
465
+ sync_error?: string | null;
466
+ sync_status?: string;
467
+ trade_forms?: string[];
190
468
  updated_at?: string;
469
+ vat_number?: string | null;
470
+ website?: string | null;
191
471
  };
192
472
  Update: {
193
473
  address?: string | null;
474
+ bio?: string | null;
194
475
  city?: string | null;
476
+ commercial_name?: string | null;
195
477
  company_name?: string;
478
+ connection_status?: string;
479
+ contact_person?: string | null;
196
480
  country?: string | null;
197
481
  created_at?: string;
198
482
  custom_fields?: import("../../integrations/supabase/types").Json;
483
+ customer_class?: string | null;
199
484
  email?: string | null;
485
+ external_id?: string | null;
486
+ floriday_connection_id?: string | null;
487
+ floriday_organization_id?: string | null;
488
+ floriday_raw?: import("../../integrations/supabase/types").Json | null;
489
+ gln?: string | null;
490
+ house_number?: string | null;
200
491
  id?: string;
492
+ is_active?: boolean;
493
+ last_synced_at?: string | null;
494
+ logo_url?: string | null;
495
+ markets?: string[];
201
496
  notes?: string | null;
497
+ organization_type?: string | null;
498
+ payment_methods?: string[];
202
499
  phone?: string | null;
203
500
  postal_code?: string | null;
501
+ product_groups?: string[];
502
+ segments?: string[];
503
+ source?: string;
504
+ street?: string | null;
505
+ sync_error?: string | null;
506
+ sync_status?: string;
507
+ trade_forms?: string[];
508
+ updated_at?: string;
509
+ vat_number?: string | null;
510
+ website?: string | null;
511
+ };
512
+ Relationships: [];
513
+ };
514
+ exact_connections: {
515
+ Row: {
516
+ access_token_encrypted: string;
517
+ company_name: string | null;
518
+ connected_at: string;
519
+ connected_by: string | null;
520
+ division_code: number | null;
521
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
522
+ expires_at: string;
523
+ id: string;
524
+ refresh_token_encrypted: string;
525
+ status: string;
526
+ updated_at: string;
527
+ };
528
+ Insert: {
529
+ access_token_encrypted: string;
530
+ company_name?: string | null;
531
+ connected_at?: string;
532
+ connected_by?: string | null;
533
+ division_code?: number | null;
534
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
535
+ expires_at: string;
536
+ id?: string;
537
+ refresh_token_encrypted: string;
538
+ status?: string;
539
+ updated_at?: string;
540
+ };
541
+ Update: {
542
+ access_token_encrypted?: string;
543
+ company_name?: string | null;
544
+ connected_at?: string;
545
+ connected_by?: string | null;
546
+ division_code?: number | null;
547
+ environment?: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
548
+ expires_at?: string;
549
+ id?: string;
550
+ refresh_token_encrypted?: string;
551
+ status?: string;
552
+ updated_at?: string;
553
+ };
554
+ Relationships: [];
555
+ };
556
+ exact_credentials: {
557
+ Row: {
558
+ client_id: string;
559
+ client_secret_encrypted: string;
560
+ created_at: string;
561
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
562
+ id: string;
563
+ redirect_uri: string;
564
+ updated_at: string;
565
+ };
566
+ Insert: {
567
+ client_id: string;
568
+ client_secret_encrypted: string;
569
+ created_at?: string;
570
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
571
+ id?: string;
572
+ redirect_uri: string;
573
+ updated_at?: string;
574
+ };
575
+ Update: {
576
+ client_id?: string;
577
+ client_secret_encrypted?: string;
578
+ created_at?: string;
579
+ environment?: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
580
+ id?: string;
581
+ redirect_uri?: string;
582
+ updated_at?: string;
583
+ };
584
+ Relationships: [];
585
+ };
586
+ exact_customers_cache: {
587
+ Row: {
588
+ connection_id: string;
589
+ data: import("../../integrations/supabase/types").Json;
590
+ exact_id: string;
591
+ fetched_at: string;
592
+ };
593
+ Insert: {
594
+ connection_id: string;
595
+ data?: import("../../integrations/supabase/types").Json;
596
+ exact_id: string;
597
+ fetched_at?: string;
598
+ };
599
+ Update: {
600
+ connection_id?: string;
601
+ data?: import("../../integrations/supabase/types").Json;
602
+ exact_id?: string;
603
+ fetched_at?: string;
604
+ };
605
+ Relationships: [];
606
+ };
607
+ exact_sync_state: {
608
+ Row: {
609
+ connection_id: string;
610
+ last_error: string | null;
611
+ last_modified_cursor: string | null;
612
+ last_synced_at: string | null;
613
+ status: string;
614
+ updated_at: string;
615
+ };
616
+ Insert: {
617
+ connection_id: string;
618
+ last_error?: string | null;
619
+ last_modified_cursor?: string | null;
620
+ last_synced_at?: string | null;
621
+ status?: string;
622
+ updated_at?: string;
623
+ };
624
+ Update: {
625
+ connection_id?: string;
626
+ last_error?: string | null;
627
+ last_modified_cursor?: string | null;
628
+ last_synced_at?: string | null;
629
+ status?: string;
204
630
  updated_at?: string;
205
631
  };
206
632
  Relationships: [];
@@ -302,6 +728,7 @@ export declare const listSalesOrders: import("@tanstack/start-client-core").Opti
302
728
  client_id: string;
303
729
  client_secret: string;
304
730
  created_at: string;
731
+ customers_endpoint: string | null;
305
732
  environment: string;
306
733
  gln_code: string | null;
307
734
  id: string;
@@ -319,6 +746,7 @@ export declare const listSalesOrders: import("@tanstack/start-client-core").Opti
319
746
  client_id: string;
320
747
  client_secret: string;
321
748
  created_at?: string;
749
+ customers_endpoint?: string | null;
322
750
  environment: string;
323
751
  gln_code?: string | null;
324
752
  id?: string;
@@ -336,6 +764,7 @@ export declare const listSalesOrders: import("@tanstack/start-client-core").Opti
336
764
  client_id?: string;
337
765
  client_secret?: string;
338
766
  created_at?: string;
767
+ customers_endpoint?: string | null;
339
768
  environment?: string;
340
769
  gln_code?: string | null;
341
770
  id?: string;
@@ -349,6 +778,90 @@ export declare const listSalesOrders: import("@tanstack/start-client-core").Opti
349
778
  };
350
779
  Relationships: [];
351
780
  };
781
+ floriday_customers_cache: {
782
+ Row: {
783
+ connection_id: string | null;
784
+ data: import("../../integrations/supabase/types").Json;
785
+ fetched_at: string;
786
+ organization_id: string;
787
+ };
788
+ Insert: {
789
+ connection_id?: string | null;
790
+ data?: import("../../integrations/supabase/types").Json;
791
+ fetched_at?: string;
792
+ organization_id: string;
793
+ };
794
+ Update: {
795
+ connection_id?: string | null;
796
+ data?: import("../../integrations/supabase/types").Json;
797
+ fetched_at?: string;
798
+ organization_id?: string;
799
+ };
800
+ Relationships: [{
801
+ foreignKeyName: "floriday_customers_cache_connection_id_fkey";
802
+ columns: ["connection_id"];
803
+ isOneToOne: false;
804
+ referencedRelation: "floriday_connections";
805
+ referencedColumns: ["id"];
806
+ }];
807
+ };
808
+ floriday_network_cache: {
809
+ Row: {
810
+ city: string | null;
811
+ connection_id: string;
812
+ country: string | null;
813
+ data: import("../../integrations/supabase/types").Json;
814
+ fetched_at: string;
815
+ gln: string | null;
816
+ organization_id: string;
817
+ organization_name: string | null;
818
+ };
819
+ Insert: {
820
+ city?: string | null;
821
+ connection_id: string;
822
+ country?: string | null;
823
+ data?: import("../../integrations/supabase/types").Json;
824
+ fetched_at?: string;
825
+ gln?: string | null;
826
+ organization_id: string;
827
+ organization_name?: string | null;
828
+ };
829
+ Update: {
830
+ city?: string | null;
831
+ connection_id?: string;
832
+ country?: string | null;
833
+ data?: import("../../integrations/supabase/types").Json;
834
+ fetched_at?: string;
835
+ gln?: string | null;
836
+ organization_id?: string;
837
+ organization_name?: string | null;
838
+ };
839
+ Relationships: [];
840
+ };
841
+ floriday_network_sync_state: {
842
+ Row: {
843
+ connection_id: string;
844
+ last_error: string | null;
845
+ last_sequence_number: number;
846
+ last_synced_at: string | null;
847
+ updated_at: string;
848
+ };
849
+ Insert: {
850
+ connection_id: string;
851
+ last_error?: string | null;
852
+ last_sequence_number?: number;
853
+ last_synced_at?: string | null;
854
+ updated_at?: string;
855
+ };
856
+ Update: {
857
+ connection_id?: string;
858
+ last_error?: string | null;
859
+ last_sequence_number?: number;
860
+ last_synced_at?: string | null;
861
+ updated_at?: string;
862
+ };
863
+ Relationships: [];
864
+ };
352
865
  floriday_settings: {
353
866
  Row: {
354
867
  active_environment: string;
@@ -1043,6 +1556,13 @@ export declare const listSalesOrders: import("@tanstack/start-client-core").Opti
1043
1556
  };
1044
1557
  Returns: boolean;
1045
1558
  };
1559
+ schedule_floriday_network_sync: {
1560
+ Args: {
1561
+ p_apikey: string;
1562
+ p_url: string;
1563
+ };
1564
+ Returns: number;
1565
+ };
1046
1566
  schedule_floriday_token_refresh: {
1047
1567
  Args: {
1048
1568
  p_apikey: string;
@@ -1050,9 +1570,20 @@ export declare const listSalesOrders: import("@tanstack/start-client-core").Opti
1050
1570
  };
1051
1571
  Returns: number;
1052
1572
  };
1573
+ show_limit: {
1574
+ Args: never;
1575
+ Returns: number;
1576
+ };
1577
+ show_trgm: {
1578
+ Args: {
1579
+ "": string;
1580
+ };
1581
+ Returns: string[];
1582
+ };
1053
1583
  };
1054
1584
  Enums: {
1055
1585
  app_role: "admin" | "manager" | "warehouse" | "sales" | "developer";
1586
+ exact_env: "staging" | "live";
1056
1587
  };
1057
1588
  CompositeTypes: { [_ in never]: never; };
1058
1589
  }, {
@@ -1124,10 +1655,148 @@ export declare const exportSalesOrders: import("@tanstack/start-client-core").Op
1124
1655
  created_at?: string;
1125
1656
  created_by?: string | null;
1126
1657
  id?: string;
1127
- name?: string;
1658
+ name?: string;
1659
+ updated_at?: string;
1660
+ };
1661
+ Relationships: [];
1662
+ };
1663
+ customer_audit_log: {
1664
+ Row: {
1665
+ action: string;
1666
+ changes: import("../../integrations/supabase/types").Json;
1667
+ created_at: string;
1668
+ customer_id: string;
1669
+ id: string;
1670
+ user_id: string | null;
1671
+ };
1672
+ Insert: {
1673
+ action: string;
1674
+ changes?: import("../../integrations/supabase/types").Json;
1675
+ created_at?: string;
1676
+ customer_id: string;
1677
+ id?: string;
1678
+ user_id?: string | null;
1679
+ };
1680
+ Update: {
1681
+ action?: string;
1682
+ changes?: import("../../integrations/supabase/types").Json;
1683
+ created_at?: string;
1684
+ customer_id?: string;
1685
+ id?: string;
1686
+ user_id?: string | null;
1687
+ };
1688
+ Relationships: [{
1689
+ foreignKeyName: "customer_audit_log_customer_id_fkey";
1690
+ columns: ["customer_id"];
1691
+ isOneToOne: false;
1692
+ referencedRelation: "customers";
1693
+ referencedColumns: ["id"];
1694
+ }];
1695
+ };
1696
+ customer_contacts: {
1697
+ Row: {
1698
+ created_at: string;
1699
+ customer_id: string;
1700
+ email: string | null;
1701
+ floriday_contact_id: string | null;
1702
+ full_name: string;
1703
+ id: string;
1704
+ is_active: boolean;
1705
+ job_title: string | null;
1706
+ phone: string | null;
1707
+ photo_url: string | null;
1708
+ raw: import("../../integrations/supabase/types").Json | null;
1709
+ updated_at: string;
1710
+ };
1711
+ Insert: {
1712
+ created_at?: string;
1713
+ customer_id: string;
1714
+ email?: string | null;
1715
+ floriday_contact_id?: string | null;
1716
+ full_name: string;
1717
+ id?: string;
1718
+ is_active?: boolean;
1719
+ job_title?: string | null;
1720
+ phone?: string | null;
1721
+ photo_url?: string | null;
1722
+ raw?: import("../../integrations/supabase/types").Json | null;
1723
+ updated_at?: string;
1724
+ };
1725
+ Update: {
1726
+ created_at?: string;
1727
+ customer_id?: string;
1728
+ email?: string | null;
1729
+ floriday_contact_id?: string | null;
1730
+ full_name?: string;
1731
+ id?: string;
1732
+ is_active?: boolean;
1733
+ job_title?: string | null;
1734
+ phone?: string | null;
1735
+ photo_url?: string | null;
1736
+ raw?: import("../../integrations/supabase/types").Json | null;
1737
+ updated_at?: string;
1738
+ };
1739
+ Relationships: [{
1740
+ foreignKeyName: "customer_contacts_customer_id_fkey";
1741
+ columns: ["customer_id"];
1742
+ isOneToOne: false;
1743
+ referencedRelation: "customers";
1744
+ referencedColumns: ["id"];
1745
+ }];
1746
+ };
1747
+ customer_delivery_locations: {
1748
+ Row: {
1749
+ address_line: string | null;
1750
+ city: string | null;
1751
+ country: string | null;
1752
+ created_at: string;
1753
+ customer_id: string;
1754
+ floriday_location_id: string | null;
1755
+ gln: string | null;
1756
+ id: string;
1757
+ is_primary: boolean;
1758
+ name: string | null;
1759
+ postal_code: string | null;
1760
+ raw: import("../../integrations/supabase/types").Json | null;
1761
+ updated_at: string;
1762
+ };
1763
+ Insert: {
1764
+ address_line?: string | null;
1765
+ city?: string | null;
1766
+ country?: string | null;
1767
+ created_at?: string;
1768
+ customer_id: string;
1769
+ floriday_location_id?: string | null;
1770
+ gln?: string | null;
1771
+ id?: string;
1772
+ is_primary?: boolean;
1773
+ name?: string | null;
1774
+ postal_code?: string | null;
1775
+ raw?: import("../../integrations/supabase/types").Json | null;
1776
+ updated_at?: string;
1777
+ };
1778
+ Update: {
1779
+ address_line?: string | null;
1780
+ city?: string | null;
1781
+ country?: string | null;
1782
+ created_at?: string;
1783
+ customer_id?: string;
1784
+ floriday_location_id?: string | null;
1785
+ gln?: string | null;
1786
+ id?: string;
1787
+ is_primary?: boolean;
1788
+ name?: string | null;
1789
+ postal_code?: string | null;
1790
+ raw?: import("../../integrations/supabase/types").Json | null;
1128
1791
  updated_at?: string;
1129
1792
  };
1130
- Relationships: [];
1793
+ Relationships: [{
1794
+ foreignKeyName: "customer_delivery_locations_customer_id_fkey";
1795
+ columns: ["customer_id"];
1796
+ isOneToOne: false;
1797
+ referencedRelation: "customers";
1798
+ referencedColumns: ["id"];
1799
+ }];
1131
1800
  };
1132
1801
  customer_field_options: {
1133
1802
  Row: {
@@ -1192,47 +1861,335 @@ export declare const exportSalesOrders: import("@tanstack/start-client-core").Op
1192
1861
  };
1193
1862
  Relationships: [];
1194
1863
  };
1864
+ customer_selected_assortment: {
1865
+ Row: {
1866
+ article_number: string | null;
1867
+ created_at: string;
1868
+ customer_id: string;
1869
+ floriday_item_id: string | null;
1870
+ id: string;
1871
+ price: number | null;
1872
+ product_group: string | null;
1873
+ product_name: string;
1874
+ raw: import("../../integrations/supabase/types").Json | null;
1875
+ unit: string | null;
1876
+ updated_at: string;
1877
+ };
1878
+ Insert: {
1879
+ article_number?: string | null;
1880
+ created_at?: string;
1881
+ customer_id: string;
1882
+ floriday_item_id?: string | null;
1883
+ id?: string;
1884
+ price?: number | null;
1885
+ product_group?: string | null;
1886
+ product_name: string;
1887
+ raw?: import("../../integrations/supabase/types").Json | null;
1888
+ unit?: string | null;
1889
+ updated_at?: string;
1890
+ };
1891
+ Update: {
1892
+ article_number?: string | null;
1893
+ created_at?: string;
1894
+ customer_id?: string;
1895
+ floriday_item_id?: string | null;
1896
+ id?: string;
1897
+ price?: number | null;
1898
+ product_group?: string | null;
1899
+ product_name?: string;
1900
+ raw?: import("../../integrations/supabase/types").Json | null;
1901
+ unit?: string | null;
1902
+ updated_at?: string;
1903
+ };
1904
+ Relationships: [{
1905
+ foreignKeyName: "customer_selected_assortment_customer_id_fkey";
1906
+ columns: ["customer_id"];
1907
+ isOneToOne: false;
1908
+ referencedRelation: "customers";
1909
+ referencedColumns: ["id"];
1910
+ }];
1911
+ };
1912
+ customer_trade_settings: {
1913
+ Row: {
1914
+ category: string;
1915
+ created_at: string;
1916
+ customer_id: string;
1917
+ id: string;
1918
+ is_active: boolean;
1919
+ raw: import("../../integrations/supabase/types").Json | null;
1920
+ setting_key: string;
1921
+ setting_label: string;
1922
+ updated_at: string;
1923
+ };
1924
+ Insert: {
1925
+ category?: string;
1926
+ created_at?: string;
1927
+ customer_id: string;
1928
+ id?: string;
1929
+ is_active?: boolean;
1930
+ raw?: import("../../integrations/supabase/types").Json | null;
1931
+ setting_key: string;
1932
+ setting_label: string;
1933
+ updated_at?: string;
1934
+ };
1935
+ Update: {
1936
+ category?: string;
1937
+ created_at?: string;
1938
+ customer_id?: string;
1939
+ id?: string;
1940
+ is_active?: boolean;
1941
+ raw?: import("../../integrations/supabase/types").Json | null;
1942
+ setting_key?: string;
1943
+ setting_label?: string;
1944
+ updated_at?: string;
1945
+ };
1946
+ Relationships: [{
1947
+ foreignKeyName: "customer_trade_settings_customer_id_fkey";
1948
+ columns: ["customer_id"];
1949
+ isOneToOne: false;
1950
+ referencedRelation: "customers";
1951
+ referencedColumns: ["id"];
1952
+ }];
1953
+ };
1195
1954
  customers: {
1196
1955
  Row: {
1197
1956
  address: string | null;
1957
+ bio: string | null;
1198
1958
  city: string | null;
1959
+ commercial_name: string | null;
1199
1960
  company_name: string;
1961
+ connection_status: string;
1962
+ contact_person: string | null;
1200
1963
  country: string | null;
1201
1964
  created_at: string;
1202
1965
  custom_fields: import("../../integrations/supabase/types").Json;
1966
+ customer_class: string | null;
1203
1967
  email: string | null;
1968
+ external_id: string | null;
1969
+ floriday_connection_id: string | null;
1970
+ floriday_organization_id: string | null;
1971
+ floriday_raw: import("../../integrations/supabase/types").Json | null;
1972
+ gln: string | null;
1973
+ house_number: string | null;
1204
1974
  id: string;
1975
+ is_active: boolean;
1976
+ last_synced_at: string | null;
1977
+ logo_url: string | null;
1978
+ markets: string[];
1205
1979
  notes: string | null;
1980
+ organization_type: string | null;
1981
+ payment_methods: string[];
1206
1982
  phone: string | null;
1207
1983
  postal_code: string | null;
1984
+ product_groups: string[];
1985
+ segments: string[];
1986
+ source: string;
1987
+ street: string | null;
1988
+ sync_error: string | null;
1989
+ sync_status: string;
1990
+ trade_forms: string[];
1208
1991
  updated_at: string;
1992
+ vat_number: string | null;
1993
+ website: string | null;
1209
1994
  };
1210
1995
  Insert: {
1211
1996
  address?: string | null;
1997
+ bio?: string | null;
1212
1998
  city?: string | null;
1999
+ commercial_name?: string | null;
1213
2000
  company_name: string;
2001
+ connection_status?: string;
2002
+ contact_person?: string | null;
1214
2003
  country?: string | null;
1215
2004
  created_at?: string;
1216
2005
  custom_fields?: import("../../integrations/supabase/types").Json;
2006
+ customer_class?: string | null;
1217
2007
  email?: string | null;
2008
+ external_id?: string | null;
2009
+ floriday_connection_id?: string | null;
2010
+ floriday_organization_id?: string | null;
2011
+ floriday_raw?: import("../../integrations/supabase/types").Json | null;
2012
+ gln?: string | null;
2013
+ house_number?: string | null;
1218
2014
  id?: string;
2015
+ is_active?: boolean;
2016
+ last_synced_at?: string | null;
2017
+ logo_url?: string | null;
2018
+ markets?: string[];
1219
2019
  notes?: string | null;
2020
+ organization_type?: string | null;
2021
+ payment_methods?: string[];
1220
2022
  phone?: string | null;
1221
2023
  postal_code?: string | null;
2024
+ product_groups?: string[];
2025
+ segments?: string[];
2026
+ source?: string;
2027
+ street?: string | null;
2028
+ sync_error?: string | null;
2029
+ sync_status?: string;
2030
+ trade_forms?: string[];
1222
2031
  updated_at?: string;
2032
+ vat_number?: string | null;
2033
+ website?: string | null;
1223
2034
  };
1224
2035
  Update: {
1225
2036
  address?: string | null;
2037
+ bio?: string | null;
1226
2038
  city?: string | null;
2039
+ commercial_name?: string | null;
1227
2040
  company_name?: string;
2041
+ connection_status?: string;
2042
+ contact_person?: string | null;
1228
2043
  country?: string | null;
1229
2044
  created_at?: string;
1230
2045
  custom_fields?: import("../../integrations/supabase/types").Json;
2046
+ customer_class?: string | null;
1231
2047
  email?: string | null;
2048
+ external_id?: string | null;
2049
+ floriday_connection_id?: string | null;
2050
+ floriday_organization_id?: string | null;
2051
+ floriday_raw?: import("../../integrations/supabase/types").Json | null;
2052
+ gln?: string | null;
2053
+ house_number?: string | null;
1232
2054
  id?: string;
2055
+ is_active?: boolean;
2056
+ last_synced_at?: string | null;
2057
+ logo_url?: string | null;
2058
+ markets?: string[];
1233
2059
  notes?: string | null;
2060
+ organization_type?: string | null;
2061
+ payment_methods?: string[];
1234
2062
  phone?: string | null;
1235
2063
  postal_code?: string | null;
2064
+ product_groups?: string[];
2065
+ segments?: string[];
2066
+ source?: string;
2067
+ street?: string | null;
2068
+ sync_error?: string | null;
2069
+ sync_status?: string;
2070
+ trade_forms?: string[];
2071
+ updated_at?: string;
2072
+ vat_number?: string | null;
2073
+ website?: string | null;
2074
+ };
2075
+ Relationships: [];
2076
+ };
2077
+ exact_connections: {
2078
+ Row: {
2079
+ access_token_encrypted: string;
2080
+ company_name: string | null;
2081
+ connected_at: string;
2082
+ connected_by: string | null;
2083
+ division_code: number | null;
2084
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
2085
+ expires_at: string;
2086
+ id: string;
2087
+ refresh_token_encrypted: string;
2088
+ status: string;
2089
+ updated_at: string;
2090
+ };
2091
+ Insert: {
2092
+ access_token_encrypted: string;
2093
+ company_name?: string | null;
2094
+ connected_at?: string;
2095
+ connected_by?: string | null;
2096
+ division_code?: number | null;
2097
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
2098
+ expires_at: string;
2099
+ id?: string;
2100
+ refresh_token_encrypted: string;
2101
+ status?: string;
2102
+ updated_at?: string;
2103
+ };
2104
+ Update: {
2105
+ access_token_encrypted?: string;
2106
+ company_name?: string | null;
2107
+ connected_at?: string;
2108
+ connected_by?: string | null;
2109
+ division_code?: number | null;
2110
+ environment?: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
2111
+ expires_at?: string;
2112
+ id?: string;
2113
+ refresh_token_encrypted?: string;
2114
+ status?: string;
2115
+ updated_at?: string;
2116
+ };
2117
+ Relationships: [];
2118
+ };
2119
+ exact_credentials: {
2120
+ Row: {
2121
+ client_id: string;
2122
+ client_secret_encrypted: string;
2123
+ created_at: string;
2124
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
2125
+ id: string;
2126
+ redirect_uri: string;
2127
+ updated_at: string;
2128
+ };
2129
+ Insert: {
2130
+ client_id: string;
2131
+ client_secret_encrypted: string;
2132
+ created_at?: string;
2133
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
2134
+ id?: string;
2135
+ redirect_uri: string;
2136
+ updated_at?: string;
2137
+ };
2138
+ Update: {
2139
+ client_id?: string;
2140
+ client_secret_encrypted?: string;
2141
+ created_at?: string;
2142
+ environment?: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
2143
+ id?: string;
2144
+ redirect_uri?: string;
2145
+ updated_at?: string;
2146
+ };
2147
+ Relationships: [];
2148
+ };
2149
+ exact_customers_cache: {
2150
+ Row: {
2151
+ connection_id: string;
2152
+ data: import("../../integrations/supabase/types").Json;
2153
+ exact_id: string;
2154
+ fetched_at: string;
2155
+ };
2156
+ Insert: {
2157
+ connection_id: string;
2158
+ data?: import("../../integrations/supabase/types").Json;
2159
+ exact_id: string;
2160
+ fetched_at?: string;
2161
+ };
2162
+ Update: {
2163
+ connection_id?: string;
2164
+ data?: import("../../integrations/supabase/types").Json;
2165
+ exact_id?: string;
2166
+ fetched_at?: string;
2167
+ };
2168
+ Relationships: [];
2169
+ };
2170
+ exact_sync_state: {
2171
+ Row: {
2172
+ connection_id: string;
2173
+ last_error: string | null;
2174
+ last_modified_cursor: string | null;
2175
+ last_synced_at: string | null;
2176
+ status: string;
2177
+ updated_at: string;
2178
+ };
2179
+ Insert: {
2180
+ connection_id: string;
2181
+ last_error?: string | null;
2182
+ last_modified_cursor?: string | null;
2183
+ last_synced_at?: string | null;
2184
+ status?: string;
2185
+ updated_at?: string;
2186
+ };
2187
+ Update: {
2188
+ connection_id?: string;
2189
+ last_error?: string | null;
2190
+ last_modified_cursor?: string | null;
2191
+ last_synced_at?: string | null;
2192
+ status?: string;
1236
2193
  updated_at?: string;
1237
2194
  };
1238
2195
  Relationships: [];
@@ -1334,6 +2291,7 @@ export declare const exportSalesOrders: import("@tanstack/start-client-core").Op
1334
2291
  client_id: string;
1335
2292
  client_secret: string;
1336
2293
  created_at: string;
2294
+ customers_endpoint: string | null;
1337
2295
  environment: string;
1338
2296
  gln_code: string | null;
1339
2297
  id: string;
@@ -1351,6 +2309,7 @@ export declare const exportSalesOrders: import("@tanstack/start-client-core").Op
1351
2309
  client_id: string;
1352
2310
  client_secret: string;
1353
2311
  created_at?: string;
2312
+ customers_endpoint?: string | null;
1354
2313
  environment: string;
1355
2314
  gln_code?: string | null;
1356
2315
  id?: string;
@@ -1368,6 +2327,7 @@ export declare const exportSalesOrders: import("@tanstack/start-client-core").Op
1368
2327
  client_id?: string;
1369
2328
  client_secret?: string;
1370
2329
  created_at?: string;
2330
+ customers_endpoint?: string | null;
1371
2331
  environment?: string;
1372
2332
  gln_code?: string | null;
1373
2333
  id?: string;
@@ -1381,6 +2341,90 @@ export declare const exportSalesOrders: import("@tanstack/start-client-core").Op
1381
2341
  };
1382
2342
  Relationships: [];
1383
2343
  };
2344
+ floriday_customers_cache: {
2345
+ Row: {
2346
+ connection_id: string | null;
2347
+ data: import("../../integrations/supabase/types").Json;
2348
+ fetched_at: string;
2349
+ organization_id: string;
2350
+ };
2351
+ Insert: {
2352
+ connection_id?: string | null;
2353
+ data?: import("../../integrations/supabase/types").Json;
2354
+ fetched_at?: string;
2355
+ organization_id: string;
2356
+ };
2357
+ Update: {
2358
+ connection_id?: string | null;
2359
+ data?: import("../../integrations/supabase/types").Json;
2360
+ fetched_at?: string;
2361
+ organization_id?: string;
2362
+ };
2363
+ Relationships: [{
2364
+ foreignKeyName: "floriday_customers_cache_connection_id_fkey";
2365
+ columns: ["connection_id"];
2366
+ isOneToOne: false;
2367
+ referencedRelation: "floriday_connections";
2368
+ referencedColumns: ["id"];
2369
+ }];
2370
+ };
2371
+ floriday_network_cache: {
2372
+ Row: {
2373
+ city: string | null;
2374
+ connection_id: string;
2375
+ country: string | null;
2376
+ data: import("../../integrations/supabase/types").Json;
2377
+ fetched_at: string;
2378
+ gln: string | null;
2379
+ organization_id: string;
2380
+ organization_name: string | null;
2381
+ };
2382
+ Insert: {
2383
+ city?: string | null;
2384
+ connection_id: string;
2385
+ country?: string | null;
2386
+ data?: import("../../integrations/supabase/types").Json;
2387
+ fetched_at?: string;
2388
+ gln?: string | null;
2389
+ organization_id: string;
2390
+ organization_name?: string | null;
2391
+ };
2392
+ Update: {
2393
+ city?: string | null;
2394
+ connection_id?: string;
2395
+ country?: string | null;
2396
+ data?: import("../../integrations/supabase/types").Json;
2397
+ fetched_at?: string;
2398
+ gln?: string | null;
2399
+ organization_id?: string;
2400
+ organization_name?: string | null;
2401
+ };
2402
+ Relationships: [];
2403
+ };
2404
+ floriday_network_sync_state: {
2405
+ Row: {
2406
+ connection_id: string;
2407
+ last_error: string | null;
2408
+ last_sequence_number: number;
2409
+ last_synced_at: string | null;
2410
+ updated_at: string;
2411
+ };
2412
+ Insert: {
2413
+ connection_id: string;
2414
+ last_error?: string | null;
2415
+ last_sequence_number?: number;
2416
+ last_synced_at?: string | null;
2417
+ updated_at?: string;
2418
+ };
2419
+ Update: {
2420
+ connection_id?: string;
2421
+ last_error?: string | null;
2422
+ last_sequence_number?: number;
2423
+ last_synced_at?: string | null;
2424
+ updated_at?: string;
2425
+ };
2426
+ Relationships: [];
2427
+ };
1384
2428
  floriday_settings: {
1385
2429
  Row: {
1386
2430
  active_environment: string;
@@ -2075,6 +3119,13 @@ export declare const exportSalesOrders: import("@tanstack/start-client-core").Op
2075
3119
  };
2076
3120
  Returns: boolean;
2077
3121
  };
3122
+ schedule_floriday_network_sync: {
3123
+ Args: {
3124
+ p_apikey: string;
3125
+ p_url: string;
3126
+ };
3127
+ Returns: number;
3128
+ };
2078
3129
  schedule_floriday_token_refresh: {
2079
3130
  Args: {
2080
3131
  p_apikey: string;
@@ -2082,9 +3133,20 @@ export declare const exportSalesOrders: import("@tanstack/start-client-core").Op
2082
3133
  };
2083
3134
  Returns: number;
2084
3135
  };
3136
+ show_limit: {
3137
+ Args: never;
3138
+ Returns: number;
3139
+ };
3140
+ show_trgm: {
3141
+ Args: {
3142
+ "": string;
3143
+ };
3144
+ Returns: string[];
3145
+ };
2085
3146
  };
2086
3147
  Enums: {
2087
3148
  app_role: "admin" | "manager" | "warehouse" | "sales" | "developer";
3149
+ exact_env: "staging" | "live";
2088
3150
  };
2089
3151
  CompositeTypes: { [_ in never]: never; };
2090
3152
  }, {
@@ -2106,63 +3168,201 @@ export declare const createSalesOrder: import("@tanstack/start-client-core").Opt
2106
3168
  Tables: {
2107
3169
  bugs: {
2108
3170
  Row: {
2109
- attachment_url: string | null;
3171
+ attachment_url: string | null;
3172
+ created_at: string;
3173
+ description: string;
3174
+ id: string;
3175
+ priority: string;
3176
+ status: string;
3177
+ title: string;
3178
+ updated_at: string;
3179
+ user_id: string;
3180
+ };
3181
+ Insert: {
3182
+ attachment_url?: string | null;
3183
+ created_at?: string;
3184
+ description: string;
3185
+ id?: string;
3186
+ priority?: string;
3187
+ status?: string;
3188
+ title: string;
3189
+ updated_at?: string;
3190
+ user_id: string;
3191
+ };
3192
+ Update: {
3193
+ attachment_url?: string | null;
3194
+ created_at?: string;
3195
+ description?: string;
3196
+ id?: string;
3197
+ priority?: string;
3198
+ status?: string;
3199
+ title?: string;
3200
+ updated_at?: string;
3201
+ user_id?: string;
3202
+ };
3203
+ Relationships: [];
3204
+ };
3205
+ collections: {
3206
+ Row: {
3207
+ created_at: string;
3208
+ created_by: string | null;
3209
+ id: string;
3210
+ name: string;
3211
+ updated_at: string;
3212
+ };
3213
+ Insert: {
3214
+ created_at?: string;
3215
+ created_by?: string | null;
3216
+ id?: string;
3217
+ name: string;
3218
+ updated_at?: string;
3219
+ };
3220
+ Update: {
3221
+ created_at?: string;
3222
+ created_by?: string | null;
3223
+ id?: string;
3224
+ name?: string;
3225
+ updated_at?: string;
3226
+ };
3227
+ Relationships: [];
3228
+ };
3229
+ customer_audit_log: {
3230
+ Row: {
3231
+ action: string;
3232
+ changes: import("../../integrations/supabase/types").Json;
3233
+ created_at: string;
3234
+ customer_id: string;
3235
+ id: string;
3236
+ user_id: string | null;
3237
+ };
3238
+ Insert: {
3239
+ action: string;
3240
+ changes?: import("../../integrations/supabase/types").Json;
3241
+ created_at?: string;
3242
+ customer_id: string;
3243
+ id?: string;
3244
+ user_id?: string | null;
3245
+ };
3246
+ Update: {
3247
+ action?: string;
3248
+ changes?: import("../../integrations/supabase/types").Json;
3249
+ created_at?: string;
3250
+ customer_id?: string;
3251
+ id?: string;
3252
+ user_id?: string | null;
3253
+ };
3254
+ Relationships: [{
3255
+ foreignKeyName: "customer_audit_log_customer_id_fkey";
3256
+ columns: ["customer_id"];
3257
+ isOneToOne: false;
3258
+ referencedRelation: "customers";
3259
+ referencedColumns: ["id"];
3260
+ }];
3261
+ };
3262
+ customer_contacts: {
3263
+ Row: {
2110
3264
  created_at: string;
2111
- description: string;
3265
+ customer_id: string;
3266
+ email: string | null;
3267
+ floriday_contact_id: string | null;
3268
+ full_name: string;
2112
3269
  id: string;
2113
- priority: string;
2114
- status: string;
2115
- title: string;
3270
+ is_active: boolean;
3271
+ job_title: string | null;
3272
+ phone: string | null;
3273
+ photo_url: string | null;
3274
+ raw: import("../../integrations/supabase/types").Json | null;
2116
3275
  updated_at: string;
2117
- user_id: string;
2118
3276
  };
2119
3277
  Insert: {
2120
- attachment_url?: string | null;
2121
3278
  created_at?: string;
2122
- description: string;
3279
+ customer_id: string;
3280
+ email?: string | null;
3281
+ floriday_contact_id?: string | null;
3282
+ full_name: string;
2123
3283
  id?: string;
2124
- priority?: string;
2125
- status?: string;
2126
- title: string;
3284
+ is_active?: boolean;
3285
+ job_title?: string | null;
3286
+ phone?: string | null;
3287
+ photo_url?: string | null;
3288
+ raw?: import("../../integrations/supabase/types").Json | null;
2127
3289
  updated_at?: string;
2128
- user_id: string;
2129
3290
  };
2130
3291
  Update: {
2131
- attachment_url?: string | null;
2132
3292
  created_at?: string;
2133
- description?: string;
3293
+ customer_id?: string;
3294
+ email?: string | null;
3295
+ floriday_contact_id?: string | null;
3296
+ full_name?: string;
2134
3297
  id?: string;
2135
- priority?: string;
2136
- status?: string;
2137
- title?: string;
3298
+ is_active?: boolean;
3299
+ job_title?: string | null;
3300
+ phone?: string | null;
3301
+ photo_url?: string | null;
3302
+ raw?: import("../../integrations/supabase/types").Json | null;
2138
3303
  updated_at?: string;
2139
- user_id?: string;
2140
3304
  };
2141
- Relationships: [];
3305
+ Relationships: [{
3306
+ foreignKeyName: "customer_contacts_customer_id_fkey";
3307
+ columns: ["customer_id"];
3308
+ isOneToOne: false;
3309
+ referencedRelation: "customers";
3310
+ referencedColumns: ["id"];
3311
+ }];
2142
3312
  };
2143
- collections: {
3313
+ customer_delivery_locations: {
2144
3314
  Row: {
3315
+ address_line: string | null;
3316
+ city: string | null;
3317
+ country: string | null;
2145
3318
  created_at: string;
2146
- created_by: string | null;
3319
+ customer_id: string;
3320
+ floriday_location_id: string | null;
3321
+ gln: string | null;
2147
3322
  id: string;
2148
- name: string;
3323
+ is_primary: boolean;
3324
+ name: string | null;
3325
+ postal_code: string | null;
3326
+ raw: import("../../integrations/supabase/types").Json | null;
2149
3327
  updated_at: string;
2150
3328
  };
2151
3329
  Insert: {
3330
+ address_line?: string | null;
3331
+ city?: string | null;
3332
+ country?: string | null;
2152
3333
  created_at?: string;
2153
- created_by?: string | null;
3334
+ customer_id: string;
3335
+ floriday_location_id?: string | null;
3336
+ gln?: string | null;
2154
3337
  id?: string;
2155
- name: string;
3338
+ is_primary?: boolean;
3339
+ name?: string | null;
3340
+ postal_code?: string | null;
3341
+ raw?: import("../../integrations/supabase/types").Json | null;
2156
3342
  updated_at?: string;
2157
3343
  };
2158
3344
  Update: {
3345
+ address_line?: string | null;
3346
+ city?: string | null;
3347
+ country?: string | null;
2159
3348
  created_at?: string;
2160
- created_by?: string | null;
3349
+ customer_id?: string;
3350
+ floriday_location_id?: string | null;
3351
+ gln?: string | null;
2161
3352
  id?: string;
2162
- name?: string;
3353
+ is_primary?: boolean;
3354
+ name?: string | null;
3355
+ postal_code?: string | null;
3356
+ raw?: import("../../integrations/supabase/types").Json | null;
2163
3357
  updated_at?: string;
2164
3358
  };
2165
- Relationships: [];
3359
+ Relationships: [{
3360
+ foreignKeyName: "customer_delivery_locations_customer_id_fkey";
3361
+ columns: ["customer_id"];
3362
+ isOneToOne: false;
3363
+ referencedRelation: "customers";
3364
+ referencedColumns: ["id"];
3365
+ }];
2166
3366
  };
2167
3367
  customer_field_options: {
2168
3368
  Row: {
@@ -2227,47 +3427,335 @@ export declare const createSalesOrder: import("@tanstack/start-client-core").Opt
2227
3427
  };
2228
3428
  Relationships: [];
2229
3429
  };
3430
+ customer_selected_assortment: {
3431
+ Row: {
3432
+ article_number: string | null;
3433
+ created_at: string;
3434
+ customer_id: string;
3435
+ floriday_item_id: string | null;
3436
+ id: string;
3437
+ price: number | null;
3438
+ product_group: string | null;
3439
+ product_name: string;
3440
+ raw: import("../../integrations/supabase/types").Json | null;
3441
+ unit: string | null;
3442
+ updated_at: string;
3443
+ };
3444
+ Insert: {
3445
+ article_number?: string | null;
3446
+ created_at?: string;
3447
+ customer_id: string;
3448
+ floriday_item_id?: string | null;
3449
+ id?: string;
3450
+ price?: number | null;
3451
+ product_group?: string | null;
3452
+ product_name: string;
3453
+ raw?: import("../../integrations/supabase/types").Json | null;
3454
+ unit?: string | null;
3455
+ updated_at?: string;
3456
+ };
3457
+ Update: {
3458
+ article_number?: string | null;
3459
+ created_at?: string;
3460
+ customer_id?: string;
3461
+ floriday_item_id?: string | null;
3462
+ id?: string;
3463
+ price?: number | null;
3464
+ product_group?: string | null;
3465
+ product_name?: string;
3466
+ raw?: import("../../integrations/supabase/types").Json | null;
3467
+ unit?: string | null;
3468
+ updated_at?: string;
3469
+ };
3470
+ Relationships: [{
3471
+ foreignKeyName: "customer_selected_assortment_customer_id_fkey";
3472
+ columns: ["customer_id"];
3473
+ isOneToOne: false;
3474
+ referencedRelation: "customers";
3475
+ referencedColumns: ["id"];
3476
+ }];
3477
+ };
3478
+ customer_trade_settings: {
3479
+ Row: {
3480
+ category: string;
3481
+ created_at: string;
3482
+ customer_id: string;
3483
+ id: string;
3484
+ is_active: boolean;
3485
+ raw: import("../../integrations/supabase/types").Json | null;
3486
+ setting_key: string;
3487
+ setting_label: string;
3488
+ updated_at: string;
3489
+ };
3490
+ Insert: {
3491
+ category?: string;
3492
+ created_at?: string;
3493
+ customer_id: string;
3494
+ id?: string;
3495
+ is_active?: boolean;
3496
+ raw?: import("../../integrations/supabase/types").Json | null;
3497
+ setting_key: string;
3498
+ setting_label: string;
3499
+ updated_at?: string;
3500
+ };
3501
+ Update: {
3502
+ category?: string;
3503
+ created_at?: string;
3504
+ customer_id?: string;
3505
+ id?: string;
3506
+ is_active?: boolean;
3507
+ raw?: import("../../integrations/supabase/types").Json | null;
3508
+ setting_key?: string;
3509
+ setting_label?: string;
3510
+ updated_at?: string;
3511
+ };
3512
+ Relationships: [{
3513
+ foreignKeyName: "customer_trade_settings_customer_id_fkey";
3514
+ columns: ["customer_id"];
3515
+ isOneToOne: false;
3516
+ referencedRelation: "customers";
3517
+ referencedColumns: ["id"];
3518
+ }];
3519
+ };
2230
3520
  customers: {
2231
3521
  Row: {
2232
3522
  address: string | null;
3523
+ bio: string | null;
2233
3524
  city: string | null;
3525
+ commercial_name: string | null;
2234
3526
  company_name: string;
3527
+ connection_status: string;
3528
+ contact_person: string | null;
2235
3529
  country: string | null;
2236
3530
  created_at: string;
2237
3531
  custom_fields: import("../../integrations/supabase/types").Json;
3532
+ customer_class: string | null;
2238
3533
  email: string | null;
3534
+ external_id: string | null;
3535
+ floriday_connection_id: string | null;
3536
+ floriday_organization_id: string | null;
3537
+ floriday_raw: import("../../integrations/supabase/types").Json | null;
3538
+ gln: string | null;
3539
+ house_number: string | null;
2239
3540
  id: string;
3541
+ is_active: boolean;
3542
+ last_synced_at: string | null;
3543
+ logo_url: string | null;
3544
+ markets: string[];
2240
3545
  notes: string | null;
3546
+ organization_type: string | null;
3547
+ payment_methods: string[];
2241
3548
  phone: string | null;
2242
3549
  postal_code: string | null;
3550
+ product_groups: string[];
3551
+ segments: string[];
3552
+ source: string;
3553
+ street: string | null;
3554
+ sync_error: string | null;
3555
+ sync_status: string;
3556
+ trade_forms: string[];
2243
3557
  updated_at: string;
3558
+ vat_number: string | null;
3559
+ website: string | null;
2244
3560
  };
2245
3561
  Insert: {
2246
3562
  address?: string | null;
3563
+ bio?: string | null;
2247
3564
  city?: string | null;
3565
+ commercial_name?: string | null;
2248
3566
  company_name: string;
3567
+ connection_status?: string;
3568
+ contact_person?: string | null;
2249
3569
  country?: string | null;
2250
3570
  created_at?: string;
2251
3571
  custom_fields?: import("../../integrations/supabase/types").Json;
3572
+ customer_class?: string | null;
2252
3573
  email?: string | null;
3574
+ external_id?: string | null;
3575
+ floriday_connection_id?: string | null;
3576
+ floriday_organization_id?: string | null;
3577
+ floriday_raw?: import("../../integrations/supabase/types").Json | null;
3578
+ gln?: string | null;
3579
+ house_number?: string | null;
2253
3580
  id?: string;
3581
+ is_active?: boolean;
3582
+ last_synced_at?: string | null;
3583
+ logo_url?: string | null;
3584
+ markets?: string[];
2254
3585
  notes?: string | null;
3586
+ organization_type?: string | null;
3587
+ payment_methods?: string[];
2255
3588
  phone?: string | null;
2256
3589
  postal_code?: string | null;
3590
+ product_groups?: string[];
3591
+ segments?: string[];
3592
+ source?: string;
3593
+ street?: string | null;
3594
+ sync_error?: string | null;
3595
+ sync_status?: string;
3596
+ trade_forms?: string[];
2257
3597
  updated_at?: string;
3598
+ vat_number?: string | null;
3599
+ website?: string | null;
2258
3600
  };
2259
3601
  Update: {
2260
3602
  address?: string | null;
3603
+ bio?: string | null;
2261
3604
  city?: string | null;
3605
+ commercial_name?: string | null;
2262
3606
  company_name?: string;
3607
+ connection_status?: string;
3608
+ contact_person?: string | null;
2263
3609
  country?: string | null;
2264
3610
  created_at?: string;
2265
3611
  custom_fields?: import("../../integrations/supabase/types").Json;
3612
+ customer_class?: string | null;
2266
3613
  email?: string | null;
3614
+ external_id?: string | null;
3615
+ floriday_connection_id?: string | null;
3616
+ floriday_organization_id?: string | null;
3617
+ floriday_raw?: import("../../integrations/supabase/types").Json | null;
3618
+ gln?: string | null;
3619
+ house_number?: string | null;
2267
3620
  id?: string;
3621
+ is_active?: boolean;
3622
+ last_synced_at?: string | null;
3623
+ logo_url?: string | null;
3624
+ markets?: string[];
2268
3625
  notes?: string | null;
3626
+ organization_type?: string | null;
3627
+ payment_methods?: string[];
2269
3628
  phone?: string | null;
2270
3629
  postal_code?: string | null;
3630
+ product_groups?: string[];
3631
+ segments?: string[];
3632
+ source?: string;
3633
+ street?: string | null;
3634
+ sync_error?: string | null;
3635
+ sync_status?: string;
3636
+ trade_forms?: string[];
3637
+ updated_at?: string;
3638
+ vat_number?: string | null;
3639
+ website?: string | null;
3640
+ };
3641
+ Relationships: [];
3642
+ };
3643
+ exact_connections: {
3644
+ Row: {
3645
+ access_token_encrypted: string;
3646
+ company_name: string | null;
3647
+ connected_at: string;
3648
+ connected_by: string | null;
3649
+ division_code: number | null;
3650
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
3651
+ expires_at: string;
3652
+ id: string;
3653
+ refresh_token_encrypted: string;
3654
+ status: string;
3655
+ updated_at: string;
3656
+ };
3657
+ Insert: {
3658
+ access_token_encrypted: string;
3659
+ company_name?: string | null;
3660
+ connected_at?: string;
3661
+ connected_by?: string | null;
3662
+ division_code?: number | null;
3663
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
3664
+ expires_at: string;
3665
+ id?: string;
3666
+ refresh_token_encrypted: string;
3667
+ status?: string;
3668
+ updated_at?: string;
3669
+ };
3670
+ Update: {
3671
+ access_token_encrypted?: string;
3672
+ company_name?: string | null;
3673
+ connected_at?: string;
3674
+ connected_by?: string | null;
3675
+ division_code?: number | null;
3676
+ environment?: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
3677
+ expires_at?: string;
3678
+ id?: string;
3679
+ refresh_token_encrypted?: string;
3680
+ status?: string;
3681
+ updated_at?: string;
3682
+ };
3683
+ Relationships: [];
3684
+ };
3685
+ exact_credentials: {
3686
+ Row: {
3687
+ client_id: string;
3688
+ client_secret_encrypted: string;
3689
+ created_at: string;
3690
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
3691
+ id: string;
3692
+ redirect_uri: string;
3693
+ updated_at: string;
3694
+ };
3695
+ Insert: {
3696
+ client_id: string;
3697
+ client_secret_encrypted: string;
3698
+ created_at?: string;
3699
+ environment: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
3700
+ id?: string;
3701
+ redirect_uri: string;
3702
+ updated_at?: string;
3703
+ };
3704
+ Update: {
3705
+ client_id?: string;
3706
+ client_secret_encrypted?: string;
3707
+ created_at?: string;
3708
+ environment?: import("../../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
3709
+ id?: string;
3710
+ redirect_uri?: string;
3711
+ updated_at?: string;
3712
+ };
3713
+ Relationships: [];
3714
+ };
3715
+ exact_customers_cache: {
3716
+ Row: {
3717
+ connection_id: string;
3718
+ data: import("../../integrations/supabase/types").Json;
3719
+ exact_id: string;
3720
+ fetched_at: string;
3721
+ };
3722
+ Insert: {
3723
+ connection_id: string;
3724
+ data?: import("../../integrations/supabase/types").Json;
3725
+ exact_id: string;
3726
+ fetched_at?: string;
3727
+ };
3728
+ Update: {
3729
+ connection_id?: string;
3730
+ data?: import("../../integrations/supabase/types").Json;
3731
+ exact_id?: string;
3732
+ fetched_at?: string;
3733
+ };
3734
+ Relationships: [];
3735
+ };
3736
+ exact_sync_state: {
3737
+ Row: {
3738
+ connection_id: string;
3739
+ last_error: string | null;
3740
+ last_modified_cursor: string | null;
3741
+ last_synced_at: string | null;
3742
+ status: string;
3743
+ updated_at: string;
3744
+ };
3745
+ Insert: {
3746
+ connection_id: string;
3747
+ last_error?: string | null;
3748
+ last_modified_cursor?: string | null;
3749
+ last_synced_at?: string | null;
3750
+ status?: string;
3751
+ updated_at?: string;
3752
+ };
3753
+ Update: {
3754
+ connection_id?: string;
3755
+ last_error?: string | null;
3756
+ last_modified_cursor?: string | null;
3757
+ last_synced_at?: string | null;
3758
+ status?: string;
2271
3759
  updated_at?: string;
2272
3760
  };
2273
3761
  Relationships: [];
@@ -2369,6 +3857,7 @@ export declare const createSalesOrder: import("@tanstack/start-client-core").Opt
2369
3857
  client_id: string;
2370
3858
  client_secret: string;
2371
3859
  created_at: string;
3860
+ customers_endpoint: string | null;
2372
3861
  environment: string;
2373
3862
  gln_code: string | null;
2374
3863
  id: string;
@@ -2386,6 +3875,7 @@ export declare const createSalesOrder: import("@tanstack/start-client-core").Opt
2386
3875
  client_id: string;
2387
3876
  client_secret: string;
2388
3877
  created_at?: string;
3878
+ customers_endpoint?: string | null;
2389
3879
  environment: string;
2390
3880
  gln_code?: string | null;
2391
3881
  id?: string;
@@ -2403,6 +3893,7 @@ export declare const createSalesOrder: import("@tanstack/start-client-core").Opt
2403
3893
  client_id?: string;
2404
3894
  client_secret?: string;
2405
3895
  created_at?: string;
3896
+ customers_endpoint?: string | null;
2406
3897
  environment?: string;
2407
3898
  gln_code?: string | null;
2408
3899
  id?: string;
@@ -2416,6 +3907,90 @@ export declare const createSalesOrder: import("@tanstack/start-client-core").Opt
2416
3907
  };
2417
3908
  Relationships: [];
2418
3909
  };
3910
+ floriday_customers_cache: {
3911
+ Row: {
3912
+ connection_id: string | null;
3913
+ data: import("../../integrations/supabase/types").Json;
3914
+ fetched_at: string;
3915
+ organization_id: string;
3916
+ };
3917
+ Insert: {
3918
+ connection_id?: string | null;
3919
+ data?: import("../../integrations/supabase/types").Json;
3920
+ fetched_at?: string;
3921
+ organization_id: string;
3922
+ };
3923
+ Update: {
3924
+ connection_id?: string | null;
3925
+ data?: import("../../integrations/supabase/types").Json;
3926
+ fetched_at?: string;
3927
+ organization_id?: string;
3928
+ };
3929
+ Relationships: [{
3930
+ foreignKeyName: "floriday_customers_cache_connection_id_fkey";
3931
+ columns: ["connection_id"];
3932
+ isOneToOne: false;
3933
+ referencedRelation: "floriday_connections";
3934
+ referencedColumns: ["id"];
3935
+ }];
3936
+ };
3937
+ floriday_network_cache: {
3938
+ Row: {
3939
+ city: string | null;
3940
+ connection_id: string;
3941
+ country: string | null;
3942
+ data: import("../../integrations/supabase/types").Json;
3943
+ fetched_at: string;
3944
+ gln: string | null;
3945
+ organization_id: string;
3946
+ organization_name: string | null;
3947
+ };
3948
+ Insert: {
3949
+ city?: string | null;
3950
+ connection_id: string;
3951
+ country?: string | null;
3952
+ data?: import("../../integrations/supabase/types").Json;
3953
+ fetched_at?: string;
3954
+ gln?: string | null;
3955
+ organization_id: string;
3956
+ organization_name?: string | null;
3957
+ };
3958
+ Update: {
3959
+ city?: string | null;
3960
+ connection_id?: string;
3961
+ country?: string | null;
3962
+ data?: import("../../integrations/supabase/types").Json;
3963
+ fetched_at?: string;
3964
+ gln?: string | null;
3965
+ organization_id?: string;
3966
+ organization_name?: string | null;
3967
+ };
3968
+ Relationships: [];
3969
+ };
3970
+ floriday_network_sync_state: {
3971
+ Row: {
3972
+ connection_id: string;
3973
+ last_error: string | null;
3974
+ last_sequence_number: number;
3975
+ last_synced_at: string | null;
3976
+ updated_at: string;
3977
+ };
3978
+ Insert: {
3979
+ connection_id: string;
3980
+ last_error?: string | null;
3981
+ last_sequence_number?: number;
3982
+ last_synced_at?: string | null;
3983
+ updated_at?: string;
3984
+ };
3985
+ Update: {
3986
+ connection_id?: string;
3987
+ last_error?: string | null;
3988
+ last_sequence_number?: number;
3989
+ last_synced_at?: string | null;
3990
+ updated_at?: string;
3991
+ };
3992
+ Relationships: [];
3993
+ };
2419
3994
  floriday_settings: {
2420
3995
  Row: {
2421
3996
  active_environment: string;
@@ -3110,6 +4685,13 @@ export declare const createSalesOrder: import("@tanstack/start-client-core").Opt
3110
4685
  };
3111
4686
  Returns: boolean;
3112
4687
  };
4688
+ schedule_floriday_network_sync: {
4689
+ Args: {
4690
+ p_apikey: string;
4691
+ p_url: string;
4692
+ };
4693
+ Returns: number;
4694
+ };
3113
4695
  schedule_floriday_token_refresh: {
3114
4696
  Args: {
3115
4697
  p_apikey: string;
@@ -3117,9 +4699,20 @@ export declare const createSalesOrder: import("@tanstack/start-client-core").Opt
3117
4699
  };
3118
4700
  Returns: number;
3119
4701
  };
4702
+ show_limit: {
4703
+ Args: never;
4704
+ Returns: number;
4705
+ };
4706
+ show_trgm: {
4707
+ Args: {
4708
+ "": string;
4709
+ };
4710
+ Returns: string[];
4711
+ };
3120
4712
  };
3121
4713
  Enums: {
3122
4714
  app_role: "admin" | "manager" | "warehouse" | "sales" | "developer";
4715
+ exact_env: "staging" | "live";
3123
4716
  };
3124
4717
  CompositeTypes: { [_ in never]: never; };
3125
4718
  }, {