@flowselections/floriday-voorraad 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist-lib/components/voorraad/ConnectionBadge.d.ts +6 -0
  2. package/dist-lib/components/voorraad/ConnectionBadge.d.ts.map +1 -0
  3. package/dist-lib/components/voorraad/ConnectionBadge.js +12 -0
  4. package/dist-lib/components/voorraad/VoorraadPage.d.ts.map +1 -1
  5. package/dist-lib/components/voorraad/VoorraadPage.js +18 -10
  6. package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
  7. package/dist-lib/components/voorraad/VoorraadTable.js +10 -2
  8. package/dist-lib/hooks/useFloridayConnection.d.ts +9 -4
  9. package/dist-lib/hooks/useFloridayConnection.d.ts.map +1 -1
  10. package/dist-lib/hooks/useFloridayConnection.js +23 -23
  11. package/dist-lib/hooks/useFlorydayCustomers.d.ts +17 -0
  12. package/dist-lib/hooks/useFlorydayCustomers.d.ts.map +1 -0
  13. package/dist-lib/hooks/useFlorydayCustomers.js +65 -0
  14. package/dist-lib/hooks/useLocalTradeItems.d.ts +22 -0
  15. package/dist-lib/hooks/useLocalTradeItems.d.ts.map +1 -0
  16. package/dist-lib/hooks/useLocalTradeItems.js +100 -0
  17. package/dist-lib/hooks/useVoorraadData.d.ts +5 -0
  18. package/dist-lib/hooks/useVoorraadData.d.ts.map +1 -1
  19. package/dist-lib/hooks/useVoorraadData.js +37 -10
  20. package/dist-lib/integrations/supabase/auth-middleware.d.ts +2493 -32
  21. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  22. package/dist-lib/integrations/supabase/client.d.ts +2493 -32
  23. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  24. package/dist-lib/integrations/supabase/client.server.d.ts +2493 -32
  25. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  26. package/dist-lib/integrations/supabase/types.d.ts +2606 -82
  27. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  28. package/dist-lib/integrations/supabase/types.js +10 -0
  29. package/dist-lib/lib/floriday-client.d.ts +10 -12
  30. package/dist-lib/lib/floriday-client.d.ts.map +1 -1
  31. package/dist-lib/lib/floriday-client.js +32 -15
  32. package/package.json +2 -2
@@ -7,6 +7,192 @@ export type Database = {
7
7
  };
