@flowselections/floriday-klanten-module 1.0.4 → 1.0.5

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.
@@ -493,6 +493,285 @@ export type Database = {
493
493
  };
494
494
  Relationships: [];
495
495
  };
496
+ dashboard_ai_conversations: {
497
+ Row: {
498
+ created_at: string;
499
+ id: string;
500
+ messages: Json;
501
+ page_id: string | null;
502
+ title: string | null;
503
+ updated_at: string;
504
+ user_id: string;
505
+ };
506
+ Insert: {
507
+ created_at?: string;
508
+ id?: string;
509
+ messages?: Json;
510
+ page_id?: string | null;
511
+ title?: string | null;
512
+ updated_at?: string;
513
+ user_id: string;
514
+ };
515
+ Update: {
516
+ created_at?: string;
517
+ id?: string;
518
+ messages?: Json;
519
+ page_id?: string | null;
520
+ title?: string | null;
521
+ updated_at?: string;
522
+ user_id?: string;
523
+ };
524
+ Relationships: [
525
+ {
526
+ foreignKeyName: "dashboard_ai_conversations_page_id_fkey";
527
+ columns: ["page_id"];
528
+ isOneToOne: false;
529
+ referencedRelation: "dashboard_pages";
530
+ referencedColumns: ["id"];
531
+ }
532
+ ];
533
+ };
534
+ dashboard_alert_events: {
535
+ Row: {
536
+ acknowledged: boolean;
537
+ block_id: string;
538
+ created_at: string;
539
+ id: string;
540
+ message: string | null;
541
+ page_id: string;
542
+ severity: string;
543
+ threshold: number | null;
544
+ user_id: string;
545
+ value: number | null;
546
+ };
547
+ Insert: {
548
+ acknowledged?: boolean;
549
+ block_id: string;
550
+ created_at?: string;
551
+ id?: string;
552
+ message?: string | null;
553
+ page_id: string;
554
+ severity?: string;
555
+ threshold?: number | null;
556
+ user_id: string;
557
+ value?: number | null;
558
+ };
559
+ Update: {
560
+ acknowledged?: boolean;
561
+ block_id?: string;
562
+ created_at?: string;
563
+ id?: string;
564
+ message?: string | null;
565
+ page_id?: string;
566
+ severity?: string;
567
+ threshold?: number | null;
568
+ user_id?: string;
569
+ value?: number | null;
570
+ };
571
+ Relationships: [
572
+ {
573
+ foreignKeyName: "dashboard_alert_events_block_id_fkey";
574
+ columns: ["block_id"];
575
+ isOneToOne: false;
576
+ referencedRelation: "dashboard_blocks";
577
+ referencedColumns: ["id"];
578
+ },
579
+ {
580
+ foreignKeyName: "dashboard_alert_events_page_id_fkey";
581
+ columns: ["page_id"];
582
+ isOneToOne: false;
583
+ referencedRelation: "dashboard_pages";
584
+ referencedColumns: ["id"];
585
+ }
586
+ ];
587
+ };
588
+ dashboard_block_templates: {
589
+ Row: {
590
+ config: Json;
591
+ created_at: string;
592
+ description: string | null;
593
+ id: string;
594
+ is_public: boolean;
595
+ name: string;
596
+ type: string;
597
+ updated_at: string;
598
+ user_id: string;
599
+ };
600
+ Insert: {
601
+ config?: Json;
602
+ created_at?: string;
603
+ description?: string | null;
604
+ id?: string;
605
+ is_public?: boolean;
606
+ name: string;
607
+ type: string;
608
+ updated_at?: string;
609
+ user_id: string;
610
+ };
611
+ Update: {
612
+ config?: Json;
613
+ created_at?: string;
614
+ description?: string | null;
615
+ id?: string;
616
+ is_public?: boolean;
617
+ name?: string;
618
+ type?: string;
619
+ updated_at?: string;
620
+ user_id?: string;
621
+ };
622
+ Relationships: [];
623
+ };
624
+ dashboard_blocks: {
625
+ Row: {
626
+ config: Json;
627
+ created_at: string;
628
+ filters: Json;
629
+ id: string;
630
+ layout: Json;
631
+ page_id: string;
632
+ permissions: Json;
633
+ sort_order: number;
634
+ title: string;
635
+ type: string;
636
+ updated_at: string;
637
+ };
638
+ Insert: {
639
+ config?: Json;
640
+ created_at?: string;
641
+ filters?: Json;
642
+ id?: string;
643
+ layout?: Json;
644
+ page_id: string;
645
+ permissions?: Json;
646
+ sort_order?: number;
647
+ title: string;
648
+ type: string;
649
+ updated_at?: string;
650
+ };
651
+ Update: {
652
+ config?: Json;
653
+ created_at?: string;
654
+ filters?: Json;
655
+ id?: string;
656
+ layout?: Json;
657
+ page_id?: string;
658
+ permissions?: Json;
659
+ sort_order?: number;
660
+ title?: string;
661
+ type?: string;
662
+ updated_at?: string;
663
+ };
664
+ Relationships: [
665
+ {
666
+ foreignKeyName: "dashboard_blocks_page_id_fkey";
667
+ columns: ["page_id"];
668
+ isOneToOne: false;
669
+ referencedRelation: "dashboard_pages";
670
+ referencedColumns: ["id"];
671
+ }
672
+ ];
673
+ };
674
+ dashboard_daily_reports: {
675
+ Row: {
676
+ created_at: string;
677
+ highlights: Json | null;
678
+ id: string;
679
+ page_id: string;
680
+ summary: string;
681
+ user_id: string;
682
+ };
683
+ Insert: {
684
+ created_at?: string;
685
+ highlights?: Json | null;
686
+ id?: string;
687
+ page_id: string;
688
+ summary: string;
689
+ user_id: string;
690
+ };
691
+ Update: {
692
+ created_at?: string;
693
+ highlights?: Json | null;
694
+ id?: string;
695
+ page_id?: string;
696
+ summary?: string;
697
+ user_id?: string;
698
+ };
699
+ Relationships: [
700
+ {
701
+ foreignKeyName: "dashboard_daily_reports_page_id_fkey";
702
+ columns: ["page_id"];
703
+ isOneToOne: false;
704
+ referencedRelation: "dashboard_pages";
705
+ referencedColumns: ["id"];
706
+ }
707
+ ];
708
+ };
709
+ dashboard_pages: {
710
+ Row: {
711
+ created_at: string;
712
+ icon: string | null;
713
+ id: string;
714
+ is_default: boolean;
715
+ name: string;
716
+ shared_with: string[];
717
+ sort_order: number;
718
+ updated_at: string;
719
+ user_id: string;
720
+ };
721
+ Insert: {
722
+ created_at?: string;
723
+ icon?: string | null;
724
+ id?: string;
725
+ is_default?: boolean;
726
+ name: string;
727
+ shared_with?: string[];
728
+ sort_order?: number;
729
+ updated_at?: string;
730
+ user_id: string;
731
+ };
732
+ Update: {
733
+ created_at?: string;
734
+ icon?: string | null;
735
+ id?: string;
736
+ is_default?: boolean;
737
+ name?: string;
738
+ shared_with?: string[];
739
+ sort_order?: number;
740
+ updated_at?: string;
741
+ user_id?: string;
742
+ };
743
+ Relationships: [];
744
+ };
745
+ dashboard_saved_queries: {
746
+ Row: {
747
+ created_at: string;
748
+ description: string | null;
749
+ id: string;
750
+ name: string;
751
+ query_spec: Json;
752
+ updated_at: string;
753
+ user_id: string;
754
+ };
755
+ Insert: {
756
+ created_at?: string;
757
+ description?: string | null;
758
+ id?: string;
759
+ name: string;
760
+ query_spec: Json;
761
+ updated_at?: string;
762
+ user_id: string;
763
+ };
764
+ Update: {
765
+ created_at?: string;
766
+ description?: string | null;
767
+ id?: string;
768
+ name?: string;
769
+ query_spec?: Json;
770
+ updated_at?: string;
771
+ user_id?: string;
772
+ };
773
+ Relationships: [];
774
+ };
496
775
  exact_connections: {
497
776
  Row: {
498
777
  access_token_encrypted: string;
@@ -503,6 +782,9 @@ export type Database = {
503
782
  environment: Database["public"]["Enums"]["exact_env"];
504
783
  expires_at: string;
505
784
  id: string;
785
+ last_error: string | null;
786
+ last_refreshed_at: string | null;
787
+ last_tested_at: string | null;
506
788
  refresh_token_encrypted: string;
507
789
  status: string;
508
790
  updated_at: string;
@@ -516,6 +798,9 @@ export type Database = {
516
798
  environment: Database["public"]["Enums"]["exact_env"];
517
799
  expires_at: string;
518
800
  id?: string;
801
+ last_error?: string | null;
802
+ last_refreshed_at?: string | null;
803
+ last_tested_at?: string | null;
519
804
  refresh_token_encrypted: string;
520
805
  status?: string;
521
806
  updated_at?: string;
@@ -529,6 +814,9 @@ export type Database = {
529
814
  environment?: Database["public"]["Enums"]["exact_env"];
530
815
  expires_at?: string;
531
816
  id?: string;
817
+ last_error?: string | null;
818
+ last_refreshed_at?: string | null;
819
+ last_tested_at?: string | null;
532
820
  refresh_token_encrypted?: string;
533
821
  status?: string;
534
822
  updated_at?: string;
@@ -551,7 +839,7 @@ export type Database = {
551
839
  created_at?: string;
552
840
  environment: Database["public"]["Enums"]["exact_env"];
553
841
  id?: string;
554
- redirect_uri: string;
842
+ redirect_uri?: string;
555
843
  updated_at?: string;
556
844
  };
557
845
  Update: {
@@ -741,204 +1029,815 @@ export type Database = {
741
1029
  updated_at?: string;
742
1030
  };
743
1031
  Update: {
744
- access_token?: string | null;
745
- api_key?: string;
746
- client_id?: string;
747
- client_secret?: string;
1032
+ access_token?: string | null;
1033
+ api_key?: string;
1034
+ client_id?: string;
1035
+ client_secret?: string;
1036
+ created_at?: string;
1037
+ customers_endpoint?: string | null;
1038
+ environment?: string;
1039
+ gln_code?: string | null;
1040
+ id?: string;
1041
+ is_active?: boolean;
1042
+ label?: string;
1043
+ organization_name?: string | null;
1044
+ preferred_warehouse_id?: string | null;
1045
+ preferred_warehouse_name?: string | null;
1046
+ token_expires_at?: string | null;
1047
+ updated_at?: string;
1048
+ };
1049
+ Relationships: [];
1050
+ };
1051
+ floriday_customers_cache: {
1052
+ Row: {
1053
+ connection_id: string | null;
1054
+ data: Json;
1055
+ fetched_at: string;
1056
+ organization_id: string;
1057
+ };
1058
+ Insert: {
1059
+ connection_id?: string | null;
1060
+ data?: Json;
1061
+ fetched_at?: string;
1062
+ organization_id: string;
1063
+ };
1064
+ Update: {
1065
+ connection_id?: string | null;
1066
+ data?: Json;
1067
+ fetched_at?: string;
1068
+ organization_id?: string;
1069
+ };
1070
+ Relationships: [
1071
+ {
1072
+ foreignKeyName: "floriday_customers_cache_connection_id_fkey";
1073
+ columns: ["connection_id"];
1074
+ isOneToOne: false;
1075
+ referencedRelation: "floriday_connections";
1076
+ referencedColumns: ["id"];
1077
+ }
1078
+ ];
1079
+ };
1080
+ floriday_network_cache: {
1081
+ Row: {
1082
+ city: string | null;
1083
+ connection_id: string;
1084
+ country: string | null;
1085
+ data: Json;
1086
+ fetched_at: string;
1087
+ gln: string | null;
1088
+ organization_id: string;
1089
+ organization_name: string | null;
1090
+ };
1091
+ Insert: {
1092
+ city?: string | null;
1093
+ connection_id: string;
1094
+ country?: string | null;
1095
+ data?: Json;
1096
+ fetched_at?: string;
1097
+ gln?: string | null;
1098
+ organization_id: string;
1099
+ organization_name?: string | null;
1100
+ };
1101
+ Update: {
1102
+ city?: string | null;
1103
+ connection_id?: string;
1104
+ country?: string | null;
1105
+ data?: Json;
1106
+ fetched_at?: string;
1107
+ gln?: string | null;
1108
+ organization_id?: string;
1109
+ organization_name?: string | null;
1110
+ };
1111
+ Relationships: [];
1112
+ };
1113
+ floriday_network_sync_state: {
1114
+ Row: {
1115
+ connection_id: string;
1116
+ last_error: string | null;
1117
+ last_sequence_number: number;
1118
+ last_synced_at: string | null;
1119
+ updated_at: string;
1120
+ };
1121
+ Insert: {
1122
+ connection_id: string;
1123
+ last_error?: string | null;
1124
+ last_sequence_number?: number;
1125
+ last_synced_at?: string | null;
1126
+ updated_at?: string;
1127
+ };
1128
+ Update: {
1129
+ connection_id?: string;
1130
+ last_error?: string | null;
1131
+ last_sequence_number?: number;
1132
+ last_synced_at?: string | null;
1133
+ updated_at?: string;
1134
+ };
1135
+ Relationships: [];
1136
+ };
1137
+ floriday_settings: {
1138
+ Row: {
1139
+ active_environment: string;
1140
+ id: number;
1141
+ updated_at: string;
1142
+ };
1143
+ Insert: {
1144
+ active_environment?: string;
1145
+ id?: number;
1146
+ updated_at?: string;
1147
+ };
1148
+ Update: {
1149
+ active_environment?: string;
1150
+ id?: number;
1151
+ updated_at?: string;
1152
+ };
1153
+ Relationships: [];
1154
+ };
1155
+ inventory_settings: {
1156
+ Row: {
1157
+ created_at: string;
1158
+ hierarchy_levels: string[];
1159
+ id: string;
1160
+ updated_at: string;
1161
+ visible_columns: string[];
1162
+ };
1163
+ Insert: {
1164
+ created_at?: string;
1165
+ hierarchy_levels?: string[];
1166
+ id?: string;
1167
+ updated_at?: string;
1168
+ visible_columns?: string[];
1169
+ };
1170
+ Update: {
1171
+ created_at?: string;
1172
+ hierarchy_levels?: string[];
1173
+ id?: string;
1174
+ updated_at?: string;
1175
+ visible_columns?: string[];
1176
+ };
1177
+ Relationships: [];
1178
+ };
1179
+ locations: {
1180
+ Row: {
1181
+ created_at: string;
1182
+ id: string;
1183
+ name: string;
1184
+ sort_order: number;
1185
+ updated_at: string;
1186
+ };
1187
+ Insert: {
1188
+ created_at?: string;
1189
+ id?: string;
1190
+ name: string;
1191
+ sort_order?: number;
1192
+ updated_at?: string;
1193
+ };
1194
+ Update: {
1195
+ created_at?: string;
1196
+ id?: string;
1197
+ name?: string;
1198
+ sort_order?: number;
1199
+ updated_at?: string;
1200
+ };
1201
+ Relationships: [];
1202
+ };
1203
+ mailbox_messages: {
1204
+ Row: {
1205
+ body_html: string | null;
1206
+ body_text: string | null;
1207
+ created_at: string;
1208
+ error_message: string | null;
1209
+ from_email: string | null;
1210
+ from_name: string | null;
1211
+ id: string;
1212
+ message_id: string | null;
1213
+ raw_size: number | null;
1214
+ received_at: string | null;
1215
+ status: string;
1216
+ subject: string | null;
1217
+ uid: number;
1218
+ updated_at: string;
1219
+ };
1220
+ Insert: {
1221
+ body_html?: string | null;
1222
+ body_text?: string | null;
1223
+ created_at?: string;
1224
+ error_message?: string | null;
1225
+ from_email?: string | null;
1226
+ from_name?: string | null;
1227
+ id?: string;
1228
+ message_id?: string | null;
1229
+ raw_size?: number | null;
1230
+ received_at?: string | null;
1231
+ status?: string;
1232
+ subject?: string | null;
1233
+ uid: number;
1234
+ updated_at?: string;
1235
+ };
1236
+ Update: {
1237
+ body_html?: string | null;
1238
+ body_text?: string | null;
1239
+ created_at?: string;
1240
+ error_message?: string | null;
1241
+ from_email?: string | null;
1242
+ from_name?: string | null;
1243
+ id?: string;
1244
+ message_id?: string | null;
1245
+ raw_size?: number | null;
1246
+ received_at?: string | null;
1247
+ status?: string;
1248
+ subject?: string | null;
1249
+ uid?: number;
1250
+ updated_at?: string;
1251
+ };
1252
+ Relationships: [];
1253
+ };
1254
+ mailbox_order_proposals: {
1255
+ Row: {
1256
+ confidence: number | null;
1257
+ created_at: string;
1258
+ created_order_id: string | null;
1259
+ delivery_date: string | null;
1260
+ id: string;
1261
+ matched_customer_id: string | null;
1262
+ message_id: string;
1263
+ notes: string | null;
1264
+ parsed_payload: Json | null;
1265
+ reviewed_at: string | null;
1266
+ reviewed_by: string | null;
1267
+ status: string;
1268
+ updated_at: string;
1269
+ };
1270
+ Insert: {
1271
+ confidence?: number | null;
1272
+ created_at?: string;
1273
+ created_order_id?: string | null;
1274
+ delivery_date?: string | null;
1275
+ id?: string;
1276
+ matched_customer_id?: string | null;
1277
+ message_id: string;
1278
+ notes?: string | null;
1279
+ parsed_payload?: Json | null;
1280
+ reviewed_at?: string | null;
1281
+ reviewed_by?: string | null;
1282
+ status?: string;
1283
+ updated_at?: string;
1284
+ };
1285
+ Update: {
1286
+ confidence?: number | null;
1287
+ created_at?: string;
1288
+ created_order_id?: string | null;
1289
+ delivery_date?: string | null;
1290
+ id?: string;
1291
+ matched_customer_id?: string | null;
1292
+ message_id?: string;
1293
+ notes?: string | null;
1294
+ parsed_payload?: Json | null;
1295
+ reviewed_at?: string | null;
1296
+ reviewed_by?: string | null;
1297
+ status?: string;
1298
+ updated_at?: string;
1299
+ };
1300
+ Relationships: [
1301
+ {
1302
+ foreignKeyName: "mailbox_order_proposals_created_order_id_fkey";
1303
+ columns: ["created_order_id"];
1304
+ isOneToOne: false;
1305
+ referencedRelation: "orders";
1306
+ referencedColumns: ["id"];
1307
+ },
1308
+ {
1309
+ foreignKeyName: "mailbox_order_proposals_matched_customer_id_fkey";
1310
+ columns: ["matched_customer_id"];
1311
+ isOneToOne: false;
1312
+ referencedRelation: "customers";
1313
+ referencedColumns: ["id"];
1314
+ },
1315
+ {
1316
+ foreignKeyName: "mailbox_order_proposals_message_id_fkey";
1317
+ columns: ["message_id"];
1318
+ isOneToOne: false;
1319
+ referencedRelation: "mailbox_messages";
1320
+ referencedColumns: ["id"];
1321
+ }
1322
+ ];
1323
+ };
1324
+ mailbox_proposal_lines: {
1325
+ Row: {
1326
+ created_at: string;
1327
+ id: string;
1328
+ match_confidence: number | null;
1329
+ product_id: string | null;
1330
+ proposal_id: string;
1331
+ quantity: number | null;
1332
+ raw_product_text: string | null;
1333
+ sort_order: number;
1334
+ unit: string | null;
1335
+ updated_at: string;
1336
+ };
1337
+ Insert: {
1338
+ created_at?: string;
1339
+ id?: string;
1340
+ match_confidence?: number | null;
1341
+ product_id?: string | null;
1342
+ proposal_id: string;
1343
+ quantity?: number | null;
1344
+ raw_product_text?: string | null;
1345
+ sort_order?: number;
1346
+ unit?: string | null;
1347
+ updated_at?: string;
1348
+ };
1349
+ Update: {
1350
+ created_at?: string;
1351
+ id?: string;
1352
+ match_confidence?: number | null;
1353
+ product_id?: string | null;
1354
+ proposal_id?: string;
1355
+ quantity?: number | null;
1356
+ raw_product_text?: string | null;
1357
+ sort_order?: number;
1358
+ unit?: string | null;
1359
+ updated_at?: string;
1360
+ };
1361
+ Relationships: [
1362
+ {
1363
+ foreignKeyName: "mailbox_proposal_lines_product_id_fkey";
1364
+ columns: ["product_id"];
1365
+ isOneToOne: false;
1366
+ referencedRelation: "products";
1367
+ referencedColumns: ["id"];
1368
+ },
1369
+ {
1370
+ foreignKeyName: "mailbox_proposal_lines_proposal_id_fkey";
1371
+ columns: ["proposal_id"];
1372
+ isOneToOne: false;
1373
+ referencedRelation: "mailbox_order_proposals";
1374
+ referencedColumns: ["id"];
1375
+ }
1376
+ ];
1377
+ };
1378
+ mailbox_settings: {
1379
+ Row: {
1380
+ created_at: string;
1381
+ folder: string;
1382
+ id: string;
1383
+ imap_host: string;
1384
+ imap_port: number;
1385
+ imap_use_tls: boolean;
1386
+ imap_username: string;
1387
+ last_error: string | null;
1388
+ last_polled_at: string | null;
1389
+ last_uid_seen: number;
1390
+ polling_enabled: boolean;
1391
+ singleton: boolean;
1392
+ updated_at: string;
1393
+ };
1394
+ Insert: {
1395
+ created_at?: string;
1396
+ folder?: string;
1397
+ id?: string;
1398
+ imap_host?: string;
1399
+ imap_port?: number;
1400
+ imap_use_tls?: boolean;
1401
+ imap_username?: string;
1402
+ last_error?: string | null;
1403
+ last_polled_at?: string | null;
1404
+ last_uid_seen?: number;
1405
+ polling_enabled?: boolean;
1406
+ singleton?: boolean;
1407
+ updated_at?: string;
1408
+ };
1409
+ Update: {
1410
+ created_at?: string;
1411
+ folder?: string;
1412
+ id?: string;
1413
+ imap_host?: string;
1414
+ imap_port?: number;
1415
+ imap_use_tls?: boolean;
1416
+ imap_username?: string;
1417
+ last_error?: string | null;
1418
+ last_polled_at?: string | null;
1419
+ last_uid_seen?: number;
1420
+ polling_enabled?: boolean;
1421
+ singleton?: boolean;
1422
+ updated_at?: string;
1423
+ };
1424
+ Relationships: [];
1425
+ };
1426
+ notifications: {
1427
+ Row: {
1428
+ created_at: string;
1429
+ id: string;
1430
+ message: string | null;
1431
+ read: boolean;
1432
+ title: string;
1433
+ updated_at: string;
1434
+ user_id: string;
1435
+ };
1436
+ Insert: {
1437
+ created_at?: string;
1438
+ id?: string;
1439
+ message?: string | null;
1440
+ read?: boolean;
1441
+ title: string;
1442
+ updated_at?: string;
1443
+ user_id: string;
1444
+ };
1445
+ Update: {
748
1446
  created_at?: string;
749
- customers_endpoint?: string | null;
750
- environment?: string;
751
- gln_code?: string | null;
752
1447
  id?: string;
753
- is_active?: boolean;
754
- label?: string;
755
- organization_name?: string | null;
756
- preferred_warehouse_id?: string | null;
757
- preferred_warehouse_name?: string | null;
758
- token_expires_at?: string | null;
1448
+ message?: string | null;
1449
+ read?: boolean;
1450
+ title?: string;
759
1451
  updated_at?: string;
1452
+ user_id?: string;
760
1453
  };
761
1454
  Relationships: [];
762
1455
  };
763
- floriday_customers_cache: {
1456
+ offer_campaign_product_tiers: {
764
1457
  Row: {
765
- connection_id: string | null;
766
- data: Json;
767
- fetched_at: string;
768
- organization_id: string;
1458
+ campaign_product_id: string;
1459
+ created_at: string;
1460
+ id: string;
1461
+ min_crates: number;
1462
+ price_per_crate: number;
1463
+ sort_order: number;
769
1464
  };
770
1465
  Insert: {
771
- connection_id?: string | null;
772
- data?: Json;
773
- fetched_at?: string;
774
- organization_id: string;
1466
+ campaign_product_id: string;
1467
+ created_at?: string;
1468
+ id?: string;
1469
+ min_crates?: number;
1470
+ price_per_crate?: number;
1471
+ sort_order?: number;
775
1472
  };
776
1473
  Update: {
777
- connection_id?: string | null;
778
- data?: Json;
779
- fetched_at?: string;
780
- organization_id?: string;
1474
+ campaign_product_id?: string;
1475
+ created_at?: string;
1476
+ id?: string;
1477
+ min_crates?: number;
1478
+ price_per_crate?: number;
1479
+ sort_order?: number;
781
1480
  };
782
1481
  Relationships: [
783
1482
  {
784
- foreignKeyName: "floriday_customers_cache_connection_id_fkey";
785
- columns: ["connection_id"];
1483
+ foreignKeyName: "offer_campaign_product_tiers_campaign_product_id_fkey";
1484
+ columns: ["campaign_product_id"];
786
1485
  isOneToOne: false;
787
- referencedRelation: "floriday_connections";
1486
+ referencedRelation: "offer_campaign_products";
788
1487
  referencedColumns: ["id"];
789
1488
  }
790
1489
  ];
791
1490
  };
792
- floriday_network_cache: {
1491
+ offer_campaign_products: {
793
1492
  Row: {
794
- city: string | null;
795
- connection_id: string;
796
- country: string | null;
797
- data: Json;
798
- fetched_at: string;
799
- gln: string | null;
800
- organization_id: string;
801
- organization_name: string | null;
1493
+ available_stock: number;
1494
+ barcode: string | null;
1495
+ belading: string | null;
1496
+ campaign_id: string;
1497
+ crate_price: number | null;
1498
+ created_at: string;
1499
+ description: string | null;
1500
+ discount_price: number;
1501
+ id: string;
1502
+ image_url: string | null;
1503
+ normal_price: number;
1504
+ plants_per_crate: number | null;
1505
+ product_id: string | null;
1506
+ product_name: string;
1507
+ sort_order: number;
1508
+ sticker_available: boolean;
1509
+ sticker_cost: number | null;
802
1510
  };
803
1511
  Insert: {
804
- city?: string | null;
805
- connection_id: string;
806
- country?: string | null;
807
- data?: Json;
808
- fetched_at?: string;
809
- gln?: string | null;
810
- organization_id: string;
811
- organization_name?: string | null;
1512
+ available_stock?: number;
1513
+ barcode?: string | null;
1514
+ belading?: string | null;
1515
+ campaign_id: string;
1516
+ crate_price?: number | null;
1517
+ created_at?: string;
1518
+ description?: string | null;
1519
+ discount_price?: number;
1520
+ id?: string;
1521
+ image_url?: string | null;
1522
+ normal_price?: number;
1523
+ plants_per_crate?: number | null;
1524
+ product_id?: string | null;
1525
+ product_name: string;
1526
+ sort_order?: number;
1527
+ sticker_available?: boolean;
1528
+ sticker_cost?: number | null;
812
1529
  };
813
1530
  Update: {
814
- city?: string | null;
815
- connection_id?: string;
816
- country?: string | null;
817
- data?: Json;
818
- fetched_at?: string;
819
- gln?: string | null;
820
- organization_id?: string;
821
- organization_name?: string | null;
1531
+ available_stock?: number;
1532
+ barcode?: string | null;
1533
+ belading?: string | null;
1534
+ campaign_id?: string;
1535
+ crate_price?: number | null;
1536
+ created_at?: string;
1537
+ description?: string | null;
1538
+ discount_price?: number;
1539
+ id?: string;
1540
+ image_url?: string | null;
1541
+ normal_price?: number;
1542
+ plants_per_crate?: number | null;
1543
+ product_id?: string | null;
1544
+ product_name?: string;
1545
+ sort_order?: number;
1546
+ sticker_available?: boolean;
1547
+ sticker_cost?: number | null;
822
1548
  };
823
- Relationships: [];
1549
+ Relationships: [
1550
+ {
1551
+ foreignKeyName: "offer_campaign_products_campaign_id_fkey";
1552
+ columns: ["campaign_id"];
1553
+ isOneToOne: false;
1554
+ referencedRelation: "offer_campaigns";
1555
+ referencedColumns: ["id"];
1556
+ },
1557
+ {
1558
+ foreignKeyName: "offer_campaign_products_product_id_fkey";
1559
+ columns: ["product_id"];
1560
+ isOneToOne: false;
1561
+ referencedRelation: "products";
1562
+ referencedColumns: ["id"];
1563
+ }
1564
+ ];
824
1565
  };
825
- floriday_network_sync_state: {
1566
+ offer_campaigns: {
826
1567
  Row: {
827
- connection_id: string;
828
- last_error: string | null;
829
- last_sequence_number: number;
830
- last_synced_at: string | null;
1568
+ created_at: string;
1569
+ created_by: string | null;
1570
+ from_email: string;
1571
+ from_name: string;
1572
+ id: string;
1573
+ intro_message: string | null;
1574
+ name: string;
1575
+ scheduled_at: string | null;
1576
+ sent_at: string | null;
1577
+ status: string;
1578
+ subject: string;
831
1579
  updated_at: string;
832
1580
  };
833
1581
  Insert: {
834
- connection_id: string;
835
- last_error?: string | null;
836
- last_sequence_number?: number;
837
- last_synced_at?: string | null;
1582
+ created_at?: string;
1583
+ created_by?: string | null;
1584
+ from_email: string;
1585
+ from_name: string;
1586
+ id?: string;
1587
+ intro_message?: string | null;
1588
+ name: string;
1589
+ scheduled_at?: string | null;
1590
+ sent_at?: string | null;
1591
+ status?: string;
1592
+ subject: string;
838
1593
  updated_at?: string;
839
1594
  };
840
1595
  Update: {
841
- connection_id?: string;
842
- last_error?: string | null;
843
- last_sequence_number?: number;
844
- last_synced_at?: string | null;
1596
+ created_at?: string;
1597
+ created_by?: string | null;
1598
+ from_email?: string;
1599
+ from_name?: string;
1600
+ id?: string;
1601
+ intro_message?: string | null;
1602
+ name?: string;
1603
+ scheduled_at?: string | null;
1604
+ sent_at?: string | null;
1605
+ status?: string;
1606
+ subject?: string;
845
1607
  updated_at?: string;
846
1608
  };
847
1609
  Relationships: [];
848
1610
  };
849
- floriday_settings: {
1611
+ offer_events: {
850
1612
  Row: {
851
- active_environment: string;
852
- id: number;
853
- updated_at: string;
1613
+ campaign_id: string;
1614
+ created_at: string;
1615
+ event_type: string;
1616
+ id: string;
1617
+ metadata: Json;
1618
+ recipient_id: string;
854
1619
  };
855
1620
  Insert: {
856
- active_environment?: string;
857
- id?: number;
858
- updated_at?: string;
1621
+ campaign_id: string;
1622
+ created_at?: string;
1623
+ event_type: string;
1624
+ id?: string;
1625
+ metadata?: Json;
1626
+ recipient_id: string;
859
1627
  };
860
1628
  Update: {
861
- active_environment?: string;
862
- id?: number;
863
- updated_at?: string;
1629
+ campaign_id?: string;
1630
+ created_at?: string;
1631
+ event_type?: string;
1632
+ id?: string;
1633
+ metadata?: Json;
1634
+ recipient_id?: string;
864
1635
  };
865
- Relationships: [];
1636
+ Relationships: [
1637
+ {
1638
+ foreignKeyName: "offer_events_campaign_id_fkey";
1639
+ columns: ["campaign_id"];
1640
+ isOneToOne: false;
1641
+ referencedRelation: "offer_campaigns";
1642
+ referencedColumns: ["id"];
1643
+ },
1644
+ {
1645
+ foreignKeyName: "offer_events_recipient_id_fkey";
1646
+ columns: ["recipient_id"];
1647
+ isOneToOne: false;
1648
+ referencedRelation: "offer_recipients";
1649
+ referencedColumns: ["id"];
1650
+ }
1651
+ ];
866
1652
  };
867
- inventory_settings: {
1653
+ offer_orders: {
868
1654
  Row: {
1655
+ campaign_id: string;
869
1656
  created_at: string;
870
- hierarchy_levels: string[];
1657
+ customer_email: string;
1658
+ customer_id: string | null;
1659
+ customer_name: string;
1660
+ customer_phone: string | null;
871
1661
  id: string;
872
- updated_at: string;
873
- visible_columns: string[];
1662
+ items: Json;
1663
+ notes: string | null;
1664
+ recipient_id: string;
1665
+ total_amount: number;
874
1666
  };
875
1667
  Insert: {
1668
+ campaign_id: string;
876
1669
  created_at?: string;
877
- hierarchy_levels?: string[];
1670
+ customer_email: string;
1671
+ customer_id?: string | null;
1672
+ customer_name: string;
1673
+ customer_phone?: string | null;
878
1674
  id?: string;
879
- updated_at?: string;
880
- visible_columns?: string[];
1675
+ items?: Json;
1676
+ notes?: string | null;
1677
+ recipient_id: string;
1678
+ total_amount?: number;
881
1679
  };
882
1680
  Update: {
1681
+ campaign_id?: string;
883
1682
  created_at?: string;
884
- hierarchy_levels?: string[];
1683
+ customer_email?: string;
1684
+ customer_id?: string | null;
1685
+ customer_name?: string;
1686
+ customer_phone?: string | null;
885
1687
  id?: string;
886
- updated_at?: string;
887
- visible_columns?: string[];
1688
+ items?: Json;
1689
+ notes?: string | null;
1690
+ recipient_id?: string;
1691
+ total_amount?: number;
888
1692
  };
889
- Relationships: [];
1693
+ Relationships: [
1694
+ {
1695
+ foreignKeyName: "offer_orders_campaign_id_fkey";
1696
+ columns: ["campaign_id"];
1697
+ isOneToOne: false;
1698
+ referencedRelation: "offer_campaigns";
1699
+ referencedColumns: ["id"];
1700
+ },
1701
+ {
1702
+ foreignKeyName: "offer_orders_customer_id_fkey";
1703
+ columns: ["customer_id"];
1704
+ isOneToOne: false;
1705
+ referencedRelation: "customers";
1706
+ referencedColumns: ["id"];
1707
+ },
1708
+ {
1709
+ foreignKeyName: "offer_orders_recipient_id_fkey";
1710
+ columns: ["recipient_id"];
1711
+ isOneToOne: false;
1712
+ referencedRelation: "offer_recipients";
1713
+ referencedColumns: ["id"];
1714
+ }
1715
+ ];
890
1716
  };
891
- locations: {
1717
+ offer_recipients: {
892
1718
  Row: {
1719
+ campaign_id: string;
1720
+ clicked_at: string | null;
1721
+ contact_id: string | null;
893
1722
  created_at: string;
1723
+ customer_id: string | null;
894
1724
  id: string;
895
- name: string;
896
- sort_order: number;
897
- updated_at: string;
1725
+ link_code: string;
1726
+ opened_at: string | null;
1727
+ ordered_at: string | null;
1728
+ recipient_email: string;
1729
+ recipient_name: string;
1730
+ sent_at: string | null;
898
1731
  };
899
1732
  Insert: {
1733
+ campaign_id: string;
1734
+ clicked_at?: string | null;
1735
+ contact_id?: string | null;
900
1736
  created_at?: string;
1737
+ customer_id?: string | null;
901
1738
  id?: string;
902
- name: string;
903
- sort_order?: number;
904
- updated_at?: string;
1739
+ link_code?: string;
1740
+ opened_at?: string | null;
1741
+ ordered_at?: string | null;
1742
+ recipient_email: string;
1743
+ recipient_name: string;
1744
+ sent_at?: string | null;
905
1745
  };
906
1746
  Update: {
1747
+ campaign_id?: string;
1748
+ clicked_at?: string | null;
1749
+ contact_id?: string | null;
907
1750
  created_at?: string;
1751
+ customer_id?: string | null;
908
1752
  id?: string;
909
- name?: string;
910
- sort_order?: number;
911
- updated_at?: string;
1753
+ link_code?: string;
1754
+ opened_at?: string | null;
1755
+ ordered_at?: string | null;
1756
+ recipient_email?: string;
1757
+ recipient_name?: string;
1758
+ sent_at?: string | null;
912
1759
  };
913
- Relationships: [];
1760
+ Relationships: [
1761
+ {
1762
+ foreignKeyName: "offer_recipients_campaign_id_fkey";
1763
+ columns: ["campaign_id"];
1764
+ isOneToOne: false;
1765
+ referencedRelation: "offer_campaigns";
1766
+ referencedColumns: ["id"];
1767
+ },
1768
+ {
1769
+ foreignKeyName: "offer_recipients_contact_id_fkey";
1770
+ columns: ["contact_id"];
1771
+ isOneToOne: false;
1772
+ referencedRelation: "customer_contacts";
1773
+ referencedColumns: ["id"];
1774
+ },
1775
+ {
1776
+ foreignKeyName: "offer_recipients_customer_id_fkey";
1777
+ columns: ["customer_id"];
1778
+ isOneToOne: false;
1779
+ referencedRelation: "customers";
1780
+ referencedColumns: ["id"];
1781
+ }
1782
+ ];
914
1783
  };
915
- notifications: {
1784
+ offer_settings: {
916
1785
  Row: {
1786
+ button_color: string;
917
1787
  created_at: string;
1788
+ default_countries: string[];
1789
+ default_customer_classes: string[];
1790
+ default_intro: string;
1791
+ default_subject: string;
1792
+ discount_display: string;
1793
+ excluded_contact_ids: string[];
1794
+ excluded_customer_ids: string[];
1795
+ from_email: string;
1796
+ from_name: string;
918
1797
  id: string;
919
- message: string | null;
920
- read: boolean;
921
- title: string;
1798
+ logo_url: string | null;
1799
+ primary_color: string;
1800
+ singleton: boolean;
1801
+ tracking_enabled: boolean;
922
1802
  updated_at: string;
923
- user_id: string;
924
1803
  };
925
1804
  Insert: {
1805
+ button_color?: string;
926
1806
  created_at?: string;
1807
+ default_countries?: string[];
1808
+ default_customer_classes?: string[];
1809
+ default_intro?: string;
1810
+ default_subject?: string;
1811
+ discount_display?: string;
1812
+ excluded_contact_ids?: string[];
1813
+ excluded_customer_ids?: string[];
1814
+ from_email?: string;
1815
+ from_name?: string;
927
1816
  id?: string;
928
- message?: string | null;
929
- read?: boolean;
930
- title: string;
1817
+ logo_url?: string | null;
1818
+ primary_color?: string;
1819
+ singleton?: boolean;
1820
+ tracking_enabled?: boolean;
931
1821
  updated_at?: string;
932
- user_id: string;
933
1822
  };
934
1823
  Update: {
1824
+ button_color?: string;
935
1825
  created_at?: string;
1826
+ default_countries?: string[];
1827
+ default_customer_classes?: string[];
1828
+ default_intro?: string;
1829
+ default_subject?: string;
1830
+ discount_display?: string;
1831
+ excluded_contact_ids?: string[];
1832
+ excluded_customer_ids?: string[];
1833
+ from_email?: string;
1834
+ from_name?: string;
936
1835
  id?: string;
937
- message?: string | null;
938
- read?: boolean;
939
- title?: string;
1836
+ logo_url?: string | null;
1837
+ primary_color?: string;
1838
+ singleton?: boolean;
1839
+ tracking_enabled?: boolean;
940
1840
  updated_at?: string;
941
- user_id?: string;
942
1841
  };
943
1842
  Relationships: [];
944
1843
  };
@@ -1554,6 +2453,24 @@ export type Database = {
1554
2453
  [_ in never]: never;
1555
2454
  };
1556
2455
  Functions: {
2456
+ exact_decrypt: {
2457
+ Args: {
2458
+ cipher: string;
2459
+ };
2460
+ Returns: string;
2461
+ };
2462
+ exact_encrypt: {
2463
+ Args: {
2464
+ plain: string;
2465
+ };
2466
+ Returns: string;
2467
+ };
2468
+ get_offer_by_link_code: {
2469
+ Args: {
2470
+ p_code: string;
2471
+ };
2472
+ Returns: Json;
2473
+ };
1557
2474
  has_role: {
1558
2475
  Args: {
1559
2476
  _role: Database["public"]["Enums"]["app_role"];