@flowselections/floriday-afhandeling-module 1.0.7 → 1.0.8

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.
@@ -193,6 +193,158 @@ export type Database = {
193
193
  };
194
194
  Relationships: [];
195
195
  };
196
+ app_settings: {
197
+ Row: {
198
+ created_at: string;
199
+ id: string;
200
+ key: string;
201
+ updated_at: string;
202
+ value: string | null;
203
+ };
204
+ Insert: {
205
+ created_at?: string;
206
+ id?: string;
207
+ key: string;
208
+ updated_at?: string;
209
+ value?: string | null;
210
+ };
211
+ Update: {
212
+ created_at?: string;
213
+ id?: string;
214
+ key?: string;
215
+ updated_at?: string;
216
+ value?: string | null;
217
+ };
218
+ Relationships: [];
219
+ };
220
+ booking_items: {
221
+ Row: {
222
+ booking_id: string;
223
+ created_at: string;
224
+ extra_id: string;
225
+ id: string;
226
+ quantity: number;
227
+ total_price: number;
228
+ unit_price: number;
229
+ };
230
+ Insert: {
231
+ booking_id: string;
232
+ created_at?: string;
233
+ extra_id: string;
234
+ id?: string;
235
+ quantity?: number;
236
+ total_price?: number;
237
+ unit_price?: number;
238
+ };
239
+ Update: {
240
+ booking_id?: string;
241
+ created_at?: string;
242
+ extra_id?: string;
243
+ id?: string;
244
+ quantity?: number;
245
+ total_price?: number;
246
+ unit_price?: number;
247
+ };
248
+ Relationships: [
249
+ {
250
+ foreignKeyName: "booking_items_booking_id_fkey";
251
+ columns: ["booking_id"];
252
+ isOneToOne: false;
253
+ referencedRelation: "bookings";
254
+ referencedColumns: ["id"];
255
+ },
256
+ {
257
+ foreignKeyName: "booking_items_extra_id_fkey";
258
+ columns: ["extra_id"];
259
+ isOneToOne: false;
260
+ referencedRelation: "extras";
261
+ referencedColumns: ["id"];
262
+ }
263
+ ];
264
+ };
265
+ bookings: {
266
+ Row: {
267
+ company_name: string | null;
268
+ conflict_checked_at: string | null;
269
+ conflict_reason: string | null;
270
+ created_at: string;
271
+ created_by_role: string | null;
272
+ customer_email: string | null;
273
+ customer_name: string | null;
274
+ end_time: string;
275
+ exact_debiteur_id: string | null;
276
+ has_conflict: boolean;
277
+ id: string;
278
+ invoice_run_id: string | null;
279
+ invoice_status: string | null;
280
+ invoiced_at: string | null;
281
+ number_of_people: number;
282
+ room_id: string;
283
+ start_time: string;
284
+ status: string;
285
+ total_excl_vat: number | null;
286
+ total_incl_vat: number | null;
287
+ user_id: string | null;
288
+ vat_amount: number | null;
289
+ };
290
+ Insert: {
291
+ company_name?: string | null;
292
+ conflict_checked_at?: string | null;
293
+ conflict_reason?: string | null;
294
+ created_at?: string;
295
+ created_by_role?: string | null;
296
+ customer_email?: string | null;
297
+ customer_name?: string | null;
298
+ end_time: string;
299
+ exact_debiteur_id?: string | null;
300
+ has_conflict?: boolean;
301
+ id?: string;
302
+ invoice_run_id?: string | null;
303
+ invoice_status?: string | null;
304
+ invoiced_at?: string | null;
305
+ number_of_people?: number;
306
+ room_id: string;
307
+ start_time: string;
308
+ status?: string;
309
+ total_excl_vat?: number | null;
310
+ total_incl_vat?: number | null;
311
+ user_id?: string | null;
312
+ vat_amount?: number | null;
313
+ };
314
+ Update: {
315
+ company_name?: string | null;
316
+ conflict_checked_at?: string | null;
317
+ conflict_reason?: string | null;
318
+ created_at?: string;
319
+ created_by_role?: string | null;
320
+ customer_email?: string | null;
321
+ customer_name?: string | null;
322
+ end_time?: string;
323
+ exact_debiteur_id?: string | null;
324
+ has_conflict?: boolean;
325
+ id?: string;
326
+ invoice_run_id?: string | null;
327
+ invoice_status?: string | null;
328
+ invoiced_at?: string | null;
329
+ number_of_people?: number;
330
+ room_id?: string;
331
+ start_time?: string;
332
+ status?: string;
333
+ total_excl_vat?: number | null;
334
+ total_incl_vat?: number | null;
335
+ user_id?: string | null;
336
+ vat_amount?: number | null;
337
+ };
338
+ Relationships: [
339
+ {
340
+ foreignKeyName: "bookings_room_id_fkey";
341
+ columns: ["room_id"];
342
+ isOneToOne: false;
343
+ referencedRelation: "rooms";
344
+ referencedColumns: ["id"];
345
+ }
346
+ ];
347
+ };
196
348
  bugs: {
197
349
  Row: {
198
350
  attachment_url: string | null;
@@ -1047,17 +1199,26 @@ export type Database = {
1047
1199
  created_at: string;
1048
1200
  created_by: string | null;
1049
1201
  display_name: string | null;
1202
+ gmail_history_id: string | null;
1203
+ gmail_watch_expires_at: string | null;
1204
+ graph_subscription_expires_at: string | null;
1205
+ graph_subscription_id: string | null;
1050
1206
  id: string;
1051
1207
  imap_host: string | null;
1208
+ imap_last_uid: number | null;
1052
1209
  imap_password_encrypted: string | null;
1053
1210
  imap_port: number | null;
1054
1211
  imap_secure: boolean | null;
1212
+ imap_uid_validity: number | null;
1055
1213
  imap_username: string | null;
1056
1214
  is_active: boolean;
1057
1215
  last_error: string | null;
1216
+ last_event_at: string | null;
1058
1217
  last_verified_at: string | null;
1059
1218
  oauth_mode: string | null;
1060
1219
  provider: string;
1220
+ purpose_assignments: Json;
1221
+ realtime_mode: string;
1061
1222
  refresh_token_encrypted: string | null;
1062
1223
  scopes: string[] | null;
1063
1224
  smtp_host: string | null;
@@ -1077,17 +1238,26 @@ export type Database = {
1077
1238
  created_at?: string;
1078
1239
  created_by?: string | null;
1079
1240
  display_name?: string | null;
1241
+ gmail_history_id?: string | null;
1242
+ gmail_watch_expires_at?: string | null;
1243
+ graph_subscription_expires_at?: string | null;
1244
+ graph_subscription_id?: string | null;
1080
1245
  id?: string;
1081
1246
  imap_host?: string | null;
1247
+ imap_last_uid?: number | null;
1082
1248
  imap_password_encrypted?: string | null;
1083
1249
  imap_port?: number | null;
1084
1250
  imap_secure?: boolean | null;
1251
+ imap_uid_validity?: number | null;
1085
1252
  imap_username?: string | null;
1086
1253
  is_active?: boolean;
1087
1254
  last_error?: string | null;
1255
+ last_event_at?: string | null;
1088
1256
  last_verified_at?: string | null;
1089
1257
  oauth_mode?: string | null;
1090
1258
  provider: string;
1259
+ purpose_assignments?: Json;
1260
+ realtime_mode?: string;
1091
1261
  refresh_token_encrypted?: string | null;
1092
1262
  scopes?: string[] | null;
1093
1263
  smtp_host?: string | null;
@@ -1107,17 +1277,26 @@ export type Database = {
1107
1277
  created_at?: string;
1108
1278
  created_by?: string | null;
1109
1279
  display_name?: string | null;
1280
+ gmail_history_id?: string | null;
1281
+ gmail_watch_expires_at?: string | null;
1282
+ graph_subscription_expires_at?: string | null;
1283
+ graph_subscription_id?: string | null;
1110
1284
  id?: string;
1111
1285
  imap_host?: string | null;
1286
+ imap_last_uid?: number | null;
1112
1287
  imap_password_encrypted?: string | null;
1113
1288
  imap_port?: number | null;
1114
1289
  imap_secure?: boolean | null;
1290
+ imap_uid_validity?: number | null;
1115
1291
  imap_username?: string | null;
1116
1292
  is_active?: boolean;
1117
1293
  last_error?: string | null;
1294
+ last_event_at?: string | null;
1118
1295
  last_verified_at?: string | null;
1119
1296
  oauth_mode?: string | null;
1120
1297
  provider?: string;
1298
+ purpose_assignments?: Json;
1299
+ realtime_mode?: string;
1121
1300
  refresh_token_encrypted?: string | null;
1122
1301
  scopes?: string[] | null;
1123
1302
  smtp_host?: string | null;
@@ -1131,6 +1310,204 @@ export type Database = {
1131
1310
  };
1132
1311
  Relationships: [];
1133
1312
  };
1313
+ email_auth_events: {
1314
+ Row: {
1315
+ connection_id: string;
1316
+ consumed_at: string | null;
1317
+ created_at: string;
1318
+ event_type: string;
1319
+ external_id: string | null;
1320
+ id: string;
1321
+ payload: Json;
1322
+ provider: string;
1323
+ received_at: string;
1324
+ };
1325
+ Insert: {
1326
+ connection_id: string;
1327
+ consumed_at?: string | null;
1328
+ created_at?: string;
1329
+ event_type: string;
1330
+ external_id?: string | null;
1331
+ id?: string;
1332
+ payload?: Json;
1333
+ provider: string;
1334
+ received_at?: string;
1335
+ };
1336
+ Update: {
1337
+ connection_id?: string;
1338
+ consumed_at?: string | null;
1339
+ created_at?: string;
1340
+ event_type?: string;
1341
+ external_id?: string | null;
1342
+ id?: string;
1343
+ payload?: Json;
1344
+ provider?: string;
1345
+ received_at?: string;
1346
+ };
1347
+ Relationships: [
1348
+ {
1349
+ foreignKeyName: "email_auth_events_connection_id_fkey";
1350
+ columns: ["connection_id"];
1351
+ isOneToOne: false;
1352
+ referencedRelation: "email_auth_connections";
1353
+ referencedColumns: ["id"];
1354
+ },
1355
+ {
1356
+ foreignKeyName: "email_auth_events_connection_id_fkey";
1357
+ columns: ["connection_id"];
1358
+ isOneToOne: false;
1359
+ referencedRelation: "email_auth_connections_safe";
1360
+ referencedColumns: ["id"];
1361
+ }
1362
+ ];
1363
+ };
1364
+ email_auth_outbox: {
1365
+ Row: {
1366
+ attempts: number;
1367
+ bcc_addresses: string[];
1368
+ cc_addresses: string[];
1369
+ connection_id: string | null;
1370
+ created_at: string;
1371
+ created_by: string | null;
1372
+ external_message_id: string | null;
1373
+ headers: Json;
1374
+ html_body: string | null;
1375
+ id: string;
1376
+ last_error: string | null;
1377
+ purpose: string;
1378
+ reply_to: string | null;
1379
+ scheduled_at: string;
1380
+ sent_at: string | null;
1381
+ status: string;
1382
+ subject: string;
1383
+ text_body: string | null;
1384
+ to_addresses: string[];
1385
+ updated_at: string;
1386
+ };
1387
+ Insert: {
1388
+ attempts?: number;
1389
+ bcc_addresses?: string[];
1390
+ cc_addresses?: string[];
1391
+ connection_id?: string | null;
1392
+ created_at?: string;
1393
+ created_by?: string | null;
1394
+ external_message_id?: string | null;
1395
+ headers?: Json;
1396
+ html_body?: string | null;
1397
+ id?: string;
1398
+ last_error?: string | null;
1399
+ purpose: string;
1400
+ reply_to?: string | null;
1401
+ scheduled_at?: string;
1402
+ sent_at?: string | null;
1403
+ status?: string;
1404
+ subject: string;
1405
+ text_body?: string | null;
1406
+ to_addresses: string[];
1407
+ updated_at?: string;
1408
+ };
1409
+ Update: {
1410
+ attempts?: number;
1411
+ bcc_addresses?: string[];
1412
+ cc_addresses?: string[];
1413
+ connection_id?: string | null;
1414
+ created_at?: string;
1415
+ created_by?: string | null;
1416
+ external_message_id?: string | null;
1417
+ headers?: Json;
1418
+ html_body?: string | null;
1419
+ id?: string;
1420
+ last_error?: string | null;
1421
+ purpose?: string;
1422
+ reply_to?: string | null;
1423
+ scheduled_at?: string;
1424
+ sent_at?: string | null;
1425
+ status?: string;
1426
+ subject?: string;
1427
+ text_body?: string | null;
1428
+ to_addresses?: string[];
1429
+ updated_at?: string;
1430
+ };
1431
+ Relationships: [
1432
+ {
1433
+ foreignKeyName: "email_auth_outbox_connection_id_fkey";
1434
+ columns: ["connection_id"];
1435
+ isOneToOne: false;
1436
+ referencedRelation: "email_auth_connections";
1437
+ referencedColumns: ["id"];
1438
+ },
1439
+ {
1440
+ foreignKeyName: "email_auth_outbox_connection_id_fkey";
1441
+ columns: ["connection_id"];
1442
+ isOneToOne: false;
1443
+ referencedRelation: "email_auth_connections_safe";
1444
+ referencedColumns: ["id"];
1445
+ }
1446
+ ];
1447
+ };
1448
+ email_auth_purpose_settings: {
1449
+ Row: {
1450
+ purpose: string;
1451
+ reply_to: string | null;
1452
+ updated_at: string;
1453
+ updated_by: string | null;
1454
+ };
1455
+ Insert: {
1456
+ purpose: string;
1457
+ reply_to?: string | null;
1458
+ updated_at?: string;
1459
+ updated_by?: string | null;
1460
+ };
1461
+ Update: {
1462
+ purpose?: string;
1463
+ reply_to?: string | null;
1464
+ updated_at?: string;
1465
+ updated_by?: string | null;
1466
+ };
1467
+ Relationships: [];
1468
+ };
1469
+ email_auth_token_refresh_log: {
1470
+ Row: {
1471
+ connection_id: string;
1472
+ error_message: string | null;
1473
+ id: string;
1474
+ refreshed_at: string;
1475
+ success: boolean;
1476
+ trigger_source: string;
1477
+ };
1478
+ Insert: {
1479
+ connection_id: string;
1480
+ error_message?: string | null;
1481
+ id?: string;
1482
+ refreshed_at?: string;
1483
+ success: boolean;
1484
+ trigger_source: string;
1485
+ };
1486
+ Update: {
1487
+ connection_id?: string;
1488
+ error_message?: string | null;
1489
+ id?: string;
1490
+ refreshed_at?: string;
1491
+ success?: boolean;
1492
+ trigger_source?: string;
1493
+ };
1494
+ Relationships: [
1495
+ {
1496
+ foreignKeyName: "email_auth_token_refresh_log_connection_id_fkey";
1497
+ columns: ["connection_id"];
1498
+ isOneToOne: false;
1499
+ referencedRelation: "email_auth_connections";
1500
+ referencedColumns: ["id"];
1501
+ },
1502
+ {
1503
+ foreignKeyName: "email_auth_token_refresh_log_connection_id_fkey";
1504
+ columns: ["connection_id"];
1505
+ isOneToOne: false;
1506
+ referencedRelation: "email_auth_connections_safe";
1507
+ referencedColumns: ["id"];
1508
+ }
1509
+ ];
1510
+ };
1134
1511
  exact_account_analytics_cache: {
1135
1512
  Row: {
1136
1513
  account_id: string;
@@ -1898,6 +2275,42 @@ export type Database = {
1898
2275
  };
1899
2276
  Relationships: [];
1900
2277
  };
2278
+ exact_settings: {
2279
+ Row: {
2280
+ client_id: string | null;
2281
+ client_secret: string | null;
2282
+ connection_status: string;
2283
+ created_at: string;
2284
+ division_id: string | null;
2285
+ id: string;
2286
+ last_sync_at: string | null;
2287
+ redirect_uri: string | null;
2288
+ updated_at: string;
2289
+ };
2290
+ Insert: {
2291
+ client_id?: string | null;
2292
+ client_secret?: string | null;
2293
+ connection_status?: string;
2294
+ created_at?: string;
2295
+ division_id?: string | null;
2296
+ id?: string;
2297
+ last_sync_at?: string | null;
2298
+ redirect_uri?: string | null;
2299
+ updated_at?: string;
2300
+ };
2301
+ Update: {
2302
+ client_id?: string | null;
2303
+ client_secret?: string | null;
2304
+ connection_status?: string;
2305
+ created_at?: string;
2306
+ division_id?: string | null;
2307
+ id?: string;
2308
+ last_sync_at?: string | null;
2309
+ redirect_uri?: string | null;
2310
+ updated_at?: string;
2311
+ };
2312
+ Relationships: [];
2313
+ };
1901
2314
  exact_sync_state: {
1902
2315
  Row: {
1903
2316
  connection_id: string;
@@ -1925,20 +2338,113 @@ export type Database = {
1925
2338
  };
1926
2339
  Relationships: [];
1927
2340
  };
1928
- floricode_connection_settings: {
2341
+ external_customer_providers: {
1929
2342
  Row: {
1930
- catalog_key: string | null;
1931
- catalog_url: string;
2343
+ color: string | null;
1932
2344
  created_at: string;
1933
- id: number;
1934
- last_meta: Json | null;
1935
- last_test_at: string | null;
1936
- last_test_error: string | null;
1937
- last_test_ok: boolean | null;
1938
- updated_at: string;
1939
- };
1940
- Insert: {
1941
- catalog_key?: string | null;
2345
+ icon: string | null;
2346
+ is_enabled: boolean;
2347
+ label: string;
2348
+ last_synced_at: string | null;
2349
+ provider: string;
2350
+ sort_order: number;
2351
+ updated_at: string;
2352
+ };
2353
+ Insert: {
2354
+ color?: string | null;
2355
+ created_at?: string;
2356
+ icon?: string | null;
2357
+ is_enabled?: boolean;
2358
+ label: string;
2359
+ last_synced_at?: string | null;
2360
+ provider: string;
2361
+ sort_order?: number;
2362
+ updated_at?: string;
2363
+ };
2364
+ Update: {
2365
+ color?: string | null;
2366
+ created_at?: string;
2367
+ icon?: string | null;
2368
+ is_enabled?: boolean;
2369
+ label?: string;
2370
+ last_synced_at?: string | null;
2371
+ provider?: string;
2372
+ sort_order?: number;
2373
+ updated_at?: string;
2374
+ };
2375
+ Relationships: [];
2376
+ };
2377
+ extra_categories: {
2378
+ Row: {
2379
+ created_at: string;
2380
+ id: string;
2381
+ name: string;
2382
+ sort_order: number;
2383
+ updated_at: string;
2384
+ };
2385
+ Insert: {
2386
+ created_at?: string;
2387
+ id?: string;
2388
+ name: string;
2389
+ sort_order?: number;
2390
+ updated_at?: string;
2391
+ };
2392
+ Update: {
2393
+ created_at?: string;
2394
+ id?: string;
2395
+ name?: string;
2396
+ sort_order?: number;
2397
+ updated_at?: string;
2398
+ };
2399
+ Relationships: [];
2400
+ };
2401
+ extras: {
2402
+ Row: {
2403
+ category: string;
2404
+ created_at: string;
2405
+ exact_article_id: string | null;
2406
+ id: string;
2407
+ is_active: boolean;
2408
+ name: string;
2409
+ price: number;
2410
+ pricing_type: string;
2411
+ };
2412
+ Insert: {
2413
+ category: string;
2414
+ created_at?: string;
2415
+ exact_article_id?: string | null;
2416
+ id?: string;
2417
+ is_active?: boolean;
2418
+ name: string;
2419
+ price?: number;
2420
+ pricing_type?: string;
2421
+ };
2422
+ Update: {
2423
+ category?: string;
2424
+ created_at?: string;
2425
+ exact_article_id?: string | null;
2426
+ id?: string;
2427
+ is_active?: boolean;
2428
+ name?: string;
2429
+ price?: number;
2430
+ pricing_type?: string;
2431
+ };
2432
+ Relationships: [];
2433
+ };
2434
+ floricode_connection_settings: {
2435
+ Row: {
2436
+ catalog_key: string | null;
2437
+ catalog_url: string;
2438
+ created_at: string;
2439
+ id: number;
2440
+ last_meta: Json | null;
2441
+ last_test_at: string | null;
2442
+ last_test_error: string | null;
2443
+ last_test_ok: boolean | null;
2444
+ updated_at: string;
2445
+ };
2446
+ Insert: {
2447
+ catalog_key?: string | null;
1942
2448
  catalog_url?: string;
1943
2449
  created_at?: string;
1944
2450
  id?: number;
@@ -2015,6 +2521,50 @@ export type Database = {
2015
2521
  };
2016
2522
  Relationships: [];
2017
2523
  };
2524
+ floriday_carriers_cache: {
2525
+ Row: {
2526
+ connection_id: string | null;
2527
+ created_at: string;
2528
+ data: Json;
2529
+ fetched_at: string;
2530
+ gln_code: string | null;
2531
+ id: string;
2532
+ name: string | null;
2533
+ organization_id: string;
2534
+ updated_at: string;
2535
+ };
2536
+ Insert: {
2537
+ connection_id?: string | null;
2538
+ created_at?: string;
2539
+ data: Json;
2540
+ fetched_at?: string;
2541
+ gln_code?: string | null;
2542
+ id?: string;
2543
+ name?: string | null;
2544
+ organization_id: string;
2545
+ updated_at?: string;
2546
+ };
2547
+ Update: {
2548
+ connection_id?: string | null;
2549
+ created_at?: string;
2550
+ data?: Json;
2551
+ fetched_at?: string;
2552
+ gln_code?: string | null;
2553
+ id?: string;
2554
+ name?: string | null;
2555
+ organization_id?: string;
2556
+ updated_at?: string;
2557
+ };
2558
+ Relationships: [
2559
+ {
2560
+ foreignKeyName: "floriday_carriers_cache_connection_id_fkey";
2561
+ columns: ["connection_id"];
2562
+ isOneToOne: false;
2563
+ referencedRelation: "floriday_connections";
2564
+ referencedColumns: ["id"];
2565
+ }
2566
+ ];
2567
+ };
2018
2568
  floriday_connections: {
2019
2569
  Row: {
2020
2570
  access_token: string | null;
@@ -2551,6 +3101,105 @@ export type Database = {
2551
3101
  };
2552
3102
  Relationships: [];
2553
3103
  };
3104
+ invoice_run_items: {
3105
+ Row: {
3106
+ booking_id: string | null;
3107
+ company_name: string | null;
3108
+ created_at: string;
3109
+ customer_email: string | null;
3110
+ description: string | null;
3111
+ exact_article_id: string | null;
3112
+ id: string;
3113
+ invoice_run_id: string | null;
3114
+ quantity: number | null;
3115
+ total_excl_vat: number | null;
3116
+ total_incl_vat: number | null;
3117
+ unit_price: number | null;
3118
+ vat_amount: number | null;
3119
+ };
3120
+ Insert: {
3121
+ booking_id?: string | null;
3122
+ company_name?: string | null;
3123
+ created_at?: string;
3124
+ customer_email?: string | null;
3125
+ description?: string | null;
3126
+ exact_article_id?: string | null;
3127
+ id?: string;
3128
+ invoice_run_id?: string | null;
3129
+ quantity?: number | null;
3130
+ total_excl_vat?: number | null;
3131
+ total_incl_vat?: number | null;
3132
+ unit_price?: number | null;
3133
+ vat_amount?: number | null;
3134
+ };
3135
+ Update: {
3136
+ booking_id?: string | null;
3137
+ company_name?: string | null;
3138
+ created_at?: string;
3139
+ customer_email?: string | null;
3140
+ description?: string | null;
3141
+ exact_article_id?: string | null;
3142
+ id?: string;
3143
+ invoice_run_id?: string | null;
3144
+ quantity?: number | null;
3145
+ total_excl_vat?: number | null;
3146
+ total_incl_vat?: number | null;
3147
+ unit_price?: number | null;
3148
+ vat_amount?: number | null;
3149
+ };
3150
+ Relationships: [
3151
+ {
3152
+ foreignKeyName: "invoice_run_items_booking_id_fkey";
3153
+ columns: ["booking_id"];
3154
+ isOneToOne: false;
3155
+ referencedRelation: "bookings";
3156
+ referencedColumns: ["id"];
3157
+ },
3158
+ {
3159
+ foreignKeyName: "invoice_run_items_invoice_run_id_fkey";
3160
+ columns: ["invoice_run_id"];
3161
+ isOneToOne: false;
3162
+ referencedRelation: "invoice_runs";
3163
+ referencedColumns: ["id"];
3164
+ }
3165
+ ];
3166
+ };
3167
+ invoice_runs: {
3168
+ Row: {
3169
+ created_at: string;
3170
+ created_by: string | null;
3171
+ id: string;
3172
+ period_end: string;
3173
+ period_start: string;
3174
+ status: string;
3175
+ total_excl_vat: number | null;
3176
+ total_incl_vat: number | null;
3177
+ vat_amount: number | null;
3178
+ };
3179
+ Insert: {
3180
+ created_at?: string;
3181
+ created_by?: string | null;
3182
+ id?: string;
3183
+ period_end: string;
3184
+ period_start: string;
3185
+ status?: string;
3186
+ total_excl_vat?: number | null;
3187
+ total_incl_vat?: number | null;
3188
+ vat_amount?: number | null;
3189
+ };
3190
+ Update: {
3191
+ created_at?: string;
3192
+ created_by?: string | null;
3193
+ id?: string;
3194
+ period_end?: string;
3195
+ period_start?: string;
3196
+ status?: string;
3197
+ total_excl_vat?: number | null;
3198
+ total_incl_vat?: number | null;
3199
+ vat_amount?: number | null;
3200
+ };
3201
+ Relationships: [];
3202
+ };
2554
3203
  locations: {
2555
3204
  Row: {
2556
3205
  created_at: string;
@@ -2581,6 +3230,7 @@ export type Database = {
2581
3230
  body_text: string | null;
2582
3231
  created_at: string;
2583
3232
  error_message: string | null;
3233
+ external_id: string | null;
2584
3234
  from_email: string | null;
2585
3235
  from_name: string | null;
2586
3236
  id: string;
@@ -2590,7 +3240,7 @@ export type Database = {
2590
3240
  received_at: string | null;
2591
3241
  status: string;
2592
3242
  subject: string | null;
2593
- uid: number;
3243
+ uid: number | null;
2594
3244
  updated_at: string;
2595
3245
  };
2596
3246
  Insert: {
@@ -2598,6 +3248,7 @@ export type Database = {
2598
3248
  body_text?: string | null;
2599
3249
  created_at?: string;
2600
3250
  error_message?: string | null;
3251
+ external_id?: string | null;
2601
3252
  from_email?: string | null;
2602
3253
  from_name?: string | null;
2603
3254
  id?: string;
@@ -2607,7 +3258,7 @@ export type Database = {
2607
3258
  received_at?: string | null;
2608
3259
  status?: string;
2609
3260
  subject?: string | null;
2610
- uid: number;
3261
+ uid?: number | null;
2611
3262
  updated_at?: string;
2612
3263
  };
2613
3264
  Update: {
@@ -2615,6 +3266,7 @@ export type Database = {
2615
3266
  body_text?: string | null;
2616
3267
  created_at?: string;
2617
3268
  error_message?: string | null;
3269
+ external_id?: string | null;
2618
3270
  from_email?: string | null;
2619
3271
  from_name?: string | null;
2620
3272
  id?: string;
@@ -2624,7 +3276,7 @@ export type Database = {
2624
3276
  received_at?: string | null;
2625
3277
  status?: string;
2626
3278
  subject?: string | null;
2627
- uid?: number;
3279
+ uid?: number | null;
2628
3280
  updated_at?: string;
2629
3281
  };
2630
3282
  Relationships: [
@@ -2907,6 +3559,62 @@ export type Database = {
2907
3559
  };
2908
3560
  Relationships: [];
2909
3561
  };
3562
+ monteurs: {
3563
+ Row: {
3564
+ avatar_url: string | null;
3565
+ color: string | null;
3566
+ created_at: string;
3567
+ email: string | null;
3568
+ id: string;
3569
+ is_active: boolean;
3570
+ leave_balance_hours: number;
3571
+ name: string;
3572
+ persnr: number | null;
3573
+ phone: string | null;
3574
+ role: string;
3575
+ tenant_id: string;
3576
+ updated_at: string;
3577
+ };
3578
+ Insert: {
3579
+ avatar_url?: string | null;
3580
+ color?: string | null;
3581
+ created_at?: string;
3582
+ email?: string | null;
3583
+ id?: string;
3584
+ is_active?: boolean;
3585
+ leave_balance_hours?: number;
3586
+ name: string;
3587
+ persnr?: number | null;
3588
+ phone?: string | null;
3589
+ role?: string;
3590
+ tenant_id: string;
3591
+ updated_at?: string;
3592
+ };
3593
+ Update: {
3594
+ avatar_url?: string | null;
3595
+ color?: string | null;
3596
+ created_at?: string;
3597
+ email?: string | null;
3598
+ id?: string;
3599
+ is_active?: boolean;
3600
+ leave_balance_hours?: number;
3601
+ name?: string;
3602
+ persnr?: number | null;
3603
+ phone?: string | null;
3604
+ role?: string;
3605
+ tenant_id?: string;
3606
+ updated_at?: string;
3607
+ };
3608
+ Relationships: [
3609
+ {
3610
+ foreignKeyName: "monteurs_tenant_id_fkey";
3611
+ columns: ["tenant_id"];
3612
+ isOneToOne: false;
3613
+ referencedRelation: "tenants";
3614
+ referencedColumns: ["id"];
3615
+ }
3616
+ ];
3617
+ };
2910
3618
  notifications: {
2911
3619
  Row: {
2912
3620
  created_at: string;
@@ -3764,6 +4472,7 @@ export type Database = {
3764
4472
  email: string | null;
3765
4473
  id: string;
3766
4474
  notification_preferences: Json;
4475
+ tenant_id: string | null;
3767
4476
  updated_at: string;
3768
4477
  };
3769
4478
  Insert: {
@@ -3772,6 +4481,7 @@ export type Database = {
3772
4481
  email?: string | null;
3773
4482
  id: string;
3774
4483
  notification_preferences?: Json;
4484
+ tenant_id?: string | null;
3775
4485
  updated_at?: string;
3776
4486
  };
3777
4487
  Update: {
@@ -3780,9 +4490,18 @@ export type Database = {
3780
4490
  email?: string | null;
3781
4491
  id?: string;
3782
4492
  notification_preferences?: Json;
4493
+ tenant_id?: string | null;
3783
4494
  updated_at?: string;
3784
4495
  };
3785
- Relationships: [];
4496
+ Relationships: [
4497
+ {
4498
+ foreignKeyName: "profiles_tenant_id_fkey";
4499
+ columns: ["tenant_id"];
4500
+ isOneToOne: false;
4501
+ referencedRelation: "tenants";
4502
+ referencedColumns: ["id"];
4503
+ }
4504
+ ];
3786
4505
  };
3787
4506
  projects: {
3788
4507
  Row: {
@@ -4514,32 +5233,109 @@ export type Database = {
4514
5233
  }
4515
5234
  ];
4516
5235
  };
4517
- supplier_products: {
5236
+ reception_notifications: {
4518
5237
  Row: {
4519
- article_number: string | null;
5238
+ booking_id: string | null;
4520
5239
  created_at: string;
4521
5240
  id: string;
4522
- name: string;
4523
- notes: string | null;
4524
- pot_size: string | null;
4525
- price: number | null;
4526
- quantity: number | null;
4527
- supplier_id: string;
4528
- unit: string;
4529
- updated_at: string;
5241
+ is_read: boolean;
5242
+ message: string;
5243
+ recipient_email: string | null;
5244
+ title: string;
5245
+ type: string;
4530
5246
  };
4531
5247
  Insert: {
4532
- article_number?: string | null;
5248
+ booking_id?: string | null;
4533
5249
  created_at?: string;
4534
5250
  id?: string;
4535
- name: string;
4536
- notes?: string | null;
4537
- pot_size?: string | null;
4538
- price?: number | null;
4539
- quantity?: number | null;
4540
- supplier_id: string;
4541
- unit?: string;
4542
- updated_at?: string;
5251
+ is_read?: boolean;
5252
+ message: string;
5253
+ recipient_email?: string | null;
5254
+ title: string;
5255
+ type: string;
5256
+ };
5257
+ Update: {
5258
+ booking_id?: string | null;
5259
+ created_at?: string;
5260
+ id?: string;
5261
+ is_read?: boolean;
5262
+ message?: string;
5263
+ recipient_email?: string | null;
5264
+ title?: string;
5265
+ type?: string;
5266
+ };
5267
+ Relationships: [
5268
+ {
5269
+ foreignKeyName: "reception_notifications_booking_id_fkey";
5270
+ columns: ["booking_id"];
5271
+ isOneToOne: false;
5272
+ referencedRelation: "bookings";
5273
+ referencedColumns: ["id"];
5274
+ }
5275
+ ];
5276
+ };
5277
+ rooms: {
5278
+ Row: {
5279
+ capacity: number;
5280
+ color_code: string | null;
5281
+ created_at: string;
5282
+ description: string | null;
5283
+ hourly_rate: number;
5284
+ id: string;
5285
+ image_url: string | null;
5286
+ is_active: boolean;
5287
+ name: string;
5288
+ };
5289
+ Insert: {
5290
+ capacity?: number;
5291
+ color_code?: string | null;
5292
+ created_at?: string;
5293
+ description?: string | null;
5294
+ hourly_rate?: number;
5295
+ id?: string;
5296
+ image_url?: string | null;
5297
+ is_active?: boolean;
5298
+ name: string;
5299
+ };
5300
+ Update: {
5301
+ capacity?: number;
5302
+ color_code?: string | null;
5303
+ created_at?: string;
5304
+ description?: string | null;
5305
+ hourly_rate?: number;
5306
+ id?: string;
5307
+ image_url?: string | null;
5308
+ is_active?: boolean;
5309
+ name?: string;
5310
+ };
5311
+ Relationships: [];
5312
+ };
5313
+ supplier_products: {
5314
+ Row: {
5315
+ article_number: string | null;
5316
+ created_at: string;
5317
+ id: string;
5318
+ name: string;
5319
+ notes: string | null;
5320
+ pot_size: string | null;
5321
+ price: number | null;
5322
+ quantity: number | null;
5323
+ supplier_id: string;
5324
+ unit: string;
5325
+ updated_at: string;
5326
+ };
5327
+ Insert: {
5328
+ article_number?: string | null;
5329
+ created_at?: string;
5330
+ id?: string;
5331
+ name: string;
5332
+ notes?: string | null;
5333
+ pot_size?: string | null;
5334
+ price?: number | null;
5335
+ quantity?: number | null;
5336
+ supplier_id: string;
5337
+ unit?: string;
5338
+ updated_at?: string;
4543
5339
  };
4544
5340
  Update: {
4545
5341
  article_number?: string | null;
@@ -4609,6 +5405,30 @@ export type Database = {
4609
5405
  };
4610
5406
  Relationships: [];
4611
5407
  };
5408
+ tenants: {
5409
+ Row: {
5410
+ created_at: string;
5411
+ id: string;
5412
+ name: string;
5413
+ slug: string | null;
5414
+ updated_at: string;
5415
+ };
5416
+ Insert: {
5417
+ created_at?: string;
5418
+ id?: string;
5419
+ name?: string;
5420
+ slug?: string | null;
5421
+ updated_at?: string;
5422
+ };
5423
+ Update: {
5424
+ created_at?: string;
5425
+ id?: string;
5426
+ name?: string;
5427
+ slug?: string | null;
5428
+ updated_at?: string;
5429
+ };
5430
+ Relationships: [];
5431
+ };
4612
5432
  trade_item_drafts: {
4613
5433
  Row: {
4614
5434
  connection_id: string | null;
@@ -4636,6 +5456,69 @@ export type Database = {
4636
5456
  };
4637
5457
  Relationships: [];
4638
5458
  };
5459
+ twinfield_connections: {
5460
+ Row: {
5461
+ access_token: string | null;
5462
+ client_id: string;
5463
+ client_secret: string | null;
5464
+ cluster_uri: string | null;
5465
+ company_code: string | null;
5466
+ company_name: string | null;
5467
+ connected_at: string | null;
5468
+ created_at: string;
5469
+ environment: string;
5470
+ id: string;
5471
+ is_active: boolean;
5472
+ label: string | null;
5473
+ office_code: string | null;
5474
+ redirect_uri: string;
5475
+ refresh_token: string | null;
5476
+ token_expires_at: string | null;
5477
+ updated_at: string;
5478
+ user_id: string;
5479
+ };
5480
+ Insert: {
5481
+ access_token?: string | null;
5482
+ client_id: string;
5483
+ client_secret?: string | null;
5484
+ cluster_uri?: string | null;
5485
+ company_code?: string | null;
5486
+ company_name?: string | null;
5487
+ connected_at?: string | null;
5488
+ created_at?: string;
5489
+ environment: string;
5490
+ id?: string;
5491
+ is_active?: boolean;
5492
+ label?: string | null;
5493
+ office_code?: string | null;
5494
+ redirect_uri: string;
5495
+ refresh_token?: string | null;
5496
+ token_expires_at?: string | null;
5497
+ updated_at?: string;
5498
+ user_id: string;
5499
+ };
5500
+ Update: {
5501
+ access_token?: string | null;
5502
+ client_id?: string;
5503
+ client_secret?: string | null;
5504
+ cluster_uri?: string | null;
5505
+ company_code?: string | null;
5506
+ company_name?: string | null;
5507
+ connected_at?: string | null;
5508
+ created_at?: string;
5509
+ environment?: string;
5510
+ id?: string;
5511
+ is_active?: boolean;
5512
+ label?: string | null;
5513
+ office_code?: string | null;
5514
+ redirect_uri?: string;
5515
+ refresh_token?: string | null;
5516
+ token_expires_at?: string | null;
5517
+ updated_at?: string;
5518
+ user_id?: string;
5519
+ };
5520
+ Relationships: [];
5521
+ };
4639
5522
  twinfield_credentials: {
4640
5523
  Row: {
4641
5524
  administration_code: string | null;
@@ -4738,6 +5621,50 @@ export type Database = {
4738
5621
  };
4739
5622
  Relationships: [];
4740
5623
  };
5624
+ twinfield_customers_cache: {
5625
+ Row: {
5626
+ connection_id: string;
5627
+ country: string | null;
5628
+ data: Json;
5629
+ email: string | null;
5630
+ fetched_at: string;
5631
+ modified_at: string | null;
5632
+ name: string | null;
5633
+ twinfield_code: string;
5634
+ vat_number: string | null;
5635
+ };
5636
+ Insert: {
5637
+ connection_id: string;
5638
+ country?: string | null;
5639
+ data?: Json;
5640
+ email?: string | null;
5641
+ fetched_at?: string;
5642
+ modified_at?: string | null;
5643
+ name?: string | null;
5644
+ twinfield_code: string;
5645
+ vat_number?: string | null;
5646
+ };
5647
+ Update: {
5648
+ connection_id?: string;
5649
+ country?: string | null;
5650
+ data?: Json;
5651
+ email?: string | null;
5652
+ fetched_at?: string;
5653
+ modified_at?: string | null;
5654
+ name?: string | null;
5655
+ twinfield_code?: string;
5656
+ vat_number?: string | null;
5657
+ };
5658
+ Relationships: [
5659
+ {
5660
+ foreignKeyName: "twinfield_customers_cache_connection_id_fkey";
5661
+ columns: ["connection_id"];
5662
+ isOneToOne: false;
5663
+ referencedRelation: "twinfield_connections";
5664
+ referencedColumns: ["id"];
5665
+ }
5666
+ ];
5667
+ };
4741
5668
  twinfield_invoice_lines: {
4742
5669
  Row: {
4743
5670
  article_code: string | null;
@@ -4794,6 +5721,53 @@ export type Database = {
4794
5721
  }
4795
5722
  ];
4796
5723
  };
5724
+ twinfield_invoice_lines_cache_v2: {
5725
+ Row: {
5726
+ article_code: string | null;
5727
+ connection_id: string;
5728
+ data: Json;
5729
+ description: string | null;
5730
+ fetched_at: string;
5731
+ invoice_number: string;
5732
+ line_number: number;
5733
+ quantity: number | null;
5734
+ unit_price: number | null;
5735
+ vat_code: string | null;
5736
+ };
5737
+ Insert: {
5738
+ article_code?: string | null;
5739
+ connection_id: string;
5740
+ data?: Json;
5741
+ description?: string | null;
5742
+ fetched_at?: string;
5743
+ invoice_number: string;
5744
+ line_number: number;
5745
+ quantity?: number | null;
5746
+ unit_price?: number | null;
5747
+ vat_code?: string | null;
5748
+ };
5749
+ Update: {
5750
+ article_code?: string | null;
5751
+ connection_id?: string;
5752
+ data?: Json;
5753
+ description?: string | null;
5754
+ fetched_at?: string;
5755
+ invoice_number?: string;
5756
+ line_number?: number;
5757
+ quantity?: number | null;
5758
+ unit_price?: number | null;
5759
+ vat_code?: string | null;
5760
+ };
5761
+ Relationships: [
5762
+ {
5763
+ foreignKeyName: "twinfield_invoice_lines_cache_v2_connection_id_fkey";
5764
+ columns: ["connection_id"];
5765
+ isOneToOne: false;
5766
+ referencedRelation: "twinfield_connections";
5767
+ referencedColumns: ["id"];
5768
+ }
5769
+ ];
5770
+ };
4797
5771
  twinfield_invoice_settings: {
4798
5772
  Row: {
4799
5773
  created_at: string;
@@ -4950,37 +5924,370 @@ export type Database = {
4950
5924
  };
4951
5925
  Relationships: [];
4952
5926
  };
4953
- user_roles: {
5927
+ twinfield_invoices_cache_v2: {
4954
5928
  Row: {
4955
- created_at: string;
4956
- id: string;
4957
- role: Database["public"]["Enums"]["app_role"];
4958
- user_id: string;
5929
+ connection_id: string;
5930
+ currency: string | null;
5931
+ customer_code: string | null;
5932
+ data: Json;
5933
+ due_date: string | null;
5934
+ fetched_at: string;
5935
+ invoice_date: string | null;
5936
+ invoice_number: string;
5937
+ modified_at: string | null;
5938
+ status: string | null;
5939
+ total_excl: number | null;
5940
+ total_incl: number | null;
4959
5941
  };
4960
5942
  Insert: {
4961
- created_at?: string;
4962
- id?: string;
4963
- role: Database["public"]["Enums"]["app_role"];
4964
- user_id: string;
5943
+ connection_id: string;
5944
+ currency?: string | null;
5945
+ customer_code?: string | null;
5946
+ data?: Json;
5947
+ due_date?: string | null;
5948
+ fetched_at?: string;
5949
+ invoice_date?: string | null;
5950
+ invoice_number: string;
5951
+ modified_at?: string | null;
5952
+ status?: string | null;
5953
+ total_excl?: number | null;
5954
+ total_incl?: number | null;
4965
5955
  };
4966
5956
  Update: {
4967
- created_at?: string;
4968
- id?: string;
4969
- role?: Database["public"]["Enums"]["app_role"];
4970
- user_id?: string;
5957
+ connection_id?: string;
5958
+ currency?: string | null;
5959
+ customer_code?: string | null;
5960
+ data?: Json;
5961
+ due_date?: string | null;
5962
+ fetched_at?: string;
5963
+ invoice_date?: string | null;
5964
+ invoice_number?: string;
5965
+ modified_at?: string | null;
5966
+ status?: string | null;
5967
+ total_excl?: number | null;
5968
+ total_incl?: number | null;
4971
5969
  };
4972
5970
  Relationships: [
4973
5971
  {
4974
- foreignKeyName: "user_roles_user_id_fkey";
4975
- columns: ["user_id"];
5972
+ foreignKeyName: "twinfield_invoices_cache_v2_connection_id_fkey";
5973
+ columns: ["connection_id"];
4976
5974
  isOneToOne: false;
4977
- referencedRelation: "profiles";
5975
+ referencedRelation: "twinfield_connections";
4978
5976
  referencedColumns: ["id"];
4979
5977
  }
4980
5978
  ];
4981
5979
  };
4982
- };
4983
- Views: {
5980
+ twinfield_oauth_state: {
5981
+ Row: {
5982
+ created_at: string;
5983
+ environment: string;
5984
+ nonce: string | null;
5985
+ state: string;
5986
+ user_id: string;
5987
+ };
5988
+ Insert: {
5989
+ created_at?: string;
5990
+ environment: string;
5991
+ nonce?: string | null;
5992
+ state: string;
5993
+ user_id: string;
5994
+ };
5995
+ Update: {
5996
+ created_at?: string;
5997
+ environment?: string;
5998
+ nonce?: string | null;
5999
+ state?: string;
6000
+ user_id?: string;
6001
+ };
6002
+ Relationships: [];
6003
+ };
6004
+ twinfield_settings: {
6005
+ Row: {
6006
+ active_environment: string;
6007
+ id: number;
6008
+ updated_at: string;
6009
+ };
6010
+ Insert: {
6011
+ active_environment?: string;
6012
+ id?: number;
6013
+ updated_at?: string;
6014
+ };
6015
+ Update: {
6016
+ active_environment?: string;
6017
+ id?: number;
6018
+ updated_at?: string;
6019
+ };
6020
+ Relationships: [];
6021
+ };
6022
+ twinfield_sync_state: {
6023
+ Row: {
6024
+ connection_id: string;
6025
+ entity_type: string;
6026
+ last_error: string | null;
6027
+ last_modified_since: string;
6028
+ last_synced_at: string | null;
6029
+ updated_at: string;
6030
+ };
6031
+ Insert: {
6032
+ connection_id: string;
6033
+ entity_type: string;
6034
+ last_error?: string | null;
6035
+ last_modified_since?: string;
6036
+ last_synced_at?: string | null;
6037
+ updated_at?: string;
6038
+ };
6039
+ Update: {
6040
+ connection_id?: string;
6041
+ entity_type?: string;
6042
+ last_error?: string | null;
6043
+ last_modified_since?: string;
6044
+ last_synced_at?: string | null;
6045
+ updated_at?: string;
6046
+ };
6047
+ Relationships: [
6048
+ {
6049
+ foreignKeyName: "twinfield_sync_state_connection_id_fkey";
6050
+ columns: ["connection_id"];
6051
+ isOneToOne: false;
6052
+ referencedRelation: "twinfield_connections";
6053
+ referencedColumns: ["id"];
6054
+ }
6055
+ ];
6056
+ };
6057
+ twinfield_token_refresh_log: {
6058
+ Row: {
6059
+ attempted_at: string;
6060
+ connection_id: string;
6061
+ error: string | null;
6062
+ expires_at: string | null;
6063
+ id: string;
6064
+ ok: boolean;
6065
+ };
6066
+ Insert: {
6067
+ attempted_at?: string;
6068
+ connection_id: string;
6069
+ error?: string | null;
6070
+ expires_at?: string | null;
6071
+ id?: string;
6072
+ ok: boolean;
6073
+ };
6074
+ Update: {
6075
+ attempted_at?: string;
6076
+ connection_id?: string;
6077
+ error?: string | null;
6078
+ expires_at?: string | null;
6079
+ id?: string;
6080
+ ok?: boolean;
6081
+ };
6082
+ Relationships: [
6083
+ {
6084
+ foreignKeyName: "twinfield_token_refresh_log_connection_id_fkey";
6085
+ columns: ["connection_id"];
6086
+ isOneToOne: false;
6087
+ referencedRelation: "twinfield_connections";
6088
+ referencedColumns: ["id"];
6089
+ }
6090
+ ];
6091
+ };
6092
+ user_roles: {
6093
+ Row: {
6094
+ created_at: string;
6095
+ id: string;
6096
+ role: Database["public"]["Enums"]["app_role"];
6097
+ user_id: string;
6098
+ };
6099
+ Insert: {
6100
+ created_at?: string;
6101
+ id?: string;
6102
+ role: Database["public"]["Enums"]["app_role"];
6103
+ user_id: string;
6104
+ };
6105
+ Update: {
6106
+ created_at?: string;
6107
+ id?: string;
6108
+ role?: Database["public"]["Enums"]["app_role"];
6109
+ user_id?: string;
6110
+ };
6111
+ Relationships: [
6112
+ {
6113
+ foreignKeyName: "user_roles_user_id_fkey";
6114
+ columns: ["user_id"];
6115
+ isOneToOne: false;
6116
+ referencedRelation: "profiles";
6117
+ referencedColumns: ["id"];
6118
+ }
6119
+ ];
6120
+ };
6121
+ work_order_monteurs: {
6122
+ Row: {
6123
+ created_at: string;
6124
+ id: string;
6125
+ monteur_id: string;
6126
+ work_order_id: string;
6127
+ };
6128
+ Insert: {
6129
+ created_at?: string;
6130
+ id?: string;
6131
+ monteur_id: string;
6132
+ work_order_id: string;
6133
+ };
6134
+ Update: {
6135
+ created_at?: string;
6136
+ id?: string;
6137
+ monteur_id?: string;
6138
+ work_order_id?: string;
6139
+ };
6140
+ Relationships: [
6141
+ {
6142
+ foreignKeyName: "work_order_monteurs_monteur_id_fkey";
6143
+ columns: ["monteur_id"];
6144
+ isOneToOne: false;
6145
+ referencedRelation: "monteurs";
6146
+ referencedColumns: ["id"];
6147
+ },
6148
+ {
6149
+ foreignKeyName: "work_order_monteurs_work_order_id_fkey";
6150
+ columns: ["work_order_id"];
6151
+ isOneToOne: false;
6152
+ referencedRelation: "work_orders";
6153
+ referencedColumns: ["id"];
6154
+ }
6155
+ ];
6156
+ };
6157
+ work_orders: {
6158
+ Row: {
6159
+ assigned_to: string | null;
6160
+ city: string | null;
6161
+ contact_person: string | null;
6162
+ created_at: string;
6163
+ custom_fields: Json;
6164
+ customer_name: string;
6165
+ description: string;
6166
+ email: string | null;
6167
+ email_source: string | null;
6168
+ estimated_duration_hours: number | null;
6169
+ external_reference: string | null;
6170
+ follow_up_needed: boolean;
6171
+ id: string;
6172
+ mandate: string;
6173
+ mandate_budget: number;
6174
+ mandate_used: number;
6175
+ order_number: string;
6176
+ parent_work_order_id: string | null;
6177
+ pdf_url: string | null;
6178
+ phone: string | null;
6179
+ postal_code: string;
6180
+ priority: string;
6181
+ project_number: string | null;
6182
+ report_validated: boolean;
6183
+ room_number: string;
6184
+ scheduled_date: string | null;
6185
+ scheduled_end_time: string | null;
6186
+ scheduled_start_time: string | null;
6187
+ status: string;
6188
+ tenant_id: string;
6189
+ total_hours_worked: number | null;
6190
+ total_price: number | null;
6191
+ travel_time_minutes: number | null;
6192
+ updated_at: string;
6193
+ work_address: string;
6194
+ work_report: string | null;
6195
+ };
6196
+ Insert: {
6197
+ assigned_to?: string | null;
6198
+ city?: string | null;
6199
+ contact_person?: string | null;
6200
+ created_at?: string;
6201
+ custom_fields?: Json;
6202
+ customer_name?: string;
6203
+ description?: string;
6204
+ email?: string | null;
6205
+ email_source?: string | null;
6206
+ estimated_duration_hours?: number | null;
6207
+ external_reference?: string | null;
6208
+ follow_up_needed?: boolean;
6209
+ id?: string;
6210
+ mandate?: string;
6211
+ mandate_budget?: number;
6212
+ mandate_used?: number;
6213
+ order_number?: string;
6214
+ parent_work_order_id?: string | null;
6215
+ pdf_url?: string | null;
6216
+ phone?: string | null;
6217
+ postal_code?: string;
6218
+ priority?: string;
6219
+ project_number?: string | null;
6220
+ report_validated?: boolean;
6221
+ room_number?: string;
6222
+ scheduled_date?: string | null;
6223
+ scheduled_end_time?: string | null;
6224
+ scheduled_start_time?: string | null;
6225
+ status?: string;
6226
+ tenant_id: string;
6227
+ total_hours_worked?: number | null;
6228
+ total_price?: number | null;
6229
+ travel_time_minutes?: number | null;
6230
+ updated_at?: string;
6231
+ work_address?: string;
6232
+ work_report?: string | null;
6233
+ };
6234
+ Update: {
6235
+ assigned_to?: string | null;
6236
+ city?: string | null;
6237
+ contact_person?: string | null;
6238
+ created_at?: string;
6239
+ custom_fields?: Json;
6240
+ customer_name?: string;
6241
+ description?: string;
6242
+ email?: string | null;
6243
+ email_source?: string | null;
6244
+ estimated_duration_hours?: number | null;
6245
+ external_reference?: string | null;
6246
+ follow_up_needed?: boolean;
6247
+ id?: string;
6248
+ mandate?: string;
6249
+ mandate_budget?: number;
6250
+ mandate_used?: number;
6251
+ order_number?: string;
6252
+ parent_work_order_id?: string | null;
6253
+ pdf_url?: string | null;
6254
+ phone?: string | null;
6255
+ postal_code?: string;
6256
+ priority?: string;
6257
+ project_number?: string | null;
6258
+ report_validated?: boolean;
6259
+ room_number?: string;
6260
+ scheduled_date?: string | null;
6261
+ scheduled_end_time?: string | null;
6262
+ scheduled_start_time?: string | null;
6263
+ status?: string;
6264
+ tenant_id?: string;
6265
+ total_hours_worked?: number | null;
6266
+ total_price?: number | null;
6267
+ travel_time_minutes?: number | null;
6268
+ updated_at?: string;
6269
+ work_address?: string;
6270
+ work_report?: string | null;
6271
+ };
6272
+ Relationships: [
6273
+ {
6274
+ foreignKeyName: "work_orders_parent_work_order_id_fkey";
6275
+ columns: ["parent_work_order_id"];
6276
+ isOneToOne: false;
6277
+ referencedRelation: "work_orders";
6278
+ referencedColumns: ["id"];
6279
+ },
6280
+ {
6281
+ foreignKeyName: "work_orders_tenant_id_fkey";
6282
+ columns: ["tenant_id"];
6283
+ isOneToOne: false;
6284
+ referencedRelation: "tenants";
6285
+ referencedColumns: ["id"];
6286
+ }
6287
+ ];
6288
+ };
6289
+ };
6290
+ Views: {
4984
6291
  email_auth_connections_safe: {
4985
6292
  Row: {
4986
6293
  account_email: string | null;
@@ -5003,6 +6310,7 @@ export type Database = {
5003
6310
  last_verified_at: string | null;
5004
6311
  oauth_mode: string | null;
5005
6312
  provider: string | null;
6313
+ purpose_assignments: Json | null;
5006
6314
  scopes: string[] | null;
5007
6315
  smtp_host: string | null;
5008
6316
  smtp_port: number | null;
@@ -5033,6 +6341,7 @@ export type Database = {
5033
6341
  last_verified_at?: string | null;
5034
6342
  oauth_mode?: string | null;
5035
6343
  provider?: string | null;
6344
+ purpose_assignments?: Json | null;
5036
6345
  scopes?: string[] | null;
5037
6346
  smtp_host?: string | null;
5038
6347
  smtp_port?: number | null;
@@ -5063,6 +6372,7 @@ export type Database = {
5063
6372
  last_verified_at?: string | null;
5064
6373
  oauth_mode?: string | null;
5065
6374
  provider?: string | null;
6375
+ purpose_assignments?: Json | null;
5066
6376
  scopes?: string[] | null;
5067
6377
  smtp_host?: string | null;
5068
6378
  smtp_port?: number | null;
@@ -5074,6 +6384,127 @@ export type Database = {
5074
6384
  };
5075
6385
  Relationships: [];
5076
6386
  };
6387
+ external_customers_grouped: {
6388
+ Row: {
6389
+ city: string | null;
6390
+ commercial_name: string | null;
6391
+ contact_person: string | null;
6392
+ country: string | null;
6393
+ display_name: string | null;
6394
+ email: string | null;
6395
+ fetched_at: string | null;
6396
+ gln: string | null;
6397
+ group_key: string | null;
6398
+ is_active: boolean | null;
6399
+ is_merged: boolean | null;
6400
+ logo_url: string | null;
6401
+ match_key: string | null;
6402
+ phone: string | null;
6403
+ providers: string[] | null;
6404
+ source_count: number | null;
6405
+ sources: Json | null;
6406
+ vat_number: string | null;
6407
+ website: string | null;
6408
+ };
6409
+ Relationships: [];
6410
+ };
6411
+ external_customers_unified: {
6412
+ Row: {
6413
+ city: string | null;
6414
+ commercial_name: string | null;
6415
+ company_name: string | null;
6416
+ connection_id: string | null;
6417
+ contact_person: string | null;
6418
+ country: string | null;
6419
+ email: string | null;
6420
+ external_id: string | null;
6421
+ fetched_at: string | null;
6422
+ gln: string | null;
6423
+ house_number: string | null;
6424
+ is_active: boolean | null;
6425
+ is_deleted: boolean | null;
6426
+ logo_url: string | null;
6427
+ phone: string | null;
6428
+ postal_code: string | null;
6429
+ provider: string | null;
6430
+ raw: Json | null;
6431
+ status: string | null;
6432
+ street: string | null;
6433
+ vat_number: string | null;
6434
+ website: string | null;
6435
+ };
6436
+ Relationships: [];
6437
+ };
6438
+ v_external_customers_floriday: {
6439
+ Row: {
6440
+ city: string | null;
6441
+ commercial_name: string | null;
6442
+ company_name: string | null;
6443
+ connection_id: string | null;
6444
+ contact_person: string | null;
6445
+ country: string | null;
6446
+ email: string | null;
6447
+ external_id: string | null;
6448
+ fetched_at: string | null;
6449
+ gln: string | null;
6450
+ house_number: string | null;
6451
+ is_active: boolean | null;
6452
+ is_deleted: boolean | null;
6453
+ logo_url: string | null;
6454
+ phone: string | null;
6455
+ postal_code: string | null;
6456
+ provider: string | null;
6457
+ raw: Json | null;
6458
+ status: string | null;
6459
+ street: string | null;
6460
+ vat_number: string | null;
6461
+ website: string | null;
6462
+ };
6463
+ Relationships: [
6464
+ {
6465
+ foreignKeyName: "floriday_customers_cache_connection_id_fkey";
6466
+ columns: ["connection_id"];
6467
+ isOneToOne: false;
6468
+ referencedRelation: "floriday_connections";
6469
+ referencedColumns: ["id"];
6470
+ }
6471
+ ];
6472
+ };
6473
+ v_external_customers_twinfield: {
6474
+ Row: {
6475
+ city: string | null;
6476
+ commercial_name: string | null;
6477
+ company_name: string | null;
6478
+ connection_id: string | null;
6479
+ contact_person: string | null;
6480
+ country: string | null;
6481
+ email: string | null;
6482
+ external_id: string | null;
6483
+ fetched_at: string | null;
6484
+ gln: string | null;
6485
+ house_number: string | null;
6486
+ is_active: boolean | null;
6487
+ is_deleted: boolean | null;
6488
+ logo_url: string | null;
6489
+ phone: string | null;
6490
+ postal_code: string | null;
6491
+ provider: string | null;
6492
+ raw: Json | null;
6493
+ status: string | null;
6494
+ street: string | null;
6495
+ vat_number: string | null;
6496
+ website: string | null;
6497
+ };
6498
+ Relationships: [
6499
+ {
6500
+ foreignKeyName: "twinfield_customers_cache_connection_id_fkey";
6501
+ columns: ["connection_id"];
6502
+ isOneToOne: false;
6503
+ referencedRelation: "twinfield_connections";
6504
+ referencedColumns: ["id"];
6505
+ }
6506
+ ];
6507
+ };
5077
6508
  };
5078
6509
  Functions: {
5079
6510
  dashboard_list_public_schema: {
@@ -5096,6 +6527,33 @@ export type Database = {
5096
6527
  };
5097
6528
  Returns: string;
5098
6529
  };
6530
+ email_auth_fetch_message: {
6531
+ Args: {
6532
+ _connection_id: string;
6533
+ _external_id: string;
6534
+ };
6535
+ Returns: Json;
6536
+ };
6537
+ email_auth_for_purpose: {
6538
+ Args: {
6539
+ _direction: string;
6540
+ _purpose: string;
6541
+ };
6542
+ Returns: {
6543
+ account_email: string;
6544
+ display_name: string;
6545
+ id: string;
6546
+ last_error: string;
6547
+ last_verified_at: string;
6548
+ needs_reauth: boolean;
6549
+ provider: string;
6550
+ status: string;
6551
+ }[];
6552
+ };
6553
+ ensure_user_tenant: {
6554
+ Args: never;
6555
+ Returns: string;
6556
+ };
5099
6557
  exact_decrypt: {
5100
6558
  Args: {
5101
6559
  cipher: string;
@@ -5142,6 +6600,17 @@ export type Database = {
5142
6600
  preferred_warehouse_name: string;
5143
6601
  }[];
5144
6602
  };
6603
+ get_active_twinfield_public: {
6604
+ Args: never;
6605
+ Returns: {
6606
+ active_environment: string;
6607
+ company_code: string;
6608
+ company_name: string;
6609
+ connection_id: string;
6610
+ environment: string;
6611
+ office_code: string;
6612
+ }[];
6613
+ };
5145
6614
  get_floriday_cron_jobs: {
5146
6615
  Args: never;
5147
6616
  Returns: {
@@ -5157,6 +6626,37 @@ export type Database = {
5157
6626
  };
5158
6627
  Returns: Json;
5159
6628
  };
6629
+ get_room_busy_windows: {
6630
+ Args: {
6631
+ p_from: string;
6632
+ p_to: string;
6633
+ };
6634
+ Returns: {
6635
+ end_time: string;
6636
+ room_id: string;
6637
+ start_time: string;
6638
+ status: string;
6639
+ }[];
6640
+ };
6641
+ get_twinfield_cron_jobs: {
6642
+ Args: never;
6643
+ Returns: {
6644
+ active: boolean;
6645
+ jobname: string;
6646
+ schedule: string;
6647
+ url: string;
6648
+ }[];
6649
+ };
6650
+ get_user_tenant_id: {
6651
+ Args: never;
6652
+ Returns: string;
6653
+ };
6654
+ get_work_order_tenant_id: {
6655
+ Args: {
6656
+ wo_id: string;
6657
+ };
6658
+ Returns: string;
6659
+ };
5160
6660
  has_role: {
5161
6661
  Args: {
5162
6662
  _role: Database["public"]["Enums"]["app_role"];
@@ -5164,6 +6664,34 @@ export type Database = {
5164
6664
  };
5165
6665
  Returns: boolean;
5166
6666
  };
6667
+ is_authenticated: {
6668
+ Args: never;
6669
+ Returns: boolean;
6670
+ };
6671
+ is_developer: {
6672
+ Args: never;
6673
+ Returns: boolean;
6674
+ };
6675
+ next_work_order_number: {
6676
+ Args: {
6677
+ p_parent_work_order_id?: string;
6678
+ p_tenant_id: string;
6679
+ };
6680
+ Returns: string;
6681
+ };
6682
+ normalize_vat: {
6683
+ Args: {
6684
+ v: string;
6685
+ };
6686
+ Returns: string;
6687
+ };
6688
+ schedule_floriday_carriers_sync: {
6689
+ Args: {
6690
+ p_apikey: string;
6691
+ p_url: string;
6692
+ };
6693
+ Returns: number;
6694
+ };
5167
6695
  schedule_floriday_connections_sync: {
5168
6696
  Args: {
5169
6697
  p_apikey: string;
@@ -5206,6 +6734,48 @@ export type Database = {
5206
6734
  };
5207
6735
  Returns: number;
5208
6736
  };
6737
+ schedule_twinfield_customers_sync: {
6738
+ Args: {
6739
+ p_apikey: string;
6740
+ p_url: string;
6741
+ };
6742
+ Returns: number;
6743
+ } | {
6744
+ Args: {
6745
+ p_apikey: string;
6746
+ p_cron_secret?: string;
6747
+ p_url: string;
6748
+ };
6749
+ Returns: number;
6750
+ };
6751
+ schedule_twinfield_invoices_sync: {
6752
+ Args: {
6753
+ p_apikey: string;
6754
+ p_url: string;
6755
+ };
6756
+ Returns: number;
6757
+ } | {
6758
+ Args: {
6759
+ p_apikey: string;
6760
+ p_cron_secret?: string;
6761
+ p_url: string;
6762
+ };
6763
+ Returns: number;
6764
+ };
6765
+ schedule_twinfield_token_refresh: {
6766
+ Args: {
6767
+ p_apikey: string;
6768
+ p_url: string;
6769
+ };
6770
+ Returns: number;
6771
+ } | {
6772
+ Args: {
6773
+ p_apikey: string;
6774
+ p_cron_secret?: string;
6775
+ p_url: string;
6776
+ };
6777
+ Returns: number;
6778
+ };
5209
6779
  show_limit: {
5210
6780
  Args: never;
5211
6781
  Returns: number;
@@ -5216,9 +6786,21 @@ export type Database = {
5216
6786
  };
5217
6787
  Returns: string[];
5218
6788
  };
6789
+ twinfield_decrypt: {
6790
+ Args: {
6791
+ cipher: string;
6792
+ };
6793
+ Returns: string;
6794
+ };
6795
+ twinfield_encrypt: {
6796
+ Args: {
6797
+ plain: string;
6798
+ };
6799
+ Returns: string;
6800
+ };
5219
6801
  };
5220
6802
  Enums: {
5221
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer";
6803
+ app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie";
5222
6804
  exact_env: "staging" | "live";
5223
6805
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
5224
6806
  };
@@ -5279,7 +6861,7 @@ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof Defaul
5279
6861
  export declare const Constants: {
5280
6862
  readonly public: {
5281
6863
  readonly Enums: {
5282
- readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer"];
6864
+ readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer", "receptie"];
5283
6865
  readonly exact_env: readonly ["staging", "live"];
5284
6866
  readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"];
5285
6867
  };