8
8
  public: {
9
9
  Tables: {
10
+ agenda_connections: {
11
+ Row: {
12
+ account_email: string | null;
13
+ created_at: string;
14
+ id: string;
15
+ last_error: string | null;
16
+ last_synced_at: string | null;
17
+ provider: string;
18
+ selected_calendars: Json;
19
+ status: string;
20
+ sync_mode: string;
21
+ updated_at: string;
22
+ user_id: string;
23
+ };
24
+ Insert: {
25
+ account_email?: string | null;
26
+ created_at?: string;
27
+ id?: string;
28
+ last_error?: string | null;
29
+ last_synced_at?: string | null;
30
+ provider: string;
31
+ selected_calendars?: Json;
32
+ status?: string;
33
+ sync_mode?: string;
34
+ updated_at?: string;
35
+ user_id: string;
36
+ };
37
+ Update: {
38
+ account_email?: string | null;
39
+ created_at?: string;
40
+ id?: string;
41
+ last_error?: string | null;
42
+ last_synced_at?: string | null;
43
+ provider?: string;
44
+ selected_calendars?: Json;
45
+ status?: string;
46
+ sync_mode?: string;
47
+ updated_at?: string;
48
+ user_id?: string;
49
+ };
50
+ Relationships: [];
51
+ };
52
+ agenda_events: {
53
+ Row: {
54
+ all_day: boolean;
55
+ calendar_id: string;
56
+ category: string | null;
57
+ color: string;
58
+ created_at: string;
59
+ description: string | null;
60
+ end_at: string;
61
+ external_id: string | null;
62
+ external_provider: string | null;
63
+ id: string;
64
+ linked_data: Json;
65
+ location: string | null;
66
+ notes: string | null;
67
+ recurrence: string | null;
68
+ reminders: Json;
69
+ source_id: string | null;
70
+ source_module: string;
71
+ source_type: string | null;
72
+ start_at: string;
73
+ status: string;
74
+ title: string;
75
+ updated_at: string;
76
+ user_id: string;
77
+ };
78
+ Insert: {
79
+ all_day?: boolean;
80
+ calendar_id?: string;
81
+ category?: string | null;
82
+ color?: string;
83
+ created_at?: string;
84
+ description?: string | null;
85
+ end_at: string;
86
+ external_id?: string | null;
87
+ external_provider?: string | null;
88
+ id?: string;
89
+ linked_data?: Json;
90
+ location?: string | null;
91
+ notes?: string | null;
92
+ recurrence?: string | null;
93
+ reminders?: Json;
94
+ source_id?: string | null;
95
+ source_module?: string;
96
+ source_type?: string | null;
97
+ start_at: string;
98
+ status?: string;
99
+ title: string;
100
+ updated_at?: string;
101
+ user_id: string;
102
+ };
103
+ Update: {
104
+ all_day?: boolean;
105
+ calendar_id?: string;
106
+ category?: string | null;
107
+ color?: string;
108
+ created_at?: string;
109
+ description?: string | null;
110
+ end_at?: string;
111
+ external_id?: string | null;
112
+ external_provider?: string | null;
113
+ id?: string;
114
+ linked_data?: Json;
115
+ location?: string | null;
116
+ notes?: string | null;
117
+ recurrence?: string | null;
118
+ reminders?: Json;
119
+ source_id?: string | null;
120
+ source_module?: string;
121
+ source_type?: string | null;
122
+ start_at?: string;
123
+ status?: string;
124
+ title?: string;
125
+ updated_at?: string;
126
+ user_id?: string;
127
+ };
128
+ Relationships: [];
129
+ };
130
+ agenda_oauth_tokens: {
131
+ Row: {
132
+ access_token: string | null;
133
+ created_at: string;
134
+ id: string;
135
+ provider: string;
136
+ refresh_token: string | null;
137
+ scope: string | null;
138
+ token_expires_at: string | null;
139
+ updated_at: string;
140
+ user_id: string;
141
+ };
142
+ Insert: {
143
+ access_token?: string | null;
144
+ created_at?: string;
145
+ id?: string;
146
+ provider: string;
147
+ refresh_token?: string | null;
148
+ scope?: string | null;
149
+ token_expires_at?: string | null;
150
+ updated_at?: string;
151
+ user_id: string;
152
+ };
153
+ Update: {
154
+ access_token?: string | null;
155
+ created_at?: string;
156
+ id?: string;
157
+ provider?: string;
158
+ refresh_token?: string | null;
159
+ scope?: string | null;
160
+ token_expires_at?: string | null;
161
+ updated_at?: string;
162
+ user_id?: string;
163
+ };
164
+ Relationships: [];
165
+ };
166
+ agenda_settings: {
167
+ Row: {
168
+ color_map: Json;
169
+ created_at: string;
170
+ default_calendar_id: string;
171
+ default_view: string;
172
+ settings: Json;
173
+ updated_at: string;
174
+ user_id: string;
175
+ };
176
+ Insert: {
177
+ color_map?: Json;
178
+ created_at?: string;
179
+ default_calendar_id?: string;
180
+ default_view?: string;
181
+ settings?: Json;
182
+ updated_at?: string;
183
+ user_id: string;
184
+ };
185
+ Update: {
186
+ color_map?: Json;
187
+ created_at?: string;
188
+ default_calendar_id?: string;
189
+ default_view?: string;
190
+ settings?: Json;
191
+ updated_at?: string;
192
+ user_id?: string;
193
+ };
194
+ Relationships: [];
195
+ };
10
196
  bugs: {
11
197
  Row: {
12
198
  attachment_url: string | null;
@@ -772,6 +958,324 @@ export type Database = {
772
958
  };
773
959
  Relationships: [];
774
960
  };
961
+ email_auth_connections: {
962
+ Row: {
963
+ access_token_encrypted: string | null;
964
+ account_email: string | null;
965
+ client_id_encrypted: string | null;
966
+ client_secret_encrypted: string | null;
967
+ created_at: string;
968
+ created_by: string | null;
969
+ display_name: string | null;
970
+ id: string;
971
+ imap_host: string | null;
972
+ imap_password_encrypted: string | null;
973
+ imap_port: number | null;
974
+ imap_secure: boolean | null;
975
+ imap_username: string | null;
976
+ is_active: boolean;
977
+ last_error: string | null;
978
+ last_verified_at: string | null;
979
+ oauth_mode: string | null;
980
+ provider: string;
981
+ refresh_token_encrypted: string | null;
982
+ scopes: string[] | null;
983
+ smtp_host: string | null;
984
+ smtp_password_encrypted: string | null;
985
+ smtp_port: number | null;
986
+ smtp_secure: boolean | null;
987
+ smtp_username: string | null;
988
+ status: string;
989
+ token_expires_at: string | null;
990
+ updated_at: string;
991
+ };
992
+ Insert: {
993
+ access_token_encrypted?: string | null;
994
+ account_email?: string | null;
995
+ client_id_encrypted?: string | null;
996
+ client_secret_encrypted?: string | null;
997
+ created_at?: string;
998
+ created_by?: string | null;
999
+ display_name?: string | null;
1000
+ id?: string;
1001
+ imap_host?: string | null;
1002
+ imap_password_encrypted?: string | null;
1003
+ imap_port?: number | null;
1004
+ imap_secure?: boolean | null;
1005
+ imap_username?: string | null;
1006
+ is_active?: boolean;
1007
+ last_error?: string | null;
1008
+ last_verified_at?: string | null;
1009
+ oauth_mode?: string | null;
1010
+ provider: string;
1011
+ refresh_token_encrypted?: string | null;
1012
+ scopes?: string[] | null;
1013
+ smtp_host?: string | null;
1014
+ smtp_password_encrypted?: string | null;
1015
+ smtp_port?: number | null;
1016
+ smtp_secure?: boolean | null;
1017
+ smtp_username?: string | null;
1018
+ status?: string;
1019
+ token_expires_at?: string | null;
1020
+ updated_at?: string;
1021
+ };
1022
+ Update: {
1023
+ access_token_encrypted?: string | null;
1024
+ account_email?: string | null;
1025
+ client_id_encrypted?: string | null;
1026
+ client_secret_encrypted?: string | null;
1027
+ created_at?: string;
1028
+ created_by?: string | null;
1029
+ display_name?: string | null;
1030
+ id?: string;
1031
+ imap_host?: string | null;
1032
+ imap_password_encrypted?: string | null;
1033
+ imap_port?: number | null;
1034
+ imap_secure?: boolean | null;
1035
+ imap_username?: string | null;
1036
+ is_active?: boolean;
1037
+ last_error?: string | null;
1038
+ last_verified_at?: string | null;
1039
+ oauth_mode?: string | null;
1040
+ provider?: string;
1041
+ refresh_token_encrypted?: string | null;
1042
+ scopes?: string[] | null;
1043
+ smtp_host?: string | null;
1044
+ smtp_password_encrypted?: string | null;
1045
+ smtp_port?: number | null;
1046
+ smtp_secure?: boolean | null;
1047
+ smtp_username?: string | null;
1048
+ status?: string;
1049
+ token_expires_at?: string | null;
1050
+ updated_at?: string;
1051
+ };
1052
+ Relationships: [];
1053
+ };
1054
+ exact_account_analytics_cache: {
1055
+ Row: {
1056
+ account_id: string;
1057
+ account_name: string | null;
1058
+ avg_payment_days: number | null;
1059
+ computed_at: string;
1060
+ connection_id: string;
1061
+ expires_at: string | null;
1062
+ id: string;
1063
+ invoice_count: number | null;
1064
+ last_invoice_date: string | null;
1065
+ last_payment_date: string | null;
1066
+ open_balance: number | null;
1067
+ overdue_balance: number | null;
1068
+ total_revenue: number | null;
1069
+ };
1070
+ Insert: {
1071
+ account_id: string;
1072
+ account_name?: string | null;
1073
+ avg_payment_days?: number | null;
1074
+ computed_at?: string;
1075
+ connection_id: string;
1076
+ expires_at?: string | null;
1077
+ id?: string;
1078
+ invoice_count?: number | null;
1079
+ last_invoice_date?: string | null;
1080
+ last_payment_date?: string | null;
1081
+ open_balance?: number | null;
1082
+ overdue_balance?: number | null;
1083
+ total_revenue?: number | null;
1084
+ };
1085
+ Update: {
1086
+ account_id?: string;
1087
+ account_name?: string | null;
1088
+ avg_payment_days?: number | null;
1089
+ computed_at?: string;
1090
+ connection_id?: string;
1091
+ expires_at?: string | null;
1092
+ id?: string;
1093
+ invoice_count?: number | null;
1094
+ last_invoice_date?: string | null;
1095
+ last_payment_date?: string | null;
1096
+ open_balance?: number | null;
1097
+ overdue_balance?: number | null;
1098
+ total_revenue?: number | null;
1099
+ };
1100
+ Relationships: [
1101
+ {
1102
+ foreignKeyName: "exact_account_analytics_cache_connection_id_fkey";
1103
+ columns: ["connection_id"];
1104
+ isOneToOne: false;
1105
+ referencedRelation: "exact_connections";
1106
+ referencedColumns: ["id"];
1107
+ }
1108
+ ];
1109
+ };
1110
+ exact_analytics_cache: {
1111
+ Row: {
1112
+ analytics_type: string;
1113
+ avg_payment_days: number | null;
1114
+ computed_at: string;
1115
+ connection_id: string;
1116
+ data_raw: Json | null;
1117
+ expires_at: string | null;
1118
+ id: string;
1119
+ open_count: number | null;
1120
+ overdue_amount: number | null;
1121
+ paid_this_month: number | null;
1122
+ period_key: string;
1123
+ total_invoiced: number | null;
1124
+ total_open: number | null;
1125
+ };
1126
+ Insert: {
1127
+ analytics_type: string;
1128
+ avg_payment_days?: number | null;
1129
+ computed_at?: string;
1130
+ connection_id: string;
1131
+ data_raw?: Json | null;
1132
+ expires_at?: string | null;
1133
+ id?: string;
1134
+ open_count?: number | null;
1135
+ overdue_amount?: number | null;
1136
+ paid_this_month?: number | null;
1137
+ period_key: string;
1138
+ total_invoiced?: number | null;
1139
+ total_open?: number | null;
1140
+ };
1141
+ Update: {
1142
+ analytics_type?: string;
1143
+ avg_payment_days?: number | null;
1144
+ computed_at?: string;
1145
+ connection_id?: string;
1146
+ data_raw?: Json | null;
1147
+ expires_at?: string | null;
1148
+ id?: string;
1149
+ open_count?: number | null;
1150
+ overdue_amount?: number | null;
1151
+ paid_this_month?: number | null;
1152
+ period_key?: string;
1153
+ total_invoiced?: number | null;
1154
+ total_open?: number | null;
1155
+ };
1156
+ Relationships: [
1157
+ {
1158
+ foreignKeyName: "exact_analytics_cache_connection_id_fkey";
1159
+ columns: ["connection_id"];
1160
+ isOneToOne: false;
1161
+ referencedRelation: "exact_connections";
1162
+ referencedColumns: ["id"];
1163
+ }
1164
+ ];
1165
+ };
1166
+ exact_bulk_operation_items: {
1167
+ Row: {
1168
+ attempts: number;
1169
+ bulk_operation_id: string;
1170
+ created_at: string;
1171
+ error_message: string | null;
1172
+ id: string;
1173
+ invoice_cache_id: string | null;
1174
+ invoice_exact_id: string | null;
1175
+ processed_at: string | null;
1176
+ result_data: Json | null;
1177
+ status: string;
1178
+ };
1179
+ Insert: {
1180
+ attempts?: number;
1181
+ bulk_operation_id: string;
1182
+ created_at?: string;
1183
+ error_message?: string | null;
1184
+ id?: string;
1185
+ invoice_cache_id?: string | null;
1186
+ invoice_exact_id?: string | null;
1187
+ processed_at?: string | null;
1188
+ result_data?: Json | null;
1189
+ status?: string;
1190
+ };
1191
+ Update: {
1192
+ attempts?: number;
1193
+ bulk_operation_id?: string;
1194
+ created_at?: string;
1195
+ error_message?: string | null;
1196
+ id?: string;
1197
+ invoice_cache_id?: string | null;
1198
+ invoice_exact_id?: string | null;
1199
+ processed_at?: string | null;
1200
+ result_data?: Json | null;
1201
+ status?: string;
1202
+ };
1203
+ Relationships: [
1204
+ {
1205
+ foreignKeyName: "exact_bulk_operation_items_bulk_operation_id_fkey";
1206
+ columns: ["bulk_operation_id"];
1207
+ isOneToOne: false;
1208
+ referencedRelation: "exact_bulk_operations";
1209
+ referencedColumns: ["id"];
1210
+ },
1211
+ {
1212
+ foreignKeyName: "exact_bulk_operation_items_invoice_cache_id_fkey";
1213
+ columns: ["invoice_cache_id"];
1214
+ isOneToOne: false;
1215
+ referencedRelation: "exact_invoices_cache";
1216
+ referencedColumns: ["id"];
1217
+ }
1218
+ ];
1219
+ };
1220
+ exact_bulk_operations: {
1221
+ Row: {
1222
+ completed_at: string | null;
1223
+ connection_id: string;
1224
+ created_at: string;
1225
+ created_by: string | null;
1226
+ error_message: string | null;
1227
+ failed_count: number | null;
1228
+ id: string;
1229
+ operation_type: string;
1230
+ processed_count: number | null;
1231
+ result_data: Json | null;
1232
+ started_at: string | null;
1233
+ status: string;
1234
+ total_count: number | null;
1235
+ updated_at: string;
1236
+ };
1237
+ Insert: {
1238
+ completed_at?: string | null;
1239
+ connection_id: string;
1240
+ created_at?: string;
1241
+ created_by?: string | null;
1242
+ error_message?: string | null;
1243
+ failed_count?: number | null;
1244
+ id?: string;
1245
+ operation_type: string;
1246
+ processed_count?: number | null;
1247
+ result_data?: Json | null;
1248
+ started_at?: string | null;
1249
+ status?: string;
1250
+ total_count?: number | null;
1251
+ updated_at?: string;
1252
+ };
1253
+ Update: {
1254
+ completed_at?: string | null;
1255
+ connection_id?: string;
1256
+ created_at?: string;
1257
+ created_by?: string | null;
1258
+ error_message?: string | null;
1259
+ failed_count?: number | null;
1260
+ id?: string;
1261
+ operation_type?: string;
1262
+ processed_count?: number | null;
1263
+ result_data?: Json | null;
1264
+ started_at?: string | null;
1265
+ status?: string;
1266
+ total_count?: number | null;
1267
+ updated_at?: string;
1268
+ };
1269
+ Relationships: [
1270
+ {
1271
+ foreignKeyName: "exact_bulk_operations_connection_id_fkey";
1272
+ columns: ["connection_id"];
1273
+ isOneToOne: false;
1274
+ referencedRelation: "exact_connections";
1275
+ referencedColumns: ["id"];
1276
+ }
1277
+ ];
1278
+ };
775
1279
  exact_connections: {
776
1280
  Row: {
777
1281
  access_token_encrypted: string;
@@ -853,24 +1357,464 @@ export type Database = {
853
1357
  };
854
1358
  Relationships: [];
855
1359
  };
856
- exact_customers_cache: {
1360
+ exact_customer_sync_queue: {
857
1361
  Row: {
1362
+ attempts: number;
858
1363
  connection_id: string;
859
- data: Json;
860
- exact_id: string;
861
- fetched_at: string;
862
- };
863
- Insert: {
864
- connection_id: string;
865
- data?: Json;
1364
+ created_at: string;
1365
+ customer_exact_id: string | null;
1366
+ error_message: string | null;
1367
+ id: string;
1368
+ max_attempts: number;
1369
+ operation: string;
1370
+ payload: Json;
1371
+ process_at: string;
1372
+ processed_at: string | null;
1373
+ status: string;
1374
+ updated_at: string;
1375
+ };
1376
+ Insert: {
1377
+ attempts?: number;
1378
+ connection_id: string;
1379
+ created_at?: string;
1380
+ customer_exact_id?: string | null;
1381
+ error_message?: string | null;
1382
+ id?: string;
1383
+ max_attempts?: number;
1384
+ operation: string;
1385
+ payload?: Json;
1386
+ process_at?: string;
1387
+ processed_at?: string | null;
1388
+ status?: string;
1389
+ updated_at?: string;
1390
+ };
1391
+ Update: {
1392
+ attempts?: number;
1393
+ connection_id?: string;
1394
+ created_at?: string;
1395
+ customer_exact_id?: string | null;
1396
+ error_message?: string | null;
1397
+ id?: string;
1398
+ max_attempts?: number;
1399
+ operation?: string;
1400
+ payload?: Json;
1401
+ process_at?: string;
1402
+ processed_at?: string | null;
1403
+ status?: string;
1404
+ updated_at?: string;
1405
+ };
1406
+ Relationships: [
1407
+ {
1408
+ foreignKeyName: "exact_customer_sync_queue_connection_id_fkey";
1409
+ columns: ["connection_id"];
1410
+ isOneToOne: false;
1411
+ referencedRelation: "exact_connections";
1412
+ referencedColumns: ["id"];
1413
+ }
1414
+ ];
1415
+ };
1416
+ exact_customers_cache: {
1417
+ Row: {
1418
+ account_name: string | null;
1419
+ account_number: string | null;
1420
+ address_line1: string | null;
1421
+ address_line2: string | null;
1422
+ balance: number | null;
1423
+ chamber_of_commerce: string | null;
1424
+ city: string | null;
1425
+ classification_description: string | null;
1426
+ connection_id: string;
1427
+ contact_name: string | null;
1428
+ country: string | null;
1429
+ created_at_exact: string | null;
1430
+ credit_line: number | null;
1431
+ currency: string | null;
1432
+ data_raw: Json | null;
1433
+ email: string | null;
1434
+ exact_id: string;
1435
+ expires_at: string | null;
1436
+ fetched_at: string;
1437
+ id: string;
1438
+ is_sales: boolean | null;
1439
+ is_supplier: boolean | null;
1440
+ language: string | null;
1441
+ modified_at_exact: string | null;
1442
+ payment_condition_description: string | null;
1443
+ payment_condition_sales: string | null;
1444
+ phone: string | null;
1445
+ postal_code: string | null;
1446
+ remarks: string | null;
1447
+ search_text: string | null;
1448
+ status: string | null;
1449
+ updated_at: string;
1450
+ vat_number: string | null;
1451
+ website: string | null;
1452
+ };
1453
+ Insert: {
1454
+ account_name?: string | null;
1455
+ account_number?: string | null;
1456
+ address_line1?: string | null;
1457
+ address_line2?: string | null;
1458
+ balance?: number | null;
1459
+ chamber_of_commerce?: string | null;
1460
+ city?: string | null;
1461
+ classification_description?: string | null;
1462
+ connection_id: string;
1463
+ contact_name?: string | null;
1464
+ country?: string | null;
1465
+ created_at_exact?: string | null;
1466
+ credit_line?: number | null;
1467
+ currency?: string | null;
1468
+ data_raw?: Json | null;
1469
+ email?: string | null;
866
1470
  exact_id: string;
1471
+ expires_at?: string | null;
867
1472
  fetched_at?: string;
1473
+ id?: string;
1474
+ is_sales?: boolean | null;
1475
+ is_supplier?: boolean | null;
1476
+ language?: string | null;
1477
+ modified_at_exact?: string | null;
1478
+ payment_condition_description?: string | null;
1479
+ payment_condition_sales?: string | null;
1480
+ phone?: string | null;
1481
+ postal_code?: string | null;
1482
+ remarks?: string | null;
1483
+ search_text?: string | null;
1484
+ status?: string | null;
1485
+ updated_at?: string;
1486
+ vat_number?: string | null;
1487
+ website?: string | null;
868
1488
  };
869
1489
  Update: {
1490
+ account_name?: string | null;
1491
+ account_number?: string | null;
1492
+ address_line1?: string | null;
1493
+ address_line2?: string | null;
1494
+ balance?: number | null;
1495
+ chamber_of_commerce?: string | null;
1496
+ city?: string | null;
1497
+ classification_description?: string | null;
870
1498
  connection_id?: string;
871
- data?: Json;
1499
+ contact_name?: string | null;
1500
+ country?: string | null;
1501
+ created_at_exact?: string | null;
1502
+ credit_line?: number | null;
1503
+ currency?: string | null;
1504
+ data_raw?: Json | null;
1505
+ email?: string | null;
1506
+ exact_id?: string;
1507
+ expires_at?: string | null;
1508
+ fetched_at?: string;
1509
+ id?: string;
1510
+ is_sales?: boolean | null;
1511
+ is_supplier?: boolean | null;
1512
+ language?: string | null;
1513
+ modified_at_exact?: string | null;
1514
+ payment_condition_description?: string | null;
1515
+ payment_condition_sales?: string | null;
1516
+ phone?: string | null;
1517
+ postal_code?: string | null;
1518
+ remarks?: string | null;
1519
+ search_text?: string | null;
1520
+ status?: string | null;
1521
+ updated_at?: string;
1522
+ vat_number?: string | null;
1523
+ website?: string | null;
1524
+ };
1525
+ Relationships: [
1526
+ {
1527
+ foreignKeyName: "exact_customers_cache_connection_id_fkey";
1528
+ columns: ["connection_id"];
1529
+ isOneToOne: false;
1530
+ referencedRelation: "exact_connections";
1531
+ referencedColumns: ["id"];
1532
+ }
1533
+ ];
1534
+ };
1535
+ exact_invoice_actions: {
1536
+ Row: {
1537
+ action_type: string;
1538
+ connection_id: string;
1539
+ created_at: string;
1540
+ created_by: string | null;
1541
+ error_message: string | null;
1542
+ id: string;
1543
+ invoice_cache_id: string | null;
1544
+ invoice_exact_id: string | null;
1545
+ rate_limit_remaining: number | null;
1546
+ response_data: Json | null;
1547
+ status: string;
1548
+ };
1549
+ Insert: {
1550
+ action_type: string;
1551
+ connection_id: string;
1552
+ created_at?: string;
1553
+ created_by?: string | null;
1554
+ error_message?: string | null;
1555
+ id?: string;
1556
+ invoice_cache_id?: string | null;
1557
+ invoice_exact_id?: string | null;
1558
+ rate_limit_remaining?: number | null;
1559
+ response_data?: Json | null;
1560
+ status: string;
1561
+ };
1562
+ Update: {
1563
+ action_type?: string;
1564
+ connection_id?: string;
1565
+ created_at?: string;
1566
+ created_by?: string | null;
1567
+ error_message?: string | null;
1568
+ id?: string;
1569
+ invoice_cache_id?: string | null;
1570
+ invoice_exact_id?: string | null;
1571
+ rate_limit_remaining?: number | null;
1572
+ response_data?: Json | null;
1573
+ status?: string;
1574
+ };
1575
+ Relationships: [
1576
+ {
1577
+ foreignKeyName: "exact_invoice_actions_connection_id_fkey";
1578
+ columns: ["connection_id"];
1579
+ isOneToOne: false;
1580
+ referencedRelation: "exact_connections";
1581
+ referencedColumns: ["id"];
1582
+ },
1583
+ {
1584
+ foreignKeyName: "exact_invoice_actions_invoice_cache_id_fkey";
1585
+ columns: ["invoice_cache_id"];
1586
+ isOneToOne: false;
1587
+ referencedRelation: "exact_invoices_cache";
1588
+ referencedColumns: ["id"];
1589
+ }
1590
+ ];
1591
+ };
1592
+ exact_invoice_lines_cache: {
1593
+ Row: {
1594
+ connection_id: string;
1595
+ created_at: string;
1596
+ data_raw: Json | null;
1597
+ description: string | null;
1598
+ discount: number | null;
1599
+ exact_line_id: string;
1600
+ gl_account_code: string | null;
1601
+ id: string;
1602
+ invoice_cache_id: string;
1603
+ item_code: string | null;
1604
+ line_total: number | null;
1605
+ quantity: number | null;
1606
+ unit_price: number | null;
1607
+ vat_code: string | null;
1608
+ };
1609
+ Insert: {
1610
+ connection_id: string;
1611
+ created_at?: string;
1612
+ data_raw?: Json | null;
1613
+ description?: string | null;
1614
+ discount?: number | null;
1615
+ exact_line_id: string;
1616
+ gl_account_code?: string | null;
1617
+ id?: string;
1618
+ invoice_cache_id: string;
1619
+ item_code?: string | null;
1620
+ line_total?: number | null;
1621
+ quantity?: number | null;
1622
+ unit_price?: number | null;
1623
+ vat_code?: string | null;
1624
+ };
1625
+ Update: {
1626
+ connection_id?: string;
1627
+ created_at?: string;
1628
+ data_raw?: Json | null;
1629
+ description?: string | null;
1630
+ discount?: number | null;
1631
+ exact_line_id?: string;
1632
+ gl_account_code?: string | null;
1633
+ id?: string;
1634
+ invoice_cache_id?: string;
1635
+ item_code?: string | null;
1636
+ line_total?: number | null;
1637
+ quantity?: number | null;
1638
+ unit_price?: number | null;
1639
+ vat_code?: string | null;
1640
+ };
1641
+ Relationships: [
1642
+ {
1643
+ foreignKeyName: "exact_invoice_lines_cache_connection_id_fkey";
1644
+ columns: ["connection_id"];
1645
+ isOneToOne: false;
1646
+ referencedRelation: "exact_connections";
1647
+ referencedColumns: ["id"];
1648
+ },
1649
+ {
1650
+ foreignKeyName: "exact_invoice_lines_cache_invoice_cache_id_fkey";
1651
+ columns: ["invoice_cache_id"];
1652
+ isOneToOne: false;
1653
+ referencedRelation: "exact_invoices_cache";
1654
+ referencedColumns: ["id"];
1655
+ }
1656
+ ];
1657
+ };
1658
+ exact_invoices_cache: {
1659
+ Row: {
1660
+ account_id: string | null;
1661
+ account_name: string | null;
1662
+ amount_excl_btw: number | null;
1663
+ btw_amount: number | null;
1664
+ connection_id: string;
1665
+ data_raw: Json | null;
1666
+ due_date: string | null;
1667
+ entry_id: string | null;
1668
+ exact_id: string;
1669
+ expires_at: string | null;
1670
+ fetched_at: string;
1671
+ has_pdf: boolean | null;
1672
+ id: string;
1673
+ invoice_date: string | null;
1674
+ invoice_number: string | null;
1675
+ last_reminder_date: string | null;
1676
+ open_amount: number | null;
1677
+ paid_amount: number | null;
1678
+ paid_date: string | null;
1679
+ reminder_count: number | null;
1680
+ search_text: string | null;
1681
+ status: string | null;
1682
+ total_amount: number | null;
1683
+ updated_at: string;
1684
+ };
1685
+ Insert: {
1686
+ account_id?: string | null;
1687
+ account_name?: string | null;
1688
+ amount_excl_btw?: number | null;
1689
+ btw_amount?: number | null;
1690
+ connection_id: string;
1691
+ data_raw?: Json | null;
1692
+ due_date?: string | null;
1693
+ entry_id?: string | null;
1694
+ exact_id: string;
1695
+ expires_at?: string | null;
1696
+ fetched_at?: string;
1697
+ has_pdf?: boolean | null;
1698
+ id?: string;
1699
+ invoice_date?: string | null;
1700
+ invoice_number?: string | null;
1701
+ last_reminder_date?: string | null;
1702
+ open_amount?: number | null;
1703
+ paid_amount?: number | null;
1704
+ paid_date?: string | null;
1705
+ reminder_count?: number | null;
1706
+ search_text?: string | null;
1707
+ status?: string | null;
1708
+ total_amount?: number | null;
1709
+ updated_at?: string;
1710
+ };
1711
+ Update: {
1712
+ account_id?: string | null;
1713
+ account_name?: string | null;
1714
+ amount_excl_btw?: number | null;
1715
+ btw_amount?: number | null;
1716
+ connection_id?: string;
1717
+ data_raw?: Json | null;
1718
+ due_date?: string | null;
1719
+ entry_id?: string | null;
872
1720
  exact_id?: string;
1721
+ expires_at?: string | null;
873
1722
  fetched_at?: string;
1723
+ has_pdf?: boolean | null;
1724
+ id?: string;
1725
+ invoice_date?: string | null;
1726
+ invoice_number?: string | null;
1727
+ last_reminder_date?: string | null;
1728
+ open_amount?: number | null;
1729
+ paid_amount?: number | null;
1730
+ paid_date?: string | null;
1731
+ reminder_count?: number | null;
1732
+ search_text?: string | null;
1733
+ status?: string | null;
1734
+ total_amount?: number | null;
1735
+ updated_at?: string;
1736
+ };
1737
+ Relationships: [
1738
+ {
1739
+ foreignKeyName: "exact_invoices_cache_connection_id_fkey";
1740
+ columns: ["connection_id"];
1741
+ isOneToOne: false;
1742
+ referencedRelation: "exact_connections";
1743
+ referencedColumns: ["id"];
1744
+ }
1745
+ ];
1746
+ };
1747
+ exact_operation_logs: {
1748
+ Row: {
1749
+ connection_id: string | null;
1750
+ created_at: string;
1751
+ duration_ms: number | null;
1752
+ entity_id: string | null;
1753
+ entity_type: string | null;
1754
+ error_message: string | null;
1755
+ id: string;
1756
+ operation: string | null;
1757
+ rate_limit_remaining: number | null;
1758
+ request_data: Json | null;
1759
+ response_data: Json | null;
1760
+ status: string | null;
1761
+ };
1762
+ Insert: {
1763
+ connection_id?: string | null;
1764
+ created_at?: string;
1765
+ duration_ms?: number | null;
1766
+ entity_id?: string | null;
1767
+ entity_type?: string | null;
1768
+ error_message?: string | null;
1769
+ id?: string;
1770
+ operation?: string | null;
1771
+ rate_limit_remaining?: number | null;
1772
+ request_data?: Json | null;
1773
+ response_data?: Json | null;
1774
+ status?: string | null;
1775
+ };
1776
+ Update: {
1777
+ connection_id?: string | null;
1778
+ created_at?: string;
1779
+ duration_ms?: number | null;
1780
+ entity_id?: string | null;
1781
+ entity_type?: string | null;
1782
+ error_message?: string | null;
1783
+ id?: string;
1784
+ operation?: string | null;
1785
+ rate_limit_remaining?: number | null;
1786
+ request_data?: Json | null;
1787
+ response_data?: Json | null;
1788
+ status?: string | null;
1789
+ };
1790
+ Relationships: [
1791
+ {
1792
+ foreignKeyName: "exact_operation_logs_connection_id_fkey";
1793
+ columns: ["connection_id"];
1794
+ isOneToOne: false;
1795
+ referencedRelation: "exact_connections";
1796
+ referencedColumns: ["id"];
1797
+ }
1798
+ ];
1799
+ };
1800
+ exact_refresh_locks: {
1801
+ Row: {
1802
+ environment: Database["public"]["Enums"]["exact_env"];
1803
+ locked_by: string;
1804
+ locked_until: string;
1805
+ updated_at: string;
1806
+ };
1807
+ Insert: {
1808
+ environment: Database["public"]["Enums"]["exact_env"];
1809
+ locked_by: string;
1810
+ locked_until: string;
1811
+ updated_at?: string;
1812
+ };
1813
+ Update: {
1814
+ environment?: Database["public"]["Enums"]["exact_env"];
1815
+ locked_by?: string;
1816
+ locked_until?: string;
1817
+ updated_at?: string;
874
1818
  };
875
1819
  Relationships: [];
876
1820
  };
@@ -1048,6 +1992,50 @@ export type Database = {
1048
1992
  };
1049
1993
  Relationships: [];
1050
1994
  };
1995
+ floriday_connections_cache: {
1996
+ Row: {
1997
+ buyer_organization_id: string | null;
1998
+ buyer_organization_name: string | null;
1999
+ connection_id: string;
2000
+ data: Json;
2001
+ floriday_connection_id: string;
2002
+ is_deleted: boolean;
2003
+ sequence_number: number;
2004
+ status: string | null;
2005
+ synced_at: string;
2006
+ };
2007
+ Insert: {
2008
+ buyer_organization_id?: string | null;
2009
+ buyer_organization_name?: string | null;
2010
+ connection_id: string;
2011
+ data: Json;
2012
+ floriday_connection_id: string;
2013
+ is_deleted?: boolean;
2014
+ sequence_number: number;
2015
+ status?: string | null;
2016
+ synced_at?: string;
2017
+ };
2018
+ Update: {
2019
+ buyer_organization_id?: string | null;
2020
+ buyer_organization_name?: string | null;
2021
+ connection_id?: string;
2022
+ data?: Json;
2023
+ floriday_connection_id?: string;
2024
+ is_deleted?: boolean;
2025
+ sequence_number?: number;
2026
+ status?: string | null;
2027
+ synced_at?: string;
2028
+ };
2029
+ Relationships: [
2030
+ {
2031
+ foreignKeyName: "floriday_connections_cache_connection_id_fkey";
2032
+ columns: ["connection_id"];
2033
+ isOneToOne: false;
2034
+ referencedRelation: "floriday_connections";
2035
+ referencedColumns: ["id"];
2036
+ }
2037
+ ];
2038
+ };
1051
2039
  floriday_customers_cache: {
1052
2040
  Row: {
1053
2041
  connection_id: string | null;
@@ -1134,27 +2122,334 @@ export type Database = {
1134
2122
  };
1135
2123
  Relationships: [];
1136
2124
  };
1137
- floriday_settings: {
2125
+ floriday_salesorders_cache: {
1138
2126
  Row: {
1139
- active_environment: string;
1140
- id: number;
2127
+ buyer_organization_id: string | null;
2128
+ connection_id: string;
2129
+ created_at: string;
2130
+ data: Json;
2131
+ floriday_id: string;
2132
+ is_deleted: boolean;
2133
+ sequence_number: number;
2134
+ status: string | null;
1141
2135
  updated_at: string;
1142
2136
  };
1143
2137
  Insert: {
1144
- active_environment?: string;
1145
- id?: number;
2138
+ buyer_organization_id?: string | null;
2139
+ connection_id: string;
2140
+ created_at?: string;
2141
+ data: Json;
2142
+ floriday_id: string;
2143
+ is_deleted?: boolean;
2144
+ sequence_number: number;
2145
+ status?: string | null;
1146
2146
  updated_at?: string;
1147
2147
  };
1148
2148
  Update: {
1149
- active_environment?: string;
1150
- id?: number;
2149
+ buyer_organization_id?: string | null;
2150
+ connection_id?: string;
2151
+ created_at?: string;
2152
+ data?: Json;
2153
+ floriday_id?: string;
2154
+ is_deleted?: boolean;
2155
+ sequence_number?: number;
2156
+ status?: string | null;
1151
2157
  updated_at?: string;
1152
2158
  };
1153
- Relationships: [];
1154
- };
1155
- inventory_settings: {
1156
- Row: {
1157
- created_at: string;
2159
+ Relationships: [
2160
+ {
2161
+ foreignKeyName: "floriday_salesorders_cache_connection_id_fkey";
2162
+ columns: ["connection_id"];
2163
+ isOneToOne: false;
2164
+ referencedRelation: "floriday_connections";
2165
+ referencedColumns: ["id"];
2166
+ }
2167
+ ];
2168
+ };
2169
+ floriday_settings: {
2170
+ Row: {
2171
+ active_environment: string;
2172
+ id: number;
2173
+ updated_at: string;
2174
+ };
2175
+ Insert: {
2176
+ active_environment?: string;
2177
+ id?: number;
2178
+ updated_at?: string;
2179
+ };
2180
+ Update: {
2181
+ active_environment?: string;
2182
+ id?: number;
2183
+ updated_at?: string;
2184
+ };
2185
+ Relationships: [];
2186
+ };
2187
+ floriday_sync_state: {
2188
+ Row: {
2189
+ connection_id: string;
2190
+ entity_type: string;
2191
+ last_error: string | null;
2192
+ last_sequence_number: number;
2193
+ last_synced_at: string | null;
2194
+ updated_at: string;
2195
+ };
2196
+ Insert: {
2197
+ connection_id: string;
2198
+ entity_type: string;
2199
+ last_error?: string | null;
2200
+ last_sequence_number?: number;
2201
+ last_synced_at?: string | null;
2202
+ updated_at?: string;
2203
+ };
2204
+ Update: {
2205
+ connection_id?: string;
2206
+ entity_type?: string;
2207
+ last_error?: string | null;
2208
+ last_sequence_number?: number;
2209
+ last_synced_at?: string | null;
2210
+ updated_at?: string;
2211
+ };
2212
+ Relationships: [
2213
+ {
2214
+ foreignKeyName: "floriday_sync_state_connection_id_fkey";
2215
+ columns: ["connection_id"];
2216
+ isOneToOne: false;
2217
+ referencedRelation: "floriday_connections";
2218
+ referencedColumns: ["id"];
2219
+ }
2220
+ ];
2221
+ };
2222
+ floriday_token_refresh_log: {
2223
+ Row: {
2224
+ attempted_at: string;
2225
+ connection_id: string | null;
2226
+ environment: string;
2227
+ error: string | null;
2228
+ expires_at: string | null;
2229
+ id: string;
2230
+ ok: boolean;
2231
+ };
2232
+ Insert: {
2233
+ attempted_at?: string;
2234
+ connection_id?: string | null;
2235
+ environment: string;
2236
+ error?: string | null;
2237
+ expires_at?: string | null;
2238
+ id?: string;
2239
+ ok: boolean;
2240
+ };
2241
+ Update: {
2242
+ attempted_at?: string;
2243
+ connection_id?: string | null;
2244
+ environment?: string;
2245
+ error?: string | null;
2246
+ expires_at?: string | null;
2247
+ id?: string;
2248
+ ok?: boolean;
2249
+ };
2250
+ Relationships: [
2251
+ {
2252
+ foreignKeyName: "floriday_token_refresh_log_connection_id_fkey";
2253
+ columns: ["connection_id"];
2254
+ isOneToOne: false;
2255
+ referencedRelation: "floriday_connections";
2256
+ referencedColumns: ["id"];
2257
+ }
2258
+ ];
2259
+ };
2260
+ floriday_trade_items_cache: {
2261
+ Row: {
2262
+ connection_id: string;
2263
+ data: Json;
2264
+ fetched_at: string;
2265
+ floriday_id: string;
2266
+ is_deleted: boolean;
2267
+ sequence_number: number;
2268
+ };
2269
+ Insert: {
2270
+ connection_id: string;
2271
+ data?: Json;
2272
+ fetched_at?: string;
2273
+ floriday_id: string;
2274
+ is_deleted?: boolean;
2275
+ sequence_number?: number;
2276
+ };
2277
+ Update: {
2278
+ connection_id?: string;
2279
+ data?: Json;
2280
+ fetched_at?: string;
2281
+ floriday_id?: string;
2282
+ is_deleted?: boolean;
2283
+ sequence_number?: number;
2284
+ };
2285
+ Relationships: [
2286
+ {
2287
+ foreignKeyName: "floriday_trade_items_cache_connection_id_fkey";
2288
+ columns: ["connection_id"];
2289
+ isOneToOne: false;
2290
+ referencedRelation: "floriday_connections";
2291
+ referencedColumns: ["id"];
2292
+ }
2293
+ ];
2294
+ };
2295
+ imap_accounts: {
2296
+ Row: {
2297
+ created_at: string;
2298
+ email: string | null;
2299
+ host: string;
2300
+ id: string;
2301
+ is_active: boolean;
2302
+ last_test_error: string | null;
2303
+ last_test_ok: boolean | null;
2304
+ last_tested_at: string | null;
2305
+ name: string;
2306
+ password: string | null;
2307
+ password_secret_name: string | null;
2308
+ port: number;
2309
+ updated_at: string;
2310
+ use_tls: boolean;
2311
+ username: string;
2312
+ };
2313
+ Insert: {
2314
+ created_at?: string;
2315
+ email?: string | null;
2316
+ host: string;
2317
+ id?: string;
2318
+ is_active?: boolean;
2319
+ last_test_error?: string | null;
2320
+ last_test_ok?: boolean | null;
2321
+ last_tested_at?: string | null;
2322
+ name: string;
2323
+ password?: string | null;
2324
+ password_secret_name?: string | null;
2325
+ port?: number;
2326
+ updated_at?: string;
2327
+ use_tls?: boolean;
2328
+ username: string;
2329
+ };
2330
+ Update: {
2331
+ created_at?: string;
2332
+ email?: string | null;
2333
+ host?: string;
2334
+ id?: string;
2335
+ is_active?: boolean;
2336
+ last_test_error?: string | null;
2337
+ last_test_ok?: boolean | null;
2338
+ last_tested_at?: string | null;
2339
+ name?: string;
2340
+ password?: string | null;
2341
+ password_secret_name?: string | null;
2342
+ port?: number;
2343
+ updated_at?: string;
2344
+ use_tls?: boolean;
2345
+ username?: string;
2346
+ };
2347
+ Relationships: [];
2348
+ };
2349
+ imap_profiles: {
2350
+ Row: {
2351
+ account_id: string | null;
2352
+ created_at: string;
2353
+ folder: string;
2354
+ id: string;
2355
+ last_error: string | null;
2356
+ last_polled_at: string | null;
2357
+ last_uid_seen: number;
2358
+ name: string;
2359
+ polling_enabled: boolean;
2360
+ profile_key: string;
2361
+ updated_at: string;
2362
+ };
2363
+ Insert: {
2364
+ account_id?: string | null;
2365
+ created_at?: string;
2366
+ folder?: string;
2367
+ id?: string;
2368
+ last_error?: string | null;
2369
+ last_polled_at?: string | null;
2370
+ last_uid_seen?: number;
2371
+ name: string;
2372
+ polling_enabled?: boolean;
2373
+ profile_key: string;
2374
+ updated_at?: string;
2375
+ };
2376
+ Update: {
2377
+ account_id?: string | null;
2378
+ created_at?: string;
2379
+ folder?: string;
2380
+ id?: string;
2381
+ last_error?: string | null;
2382
+ last_polled_at?: string | null;
2383
+ last_uid_seen?: number;
2384
+ name?: string;
2385
+ polling_enabled?: boolean;
2386
+ profile_key?: string;
2387
+ updated_at?: string;
2388
+ };
2389
+ Relationships: [
2390
+ {
2391
+ foreignKeyName: "imap_profiles_account_id_fkey";
2392
+ columns: ["account_id"];
2393
+ isOneToOne: false;
2394
+ referencedRelation: "imap_accounts";
2395
+ referencedColumns: ["id"];
2396
+ }
2397
+ ];
2398
+ };
2399
+ imap_sync_log: {
2400
+ Row: {
2401
+ account_id: string | null;
2402
+ details: Json | null;
2403
+ error: string | null;
2404
+ finished_at: string | null;
2405
+ id: string;
2406
+ inserted: number;
2407
+ ok: boolean | null;
2408
+ profile_id: string | null;
2409
+ started_at: string;
2410
+ };
2411
+ Insert: {
2412
+ account_id?: string | null;
2413
+ details?: Json | null;
2414
+ error?: string | null;
2415
+ finished_at?: string | null;
2416
+ id?: string;
2417
+ inserted?: number;
2418
+ ok?: boolean | null;
2419
+ profile_id?: string | null;
2420
+ started_at?: string;
2421
+ };
2422
+ Update: {
2423
+ account_id?: string | null;
2424
+ details?: Json | null;
2425
+ error?: string | null;
2426
+ finished_at?: string | null;
2427
+ id?: string;
2428
+ inserted?: number;
2429
+ ok?: boolean | null;
2430
+ profile_id?: string | null;
2431
+ started_at?: string;
2432
+ };
2433
+ Relationships: [
2434
+ {
2435
+ foreignKeyName: "imap_sync_log_account_id_fkey";
2436
+ columns: ["account_id"];
2437
+ isOneToOne: false;
2438
+ referencedRelation: "imap_accounts";
2439
+ referencedColumns: ["id"];
2440
+ },
2441
+ {
2442
+ foreignKeyName: "imap_sync_log_profile_id_fkey";
2443
+ columns: ["profile_id"];
2444
+ isOneToOne: false;
2445
+ referencedRelation: "imap_profiles";
2446
+ referencedColumns: ["id"];
2447
+ }
2448
+ ];
2449
+ };
2450
+ inventory_settings: {
2451
+ Row: {
2452
+ created_at: string;
1158
2453
  hierarchy_levels: string[];
1159
2454
  id: string;
1160
2455
  updated_at: string;
@@ -1210,6 +2505,7 @@ export type Database = {
1210
2505
  from_name: string | null;
1211
2506
  id: string;
1212
2507
  message_id: string | null;
2508
+ profile_id: string | null;
1213
2509
  raw_size: number | null;
1214
2510
  received_at: string | null;
1215
2511
  status: string;
@@ -1226,6 +2522,7 @@ export type Database = {
1226
2522
  from_name?: string | null;
1227
2523
  id?: string;
1228
2524
  message_id?: string | null;
2525
+ profile_id?: string | null;
1229
2526
  raw_size?: number | null;
1230
2527
  received_at?: string | null;
1231
2528
  status?: string;
@@ -1242,6 +2539,7 @@ export type Database = {
1242
2539
  from_name?: string | null;
1243
2540
  id?: string;
1244
2541
  message_id?: string | null;
2542
+ profile_id?: string | null;
1245
2543
  raw_size?: number | null;
1246
2544
  received_at?: string | null;
1247
2545
  status?: string;
@@ -1249,7 +2547,15 @@ export type Database = {
1249
2547
  uid?: number;
1250
2548
  updated_at?: string;
1251
2549
  };
1252
- Relationships: [];
2550
+ Relationships: [
2551
+ {
2552
+ foreignKeyName: "mailbox_messages_profile_id_fkey";
2553
+ columns: ["profile_id"];
2554
+ isOneToOne: false;
2555
+ referencedRelation: "imap_profiles";
2556
+ referencedColumns: ["id"];
2557
+ }
2558
+ ];
1253
2559
  };
1254
2560
  mailbox_order_proposals: {
1255
2561
  Row: {
@@ -2117,80 +3423,173 @@ export type Database = {
2117
3423
  }
2118
3424
  ];
2119
3425
  };
2120
- product_categories: {
3426
+ packages: {
2121
3427
  Row: {
2122
3428
  color: string;
2123
3429
  created_at: string;
2124
- icon: string | null;
3430
+ description: string | null;
2125
3431
  id: string;
3432
+ is_active: boolean;
2126
3433
  name: string;
2127
- slug: string;
2128
3434
  sort_order: number;
2129
3435
  updated_at: string;
3436
+ value: number;
2130
3437
  };
2131
3438
  Insert: {
2132
3439
  color?: string;
2133
3440
  created_at?: string;
2134
- icon?: string | null;
3441
+ description?: string | null;
2135
3442
  id?: string;
3443
+ is_active?: boolean;
2136
3444
  name: string;
2137
- slug: string;
2138
3445
  sort_order?: number;
2139
3446
  updated_at?: string;
3447
+ value?: number;
2140
3448
  };
2141
3449
  Update: {
2142
3450
  color?: string;
2143
3451
  created_at?: string;
2144
- icon?: string | null;
3452
+ description?: string | null;
2145
3453
  id?: string;
3454
+ is_active?: boolean;
2146
3455
  name?: string;
2147
- slug?: string;
2148
3456
  sort_order?: number;
2149
3457
  updated_at?: string;
3458
+ value?: number;
2150
3459
  };
2151
3460
  Relationships: [];
2152
3461
  };
2153
- product_field_options: {
3462
+ pipeline_settings: {
2154
3463
  Row: {
2155
3464
  created_at: string;
2156
- field_setting_id: string;
2157
3465
  id: string;
2158
- label: string;
2159
- sort_order: number;
3466
+ key: string;
3467
+ updated_at: string;
3468
+ value: string | null;
2160
3469
  };
2161
3470
  Insert: {
2162
3471
  created_at?: string;
2163
- field_setting_id: string;
2164
3472
  id?: string;
2165
- label: string;
2166
- sort_order?: number;
3473
+ key: string;
3474
+ updated_at?: string;
3475
+ value?: string | null;
2167
3476
  };
2168
3477
  Update: {
2169
3478
  created_at?: string;
2170
- field_setting_id?: string;
2171
3479
  id?: string;
2172
- label?: string;
2173
- sort_order?: number;
3480
+ key?: string;
3481
+ updated_at?: string;
3482
+ value?: string | null;
2174
3483
  };
2175
- Relationships: [
2176
- {
2177
- foreignKeyName: "product_field_options_field_setting_id_fkey";
2178
- columns: ["field_setting_id"];
2179
- isOneToOne: false;
2180
- referencedRelation: "product_field_settings";
2181
- referencedColumns: ["id"];
2182
- }
2183
- ];
3484
+ Relationships: [];
2184
3485
  };
2185
- product_field_settings: {
3486
+ pipeline_stages: {
2186
3487
  Row: {
2187
- active_per_category: Json;
3488
+ automation_type: string;
3489
+ color: string;
2188
3490
  created_at: string;
2189
- field_key: string;
2190
- field_label: string;
2191
- field_type: string;
2192
3491
  id: string;
2193
- is_custom: boolean;
3492
+ is_active: boolean;
3493
+ name: string;
3494
+ sort_order: number;
3495
+ updated_at: string;
3496
+ };
3497
+ Insert: {
3498
+ automation_type?: string;
3499
+ color?: string;
3500
+ created_at?: string;
3501
+ id?: string;
3502
+ is_active?: boolean;
3503
+ name: string;
3504
+ sort_order?: number;
3505
+ updated_at?: string;
3506
+ };
3507
+ Update: {
3508
+ automation_type?: string;
3509
+ color?: string;
3510
+ created_at?: string;
3511
+ id?: string;
3512
+ is_active?: boolean;
3513
+ name?: string;
3514
+ sort_order?: number;
3515
+ updated_at?: string;
3516
+ };
3517
+ Relationships: [];
3518
+ };
3519
+ product_categories: {
3520
+ Row: {
3521
+ color: string;
3522
+ created_at: string;
3523
+ icon: string | null;
3524
+ id: string;
3525
+ name: string;
3526
+ slug: string;
3527
+ sort_order: number;
3528
+ updated_at: string;
3529
+ };
3530
+ Insert: {
3531
+ color?: string;
3532
+ created_at?: string;
3533
+ icon?: string | null;
3534
+ id?: string;
3535
+ name: string;
3536
+ slug: string;
3537
+ sort_order?: number;
3538
+ updated_at?: string;
3539
+ };
3540
+ Update: {
3541
+ color?: string;
3542
+ created_at?: string;
3543
+ icon?: string | null;
3544
+ id?: string;
3545
+ name?: string;
3546
+ slug?: string;
3547
+ sort_order?: number;
3548
+ updated_at?: string;
3549
+ };
3550
+ Relationships: [];
3551
+ };
3552
+ product_field_options: {
3553
+ Row: {
3554
+ created_at: string;
3555
+ field_setting_id: string;
3556
+ id: string;
3557
+ label: string;
3558
+ sort_order: number;
3559
+ };
3560
+ Insert: {
3561
+ created_at?: string;
3562
+ field_setting_id: string;
3563
+ id?: string;
3564
+ label: string;
3565
+ sort_order?: number;
3566
+ };
3567
+ Update: {
3568
+ created_at?: string;
3569
+ field_setting_id?: string;
3570
+ id?: string;
3571
+ label?: string;
3572
+ sort_order?: number;
3573
+ };
3574
+ Relationships: [
3575
+ {
3576
+ foreignKeyName: "product_field_options_field_setting_id_fkey";
3577
+ columns: ["field_setting_id"];
3578
+ isOneToOne: false;
3579
+ referencedRelation: "product_field_settings";
3580
+ referencedColumns: ["id"];
3581
+ }
3582
+ ];
3583
+ };
3584
+ product_field_settings: {
3585
+ Row: {
3586
+ active_per_category: Json;
3587
+ created_at: string;
3588
+ field_key: string;
3589
+ field_label: string;
3590
+ field_type: string;
3591
+ id: string;
3592
+ is_custom: boolean;
2194
3593
  sort_order: number;
2195
3594
  updated_at: string;
2196
3595
  };
@@ -2305,6 +3704,180 @@ export type Database = {
2305
3704
  };
2306
3705
  Relationships: [];
2307
3706
  };
3707
+ projects: {
3708
+ Row: {
3709
+ contact_name: string | null;
3710
+ created_at: string;
3711
+ email: string | null;
3712
+ id: string;
3713
+ name: string;
3714
+ notes: string | null;
3715
+ order_value: number;
3716
+ package_id: string | null;
3717
+ package_name: string | null;
3718
+ phone: string | null;
3719
+ prospect_id: string | null;
3720
+ status: string;
3721
+ updated_at: string;
3722
+ };
3723
+ Insert: {
3724
+ contact_name?: string | null;
3725
+ created_at?: string;
3726
+ email?: string | null;
3727
+ id?: string;
3728
+ name: string;
3729
+ notes?: string | null;
3730
+ order_value?: number;
3731
+ package_id?: string | null;
3732
+ package_name?: string | null;
3733
+ phone?: string | null;
3734
+ prospect_id?: string | null;
3735
+ status?: string;
3736
+ updated_at?: string;
3737
+ };
3738
+ Update: {
3739
+ contact_name?: string | null;
3740
+ created_at?: string;
3741
+ email?: string | null;
3742
+ id?: string;
3743
+ name?: string;
3744
+ notes?: string | null;
3745
+ order_value?: number;
3746
+ package_id?: string | null;
3747
+ package_name?: string | null;
3748
+ phone?: string | null;
3749
+ prospect_id?: string | null;
3750
+ status?: string;
3751
+ updated_at?: string;
3752
+ };
3753
+ Relationships: [
3754
+ {
3755
+ foreignKeyName: "projects_package_id_fkey";
3756
+ columns: ["package_id"];
3757
+ isOneToOne: false;
3758
+ referencedRelation: "packages";
3759
+ referencedColumns: ["id"];
3760
+ },
3761
+ {
3762
+ foreignKeyName: "projects_prospect_id_fkey";
3763
+ columns: ["prospect_id"];
3764
+ isOneToOne: false;
3765
+ referencedRelation: "prospects";
3766
+ referencedColumns: ["id"];
3767
+ }
3768
+ ];
3769
+ };
3770
+ prospect_field_settings: {
3771
+ Row: {
3772
+ created_at: string;
3773
+ field_key: string;
3774
+ field_type: string;
3775
+ id: string;
3776
+ label: string;
3777
+ required: boolean;
3778
+ sort_order: number;
3779
+ updated_at: string;
3780
+ visible: boolean;
3781
+ };
3782
+ Insert: {
3783
+ created_at?: string;
3784
+ field_key: string;
3785
+ field_type?: string;
3786
+ id?: string;
3787
+ label: string;
3788
+ required?: boolean;
3789
+ sort_order?: number;
3790
+ updated_at?: string;
3791
+ visible?: boolean;
3792
+ };
3793
+ Update: {
3794
+ created_at?: string;
3795
+ field_key?: string;
3796
+ field_type?: string;
3797
+ id?: string;
3798
+ label?: string;
3799
+ required?: boolean;
3800
+ sort_order?: number;
3801
+ updated_at?: string;
3802
+ visible?: boolean;
3803
+ };
3804
+ Relationships: [];
3805
+ };
3806
+ prospects: {
3807
+ Row: {
3808
+ address: string | null;
3809
+ company_name: string;
3810
+ contact_name: string | null;
3811
+ created_at: string;
3812
+ email: string | null;
3813
+ id: string;
3814
+ industry: string | null;
3815
+ notes: string | null;
3816
+ order_value: number;
3817
+ package_id: string | null;
3818
+ phone: string | null;
3819
+ source: string | null;
3820
+ stage_id: string | null;
3821
+ status: string;
3822
+ updated_at: string;
3823
+ value_mode: string;
3824
+ website: string | null;
3825
+ };
3826
+ Insert: {
3827
+ address?: string | null;
3828
+ company_name: string;
3829
+ contact_name?: string | null;
3830
+ created_at?: string;
3831
+ email?: string | null;
3832
+ id?: string;
3833
+ industry?: string | null;
3834
+ notes?: string | null;
3835
+ order_value?: number;
3836
+ package_id?: string | null;
3837
+ phone?: string | null;
3838
+ source?: string | null;
3839
+ stage_id?: string | null;
3840
+ status?: string;
3841
+ updated_at?: string;
3842
+ value_mode?: string;
3843
+ website?: string | null;
3844
+ };
3845
+ Update: {
3846
+ address?: string | null;
3847
+ company_name?: string;
3848
+ contact_name?: string | null;
3849
+ created_at?: string;
3850
+ email?: string | null;
3851
+ id?: string;
3852
+ industry?: string | null;
3853
+ notes?: string | null;
3854
+ order_value?: number;
3855
+ package_id?: string | null;
3856
+ phone?: string | null;
3857
+ source?: string | null;
3858
+ stage_id?: string | null;
3859
+ status?: string;
3860
+ updated_at?: string;
3861
+ value_mode?: string;
3862
+ website?: string | null;
3863
+ };
3864
+ Relationships: [
3865
+ {
3866
+ foreignKeyName: "prospects_package_id_fkey";
3867
+ columns: ["package_id"];
3868
+ isOneToOne: false;
3869
+ referencedRelation: "packages";
3870
+ referencedColumns: ["id"];
3871
+ },
3872
+ {
3873
+ foreignKeyName: "prospects_stage_id_fkey";
3874
+ columns: ["stage_id"];
3875
+ isOneToOne: false;
3876
+ referencedRelation: "pipeline_stages";
3877
+ referencedColumns: ["id"];
3878
+ }
3879
+ ];
3880
+ };
2308
3881
  purchase_order_items: {
2309
3882
  Row: {
2310
3883
  created_at: string;
@@ -2401,44 +3974,504 @@ export type Database = {
2401
3974
  }
2402
3975
  ];
2403
3976
  };
2404
- supplier_products: {
3977
+ quote_activities: {
2405
3978
  Row: {
2406
- article_number: string | null;
2407
3979
  created_at: string;
3980
+ event_type: string;
2408
3981
  id: string;
2409
- name: string;
2410
- notes: string | null;
2411
- pot_size: string | null;
2412
- price: number | null;
2413
- quantity: number | null;
2414
- supplier_id: string;
2415
- unit: string;
2416
- updated_at: string;
3982
+ metadata: Json;
3983
+ quote_id: string;
3984
+ user_id: string | null;
2417
3985
  };
2418
3986
  Insert: {
2419
- article_number?: string | null;
2420
3987
  created_at?: string;
3988
+ event_type: string;
2421
3989
  id?: string;
2422
- name: string;
2423
- notes?: string | null;
2424
- pot_size?: string | null;
2425
- price?: number | null;
2426
- quantity?: number | null;
2427
- supplier_id: string;
2428
- unit?: string;
2429
- updated_at?: string;
3990
+ metadata?: Json;
3991
+ quote_id: string;
3992
+ user_id?: string | null;
2430
3993
  };
2431
3994
  Update: {
2432
- article_number?: string | null;
2433
3995
  created_at?: string;
3996
+ event_type?: string;
2434
3997
  id?: string;
2435
- name?: string;
2436
- notes?: string | null;
2437
- pot_size?: string | null;
2438
- price?: number | null;
2439
- quantity?: number | null;
2440
- supplier_id?: string;
2441
- unit?: string;
3998
+ metadata?: Json;
3999
+ quote_id?: string;
4000
+ user_id?: string | null;
4001
+ };
4002
+ Relationships: [
4003
+ {
4004
+ foreignKeyName: "quote_activities_quote_id_fkey";
4005
+ columns: ["quote_id"];
4006
+ isOneToOne: false;
4007
+ referencedRelation: "quotes";
4008
+ referencedColumns: ["id"];
4009
+ }
4010
+ ];
4011
+ };
4012
+ quote_attachments: {
4013
+ Row: {
4014
+ created_at: string;
4015
+ file_name: string;
4016
+ file_size: number | null;
4017
+ file_url: string;
4018
+ id: string;
4019
+ mime_type: string | null;
4020
+ quote_id: string;
4021
+ };
4022
+ Insert: {
4023
+ created_at?: string;
4024
+ file_name: string;
4025
+ file_size?: number | null;
4026
+ file_url: string;
4027
+ id?: string;
4028
+ mime_type?: string | null;
4029
+ quote_id: string;
4030
+ };
4031
+ Update: {
4032
+ created_at?: string;
4033
+ file_name?: string;
4034
+ file_size?: number | null;
4035
+ file_url?: string;
4036
+ id?: string;
4037
+ mime_type?: string | null;
4038
+ quote_id?: string;
4039
+ };
4040
+ Relationships: [
4041
+ {
4042
+ foreignKeyName: "quote_attachments_quote_id_fkey";
4043
+ columns: ["quote_id"];
4044
+ isOneToOne: false;
4045
+ referencedRelation: "quotes";
4046
+ referencedColumns: ["id"];
4047
+ }
4048
+ ];
4049
+ };
4050
+ quote_field_options: {
4051
+ Row: {
4052
+ created_at: string;
4053
+ field_id: string;
4054
+ id: string;
4055
+ label: string;
4056
+ sort_order: number;
4057
+ value: string;
4058
+ };
4059
+ Insert: {
4060
+ created_at?: string;
4061
+ field_id: string;
4062
+ id?: string;
4063
+ label: string;
4064
+ sort_order?: number;
4065
+ value: string;
4066
+ };
4067
+ Update: {
4068
+ created_at?: string;
4069
+ field_id?: string;
4070
+ id?: string;
4071
+ label?: string;
4072
+ sort_order?: number;
4073
+ value?: string;
4074
+ };
4075
+ Relationships: [
4076
+ {
4077
+ foreignKeyName: "quote_field_options_field_id_fkey";
4078
+ columns: ["field_id"];
4079
+ isOneToOne: false;
4080
+ referencedRelation: "quote_field_settings";
4081
+ referencedColumns: ["id"];
4082
+ }
4083
+ ];
4084
+ };
4085
+ quote_field_settings: {
4086
+ Row: {
4087
+ created_at: string;
4088
+ default_value: string | null;
4089
+ field_key: string;
4090
+ field_type: string;
4091
+ id: string;
4092
+ is_system: boolean;
4093
+ label: string;
4094
+ required: boolean;
4095
+ sort_order: number;
4096
+ updated_at: string;
4097
+ visible: boolean;
4098
+ };
4099
+ Insert: {
4100
+ created_at?: string;
4101
+ default_value?: string | null;
4102
+ field_key: string;
4103
+ field_type: string;
4104
+ id?: string;
4105
+ is_system?: boolean;
4106
+ label: string;
4107
+ required?: boolean;
4108
+ sort_order?: number;
4109
+ updated_at?: string;
4110
+ visible?: boolean;
4111
+ };
4112
+ Update: {
4113
+ created_at?: string;
4114
+ default_value?: string | null;
4115
+ field_key?: string;
4116
+ field_type?: string;
4117
+ id?: string;
4118
+ is_system?: boolean;
4119
+ label?: string;
4120
+ required?: boolean;
4121
+ sort_order?: number;
4122
+ updated_at?: string;
4123
+ visible?: boolean;
4124
+ };
4125
+ Relationships: [];
4126
+ };
4127
+ quote_items: {
4128
+ Row: {
4129
+ category: string | null;
4130
+ created_at: string;
4131
+ description: string;
4132
+ id: string;
4133
+ line_total: number;
4134
+ module_id: string | null;
4135
+ name: string | null;
4136
+ quantity: number;
4137
+ quote_id: string;
4138
+ sort_order: number;
4139
+ unit_price: number;
4140
+ };
4141
+ Insert: {
4142
+ category?: string | null;
4143
+ created_at?: string;
4144
+ description?: string;
4145
+ id?: string;
4146
+ line_total?: number;
4147
+ module_id?: string | null;
4148
+ name?: string | null;
4149
+ quantity?: number;
4150
+ quote_id: string;
4151
+ sort_order?: number;
4152
+ unit_price?: number;
4153
+ };
4154
+ Update: {
4155
+ category?: string | null;
4156
+ created_at?: string;
4157
+ description?: string;
4158
+ id?: string;
4159
+ line_total?: number;
4160
+ module_id?: string | null;
4161
+ name?: string | null;
4162
+ quantity?: number;
4163
+ quote_id?: string;
4164
+ sort_order?: number;
4165
+ unit_price?: number;
4166
+ };
4167
+ Relationships: [
4168
+ {
4169
+ foreignKeyName: "quote_items_module_id_fkey";
4170
+ columns: ["module_id"];
4171
+ isOneToOne: false;
4172
+ referencedRelation: "quote_modules";
4173
+ referencedColumns: ["id"];
4174
+ },
4175
+ {
4176
+ foreignKeyName: "quote_items_quote_id_fkey";
4177
+ columns: ["quote_id"];
4178
+ isOneToOne: false;
4179
+ referencedRelation: "quotes";
4180
+ referencedColumns: ["id"];
4181
+ }
4182
+ ];
4183
+ };
4184
+ quote_modules: {
4185
+ Row: {
4186
+ category: string | null;
4187
+ created_at: string;
4188
+ description: string | null;
4189
+ id: string;
4190
+ is_active: boolean;
4191
+ name: string;
4192
+ price: number;
4193
+ sort_order: number;
4194
+ updated_at: string;
4195
+ };
4196
+ Insert: {
4197
+ category?: string | null;
4198
+ created_at?: string;
4199
+ description?: string | null;
4200
+ id?: string;
4201
+ is_active?: boolean;
4202
+ name: string;
4203
+ price?: number;
4204
+ sort_order?: number;
4205
+ updated_at?: string;
4206
+ };
4207
+ Update: {
4208
+ category?: string | null;
4209
+ created_at?: string;
4210
+ description?: string | null;
4211
+ id?: string;
4212
+ is_active?: boolean;
4213
+ name?: string;
4214
+ price?: number;
4215
+ sort_order?: number;
4216
+ updated_at?: string;
4217
+ };
4218
+ Relationships: [];
4219
+ };
4220
+ quote_templates: {
4221
+ Row: {
4222
+ created_at: string;
4223
+ description: string | null;
4224
+ field_values: Json;
4225
+ id: string;
4226
+ is_default: boolean;
4227
+ items: Json;
4228
+ name: string;
4229
+ updated_at: string;
4230
+ vat_rate: number;
4231
+ };
4232
+ Insert: {
4233
+ created_at?: string;
4234
+ description?: string | null;
4235
+ field_values?: Json;
4236
+ id?: string;
4237
+ is_default?: boolean;
4238
+ items?: Json;
4239
+ name: string;
4240
+ updated_at?: string;
4241
+ vat_rate?: number;
4242
+ };
4243
+ Update: {
4244
+ created_at?: string;
4245
+ description?: string | null;
4246
+ field_values?: Json;
4247
+ id?: string;
4248
+ is_default?: boolean;
4249
+ items?: Json;
4250
+ name?: string;
4251
+ updated_at?: string;
4252
+ vat_rate?: number;
4253
+ };
4254
+ Relationships: [];
4255
+ };
4256
+ quote_terms: {
4257
+ Row: {
4258
+ content: string | null;
4259
+ created_at: string;
4260
+ file_url: string | null;
4261
+ id: string;
4262
+ is_active: boolean;
4263
+ name: string;
4264
+ published_at: string | null;
4265
+ updated_at: string;
4266
+ version: string;
4267
+ };
4268
+ Insert: {
4269
+ content?: string | null;
4270
+ created_at?: string;
4271
+ file_url?: string | null;
4272
+ id?: string;
4273
+ is_active?: boolean;
4274
+ name: string;
4275
+ published_at?: string | null;
4276
+ updated_at?: string;
4277
+ version?: string;
4278
+ };
4279
+ Update: {
4280
+ content?: string | null;
4281
+ created_at?: string;
4282
+ file_url?: string | null;
4283
+ id?: string;
4284
+ is_active?: boolean;
4285
+ name?: string;
4286
+ published_at?: string | null;
4287
+ updated_at?: string;
4288
+ version?: string;
4289
+ };
4290
+ Relationships: [];
4291
+ };
4292
+ quotes: {
4293
+ Row: {
4294
+ accepted_at: string | null;
4295
+ archived_at: string | null;
4296
+ contact_id: string | null;
4297
+ created_at: string;
4298
+ customer_id: string | null;
4299
+ discount: number;
4300
+ expires_at: string | null;
4301
+ field_values: Json;
4302
+ id: string;
4303
+ notes: string | null;
4304
+ owner_id: string | null;
4305
+ personal_message: string | null;
4306
+ project_id: string | null;
4307
+ prospect_id: string | null;
4308
+ public_token: string;
4309
+ quote_number: string | null;
4310
+ recipient_email: string | null;
4311
+ recipient_name: string | null;
4312
+ rejected_at: string | null;
4313
+ sent_at: string | null;
4314
+ status: string;
4315
+ subtotal: number;
4316
+ template_id: string | null;
4317
+ terms_id: string | null;
4318
+ title: string;
4319
+ total: number;
4320
+ updated_at: string;
4321
+ valid_until: string | null;
4322
+ vat_amount: number;
4323
+ vat_rate: number;
4324
+ viewed_at: string | null;
4325
+ };
4326
+ Insert: {
4327
+ accepted_at?: string | null;
4328
+ archived_at?: string | null;
4329
+ contact_id?: string | null;
4330
+ created_at?: string;
4331
+ customer_id?: string | null;
4332
+ discount?: number;
4333
+ expires_at?: string | null;
4334
+ field_values?: Json;
4335
+ id?: string;
4336
+ notes?: string | null;
4337
+ owner_id?: string | null;
4338
+ personal_message?: string | null;
4339
+ project_id?: string | null;
4340
+ prospect_id?: string | null;
4341
+ public_token?: string;
4342
+ quote_number?: string | null;
4343
+ recipient_email?: string | null;
4344
+ recipient_name?: string | null;
4345
+ rejected_at?: string | null;
4346
+ sent_at?: string | null;
4347
+ status?: string;
4348
+ subtotal?: number;
4349
+ template_id?: string | null;
4350
+ terms_id?: string | null;
4351
+ title?: string;
4352
+ total?: number;
4353
+ updated_at?: string;
4354
+ valid_until?: string | null;
4355
+ vat_amount?: number;
4356
+ vat_rate?: number;
4357
+ viewed_at?: string | null;
4358
+ };
4359
+ Update: {
4360
+ accepted_at?: string | null;
4361
+ archived_at?: string | null;
4362
+ contact_id?: string | null;
4363
+ created_at?: string;
4364
+ customer_id?: string | null;
4365
+ discount?: number;
4366
+ expires_at?: string | null;
4367
+ field_values?: Json;
4368
+ id?: string;
4369
+ notes?: string | null;
4370
+ owner_id?: string | null;
4371
+ personal_message?: string | null;
4372
+ project_id?: string | null;
4373
+ prospect_id?: string | null;
4374
+ public_token?: string;
4375
+ quote_number?: string | null;
4376
+ recipient_email?: string | null;
4377
+ recipient_name?: string | null;
4378
+ rejected_at?: string | null;
4379
+ sent_at?: string | null;
4380
+ status?: string;
4381
+ subtotal?: number;
4382
+ template_id?: string | null;
4383
+ terms_id?: string | null;
4384
+ title?: string;
4385
+ total?: number;
4386
+ updated_at?: string;
4387
+ valid_until?: string | null;
4388
+ vat_amount?: number;
4389
+ vat_rate?: number;
4390
+ viewed_at?: string | null;
4391
+ };
4392
+ Relationships: [
4393
+ {
4394
+ foreignKeyName: "quotes_contact_id_fkey";
4395
+ columns: ["contact_id"];
4396
+ isOneToOne: false;
4397
+ referencedRelation: "customer_contacts";
4398
+ referencedColumns: ["id"];
4399
+ },
4400
+ {
4401
+ foreignKeyName: "quotes_customer_id_fkey";
4402
+ columns: ["customer_id"];
4403
+ isOneToOne: false;
4404
+ referencedRelation: "customers";
4405
+ referencedColumns: ["id"];
4406
+ },
4407
+ {
4408
+ foreignKeyName: "quotes_project_id_fkey";
4409
+ columns: ["project_id"];
4410
+ isOneToOne: false;
4411
+ referencedRelation: "projects";
4412
+ referencedColumns: ["id"];
4413
+ },
4414
+ {
4415
+ foreignKeyName: "quotes_prospect_id_fkey";
4416
+ columns: ["prospect_id"];
4417
+ isOneToOne: false;
4418
+ referencedRelation: "prospects";
4419
+ referencedColumns: ["id"];
4420
+ },
4421
+ {
4422
+ foreignKeyName: "quotes_template_id_fkey";
4423
+ columns: ["template_id"];
4424
+ isOneToOne: false;
4425
+ referencedRelation: "quote_templates";
4426
+ referencedColumns: ["id"];
4427
+ },
4428
+ {
4429
+ foreignKeyName: "quotes_terms_id_fkey";
4430
+ columns: ["terms_id"];
4431
+ isOneToOne: false;
4432
+ referencedRelation: "quote_terms";
4433
+ referencedColumns: ["id"];
4434
+ }
4435
+ ];
4436
+ };
4437
+ supplier_products: {
4438
+ Row: {
4439
+ article_number: string | null;
4440
+ created_at: string;
4441
+ id: string;
4442
+ name: string;
4443
+ notes: string | null;
4444
+ pot_size: string | null;
4445
+ price: number | null;
4446
+ quantity: number | null;
4447
+ supplier_id: string;
4448
+ unit: string;
4449
+ updated_at: string;
4450
+ };
4451
+ Insert: {
4452
+ article_number?: string | null;
4453
+ created_at?: string;
4454
+ id?: string;
4455
+ name: string;
4456
+ notes?: string | null;
4457
+ pot_size?: string | null;
4458
+ price?: number | null;
4459
+ quantity?: number | null;
4460
+ supplier_id: string;
4461
+ unit?: string;
4462
+ updated_at?: string;
4463
+ };
4464
+ Update: {
4465
+ article_number?: string | null;
4466
+ created_at?: string;
4467
+ id?: string;
4468
+ name?: string;
4469
+ notes?: string | null;
4470
+ pot_size?: string | null;
4471
+ price?: number | null;
4472
+ quantity?: number | null;
4473
+ supplier_id?: string;
4474
+ unit?: string;
2442
4475
  updated_at?: string;
2443
4476
  };
2444
4477
  Relationships: [
@@ -2523,6 +4556,320 @@ export type Database = {
2523
4556
  };
2524
4557
  Relationships: [];
2525
4558
  };
4559
+ twinfield_credentials: {
4560
+ Row: {
4561
+ administration_code: string | null;
4562
+ client_id: string | null;
4563
+ client_secret: string | null;
4564
+ cluster: string | null;
4565
+ connected_at: string | null;
4566
+ created_at: string;
4567
+ environment: string | null;
4568
+ id: string;
4569
+ redirect_uri: string | null;
4570
+ refresh_token: string | null;
4571
+ updated_at: string;
4572
+ user_id: string;
4573
+ };
4574
+ Insert: {
4575
+ administration_code?: string | null;
4576
+ client_id?: string | null;
4577
+ client_secret?: string | null;
4578
+ cluster?: string | null;
4579
+ connected_at?: string | null;
4580
+ created_at?: string;
4581
+ environment?: string | null;
4582
+ id?: string;
4583
+ redirect_uri?: string | null;
4584
+ refresh_token?: string | null;
4585
+ updated_at?: string;
4586
+ user_id: string;
4587
+ };
4588
+ Update: {
4589
+ administration_code?: string | null;
4590
+ client_id?: string | null;
4591
+ client_secret?: string | null;
4592
+ cluster?: string | null;
4593
+ connected_at?: string | null;
4594
+ created_at?: string;
4595
+ environment?: string | null;
4596
+ id?: string;
4597
+ redirect_uri?: string | null;
4598
+ refresh_token?: string | null;
4599
+ updated_at?: string;
4600
+ user_id?: string;
4601
+ };
4602
+ Relationships: [];
4603
+ };
4604
+ twinfield_customers: {
4605
+ Row: {
4606
+ address: string | null;
4607
+ city: string | null;
4608
+ country: string | null;
4609
+ created_at: string;
4610
+ email: string | null;
4611
+ id: string;
4612
+ last_synced_at: string | null;
4613
+ name: string;
4614
+ phone: string | null;
4615
+ postal_code: string | null;
4616
+ status: string;
4617
+ sync_error: string | null;
4618
+ sync_status: string;
4619
+ twinfield_code: string | null;
4620
+ updated_at: string;
4621
+ user_id: string;
4622
+ };
4623
+ Insert: {
4624
+ address?: string | null;
4625
+ city?: string | null;
4626
+ country?: string | null;
4627
+ created_at?: string;
4628
+ email?: string | null;
4629
+ id?: string;
4630
+ last_synced_at?: string | null;
4631
+ name: string;
4632
+ phone?: string | null;
4633
+ postal_code?: string | null;
4634
+ status?: string;
4635
+ sync_error?: string | null;
4636
+ sync_status?: string;
4637
+ twinfield_code?: string | null;
4638
+ updated_at?: string;
4639
+ user_id: string;
4640
+ };
4641
+ Update: {
4642
+ address?: string | null;
4643
+ city?: string | null;
4644
+ country?: string | null;
4645
+ created_at?: string;
4646
+ email?: string | null;
4647
+ id?: string;
4648
+ last_synced_at?: string | null;
4649
+ name?: string;
4650
+ phone?: string | null;
4651
+ postal_code?: string | null;
4652
+ status?: string;
4653
+ sync_error?: string | null;
4654
+ sync_status?: string;
4655
+ twinfield_code?: string | null;
4656
+ updated_at?: string;
4657
+ user_id?: string;
4658
+ };
4659
+ Relationships: [];
4660
+ };
4661
+ twinfield_invoice_lines: {
4662
+ Row: {
4663
+ article_code: string | null;
4664
+ created_at: string;
4665
+ description: string | null;
4666
+ gl_account: string | null;
4667
+ id: string;
4668
+ invoice_id: string;
4669
+ line_number: number | null;
4670
+ line_total: number;
4671
+ quantity: number;
4672
+ unit_price: number;
4673
+ user_id: string;
4674
+ vat_code: string | null;
4675
+ vat_rate: number;
4676
+ };
4677
+ Insert: {
4678
+ article_code?: string | null;
4679
+ created_at?: string;
4680
+ description?: string | null;
4681
+ gl_account?: string | null;
4682
+ id?: string;
4683
+ invoice_id: string;
4684
+ line_number?: number | null;
4685
+ line_total?: number;
4686
+ quantity?: number;
4687
+ unit_price?: number;
4688
+ user_id: string;
4689
+ vat_code?: string | null;
4690
+ vat_rate?: number;
4691
+ };
4692
+ Update: {
4693
+ article_code?: string | null;
4694
+ created_at?: string;
4695
+ description?: string | null;
4696
+ gl_account?: string | null;
4697
+ id?: string;
4698
+ invoice_id?: string;
4699
+ line_number?: number | null;
4700
+ line_total?: number;
4701
+ quantity?: number;
4702
+ unit_price?: number;
4703
+ user_id?: string;
4704
+ vat_code?: string | null;
4705
+ vat_rate?: number;
4706
+ };
4707
+ Relationships: [
4708
+ {
4709
+ foreignKeyName: "twinfield_invoice_lines_invoice_id_fkey";
4710
+ columns: ["invoice_id"];
4711
+ isOneToOne: false;
4712
+ referencedRelation: "twinfield_invoices";
4713
+ referencedColumns: ["id"];
4714
+ }
4715
+ ];
4716
+ };
4717
+ twinfield_invoice_settings: {
4718
+ Row: {
4719
+ created_at: string;
4720
+ default_gl_account: string;
4721
+ default_invoice_type: string;
4722
+ default_payment_term_days: number;
4723
+ default_vat_code: string;
4724
+ updated_at: string;
4725
+ user_id: string;
4726
+ };
4727
+ Insert: {
4728
+ created_at?: string;
4729
+ default_gl_account?: string;
4730
+ default_invoice_type?: string;
4731
+ default_payment_term_days?: number;
4732
+ default_vat_code?: string;
4733
+ updated_at?: string;
4734
+ user_id: string;
4735
+ };
4736
+ Update: {
4737
+ created_at?: string;
4738
+ default_gl_account?: string;
4739
+ default_invoice_type?: string;
4740
+ default_payment_term_days?: number;
4741
+ default_vat_code?: string;
4742
+ updated_at?: string;
4743
+ user_id?: string;
4744
+ };
4745
+ Relationships: [];
4746
+ };
4747
+ twinfield_invoice_sync_logs: {
4748
+ Row: {
4749
+ created_at: string;
4750
+ details: Json | null;
4751
+ duration_ms: number | null;
4752
+ id: string;
4753
+ invoice_lines_fetched: number | null;
4754
+ invoices_fetched: number | null;
4755
+ message: string | null;
4756
+ status: string;
4757
+ step: string | null;
4758
+ user_id: string;
4759
+ };
4760
+ Insert: {
4761
+ created_at?: string;
4762
+ details?: Json | null;
4763
+ duration_ms?: number | null;
4764
+ id?: string;
4765
+ invoice_lines_fetched?: number | null;
4766
+ invoices_fetched?: number | null;
4767
+ message?: string | null;
4768
+ status: string;
4769
+ step?: string | null;
4770
+ user_id: string;
4771
+ };
4772
+ Update: {
4773
+ created_at?: string;
4774
+ details?: Json | null;
4775
+ duration_ms?: number | null;
4776
+ id?: string;
4777
+ invoice_lines_fetched?: number | null;
4778
+ invoices_fetched?: number | null;
4779
+ message?: string | null;
4780
+ status?: string;
4781
+ step?: string | null;
4782
+ user_id?: string;
4783
+ };
4784
+ Relationships: [];
4785
+ };
4786
+ twinfield_invoices: {
4787
+ Row: {
4788
+ administration_code: string | null;
4789
+ created_at: string;
4790
+ currency: string | null;
4791
+ customer_code: string | null;
4792
+ customer_email: string | null;
4793
+ customer_name: string | null;
4794
+ customer_phone: string | null;
4795
+ due_date: string | null;
4796
+ id: string;
4797
+ invoice_date: string | null;
4798
+ last_synced_at: string;
4799
+ local_invoice_number: string | null;
4800
+ outstanding_amount: number;
4801
+ paid_amount: number;
4802
+ payment_date: string | null;
4803
+ raw_payload: Json | null;
4804
+ status: string;
4805
+ subtotal: number;
4806
+ sync_error: string | null;
4807
+ sync_status: string;
4808
+ total: number;
4809
+ twinfield_invoice_number: string;
4810
+ twinfield_transaction_number: string | null;
4811
+ updated_at: string;
4812
+ user_id: string;
4813
+ vat_amount: number;
4814
+ };
4815
+ Insert: {
4816
+ administration_code?: string | null;
4817
+ created_at?: string;
4818
+ currency?: string | null;
4819
+ customer_code?: string | null;
4820
+ customer_email?: string | null;
4821
+ customer_name?: string | null;
4822
+ customer_phone?: string | null;
4823
+ due_date?: string | null;
4824
+ id?: string;
4825
+ invoice_date?: string | null;
4826
+ last_synced_at?: string;
4827
+ local_invoice_number?: string | null;
4828
+ outstanding_amount?: number;
4829
+ paid_amount?: number;
4830
+ payment_date?: string | null;
4831
+ raw_payload?: Json | null;
4832
+ status?: string;
4833
+ subtotal?: number;
4834
+ sync_error?: string | null;
4835
+ sync_status?: string;
4836
+ total?: number;
4837
+ twinfield_invoice_number: string;
4838
+ twinfield_transaction_number?: string | null;
4839
+ updated_at?: string;
4840
+ user_id: string;
4841
+ vat_amount?: number;
4842
+ };
4843
+ Update: {
4844
+ administration_code?: string | null;
4845
+ created_at?: string;
4846
+ currency?: string | null;
4847
+ customer_code?: string | null;
4848
+ customer_email?: string | null;
4849
+ customer_name?: string | null;
4850
+ customer_phone?: string | null;
4851
+ due_date?: string | null;
4852
+ id?: string;
4853
+ invoice_date?: string | null;
4854
+ last_synced_at?: string;
4855
+ local_invoice_number?: string | null;
4856
+ outstanding_amount?: number;
4857
+ paid_amount?: number;
4858
+ payment_date?: string | null;
4859
+ raw_payload?: Json | null;
4860
+ status?: string;
4861
+ subtotal?: number;
4862
+ sync_error?: string | null;
4863
+ sync_status?: string;
4864
+ total?: number;
4865
+ twinfield_invoice_number?: string;
4866
+ twinfield_transaction_number?: string | null;
4867
+ updated_at?: string;
4868
+ user_id?: string;
4869
+ vat_amount?: number;
4870
+ };
4871
+ Relationships: [];
4872
+ };
2526
4873
  user_roles: {
2527
4874
  Row: {
2528
4875
  created_at: string;
@@ -2554,7 +4901,99 @@ export type Database = {
2554
4901
  };
2555
4902
  };
2556
4903
  Views: {
2557
- [_ in never]: never;
4904
+ email_auth_connections_safe: {
4905
+ Row: {
4906
+ account_email: string | null;
4907
+ created_at: string | null;
4908
+ created_by: string | null;
4909
+ display_name: string | null;
4910
+ has_access_token: boolean | null;
4911
+ has_client_id: boolean | null;
4912
+ has_client_secret: boolean | null;
4913
+ has_imap_password: boolean | null;
4914
+ has_refresh_token: boolean | null;
4915
+ has_smtp_password: boolean | null;
4916
+ id: string | null;
4917
+ imap_host: string | null;
4918
+ imap_port: number | null;
4919
+ imap_secure: boolean | null;
4920
+ imap_username: string | null;
4921
+ is_active: boolean | null;
4922
+ last_error: string | null;
4923
+ last_verified_at: string | null;
4924
+ oauth_mode: string | null;
4925
+ provider: string | null;
4926
+ scopes: string[] | null;
4927
+ smtp_host: string | null;
4928
+ smtp_port: number | null;
4929
+ smtp_secure: boolean | null;
4930
+ smtp_username: string | null;
4931
+ status: string | null;
4932
+ token_expires_at: string | null;
4933
+ updated_at: string | null;
4934
+ };
4935
+ Insert: {
4936
+ account_email?: string | null;
4937
+ created_at?: string | null;
4938
+ created_by?: string | null;
4939
+ display_name?: string | null;
4940
+ has_access_token?: never;
4941
+ has_client_id?: never;
4942
+ has_client_secret?: never;
4943
+ has_imap_password?: never;
4944
+ has_refresh_token?: never;
4945
+ has_smtp_password?: never;
4946
+ id?: string | null;
4947
+ imap_host?: string | null;
4948
+ imap_port?: number | null;
4949
+ imap_secure?: boolean | null;
4950
+ imap_username?: string | null;
4951
+ is_active?: boolean | null;
4952
+ last_error?: string | null;
4953
+ last_verified_at?: string | null;
4954
+ oauth_mode?: string | null;
4955
+ provider?: string | null;
4956
+ scopes?: string[] | null;
4957
+ smtp_host?: string | null;
4958
+ smtp_port?: number | null;
4959
+ smtp_secure?: boolean | null;
4960
+ smtp_username?: string | null;
4961
+ status?: string | null;
4962
+ token_expires_at?: string | null;
4963
+ updated_at?: string | null;
4964
+ };
4965
+ Update: {
4966
+ account_email?: string | null;
4967
+ created_at?: string | null;
4968
+ created_by?: string | null;
4969
+ display_name?: string | null;
4970
+ has_access_token?: never;
4971
+ has_client_id?: never;
4972
+ has_client_secret?: never;
4973
+ has_imap_password?: never;
4974
+ has_refresh_token?: never;
4975
+ has_smtp_password?: never;
4976
+ id?: string | null;
4977
+ imap_host?: string | null;
4978
+ imap_port?: number | null;
4979
+ imap_secure?: boolean | null;
4980
+ imap_username?: string | null;
4981
+ is_active?: boolean | null;
4982
+ last_error?: string | null;
4983
+ last_verified_at?: string | null;
4984
+ oauth_mode?: string | null;
4985
+ provider?: string | null;
4986
+ scopes?: string[] | null;
4987
+ smtp_host?: string | null;
4988
+ smtp_port?: number | null;
4989
+ smtp_secure?: boolean | null;
4990
+ smtp_username?: string | null;
4991
+ status?: string | null;
4992
+ token_expires_at?: string | null;
4993
+ updated_at?: string | null;
4994
+ };
4995
+ Relationships: [];
4996
+ };
2558
4997
  };
2559
4998
  Functions: {
2560
4999
  dashboard_list_public_schema: {
@@ -2565,6 +5004,18 @@ export type Database = {
2565
5004
  table_name: string;
2566
5005
  }[];
2567
5006
  };
5007
+ email_auth_decrypt: {
5008
+ Args: {
5009
+ cipher: string;
5010
+ };
5011
+ Returns: string;
5012
+ };
5013
+ email_auth_encrypt: {
5014
+ Args: {
5015
+ plain: string;
5016
+ };
5017
+ Returns: string;
5018
+ };
2568
5019
  exact_decrypt: {
2569
5020
  Args: {
2570
5021
  cipher: string;
@@ -2577,6 +5028,49 @@ export type Database = {
2577
5028
  };
2578
5029
  Returns: string;
2579
5030
  };
5031
+ exact_lock_environment: {
5032
+ Args: {
5033
+ _environment: string;
5034
+ };
5035
+ Returns: undefined;
5036
+ };
5037
+ exact_release_refresh_lock: {
5038
+ Args: {
5039
+ _environment: Database["public"]["Enums"]["exact_env"];
5040
+ _locked_by: string;
5041
+ };
5042
+ Returns: undefined;
5043
+ };
5044
+ exact_try_acquire_refresh_lock: {
5045
+ Args: {
5046
+ _environment: Database["public"]["Enums"]["exact_env"];
5047
+ _lease_seconds?: number;
5048
+ _locked_by?: string;
5049
+ };
5050
+ Returns: boolean;
5051
+ };
5052
+ get_active_floriday_connection_public: {
5053
+ Args: never;
5054
+ Returns: {
5055
+ active_environment: string;
5056
+ environment: string;
5057
+ gln_code: string;
5058
+ id: string;
5059
+ label: string;
5060
+ organization_name: string;
5061
+ preferred_warehouse_id: string;
5062
+ preferred_warehouse_name: string;
5063
+ }[];
5064
+ };
5065
+ get_floriday_cron_jobs: {
5066
+ Args: never;
5067
+ Returns: {
5068
+ active: boolean;
5069
+ jobname: string;
5070
+ schedule: string;
5071
+ url: string;
5072
+ }[];
5073
+ };
2580
5074
  get_offer_by_link_code: {
2581
5075
  Args: {
2582
5076
  p_code: string;
@@ -2590,6 +5084,20 @@ export type Database = {
2590
5084
  };
2591
5085
  Returns: boolean;
2592
5086
  };
5087
+ schedule_floriday_connections_sync: {
5088
+ Args: {
5089
+ p_apikey: string;
5090
+ p_url: string;
5091
+ };
5092
+ Returns: number;
5093
+ };
5094
+ schedule_floriday_customer_organizations_sync: {
5095
+ Args: {
5096
+ p_apikey: string;
5097
+ p_url: string;
5098
+ };
5099
+ Returns: number;
5100
+ };
2593
5101
  schedule_floriday_network_sync: {
2594
5102
  Args: {
2595
5103
  p_apikey: string;
@@ -2597,6 +5105,13 @@ export type Database = {
2597
5105
  };
2598
5106
  Returns: number;
2599
5107
  };
5108
+ schedule_floriday_salesorders_sync: {
5109
+ Args: {
5110
+ p_apikey: string;
5111
+ p_url: string;
5112
+ };
5113
+ Returns: number;
5114
+ };
2600
5115
  schedule_floriday_token_refresh: {
2601
5116
  Args: {
2602
5117
  p_apikey: string;
@@ -2604,6 +5119,13 @@ export type Database = {
2604
5119
  };
2605
5120
  Returns: number;
2606
5121
  };
5122
+ schedule_floriday_trade_items_sync: {
5123
+ Args: {
5124
+ p_apikey: string;
5125
+ p_url: string;
5126
+ };
5127
+ Returns: number;
5128
+ };
2607
5129
  show_limit: {
2608
5130
  Args: never;
2609
5131
  Returns: number;
@@ -2618,6 +5140,7 @@ export type Database = {
2618
5140
  Enums: {
2619
5141
  app_role: "admin" | "manager" | "warehouse" | "sales" | "developer";
2620
5142
  exact_env: "staging" | "live";
5143
+ quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
2621
5144
  };
2622
5145
  CompositeTypes: {
2623
5146
  [_ in never]: never;
@@ -2678,6 +5201,7 @@ export declare const Constants: {
2678
5201
  readonly Enums: {
2679
5202
  readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer"];
2680
5203
  readonly exact_env: readonly ["staging", "live"];
5204
+ readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"];
2681
5205
  };
2682
5206
  };
2683
5207
  };