@flowselections/floriday-afhandeling-module 1.0.6 → 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.
Files changed (33) hide show
  1. package/dist-lib/components/afhandeling/LeveringenPage.d.ts.map +1 -1
  2. package/dist-lib/components/afhandeling/LeveringenPage.js +23 -2
  3. package/dist-lib/components/afhandeling/NieuweLeveringPage.d.ts +2 -0
  4. package/dist-lib/components/afhandeling/NieuweLeveringPage.d.ts.map +1 -0
  5. package/dist-lib/components/afhandeling/NieuweLeveringPage.js +7 -0
  6. package/dist-lib/components/afhandeling/VervoerderForm.d.ts +6 -0
  7. package/dist-lib/components/afhandeling/VervoerderForm.d.ts.map +1 -0
  8. package/dist-lib/components/afhandeling/VervoerderForm.js +136 -0
  9. package/dist-lib/components/afhandeling/VervoerdersPage.d.ts +2 -0
  10. package/dist-lib/components/afhandeling/VervoerdersPage.d.ts.map +1 -0
  11. package/dist-lib/components/afhandeling/VervoerdersPage.js +41 -0
  12. package/dist-lib/index.d.ts +2 -0
  13. package/dist-lib/index.d.ts.map +1 -1
  14. package/dist-lib/index.js +6 -3
  15. package/dist-lib/integrations/supabase/auth-middleware.d.ts +3038 -234
  16. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  17. package/dist-lib/integrations/supabase/client.d.ts +3038 -234
  18. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  19. package/dist-lib/integrations/supabase/client.server.d.ts +3038 -234
  20. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  21. package/dist-lib/integrations/supabase/types.d.ts +3170 -296
  22. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  23. package/dist-lib/integrations/supabase/types.js +18 -1
  24. package/dist-lib/lib/carriers.functions.d.ts +26576 -0
  25. package/dist-lib/lib/carriers.functions.d.ts.map +1 -0
  26. package/dist-lib/lib/carriers.functions.js +131 -0
  27. package/dist-lib/lib/countries.d.ts +7 -0
  28. package/dist-lib/lib/countries.d.ts.map +1 -0
  29. package/dist-lib/lib/countries.js +47 -0
  30. package/dist-lib/lib/floriday.functions.d.ts +3040 -235
  31. package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
  32. package/dist-lib/lib/floriday.functions.js +4 -5
  33. package/package.json +8 -3
@@ -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;
@@ -229,6 +381,86 @@ export type Database = {
229
381
  };
230
382
  Relationships: [];
231
383
  };
384
+ carrier_shipping_rates: {
385
+ Row: {
386
+ carrier_id: string;
387
+ country_code: string;
388
+ created_at: string;
389
+ id: string;
390
+ price_per_trolley: number;
391
+ };
392
+ Insert: {
393
+ carrier_id: string;
394
+ country_code: string;
395
+ created_at?: string;
396
+ id?: string;
397
+ price_per_trolley: number;
398
+ };
399
+ Update: {
400
+ carrier_id?: string;
401
+ country_code?: string;
402
+ created_at?: string;
403
+ id?: string;
404
+ price_per_trolley?: number;
405
+ };
406
+ Relationships: [
407
+ {
408
+ foreignKeyName: "carrier_shipping_rates_carrier_id_fkey";
409
+ columns: ["carrier_id"];
410
+ isOneToOne: false;
411
+ referencedRelation: "carriers";
412
+ referencedColumns: ["id"];
413
+ }
414
+ ];
415
+ };
416
+ carriers: {
417
+ Row: {
418
+ address: string | null;
419
+ contact_person: string | null;
420
+ created_at: string;
421
+ delivery_days: number | null;
422
+ email: string | null;
423
+ id: string;
424
+ name: string;
425
+ notes: string | null;
426
+ phone: string | null;
427
+ signup_time_1: string | null;
428
+ signup_time_2: string | null;
429
+ updated_at: string;
430
+ user_id: string;
431
+ };
432
+ Insert: {
433
+ address?: string | null;
434
+ contact_person?: string | null;
435
+ created_at?: string;
436
+ delivery_days?: number | null;
437
+ email?: string | null;
438
+ id?: string;
439
+ name: string;
440
+ notes?: string | null;
441
+ phone?: string | null;
442
+ signup_time_1?: string | null;
443
+ signup_time_2?: string | null;
444
+ updated_at?: string;
445
+ user_id: string;
446
+ };
447
+ Update: {
448
+ address?: string | null;
449
+ contact_person?: string | null;
450
+ created_at?: string;
451
+ delivery_days?: number | null;
452
+ email?: string | null;
453
+ id?: string;
454
+ name?: string;
455
+ notes?: string | null;
456
+ phone?: string | null;
457
+ signup_time_1?: string | null;
458
+ signup_time_2?: string | null;
459
+ updated_at?: string;
460
+ user_id?: string;
461
+ };
462
+ Relationships: [];
463
+ };
232
464
  collections: {
233
465
  Row: {
234
466
  created_at: string;
@@ -958,85 +1190,403 @@ export type Database = {
958
1190
  };
959
1191
  Relationships: [];
960
1192
  };
961
- exact_account_analytics_cache: {
1193
+ email_auth_connections: {
1194
+ Row: {
1195
+ access_token_encrypted: string | null;
1196
+ account_email: string | null;
1197
+ client_id_encrypted: string | null;
1198
+ client_secret_encrypted: string | null;
1199
+ created_at: string;
1200
+ created_by: string | null;
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;
1206
+ id: string;
1207
+ imap_host: string | null;
1208
+ imap_last_uid: number | null;
1209
+ imap_password_encrypted: string | null;
1210
+ imap_port: number | null;
1211
+ imap_secure: boolean | null;
1212
+ imap_uid_validity: number | null;
1213
+ imap_username: string | null;
1214
+ is_active: boolean;
1215
+ last_error: string | null;
1216
+ last_event_at: string | null;
1217
+ last_verified_at: string | null;
1218
+ oauth_mode: string | null;
1219
+ provider: string;
1220
+ purpose_assignments: Json;
1221
+ realtime_mode: string;
1222
+ refresh_token_encrypted: string | null;
1223
+ scopes: string[] | null;
1224
+ smtp_host: string | null;
1225
+ smtp_password_encrypted: string | null;
1226
+ smtp_port: number | null;
1227
+ smtp_secure: boolean | null;
1228
+ smtp_username: string | null;
1229
+ status: string;
1230
+ token_expires_at: string | null;
1231
+ updated_at: string;
1232
+ };
1233
+ Insert: {
1234
+ access_token_encrypted?: string | null;
1235
+ account_email?: string | null;
1236
+ client_id_encrypted?: string | null;
1237
+ client_secret_encrypted?: string | null;
1238
+ created_at?: string;
1239
+ created_by?: string | null;
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;
1245
+ id?: string;
1246
+ imap_host?: string | null;
1247
+ imap_last_uid?: number | null;
1248
+ imap_password_encrypted?: string | null;
1249
+ imap_port?: number | null;
1250
+ imap_secure?: boolean | null;
1251
+ imap_uid_validity?: number | null;
1252
+ imap_username?: string | null;
1253
+ is_active?: boolean;
1254
+ last_error?: string | null;
1255
+ last_event_at?: string | null;
1256
+ last_verified_at?: string | null;
1257
+ oauth_mode?: string | null;
1258
+ provider: string;
1259
+ purpose_assignments?: Json;
1260
+ realtime_mode?: string;
1261
+ refresh_token_encrypted?: string | null;
1262
+ scopes?: string[] | null;
1263
+ smtp_host?: string | null;
1264
+ smtp_password_encrypted?: string | null;
1265
+ smtp_port?: number | null;
1266
+ smtp_secure?: boolean | null;
1267
+ smtp_username?: string | null;
1268
+ status?: string;
1269
+ token_expires_at?: string | null;
1270
+ updated_at?: string;
1271
+ };
1272
+ Update: {
1273
+ access_token_encrypted?: string | null;
1274
+ account_email?: string | null;
1275
+ client_id_encrypted?: string | null;
1276
+ client_secret_encrypted?: string | null;
1277
+ created_at?: string;
1278
+ created_by?: string | null;
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;
1284
+ id?: string;
1285
+ imap_host?: string | null;
1286
+ imap_last_uid?: number | null;
1287
+ imap_password_encrypted?: string | null;
1288
+ imap_port?: number | null;
1289
+ imap_secure?: boolean | null;
1290
+ imap_uid_validity?: number | null;
1291
+ imap_username?: string | null;
1292
+ is_active?: boolean;
1293
+ last_error?: string | null;
1294
+ last_event_at?: string | null;
1295
+ last_verified_at?: string | null;
1296
+ oauth_mode?: string | null;
1297
+ provider?: string;
1298
+ purpose_assignments?: Json;
1299
+ realtime_mode?: string;
1300
+ refresh_token_encrypted?: string | null;
1301
+ scopes?: string[] | null;
1302
+ smtp_host?: string | null;
1303
+ smtp_password_encrypted?: string | null;
1304
+ smtp_port?: number | null;
1305
+ smtp_secure?: boolean | null;
1306
+ smtp_username?: string | null;
1307
+ status?: string;
1308
+ token_expires_at?: string | null;
1309
+ updated_at?: string;
1310
+ };
1311
+ Relationships: [];
1312
+ };
1313
+ email_auth_events: {
962
1314
  Row: {
963
- account_id: string;
964
- account_name: string | null;
965
- avg_payment_days: number | null;
966
- computed_at: string;
967
1315
  connection_id: string;
968
- expires_at: string | null;
1316
+ consumed_at: string | null;
1317
+ created_at: string;
1318
+ event_type: string;
1319
+ external_id: string | null;
969
1320
  id: string;
970
- invoice_count: number | null;
971
- last_invoice_date: string | null;
972
- last_payment_date: string | null;
973
- open_balance: number | null;
974
- overdue_balance: number | null;
975
- total_revenue: number | null;
1321
+ payload: Json;
1322
+ provider: string;
1323
+ received_at: string;
976
1324
  };
977
1325
  Insert: {
978
- account_id: string;
979
- account_name?: string | null;
980
- avg_payment_days?: number | null;
981
- computed_at?: string;
982
1326
  connection_id: string;
983
- expires_at?: string | null;
1327
+ consumed_at?: string | null;
1328
+ created_at?: string;
1329
+ event_type: string;
1330
+ external_id?: string | null;
984
1331
  id?: string;
985
- invoice_count?: number | null;
986
- last_invoice_date?: string | null;
987
- last_payment_date?: string | null;
988
- open_balance?: number | null;
989
- overdue_balance?: number | null;
990
- total_revenue?: number | null;
1332
+ payload?: Json;
1333
+ provider: string;
1334
+ received_at?: string;
991
1335
  };
992
1336
  Update: {
993
- account_id?: string;
994
- account_name?: string | null;
995
- avg_payment_days?: number | null;
996
- computed_at?: string;
997
1337
  connection_id?: string;
998
- expires_at?: string | null;
1338
+ consumed_at?: string | null;
1339
+ created_at?: string;
1340
+ event_type?: string;
1341
+ external_id?: string | null;
999
1342
  id?: string;
1000
- invoice_count?: number | null;
1001
- last_invoice_date?: string | null;
1002
- last_payment_date?: string | null;
1003
- open_balance?: number | null;
1004
- overdue_balance?: number | null;
1005
- total_revenue?: number | null;
1343
+ payload?: Json;
1344
+ provider?: string;
1345
+ received_at?: string;
1006
1346
  };
1007
1347
  Relationships: [
1008
1348
  {
1009
- foreignKeyName: "exact_account_analytics_cache_connection_id_fkey";
1349
+ foreignKeyName: "email_auth_events_connection_id_fkey";
1010
1350
  columns: ["connection_id"];
1011
1351
  isOneToOne: false;
1012
- referencedRelation: "exact_connections";
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";
1013
1360
  referencedColumns: ["id"];
1014
1361
  }
1015
1362
  ];
1016
1363
  };
1017
- exact_analytics_cache: {
1364
+ email_auth_outbox: {
1018
1365
  Row: {
1019
- analytics_type: string;
1020
- avg_payment_days: number | null;
1021
- computed_at: string;
1022
- connection_id: string;
1023
- data_raw: Json | null;
1024
- expires_at: string | null;
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;
1025
1375
  id: string;
1026
- open_count: number | null;
1027
- overdue_amount: number | null;
1028
- paid_this_month: number | null;
1029
- period_key: string;
1030
- total_invoiced: number | null;
1031
- total_open: number | null;
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;
1032
1386
  };
1033
1387
  Insert: {
1034
- analytics_type: string;
1035
- avg_payment_days?: number | null;
1036
- computed_at?: string;
1037
- connection_id: string;
1038
- data_raw?: Json | null;
1039
- expires_at?: string | null;
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
+ };
1511
+ exact_account_analytics_cache: {
1512
+ Row: {
1513
+ account_id: string;
1514
+ account_name: string | null;
1515
+ avg_payment_days: number | null;
1516
+ computed_at: string;
1517
+ connection_id: string;
1518
+ expires_at: string | null;
1519
+ id: string;
1520
+ invoice_count: number | null;
1521
+ last_invoice_date: string | null;
1522
+ last_payment_date: string | null;
1523
+ open_balance: number | null;
1524
+ overdue_balance: number | null;
1525
+ total_revenue: number | null;
1526
+ };
1527
+ Insert: {
1528
+ account_id: string;
1529
+ account_name?: string | null;
1530
+ avg_payment_days?: number | null;
1531
+ computed_at?: string;
1532
+ connection_id: string;
1533
+ expires_at?: string | null;
1534
+ id?: string;
1535
+ invoice_count?: number | null;
1536
+ last_invoice_date?: string | null;
1537
+ last_payment_date?: string | null;
1538
+ open_balance?: number | null;
1539
+ overdue_balance?: number | null;
1540
+ total_revenue?: number | null;
1541
+ };
1542
+ Update: {
1543
+ account_id?: string;
1544
+ account_name?: string | null;
1545
+ avg_payment_days?: number | null;
1546
+ computed_at?: string;
1547
+ connection_id?: string;
1548
+ expires_at?: string | null;
1549
+ id?: string;
1550
+ invoice_count?: number | null;
1551
+ last_invoice_date?: string | null;
1552
+ last_payment_date?: string | null;
1553
+ open_balance?: number | null;
1554
+ overdue_balance?: number | null;
1555
+ total_revenue?: number | null;
1556
+ };
1557
+ Relationships: [
1558
+ {
1559
+ foreignKeyName: "exact_account_analytics_cache_connection_id_fkey";
1560
+ columns: ["connection_id"];
1561
+ isOneToOne: false;
1562
+ referencedRelation: "exact_connections";
1563
+ referencedColumns: ["id"];
1564
+ }
1565
+ ];
1566
+ };
1567
+ exact_analytics_cache: {
1568
+ Row: {
1569
+ analytics_type: string;
1570
+ avg_payment_days: number | null;
1571
+ computed_at: string;
1572
+ connection_id: string;
1573
+ data_raw: Json | null;
1574
+ expires_at: string | null;
1575
+ id: string;
1576
+ open_count: number | null;
1577
+ overdue_amount: number | null;
1578
+ paid_this_month: number | null;
1579
+ period_key: string;
1580
+ total_invoiced: number | null;
1581
+ total_open: number | null;
1582
+ };
1583
+ Insert: {
1584
+ analytics_type: string;
1585
+ avg_payment_days?: number | null;
1586
+ computed_at?: string;
1587
+ connection_id: string;
1588
+ data_raw?: Json | null;
1589
+ expires_at?: string | null;
1040
1590
  id?: string;
1041
1591
  open_count?: number | null;
1042
1592
  overdue_amount?: number | null;
@@ -1327,11 +1877,15 @@ export type Database = {
1327
1877
  address_line1: string | null;
1328
1878
  address_line2: string | null;
1329
1879
  balance: number | null;
1880
+ chamber_of_commerce: string | null;
1330
1881
  city: string | null;
1882
+ classification_description: string | null;
1331
1883
  connection_id: string;
1332
1884
  contact_name: string | null;
1333
1885
  country: string | null;
1886
+ created_at_exact: string | null;
1334
1887
  credit_line: number | null;
1888
+ currency: string | null;
1335
1889
  data_raw: Json | null;
1336
1890
  email: string | null;
1337
1891
  exact_id: string;
@@ -1340,12 +1894,18 @@ export type Database = {
1340
1894
  id: string;
1341
1895
  is_sales: boolean | null;
1342
1896
  is_supplier: boolean | null;
1897
+ language: string | null;
1898
+ modified_at_exact: string | null;
1899
+ payment_condition_description: string | null;
1900
+ payment_condition_sales: string | null;
1343
1901
  phone: string | null;
1344
1902
  postal_code: string | null;
1903
+ remarks: string | null;
1345
1904
  search_text: string | null;
1346
1905
  status: string | null;
1347
1906
  updated_at: string;
1348
1907
  vat_number: string | null;
1908
+ website: string | null;
1349
1909
  };
1350
1910
  Insert: {
1351
1911
  account_name?: string | null;
@@ -1353,11 +1913,15 @@ export type Database = {
1353
1913
  address_line1?: string | null;
1354
1914
  address_line2?: string | null;
1355
1915
  balance?: number | null;
1916
+ chamber_of_commerce?: string | null;
1356
1917
  city?: string | null;
1918
+ classification_description?: string | null;
1357
1919
  connection_id: string;
1358
1920
  contact_name?: string | null;
1359
1921
  country?: string | null;
1922
+ created_at_exact?: string | null;
1360
1923
  credit_line?: number | null;
1924
+ currency?: string | null;
1361
1925
  data_raw?: Json | null;
1362
1926
  email?: string | null;
1363
1927
  exact_id: string;
@@ -1366,12 +1930,18 @@ export type Database = {
1366
1930
  id?: string;
1367
1931
  is_sales?: boolean | null;
1368
1932
  is_supplier?: boolean | null;
1933
+ language?: string | null;
1934
+ modified_at_exact?: string | null;
1935
+ payment_condition_description?: string | null;
1936
+ payment_condition_sales?: string | null;
1369
1937
  phone?: string | null;
1370
1938
  postal_code?: string | null;
1939
+ remarks?: string | null;
1371
1940
  search_text?: string | null;
1372
1941
  status?: string | null;
1373
1942
  updated_at?: string;
1374
1943
  vat_number?: string | null;
1944
+ website?: string | null;
1375
1945
  };
1376
1946
  Update: {
1377
1947
  account_name?: string | null;
@@ -1379,11 +1949,15 @@ export type Database = {
1379
1949
  address_line1?: string | null;
1380
1950
  address_line2?: string | null;
1381
1951
  balance?: number | null;
1952
+ chamber_of_commerce?: string | null;
1382
1953
  city?: string | null;
1954
+ classification_description?: string | null;
1383
1955
  connection_id?: string;
1384
1956
  contact_name?: string | null;
1385
1957
  country?: string | null;
1958
+ created_at_exact?: string | null;
1386
1959
  credit_line?: number | null;
1960
+ currency?: string | null;
1387
1961
  data_raw?: Json | null;
1388
1962
  email?: string | null;
1389
1963
  exact_id?: string;
@@ -1392,12 +1966,18 @@ export type Database = {
1392
1966
  id?: string;
1393
1967
  is_sales?: boolean | null;
1394
1968
  is_supplier?: boolean | null;
1969
+ language?: string | null;
1970
+ modified_at_exact?: string | null;
1971
+ payment_condition_description?: string | null;
1972
+ payment_condition_sales?: string | null;
1395
1973
  phone?: string | null;
1396
1974
  postal_code?: string | null;
1975
+ remarks?: string | null;
1397
1976
  search_text?: string | null;
1398
1977
  status?: string | null;
1399
1978
  updated_at?: string;
1400
1979
  vat_number?: string | null;
1980
+ website?: string | null;
1401
1981
  };
1402
1982
  Relationships: [
1403
1983
  {
@@ -1541,6 +2121,7 @@ export type Database = {
1541
2121
  connection_id: string;
1542
2122
  data_raw: Json | null;
1543
2123
  due_date: string | null;
2124
+ entry_id: string | null;
1544
2125
  exact_id: string;
1545
2126
  expires_at: string | null;
1546
2127
  fetched_at: string;
@@ -1566,6 +2147,7 @@ export type Database = {
1566
2147
  connection_id: string;
1567
2148
  data_raw?: Json | null;
1568
2149
  due_date?: string | null;
2150
+ entry_id?: string | null;
1569
2151
  exact_id: string;
1570
2152
  expires_at?: string | null;
1571
2153
  fetched_at?: string;
@@ -1591,6 +2173,7 @@ export type Database = {
1591
2173
  connection_id?: string;
1592
2174
  data_raw?: Json | null;
1593
2175
  due_date?: string | null;
2176
+ entry_id?: string | null;
1594
2177
  exact_id?: string;
1595
2178
  expires_at?: string | null;
1596
2179
  fetched_at?: string;
@@ -1671,6 +2254,63 @@ export type Database = {
1671
2254
  }
1672
2255
  ];
1673
2256
  };
2257
+ exact_refresh_locks: {
2258
+ Row: {
2259
+ environment: Database["public"]["Enums"]["exact_env"];
2260
+ locked_by: string;
2261
+ locked_until: string;
2262
+ updated_at: string;
2263
+ };
2264
+ Insert: {
2265
+ environment: Database["public"]["Enums"]["exact_env"];
2266
+ locked_by: string;
2267
+ locked_until: string;
2268
+ updated_at?: string;
2269
+ };
2270
+ Update: {
2271
+ environment?: Database["public"]["Enums"]["exact_env"];
2272
+ locked_by?: string;
2273
+ locked_until?: string;
2274
+ updated_at?: string;
2275
+ };
2276
+ Relationships: [];
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
+ };
1674
2314
  exact_sync_state: {
1675
2315
  Row: {
1676
2316
  connection_id: string;
@@ -1698,62 +2338,155 @@ export type Database = {
1698
2338
  };
1699
2339
  Relationships: [];
1700
2340
  };
1701
- floricode_connection_settings: {
2341
+ external_customer_providers: {
1702
2342
  Row: {
1703
- catalog_key: string | null;
1704
- catalog_url: string;
2343
+ color: string | null;
1705
2344
  created_at: string;
1706
- id: number;
1707
- last_meta: Json | null;
1708
- last_test_at: string | null;
1709
- last_test_error: string | null;
1710
- last_test_ok: boolean | 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;
1711
2351
  updated_at: string;
1712
2352
  };
1713
2353
  Insert: {
1714
- catalog_key?: string | null;
1715
- catalog_url?: string;
2354
+ color?: string | null;
1716
2355
  created_at?: string;
1717
- id?: number;
1718
- last_meta?: Json | null;
1719
- last_test_at?: string | null;
1720
- last_test_error?: string | null;
1721
- last_test_ok?: boolean | null;
2356
+ icon?: string | null;
2357
+ is_enabled?: boolean;
2358
+ label: string;
2359
+ last_synced_at?: string | null;
2360
+ provider: string;
2361
+ sort_order?: number;
1722
2362
  updated_at?: string;
1723
2363
  };
1724
2364
  Update: {
1725
- catalog_key?: string | null;
1726
- catalog_url?: string;
2365
+ color?: string | null;
1727
2366
  created_at?: string;
1728
- id?: number;
1729
- last_meta?: Json | null;
1730
- last_test_at?: string | null;
1731
- last_test_error?: string | null;
1732
- last_test_ok?: boolean | null;
2367
+ icon?: string | null;
2368
+ is_enabled?: boolean;
2369
+ label?: string;
2370
+ last_synced_at?: string | null;
2371
+ provider?: string;
2372
+ sort_order?: number;
1733
2373
  updated_at?: string;
1734
2374
  };
1735
2375
  Relationships: [];
1736
2376
  };
1737
- floricode_records: {
2377
+ extra_categories: {
1738
2378
  Row: {
1739
- change_date_time: string | null;
1740
- data: Json;
1741
- last_synced_at: string;
1742
- record_id: string;
1743
- resource: string;
2379
+ created_at: string;
2380
+ id: string;
2381
+ name: string;
2382
+ sort_order: number;
2383
+ updated_at: string;
1744
2384
  };
1745
2385
  Insert: {
1746
- change_date_time?: string | null;
1747
- data?: Json;
1748
- last_synced_at?: string;
1749
- record_id: string;
1750
- resource: string;
2386
+ created_at?: string;
2387
+ id?: string;
2388
+ name: string;
2389
+ sort_order?: number;
2390
+ updated_at?: string;
1751
2391
  };
1752
2392
  Update: {
1753
- change_date_time?: string | null;
1754
- data?: Json;
1755
- last_synced_at?: string;
1756
- record_id?: string;
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;
2448
+ catalog_url?: string;
2449
+ created_at?: string;
2450
+ id?: number;
2451
+ last_meta?: Json | null;
2452
+ last_test_at?: string | null;
2453
+ last_test_error?: string | null;
2454
+ last_test_ok?: boolean | null;
2455
+ updated_at?: string;
2456
+ };
2457
+ Update: {
2458
+ catalog_key?: string | null;
2459
+ catalog_url?: string;
2460
+ created_at?: string;
2461
+ id?: number;
2462
+ last_meta?: Json | null;
2463
+ last_test_at?: string | null;
2464
+ last_test_error?: string | null;
2465
+ last_test_ok?: boolean | null;
2466
+ updated_at?: string;
2467
+ };
2468
+ Relationships: [];
2469
+ };
2470
+ floricode_records: {
2471
+ Row: {
2472
+ change_date_time: string | null;
2473
+ data: Json;
2474
+ last_synced_at: string;
2475
+ record_id: string;
2476
+ resource: string;
2477
+ };
2478
+ Insert: {
2479
+ change_date_time?: string | null;
2480
+ data?: Json;
2481
+ last_synced_at?: string;
2482
+ record_id: string;
2483
+ resource: string;
2484
+ };
2485
+ Update: {
2486
+ change_date_time?: string | null;
2487
+ data?: Json;
2488
+ last_synced_at?: string;
2489
+ record_id?: string;
1757
2490
  resource?: string;
1758
2491
  };
1759
2492
  Relationships: [];
@@ -1788,6 +2521,50 @@ export type Database = {
1788
2521
  };
1789
2522
  Relationships: [];
1790
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
+ };
1791
2568
  floriday_connections: {
1792
2569
  Row: {
1793
2570
  access_token: string | null;
@@ -1845,6 +2622,50 @@ export type Database = {
1845
2622
  };
1846
2623
  Relationships: [];
1847
2624
  };
2625
+ floriday_connections_cache: {
2626
+ Row: {
2627
+ buyer_organization_id: string | null;
2628
+ buyer_organization_name: string | null;
2629
+ connection_id: string;
2630
+ data: Json;
2631
+ floriday_connection_id: string;
2632
+ is_deleted: boolean;
2633
+ sequence_number: number;
2634
+ status: string | null;
2635
+ synced_at: string;
2636
+ };
2637
+ Insert: {
2638
+ buyer_organization_id?: string | null;
2639
+ buyer_organization_name?: string | null;
2640
+ connection_id: string;
2641
+ data: Json;
2642
+ floriday_connection_id: string;
2643
+ is_deleted?: boolean;
2644
+ sequence_number: number;
2645
+ status?: string | null;
2646
+ synced_at?: string;
2647
+ };
2648
+ Update: {
2649
+ buyer_organization_id?: string | null;
2650
+ buyer_organization_name?: string | null;
2651
+ connection_id?: string;
2652
+ data?: Json;
2653
+ floriday_connection_id?: string;
2654
+ is_deleted?: boolean;
2655
+ sequence_number?: number;
2656
+ status?: string | null;
2657
+ synced_at?: string;
2658
+ };
2659
+ Relationships: [
2660
+ {
2661
+ foreignKeyName: "floriday_connections_cache_connection_id_fkey";
2662
+ columns: ["connection_id"];
2663
+ isOneToOne: false;
2664
+ referencedRelation: "floriday_connections";
2665
+ referencedColumns: ["id"];
2666
+ }
2667
+ ];
2668
+ };
1848
2669
  floriday_customers_cache: {
1849
2670
  Row: {
1850
2671
  connection_id: string | null;
@@ -1931,103 +2752,255 @@ export type Database = {
1931
2752
  };
1932
2753
  Relationships: [];
1933
2754
  };
1934
- floriday_settings: {
2755
+ floriday_salesorders_cache: {
1935
2756
  Row: {
1936
- active_environment: string;
1937
- id: number;
2757
+ buyer_organization_id: string | null;
2758
+ connection_id: string;
2759
+ created_at: string;
2760
+ data: Json;
2761
+ floriday_id: string;
2762
+ is_deleted: boolean;
2763
+ sequence_number: number;
2764
+ status: string | null;
1938
2765
  updated_at: string;
1939
2766
  };
1940
2767
  Insert: {
1941
- active_environment?: string;
1942
- id?: number;
2768
+ buyer_organization_id?: string | null;
2769
+ connection_id: string;
2770
+ created_at?: string;
2771
+ data: Json;
2772
+ floriday_id: string;
2773
+ is_deleted?: boolean;
2774
+ sequence_number: number;
2775
+ status?: string | null;
1943
2776
  updated_at?: string;
1944
2777
  };
1945
2778
  Update: {
1946
- active_environment?: string;
1947
- id?: number;
2779
+ buyer_organization_id?: string | null;
2780
+ connection_id?: string;
2781
+ created_at?: string;
2782
+ data?: Json;
2783
+ floriday_id?: string;
2784
+ is_deleted?: boolean;
2785
+ sequence_number?: number;
2786
+ status?: string | null;
1948
2787
  updated_at?: string;
1949
2788
  };
1950
- Relationships: [];
2789
+ Relationships: [
2790
+ {
2791
+ foreignKeyName: "floriday_salesorders_cache_connection_id_fkey";
2792
+ columns: ["connection_id"];
2793
+ isOneToOne: false;
2794
+ referencedRelation: "floriday_connections";
2795
+ referencedColumns: ["id"];
2796
+ }
2797
+ ];
1951
2798
  };
1952
- imap_accounts: {
2799
+ floriday_settings: {
1953
2800
  Row: {
1954
- created_at: string;
1955
- email: string | null;
1956
- host: string;
1957
- id: string;
1958
- is_active: boolean;
1959
- last_test_error: string | null;
1960
- last_test_ok: boolean | null;
1961
- last_tested_at: string | null;
1962
- name: string;
1963
- password: string | null;
1964
- password_secret_name: string | null;
1965
- port: number;
2801
+ active_environment: string;
2802
+ id: number;
1966
2803
  updated_at: string;
1967
- use_tls: boolean;
1968
- username: string;
1969
2804
  };
1970
2805
  Insert: {
1971
- created_at?: string;
1972
- email?: string | null;
1973
- host: string;
1974
- id?: string;
1975
- is_active?: boolean;
1976
- last_test_error?: string | null;
1977
- last_test_ok?: boolean | null;
1978
- last_tested_at?: string | null;
1979
- name: string;
1980
- password?: string | null;
1981
- password_secret_name?: string | null;
1982
- port?: number;
2806
+ active_environment?: string;
2807
+ id?: number;
1983
2808
  updated_at?: string;
1984
- use_tls?: boolean;
1985
- username: string;
1986
2809
  };
1987
2810
  Update: {
1988
- created_at?: string;
1989
- email?: string | null;
1990
- host?: string;
1991
- id?: string;
1992
- is_active?: boolean;
1993
- last_test_error?: string | null;
1994
- last_test_ok?: boolean | null;
1995
- last_tested_at?: string | null;
1996
- name?: string;
1997
- password?: string | null;
1998
- password_secret_name?: string | null;
1999
- port?: number;
2811
+ active_environment?: string;
2812
+ id?: number;
2000
2813
  updated_at?: string;
2001
- use_tls?: boolean;
2002
- username?: string;
2003
2814
  };
2004
2815
  Relationships: [];
2005
2816
  };
2006
- imap_profiles: {
2817
+ floriday_sync_state: {
2007
2818
  Row: {
2008
- account_id: string | null;
2009
- created_at: string;
2010
- folder: string;
2011
- id: string;
2819
+ connection_id: string;
2820
+ entity_type: string;
2012
2821
  last_error: string | null;
2013
- last_polled_at: string | null;
2014
- last_uid_seen: number;
2015
- name: string;
2016
- polling_enabled: boolean;
2017
- profile_key: string;
2822
+ last_sequence_number: number;
2823
+ last_synced_at: string | null;
2018
2824
  updated_at: string;
2019
2825
  };
2020
2826
  Insert: {
2021
- account_id?: string | null;
2022
- created_at?: string;
2023
- folder?: string;
2024
- id?: string;
2827
+ connection_id: string;
2828
+ entity_type: string;
2025
2829
  last_error?: string | null;
2026
- last_polled_at?: string | null;
2027
- last_uid_seen?: number;
2028
- name: string;
2029
- polling_enabled?: boolean;
2030
- profile_key: string;
2830
+ last_sequence_number?: number;
2831
+ last_synced_at?: string | null;
2832
+ updated_at?: string;
2833
+ };
2834
+ Update: {
2835
+ connection_id?: string;
2836
+ entity_type?: string;
2837
+ last_error?: string | null;
2838
+ last_sequence_number?: number;
2839
+ last_synced_at?: string | null;
2840
+ updated_at?: string;
2841
+ };
2842
+ Relationships: [
2843
+ {
2844
+ foreignKeyName: "floriday_sync_state_connection_id_fkey";
2845
+ columns: ["connection_id"];
2846
+ isOneToOne: false;
2847
+ referencedRelation: "floriday_connections";
2848
+ referencedColumns: ["id"];
2849
+ }
2850
+ ];
2851
+ };
2852
+ floriday_token_refresh_log: {
2853
+ Row: {
2854
+ attempted_at: string;
2855
+ connection_id: string | null;
2856
+ environment: string;
2857
+ error: string | null;
2858
+ expires_at: string | null;
2859
+ id: string;
2860
+ ok: boolean;
2861
+ };
2862
+ Insert: {
2863
+ attempted_at?: string;
2864
+ connection_id?: string | null;
2865
+ environment: string;
2866
+ error?: string | null;
2867
+ expires_at?: string | null;
2868
+ id?: string;
2869
+ ok: boolean;
2870
+ };
2871
+ Update: {
2872
+ attempted_at?: string;
2873
+ connection_id?: string | null;
2874
+ environment?: string;
2875
+ error?: string | null;
2876
+ expires_at?: string | null;
2877
+ id?: string;
2878
+ ok?: boolean;
2879
+ };
2880
+ Relationships: [
2881
+ {
2882
+ foreignKeyName: "floriday_token_refresh_log_connection_id_fkey";
2883
+ columns: ["connection_id"];
2884
+ isOneToOne: false;
2885
+ referencedRelation: "floriday_connections";
2886
+ referencedColumns: ["id"];
2887
+ }
2888
+ ];
2889
+ };
2890
+ floriday_trade_items_cache: {
2891
+ Row: {
2892
+ connection_id: string;
2893
+ data: Json;
2894
+ fetched_at: string;
2895
+ floriday_id: string;
2896
+ is_deleted: boolean;
2897
+ sequence_number: number;
2898
+ };
2899
+ Insert: {
2900
+ connection_id: string;
2901
+ data?: Json;
2902
+ fetched_at?: string;
2903
+ floriday_id: string;
2904
+ is_deleted?: boolean;
2905
+ sequence_number?: number;
2906
+ };
2907
+ Update: {
2908
+ connection_id?: string;
2909
+ data?: Json;
2910
+ fetched_at?: string;
2911
+ floriday_id?: string;
2912
+ is_deleted?: boolean;
2913
+ sequence_number?: number;
2914
+ };
2915
+ Relationships: [
2916
+ {
2917
+ foreignKeyName: "floriday_trade_items_cache_connection_id_fkey";
2918
+ columns: ["connection_id"];
2919
+ isOneToOne: false;
2920
+ referencedRelation: "floriday_connections";
2921
+ referencedColumns: ["id"];
2922
+ }
2923
+ ];
2924
+ };
2925
+ imap_accounts: {
2926
+ Row: {
2927
+ created_at: string;
2928
+ email: string | null;
2929
+ host: string;
2930
+ id: string;
2931
+ is_active: boolean;
2932
+ last_test_error: string | null;
2933
+ last_test_ok: boolean | null;
2934
+ last_tested_at: string | null;
2935
+ name: string;
2936
+ password: string | null;
2937
+ password_secret_name: string | null;
2938
+ port: number;
2939
+ updated_at: string;
2940
+ use_tls: boolean;
2941
+ username: string;
2942
+ };
2943
+ Insert: {
2944
+ created_at?: string;
2945
+ email?: string | null;
2946
+ host: string;
2947
+ id?: string;
2948
+ is_active?: boolean;
2949
+ last_test_error?: string | null;
2950
+ last_test_ok?: boolean | null;
2951
+ last_tested_at?: string | null;
2952
+ name: string;
2953
+ password?: string | null;
2954
+ password_secret_name?: string | null;
2955
+ port?: number;
2956
+ updated_at?: string;
2957
+ use_tls?: boolean;
2958
+ username: string;
2959
+ };
2960
+ Update: {
2961
+ created_at?: string;
2962
+ email?: string | null;
2963
+ host?: string;
2964
+ id?: string;
2965
+ is_active?: boolean;
2966
+ last_test_error?: string | null;
2967
+ last_test_ok?: boolean | null;
2968
+ last_tested_at?: string | null;
2969
+ name?: string;
2970
+ password?: string | null;
2971
+ password_secret_name?: string | null;
2972
+ port?: number;
2973
+ updated_at?: string;
2974
+ use_tls?: boolean;
2975
+ username?: string;
2976
+ };
2977
+ Relationships: [];
2978
+ };
2979
+ imap_profiles: {
2980
+ Row: {
2981
+ account_id: string | null;
2982
+ created_at: string;
2983
+ folder: string;
2984
+ id: string;
2985
+ last_error: string | null;
2986
+ last_polled_at: string | null;
2987
+ last_uid_seen: number;
2988
+ name: string;
2989
+ polling_enabled: boolean;
2990
+ profile_key: string;
2991
+ updated_at: string;
2992
+ };
2993
+ Insert: {
2994
+ account_id?: string | null;
2995
+ created_at?: string;
2996
+ folder?: string;
2997
+ id?: string;
2998
+ last_error?: string | null;
2999
+ last_polled_at?: string | null;
3000
+ last_uid_seen?: number;
3001
+ name: string;
3002
+ polling_enabled?: boolean;
3003
+ profile_key: string;
2031
3004
  updated_at?: string;
2032
3005
  };
2033
3006
  Update: {
@@ -2128,6 +3101,105 @@ export type Database = {
2128
3101
  };
2129
3102
  Relationships: [];
2130
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
+ };
2131
3203
  locations: {
2132
3204
  Row: {
2133
3205
  created_at: string;
@@ -2158,6 +3230,7 @@ export type Database = {
2158
3230
  body_text: string | null;
2159
3231
  created_at: string;
2160
3232
  error_message: string | null;
3233
+ external_id: string | null;
2161
3234
  from_email: string | null;
2162
3235
  from_name: string | null;
2163
3236
  id: string;
@@ -2167,7 +3240,7 @@ export type Database = {
2167
3240
  received_at: string | null;
2168
3241
  status: string;
2169
3242
  subject: string | null;
2170
- uid: number;
3243
+ uid: number | null;
2171
3244
  updated_at: string;
2172
3245
  };
2173
3246
  Insert: {
@@ -2175,6 +3248,7 @@ export type Database = {
2175
3248
  body_text?: string | null;
2176
3249
  created_at?: string;
2177
3250
  error_message?: string | null;
3251
+ external_id?: string | null;
2178
3252
  from_email?: string | null;
2179
3253
  from_name?: string | null;
2180
3254
  id?: string;
@@ -2184,7 +3258,7 @@ export type Database = {
2184
3258
  received_at?: string | null;
2185
3259
  status?: string;
2186
3260
  subject?: string | null;
2187
- uid: number;
3261
+ uid?: number | null;
2188
3262
  updated_at?: string;
2189
3263
  };
2190
3264
  Update: {
@@ -2192,6 +3266,7 @@ export type Database = {
2192
3266
  body_text?: string | null;
2193
3267
  created_at?: string;
2194
3268
  error_message?: string | null;
3269
+ external_id?: string | null;
2195
3270
  from_email?: string | null;
2196
3271
  from_name?: string | null;
2197
3272
  id?: string;
@@ -2201,7 +3276,7 @@ export type Database = {
2201
3276
  received_at?: string | null;
2202
3277
  status?: string;
2203
3278
  subject?: string | null;
2204
- uid?: number;
3279
+ uid?: number | null;
2205
3280
  updated_at?: string;
2206
3281
  };
2207
3282
  Relationships: [
@@ -2484,6 +3559,62 @@ export type Database = {
2484
3559
  };
2485
3560
  Relationships: [];
2486
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
+ };
2487
3618
  notifications: {
2488
3619
  Row: {
2489
3620
  created_at: string;
@@ -3341,6 +4472,7 @@ export type Database = {
3341
4472
  email: string | null;
3342
4473
  id: string;
3343
4474
  notification_preferences: Json;
4475
+ tenant_id: string | null;
3344
4476
  updated_at: string;
3345
4477
  };
3346
4478
  Insert: {
@@ -3349,6 +4481,7 @@ export type Database = {
3349
4481
  email?: string | null;
3350
4482
  id: string;
3351
4483
  notification_preferences?: Json;
4484
+ tenant_id?: string | null;
3352
4485
  updated_at?: string;
3353
4486
  };
3354
4487
  Update: {
@@ -3357,9 +4490,18 @@ export type Database = {
3357
4490
  email?: string | null;
3358
4491
  id?: string;
3359
4492
  notification_preferences?: Json;
4493
+ tenant_id?: string | null;
3360
4494
  updated_at?: string;
3361
4495
  };
3362
- 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
+ ];
3363
4505
  };
3364
4506
  projects: {
3365
4507
  Row: {
@@ -3631,37 +4773,34 @@ export type Database = {
3631
4773
  }
3632
4774
  ];
3633
4775
  };
3634
- quote_items: {
4776
+ quote_activities: {
3635
4777
  Row: {
3636
4778
  created_at: string;
3637
- description: string;
4779
+ event_type: string;
3638
4780
  id: string;
3639
- quantity: number;
4781
+ metadata: Json;
3640
4782
  quote_id: string;
3641
- sort_order: number;
3642
- unit_price: number;
4783
+ user_id: string | null;
3643
4784
  };
3644
4785
  Insert: {
3645
4786
  created_at?: string;
3646
- description?: string;
4787
+ event_type: string;
3647
4788
  id?: string;
3648
- quantity?: number;
4789
+ metadata?: Json;
3649
4790
  quote_id: string;
3650
- sort_order?: number;
3651
- unit_price?: number;
4791
+ user_id?: string | null;
3652
4792
  };
3653
4793
  Update: {
3654
4794
  created_at?: string;
3655
- description?: string;
4795
+ event_type?: string;
3656
4796
  id?: string;
3657
- quantity?: number;
4797
+ metadata?: Json;
3658
4798
  quote_id?: string;
3659
- sort_order?: number;
3660
- unit_price?: number;
4799
+ user_id?: string | null;
3661
4800
  };
3662
4801
  Relationships: [
3663
4802
  {
3664
- foreignKeyName: "quote_items_quote_id_fkey";
4803
+ foreignKeyName: "quote_activities_quote_id_fkey";
3665
4804
  columns: ["quote_id"];
3666
4805
  isOneToOne: false;
3667
4806
  referencedRelation: "quotes";
@@ -3669,214 +4808,1752 @@ export type Database = {
3669
4808
  }
3670
4809
  ];
3671
4810
  };
3672
- quotes: {
4811
+ quote_attachments: {
3673
4812
  Row: {
3674
4813
  created_at: string;
4814
+ file_name: string;
4815
+ file_size: number | null;
4816
+ file_url: string;
3675
4817
  id: string;
3676
- notes: string | null;
3677
- prospect_id: string | null;
3678
- quote_number: string | null;
3679
- status: string;
3680
- title: string;
3681
- updated_at: string;
3682
- valid_until: string | null;
4818
+ mime_type: string | null;
4819
+ quote_id: string;
3683
4820
  };
3684
4821
  Insert: {
3685
4822
  created_at?: string;
4823
+ file_name: string;
4824
+ file_size?: number | null;
4825
+ file_url: string;
3686
4826
  id?: string;
3687
- notes?: string | null;
3688
- prospect_id?: string | null;
3689
- quote_number?: string | null;
3690
- status?: string;
3691
- title?: string;
3692
- updated_at?: string;
3693
- valid_until?: string | null;
4827
+ mime_type?: string | null;
4828
+ quote_id: string;
3694
4829
  };
3695
4830
  Update: {
3696
4831
  created_at?: string;
4832
+ file_name?: string;
4833
+ file_size?: number | null;
4834
+ file_url?: string;
3697
4835
  id?: string;
3698
- notes?: string | null;
3699
- prospect_id?: string | null;
3700
- quote_number?: string | null;
3701
- status?: string;
3702
- title?: string;
3703
- updated_at?: string;
3704
- valid_until?: string | null;
4836
+ mime_type?: string | null;
4837
+ quote_id?: string;
3705
4838
  };
3706
4839
  Relationships: [
3707
4840
  {
3708
- foreignKeyName: "quotes_prospect_id_fkey";
3709
- columns: ["prospect_id"];
4841
+ foreignKeyName: "quote_attachments_quote_id_fkey";
4842
+ columns: ["quote_id"];
3710
4843
  isOneToOne: false;
3711
- referencedRelation: "prospects";
4844
+ referencedRelation: "quotes";
3712
4845
  referencedColumns: ["id"];
3713
4846
  }
3714
4847
  ];
3715
4848
  };
3716
- supplier_products: {
4849
+ quote_field_options: {
3717
4850
  Row: {
3718
- article_number: string | null;
3719
4851
  created_at: string;
4852
+ field_id: string;
3720
4853
  id: string;
3721
- name: string;
3722
- notes: string | null;
3723
- pot_size: string | null;
3724
- price: number | null;
3725
- quantity: number | null;
3726
- supplier_id: string;
3727
- unit: string;
4854
+ label: string;
4855
+ sort_order: number;
4856
+ value: string;
4857
+ };
4858
+ Insert: {
4859
+ created_at?: string;
4860
+ field_id: string;
4861
+ id?: string;
4862
+ label: string;
4863
+ sort_order?: number;
4864
+ value: string;
4865
+ };
4866
+ Update: {
4867
+ created_at?: string;
4868
+ field_id?: string;
4869
+ id?: string;
4870
+ label?: string;
4871
+ sort_order?: number;
4872
+ value?: string;
4873
+ };
4874
+ Relationships: [
4875
+ {
4876
+ foreignKeyName: "quote_field_options_field_id_fkey";
4877
+ columns: ["field_id"];
4878
+ isOneToOne: false;
4879
+ referencedRelation: "quote_field_settings";
4880
+ referencedColumns: ["id"];
4881
+ }
4882
+ ];
4883
+ };
4884
+ quote_field_settings: {
4885
+ Row: {
4886
+ created_at: string;
4887
+ default_value: string | null;
4888
+ field_key: string;
4889
+ field_type: string;
4890
+ id: string;
4891
+ is_system: boolean;
4892
+ label: string;
4893
+ required: boolean;
4894
+ sort_order: number;
3728
4895
  updated_at: string;
4896
+ visible: boolean;
3729
4897
  };
3730
4898
  Insert: {
3731
- article_number?: string | null;
3732
4899
  created_at?: string;
4900
+ default_value?: string | null;
4901
+ field_key: string;
4902
+ field_type: string;
3733
4903
  id?: string;
3734
- name: string;
3735
- notes?: string | null;
3736
- pot_size?: string | null;
3737
- price?: number | null;
3738
- quantity?: number | null;
3739
- supplier_id: string;
3740
- unit?: string;
4904
+ is_system?: boolean;
4905
+ label: string;
4906
+ required?: boolean;
4907
+ sort_order?: number;
3741
4908
  updated_at?: string;
4909
+ visible?: boolean;
3742
4910
  };
3743
4911
  Update: {
3744
- article_number?: string | null;
3745
4912
  created_at?: string;
4913
+ default_value?: string | null;
4914
+ field_key?: string;
4915
+ field_type?: string;
3746
4916
  id?: string;
3747
- name?: string;
3748
- notes?: string | null;
3749
- pot_size?: string | null;
3750
- price?: number | null;
3751
- quantity?: number | null;
3752
- supplier_id?: string;
3753
- unit?: string;
4917
+ is_system?: boolean;
4918
+ label?: string;
4919
+ required?: boolean;
4920
+ sort_order?: number;
3754
4921
  updated_at?: string;
4922
+ visible?: boolean;
4923
+ };
4924
+ Relationships: [];
4925
+ };
4926
+ quote_items: {
4927
+ Row: {
4928
+ category: string | null;
4929
+ created_at: string;
4930
+ description: string;
4931
+ id: string;
4932
+ line_total: number;
4933
+ module_id: string | null;
4934
+ name: string | null;
4935
+ quantity: number;
4936
+ quote_id: string;
4937
+ sort_order: number;
4938
+ unit_price: number;
4939
+ };
4940
+ Insert: {
4941
+ category?: string | null;
4942
+ created_at?: string;
4943
+ description?: string;
4944
+ id?: string;
4945
+ line_total?: number;
4946
+ module_id?: string | null;
4947
+ name?: string | null;
4948
+ quantity?: number;
4949
+ quote_id: string;
4950
+ sort_order?: number;
4951
+ unit_price?: number;
4952
+ };
4953
+ Update: {
4954
+ category?: string | null;
4955
+ created_at?: string;
4956
+ description?: string;
4957
+ id?: string;
4958
+ line_total?: number;
4959
+ module_id?: string | null;
4960
+ name?: string | null;
4961
+ quantity?: number;
4962
+ quote_id?: string;
4963
+ sort_order?: number;
4964
+ unit_price?: number;
3755
4965
  };
3756
4966
  Relationships: [
3757
4967
  {
3758
- foreignKeyName: "supplier_products_supplier_id_fkey";
3759
- columns: ["supplier_id"];
4968
+ foreignKeyName: "quote_items_module_id_fkey";
4969
+ columns: ["module_id"];
3760
4970
  isOneToOne: false;
3761
- referencedRelation: "suppliers";
4971
+ referencedRelation: "quote_modules";
4972
+ referencedColumns: ["id"];
4973
+ },
4974
+ {
4975
+ foreignKeyName: "quote_items_quote_id_fkey";
4976
+ columns: ["quote_id"];
4977
+ isOneToOne: false;
4978
+ referencedRelation: "quotes";
3762
4979
  referencedColumns: ["id"];
3763
4980
  }
3764
4981
  ];
3765
4982
  };
3766
- suppliers: {
4983
+ quote_modules: {
3767
4984
  Row: {
3768
- address: string | null;
3769
- column_mappings: Json | null;
3770
- contact_person: string | null;
4985
+ category: string | null;
3771
4986
  created_at: string;
3772
- default_product_type: string;
3773
- email: string | null;
4987
+ description: string | null;
3774
4988
  id: string;
3775
- imported_file_name: string | null;
4989
+ is_active: boolean;
3776
4990
  name: string;
3777
- notes: string | null;
3778
- phone: string | null;
4991
+ price: number;
4992
+ sort_order: number;
3779
4993
  updated_at: string;
3780
4994
  };
3781
4995
  Insert: {
3782
- address?: string | null;
3783
- column_mappings?: Json | null;
3784
- contact_person?: string | null;
4996
+ category?: string | null;
3785
4997
  created_at?: string;
3786
- default_product_type?: string;
3787
- email?: string | null;
4998
+ description?: string | null;
3788
4999
  id?: string;
3789
- imported_file_name?: string | null;
5000
+ is_active?: boolean;
3790
5001
  name: string;
3791
- notes?: string | null;
3792
- phone?: string | null;
5002
+ price?: number;
5003
+ sort_order?: number;
3793
5004
  updated_at?: string;
3794
5005
  };
3795
5006
  Update: {
3796
- address?: string | null;
3797
- column_mappings?: Json | null;
3798
- contact_person?: string | null;
5007
+ category?: string | null;
3799
5008
  created_at?: string;
3800
- default_product_type?: string;
3801
- email?: string | null;
5009
+ description?: string | null;
3802
5010
  id?: string;
3803
- imported_file_name?: string | null;
5011
+ is_active?: boolean;
3804
5012
  name?: string;
3805
- notes?: string | null;
3806
- phone?: string | null;
5013
+ price?: number;
5014
+ sort_order?: number;
3807
5015
  updated_at?: string;
3808
5016
  };
3809
5017
  Relationships: [];
3810
5018
  };
3811
- trade_item_drafts: {
5019
+ quote_templates: {
3812
5020
  Row: {
3813
- connection_id: string | null;
3814
5021
  created_at: string;
3815
- data: Json;
5022
+ description: string | null;
5023
+ field_values: Json;
3816
5024
  id: string;
5025
+ is_default: boolean;
5026
+ items: Json;
5027
+ name: string;
3817
5028
  updated_at: string;
3818
- user_id: string;
5029
+ vat_rate: number;
3819
5030
  };
3820
5031
  Insert: {
3821
- connection_id?: string | null;
3822
5032
  created_at?: string;
3823
- data?: Json;
5033
+ description?: string | null;
5034
+ field_values?: Json;
3824
5035
  id?: string;
5036
+ is_default?: boolean;
5037
+ items?: Json;
5038
+ name: string;
3825
5039
  updated_at?: string;
3826
- user_id: string;
5040
+ vat_rate?: number;
3827
5041
  };
3828
5042
  Update: {
3829
- connection_id?: string | null;
3830
5043
  created_at?: string;
3831
- data?: Json;
5044
+ description?: string | null;
5045
+ field_values?: Json;
3832
5046
  id?: string;
5047
+ is_default?: boolean;
5048
+ items?: Json;
5049
+ name?: string;
3833
5050
  updated_at?: string;
3834
- user_id?: string;
5051
+ vat_rate?: number;
3835
5052
  };
3836
5053
  Relationships: [];
3837
5054
  };
3838
- user_roles: {
5055
+ quote_terms: {
3839
5056
  Row: {
5057
+ content: string | null;
3840
5058
  created_at: string;
5059
+ file_url: string | null;
3841
5060
  id: string;
3842
- role: Database["public"]["Enums"]["app_role"];
3843
- user_id: string;
5061
+ is_active: boolean;
5062
+ name: string;
5063
+ published_at: string | null;
5064
+ updated_at: string;
5065
+ version: string;
3844
5066
  };
3845
5067
  Insert: {
5068
+ content?: string | null;
3846
5069
  created_at?: string;
5070
+ file_url?: string | null;
3847
5071
  id?: string;
3848
- role: Database["public"]["Enums"]["app_role"];
3849
- user_id: string;
5072
+ is_active?: boolean;
5073
+ name: string;
5074
+ published_at?: string | null;
5075
+ updated_at?: string;
5076
+ version?: string;
3850
5077
  };
3851
5078
  Update: {
5079
+ content?: string | null;
3852
5080
  created_at?: string;
5081
+ file_url?: string | null;
3853
5082
  id?: string;
3854
- role?: Database["public"]["Enums"]["app_role"];
3855
- user_id?: string;
5083
+ is_active?: boolean;
5084
+ name?: string;
5085
+ published_at?: string | null;
5086
+ updated_at?: string;
5087
+ version?: string;
3856
5088
  };
3857
- Relationships: [
3858
- {
3859
- foreignKeyName: "user_roles_user_id_fkey";
3860
- columns: ["user_id"];
3861
- isOneToOne: false;
3862
- referencedRelation: "profiles";
3863
- referencedColumns: ["id"];
3864
- }
3865
- ];
5089
+ Relationships: [];
3866
5090
  };
3867
- };
3868
- Views: {
3869
- [_ in never]: never;
3870
- };
3871
- Functions: {
3872
- dashboard_list_public_schema: {
3873
- Args: never;
3874
- Returns: {
3875
- column_name: string;
3876
- data_type: string;
5091
+ quotes: {
5092
+ Row: {
5093
+ accepted_at: string | null;
5094
+ archived_at: string | null;
5095
+ contact_id: string | null;
5096
+ created_at: string;
5097
+ customer_id: string | null;
5098
+ discount: number;
5099
+ expires_at: string | null;
5100
+ field_values: Json;
5101
+ id: string;
5102
+ notes: string | null;
5103
+ owner_id: string | null;
5104
+ personal_message: string | null;
5105
+ project_id: string | null;
5106
+ prospect_id: string | null;
5107
+ public_token: string;
5108
+ quote_number: string | null;
5109
+ recipient_email: string | null;
5110
+ recipient_name: string | null;
5111
+ rejected_at: string | null;
5112
+ sent_at: string | null;
5113
+ status: string;
5114
+ subtotal: number;
5115
+ template_id: string | null;
5116
+ terms_id: string | null;
5117
+ title: string;
5118
+ total: number;
5119
+ updated_at: string;
5120
+ valid_until: string | null;
5121
+ vat_amount: number;
5122
+ vat_rate: number;
5123
+ viewed_at: string | null;
5124
+ };
5125
+ Insert: {
5126
+ accepted_at?: string | null;
5127
+ archived_at?: string | null;
5128
+ contact_id?: string | null;
5129
+ created_at?: string;
5130
+ customer_id?: string | null;
5131
+ discount?: number;
5132
+ expires_at?: string | null;
5133
+ field_values?: Json;
5134
+ id?: string;
5135
+ notes?: string | null;
5136
+ owner_id?: string | null;
5137
+ personal_message?: string | null;
5138
+ project_id?: string | null;
5139
+ prospect_id?: string | null;
5140
+ public_token?: string;
5141
+ quote_number?: string | null;
5142
+ recipient_email?: string | null;
5143
+ recipient_name?: string | null;
5144
+ rejected_at?: string | null;
5145
+ sent_at?: string | null;
5146
+ status?: string;
5147
+ subtotal?: number;
5148
+ template_id?: string | null;
5149
+ terms_id?: string | null;
5150
+ title?: string;
5151
+ total?: number;
5152
+ updated_at?: string;
5153
+ valid_until?: string | null;
5154
+ vat_amount?: number;
5155
+ vat_rate?: number;
5156
+ viewed_at?: string | null;
5157
+ };
5158
+ Update: {
5159
+ accepted_at?: string | null;
5160
+ archived_at?: string | null;
5161
+ contact_id?: string | null;
5162
+ created_at?: string;
5163
+ customer_id?: string | null;
5164
+ discount?: number;
5165
+ expires_at?: string | null;
5166
+ field_values?: Json;
5167
+ id?: string;
5168
+ notes?: string | null;
5169
+ owner_id?: string | null;
5170
+ personal_message?: string | null;
5171
+ project_id?: string | null;
5172
+ prospect_id?: string | null;
5173
+ public_token?: string;
5174
+ quote_number?: string | null;
5175
+ recipient_email?: string | null;
5176
+ recipient_name?: string | null;
5177
+ rejected_at?: string | null;
5178
+ sent_at?: string | null;
5179
+ status?: string;
5180
+ subtotal?: number;
5181
+ template_id?: string | null;
5182
+ terms_id?: string | null;
5183
+ title?: string;
5184
+ total?: number;
5185
+ updated_at?: string;
5186
+ valid_until?: string | null;
5187
+ vat_amount?: number;
5188
+ vat_rate?: number;
5189
+ viewed_at?: string | null;
5190
+ };
5191
+ Relationships: [
5192
+ {
5193
+ foreignKeyName: "quotes_contact_id_fkey";
5194
+ columns: ["contact_id"];
5195
+ isOneToOne: false;
5196
+ referencedRelation: "customer_contacts";
5197
+ referencedColumns: ["id"];
5198
+ },
5199
+ {
5200
+ foreignKeyName: "quotes_customer_id_fkey";
5201
+ columns: ["customer_id"];
5202
+ isOneToOne: false;
5203
+ referencedRelation: "customers";
5204
+ referencedColumns: ["id"];
5205
+ },
5206
+ {
5207
+ foreignKeyName: "quotes_project_id_fkey";
5208
+ columns: ["project_id"];
5209
+ isOneToOne: false;
5210
+ referencedRelation: "projects";
5211
+ referencedColumns: ["id"];
5212
+ },
5213
+ {
5214
+ foreignKeyName: "quotes_prospect_id_fkey";
5215
+ columns: ["prospect_id"];
5216
+ isOneToOne: false;
5217
+ referencedRelation: "prospects";
5218
+ referencedColumns: ["id"];
5219
+ },
5220
+ {
5221
+ foreignKeyName: "quotes_template_id_fkey";
5222
+ columns: ["template_id"];
5223
+ isOneToOne: false;
5224
+ referencedRelation: "quote_templates";
5225
+ referencedColumns: ["id"];
5226
+ },
5227
+ {
5228
+ foreignKeyName: "quotes_terms_id_fkey";
5229
+ columns: ["terms_id"];
5230
+ isOneToOne: false;
5231
+ referencedRelation: "quote_terms";
5232
+ referencedColumns: ["id"];
5233
+ }
5234
+ ];
5235
+ };
5236
+ reception_notifications: {
5237
+ Row: {
5238
+ booking_id: string | null;
5239
+ created_at: string;
5240
+ id: string;
5241
+ is_read: boolean;
5242
+ message: string;
5243
+ recipient_email: string | null;
5244
+ title: string;
5245
+ type: string;
5246
+ };
5247
+ Insert: {
5248
+ booking_id?: string | null;
5249
+ created_at?: string;
5250
+ id?: 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;
5339
+ };
5340
+ Update: {
5341
+ article_number?: string | null;
5342
+ created_at?: string;
5343
+ id?: string;
5344
+ name?: string;
5345
+ notes?: string | null;
5346
+ pot_size?: string | null;
5347
+ price?: number | null;
5348
+ quantity?: number | null;
5349
+ supplier_id?: string;
5350
+ unit?: string;
5351
+ updated_at?: string;
5352
+ };
5353
+ Relationships: [
5354
+ {
5355
+ foreignKeyName: "supplier_products_supplier_id_fkey";
5356
+ columns: ["supplier_id"];
5357
+ isOneToOne: false;
5358
+ referencedRelation: "suppliers";
5359
+ referencedColumns: ["id"];
5360
+ }
5361
+ ];
5362
+ };
5363
+ suppliers: {
5364
+ Row: {
5365
+ address: string | null;
5366
+ column_mappings: Json | null;
5367
+ contact_person: string | null;
5368
+ created_at: string;
5369
+ default_product_type: string;
5370
+ email: string | null;
5371
+ id: string;
5372
+ imported_file_name: string | null;
5373
+ name: string;
5374
+ notes: string | null;
5375
+ phone: string | null;
5376
+ updated_at: string;
5377
+ };
5378
+ Insert: {
5379
+ address?: string | null;
5380
+ column_mappings?: Json | null;
5381
+ contact_person?: string | null;
5382
+ created_at?: string;
5383
+ default_product_type?: string;
5384
+ email?: string | null;
5385
+ id?: string;
5386
+ imported_file_name?: string | null;
5387
+ name: string;
5388
+ notes?: string | null;
5389
+ phone?: string | null;
5390
+ updated_at?: string;
5391
+ };
5392
+ Update: {
5393
+ address?: string | null;
5394
+ column_mappings?: Json | null;
5395
+ contact_person?: string | null;
5396
+ created_at?: string;
5397
+ default_product_type?: string;
5398
+ email?: string | null;
5399
+ id?: string;
5400
+ imported_file_name?: string | null;
5401
+ name?: string;
5402
+ notes?: string | null;
5403
+ phone?: string | null;
5404
+ updated_at?: string;
5405
+ };
5406
+ Relationships: [];
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
+ };
5432
+ trade_item_drafts: {
5433
+ Row: {
5434
+ connection_id: string | null;
5435
+ created_at: string;
5436
+ data: Json;
5437
+ id: string;
5438
+ updated_at: string;
5439
+ user_id: string;
5440
+ };
5441
+ Insert: {
5442
+ connection_id?: string | null;
5443
+ created_at?: string;
5444
+ data?: Json;
5445
+ id?: string;
5446
+ updated_at?: string;
5447
+ user_id: string;
5448
+ };
5449
+ Update: {
5450
+ connection_id?: string | null;
5451
+ created_at?: string;
5452
+ data?: Json;
5453
+ id?: string;
5454
+ updated_at?: string;
5455
+ user_id?: string;
5456
+ };
5457
+ Relationships: [];
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
+ };
5522
+ twinfield_credentials: {
5523
+ Row: {
5524
+ administration_code: string | null;
5525
+ client_id: string | null;
5526
+ client_secret: string | null;
5527
+ cluster: string | null;
5528
+ connected_at: string | null;
5529
+ created_at: string;
5530
+ environment: string | null;
5531
+ id: string;
5532
+ redirect_uri: string | null;
5533
+ refresh_token: string | null;
5534
+ updated_at: string;
5535
+ user_id: string;
5536
+ };
5537
+ Insert: {
5538
+ administration_code?: string | null;
5539
+ client_id?: string | null;
5540
+ client_secret?: string | null;
5541
+ cluster?: string | null;
5542
+ connected_at?: string | null;
5543
+ created_at?: string;
5544
+ environment?: string | null;
5545
+ id?: string;
5546
+ redirect_uri?: string | null;
5547
+ refresh_token?: string | null;
5548
+ updated_at?: string;
5549
+ user_id: string;
5550
+ };
5551
+ Update: {
5552
+ administration_code?: string | null;
5553
+ client_id?: string | null;
5554
+ client_secret?: string | null;
5555
+ cluster?: string | null;
5556
+ connected_at?: string | null;
5557
+ created_at?: string;
5558
+ environment?: string | null;
5559
+ id?: string;
5560
+ redirect_uri?: string | null;
5561
+ refresh_token?: string | null;
5562
+ updated_at?: string;
5563
+ user_id?: string;
5564
+ };
5565
+ Relationships: [];
5566
+ };
5567
+ twinfield_customers: {
5568
+ Row: {
5569
+ address: string | null;
5570
+ city: string | null;
5571
+ country: string | null;
5572
+ created_at: string;
5573
+ email: string | null;
5574
+ id: string;
5575
+ last_synced_at: string | null;
5576
+ name: string;
5577
+ phone: string | null;
5578
+ postal_code: string | null;
5579
+ status: string;
5580
+ sync_error: string | null;
5581
+ sync_status: string;
5582
+ twinfield_code: string | null;
5583
+ updated_at: string;
5584
+ user_id: string;
5585
+ };
5586
+ Insert: {
5587
+ address?: string | null;
5588
+ city?: string | null;
5589
+ country?: string | null;
5590
+ created_at?: string;
5591
+ email?: string | null;
5592
+ id?: string;
5593
+ last_synced_at?: string | null;
5594
+ name: string;
5595
+ phone?: string | null;
5596
+ postal_code?: string | null;
5597
+ status?: string;
5598
+ sync_error?: string | null;
5599
+ sync_status?: string;
5600
+ twinfield_code?: string | null;
5601
+ updated_at?: string;
5602
+ user_id: string;
5603
+ };
5604
+ Update: {
5605
+ address?: string | null;
5606
+ city?: string | null;
5607
+ country?: string | null;
5608
+ created_at?: string;
5609
+ email?: string | null;
5610
+ id?: string;
5611
+ last_synced_at?: string | null;
5612
+ name?: string;
5613
+ phone?: string | null;
5614
+ postal_code?: string | null;
5615
+ status?: string;
5616
+ sync_error?: string | null;
5617
+ sync_status?: string;
5618
+ twinfield_code?: string | null;
5619
+ updated_at?: string;
5620
+ user_id?: string;
5621
+ };
5622
+ Relationships: [];
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
+ };
5668
+ twinfield_invoice_lines: {
5669
+ Row: {
5670
+ article_code: string | null;
5671
+ created_at: string;
5672
+ description: string | null;
5673
+ gl_account: string | null;
5674
+ id: string;
5675
+ invoice_id: string;
5676
+ line_number: number | null;
5677
+ line_total: number;
5678
+ quantity: number;
5679
+ unit_price: number;
5680
+ user_id: string;
5681
+ vat_code: string | null;
5682
+ vat_rate: number;
5683
+ };
5684
+ Insert: {
5685
+ article_code?: string | null;
5686
+ created_at?: string;
5687
+ description?: string | null;
5688
+ gl_account?: string | null;
5689
+ id?: string;
5690
+ invoice_id: string;
5691
+ line_number?: number | null;
5692
+ line_total?: number;
5693
+ quantity?: number;
5694
+ unit_price?: number;
5695
+ user_id: string;
5696
+ vat_code?: string | null;
5697
+ vat_rate?: number;
5698
+ };
5699
+ Update: {
5700
+ article_code?: string | null;
5701
+ created_at?: string;
5702
+ description?: string | null;
5703
+ gl_account?: string | null;
5704
+ id?: string;
5705
+ invoice_id?: string;
5706
+ line_number?: number | null;
5707
+ line_total?: number;
5708
+ quantity?: number;
5709
+ unit_price?: number;
5710
+ user_id?: string;
5711
+ vat_code?: string | null;
5712
+ vat_rate?: number;
5713
+ };
5714
+ Relationships: [
5715
+ {
5716
+ foreignKeyName: "twinfield_invoice_lines_invoice_id_fkey";
5717
+ columns: ["invoice_id"];
5718
+ isOneToOne: false;
5719
+ referencedRelation: "twinfield_invoices";
5720
+ referencedColumns: ["id"];
5721
+ }
5722
+ ];
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
+ };
5771
+ twinfield_invoice_settings: {
5772
+ Row: {
5773
+ created_at: string;
5774
+ default_gl_account: string;
5775
+ default_invoice_type: string;
5776
+ default_payment_term_days: number;
5777
+ default_vat_code: string;
5778
+ updated_at: string;
5779
+ user_id: string;
5780
+ };
5781
+ Insert: {
5782
+ created_at?: string;
5783
+ default_gl_account?: string;
5784
+ default_invoice_type?: string;
5785
+ default_payment_term_days?: number;
5786
+ default_vat_code?: string;
5787
+ updated_at?: string;
5788
+ user_id: string;
5789
+ };
5790
+ Update: {
5791
+ created_at?: string;
5792
+ default_gl_account?: string;
5793
+ default_invoice_type?: string;
5794
+ default_payment_term_days?: number;
5795
+ default_vat_code?: string;
5796
+ updated_at?: string;
5797
+ user_id?: string;
5798
+ };
5799
+ Relationships: [];
5800
+ };
5801
+ twinfield_invoice_sync_logs: {
5802
+ Row: {
5803
+ created_at: string;
5804
+ details: Json | null;
5805
+ duration_ms: number | null;
5806
+ id: string;
5807
+ invoice_lines_fetched: number | null;
5808
+ invoices_fetched: number | null;
5809
+ message: string | null;
5810
+ status: string;
5811
+ step: string | null;
5812
+ user_id: string;
5813
+ };
5814
+ Insert: {
5815
+ created_at?: string;
5816
+ details?: Json | null;
5817
+ duration_ms?: number | null;
5818
+ id?: string;
5819
+ invoice_lines_fetched?: number | null;
5820
+ invoices_fetched?: number | null;
5821
+ message?: string | null;
5822
+ status: string;
5823
+ step?: string | null;
5824
+ user_id: string;
5825
+ };
5826
+ Update: {
5827
+ created_at?: string;
5828
+ details?: Json | null;
5829
+ duration_ms?: number | null;
5830
+ id?: string;
5831
+ invoice_lines_fetched?: number | null;
5832
+ invoices_fetched?: number | null;
5833
+ message?: string | null;
5834
+ status?: string;
5835
+ step?: string | null;
5836
+ user_id?: string;
5837
+ };
5838
+ Relationships: [];
5839
+ };
5840
+ twinfield_invoices: {
5841
+ Row: {
5842
+ administration_code: string | null;
5843
+ created_at: string;
5844
+ currency: string | null;
5845
+ customer_code: string | null;
5846
+ customer_email: string | null;
5847
+ customer_name: string | null;
5848
+ customer_phone: string | null;
5849
+ due_date: string | null;
5850
+ id: string;
5851
+ invoice_date: string | null;
5852
+ last_synced_at: string;
5853
+ local_invoice_number: string | null;
5854
+ outstanding_amount: number;
5855
+ paid_amount: number;
5856
+ payment_date: string | null;
5857
+ raw_payload: Json | null;
5858
+ status: string;
5859
+ subtotal: number;
5860
+ sync_error: string | null;
5861
+ sync_status: string;
5862
+ total: number;
5863
+ twinfield_invoice_number: string;
5864
+ twinfield_transaction_number: string | null;
5865
+ updated_at: string;
5866
+ user_id: string;
5867
+ vat_amount: number;
5868
+ };
5869
+ Insert: {
5870
+ administration_code?: string | null;
5871
+ created_at?: string;
5872
+ currency?: string | null;
5873
+ customer_code?: string | null;
5874
+ customer_email?: string | null;
5875
+ customer_name?: string | null;
5876
+ customer_phone?: string | null;
5877
+ due_date?: string | null;
5878
+ id?: string;
5879
+ invoice_date?: string | null;
5880
+ last_synced_at?: string;
5881
+ local_invoice_number?: string | null;
5882
+ outstanding_amount?: number;
5883
+ paid_amount?: number;
5884
+ payment_date?: string | null;
5885
+ raw_payload?: Json | null;
5886
+ status?: string;
5887
+ subtotal?: number;
5888
+ sync_error?: string | null;
5889
+ sync_status?: string;
5890
+ total?: number;
5891
+ twinfield_invoice_number: string;
5892
+ twinfield_transaction_number?: string | null;
5893
+ updated_at?: string;
5894
+ user_id: string;
5895
+ vat_amount?: number;
5896
+ };
5897
+ Update: {
5898
+ administration_code?: string | null;
5899
+ created_at?: string;
5900
+ currency?: string | null;
5901
+ customer_code?: string | null;
5902
+ customer_email?: string | null;
5903
+ customer_name?: string | null;
5904
+ customer_phone?: string | null;
5905
+ due_date?: string | null;
5906
+ id?: string;
5907
+ invoice_date?: string | null;
5908
+ last_synced_at?: string;
5909
+ local_invoice_number?: string | null;
5910
+ outstanding_amount?: number;
5911
+ paid_amount?: number;
5912
+ payment_date?: string | null;
5913
+ raw_payload?: Json | null;
5914
+ status?: string;
5915
+ subtotal?: number;
5916
+ sync_error?: string | null;
5917
+ sync_status?: string;
5918
+ total?: number;
5919
+ twinfield_invoice_number?: string;
5920
+ twinfield_transaction_number?: string | null;
5921
+ updated_at?: string;
5922
+ user_id?: string;
5923
+ vat_amount?: number;
5924
+ };
5925
+ Relationships: [];
5926
+ };
5927
+ twinfield_invoices_cache_v2: {
5928
+ Row: {
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;
5941
+ };
5942
+ Insert: {
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;
5955
+ };
5956
+ Update: {
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;
5969
+ };
5970
+ Relationships: [
5971
+ {
5972
+ foreignKeyName: "twinfield_invoices_cache_v2_connection_id_fkey";
5973
+ columns: ["connection_id"];
5974
+ isOneToOne: false;
5975
+ referencedRelation: "twinfield_connections";
5976
+ referencedColumns: ["id"];
5977
+ }
5978
+ ];
5979
+ };
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: {
6291
+ email_auth_connections_safe: {
6292
+ Row: {
6293
+ account_email: string | null;
6294
+ created_at: string | null;
6295
+ created_by: string | null;
6296
+ display_name: string | null;
6297
+ has_access_token: boolean | null;
6298
+ has_client_id: boolean | null;
6299
+ has_client_secret: boolean | null;
6300
+ has_imap_password: boolean | null;
6301
+ has_refresh_token: boolean | null;
6302
+ has_smtp_password: boolean | null;
6303
+ id: string | null;
6304
+ imap_host: string | null;
6305
+ imap_port: number | null;
6306
+ imap_secure: boolean | null;
6307
+ imap_username: string | null;
6308
+ is_active: boolean | null;
6309
+ last_error: string | null;
6310
+ last_verified_at: string | null;
6311
+ oauth_mode: string | null;
6312
+ provider: string | null;
6313
+ purpose_assignments: Json | null;
6314
+ scopes: string[] | null;
6315
+ smtp_host: string | null;
6316
+ smtp_port: number | null;
6317
+ smtp_secure: boolean | null;
6318
+ smtp_username: string | null;
6319
+ status: string | null;
6320
+ token_expires_at: string | null;
6321
+ updated_at: string | null;
6322
+ };
6323
+ Insert: {
6324
+ account_email?: string | null;
6325
+ created_at?: string | null;
6326
+ created_by?: string | null;
6327
+ display_name?: string | null;
6328
+ has_access_token?: never;
6329
+ has_client_id?: never;
6330
+ has_client_secret?: never;
6331
+ has_imap_password?: never;
6332
+ has_refresh_token?: never;
6333
+ has_smtp_password?: never;
6334
+ id?: string | null;
6335
+ imap_host?: string | null;
6336
+ imap_port?: number | null;
6337
+ imap_secure?: boolean | null;
6338
+ imap_username?: string | null;
6339
+ is_active?: boolean | null;
6340
+ last_error?: string | null;
6341
+ last_verified_at?: string | null;
6342
+ oauth_mode?: string | null;
6343
+ provider?: string | null;
6344
+ purpose_assignments?: Json | null;
6345
+ scopes?: string[] | null;
6346
+ smtp_host?: string | null;
6347
+ smtp_port?: number | null;
6348
+ smtp_secure?: boolean | null;
6349
+ smtp_username?: string | null;
6350
+ status?: string | null;
6351
+ token_expires_at?: string | null;
6352
+ updated_at?: string | null;
6353
+ };
6354
+ Update: {
6355
+ account_email?: string | null;
6356
+ created_at?: string | null;
6357
+ created_by?: string | null;
6358
+ display_name?: string | null;
6359
+ has_access_token?: never;
6360
+ has_client_id?: never;
6361
+ has_client_secret?: never;
6362
+ has_imap_password?: never;
6363
+ has_refresh_token?: never;
6364
+ has_smtp_password?: never;
6365
+ id?: string | null;
6366
+ imap_host?: string | null;
6367
+ imap_port?: number | null;
6368
+ imap_secure?: boolean | null;
6369
+ imap_username?: string | null;
6370
+ is_active?: boolean | null;
6371
+ last_error?: string | null;
6372
+ last_verified_at?: string | null;
6373
+ oauth_mode?: string | null;
6374
+ provider?: string | null;
6375
+ purpose_assignments?: Json | null;
6376
+ scopes?: string[] | null;
6377
+ smtp_host?: string | null;
6378
+ smtp_port?: number | null;
6379
+ smtp_secure?: boolean | null;
6380
+ smtp_username?: string | null;
6381
+ status?: string | null;
6382
+ token_expires_at?: string | null;
6383
+ updated_at?: string | null;
6384
+ };
6385
+ Relationships: [];
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
+ };
6508
+ };
6509
+ Functions: {
6510
+ dashboard_list_public_schema: {
6511
+ Args: never;
6512
+ Returns: {
6513
+ column_name: string;
6514
+ data_type: string;
3877
6515
  table_name: string;
3878
6516
  }[];
3879
6517
  };
6518
+ email_auth_decrypt: {
6519
+ Args: {
6520
+ cipher: string;
6521
+ };
6522
+ Returns: string;
6523
+ };
6524
+ email_auth_encrypt: {
6525
+ Args: {
6526
+ plain: string;
6527
+ };
6528
+ Returns: string;
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
+ };
3880
6557
  exact_decrypt: {
3881
6558
  Args: {
3882
6559
  cipher: string;
@@ -3889,12 +6566,97 @@ export type Database = {
3889
6566
  };
3890
6567
  Returns: string;
3891
6568
  };
6569
+ exact_lock_environment: {
6570
+ Args: {
6571
+ _environment: string;
6572
+ };
6573
+ Returns: undefined;
6574
+ };
6575
+ exact_release_refresh_lock: {
6576
+ Args: {
6577
+ _environment: Database["public"]["Enums"]["exact_env"];
6578
+ _locked_by: string;
6579
+ };
6580
+ Returns: undefined;
6581
+ };
6582
+ exact_try_acquire_refresh_lock: {
6583
+ Args: {
6584
+ _environment: Database["public"]["Enums"]["exact_env"];
6585
+ _lease_seconds?: number;
6586
+ _locked_by?: string;
6587
+ };
6588
+ Returns: boolean;
6589
+ };
6590
+ get_active_floriday_connection_public: {
6591
+ Args: never;
6592
+ Returns: {
6593
+ active_environment: string;
6594
+ environment: string;
6595
+ gln_code: string;
6596
+ id: string;
6597
+ label: string;
6598
+ organization_name: string;
6599
+ preferred_warehouse_id: string;
6600
+ preferred_warehouse_name: string;
6601
+ }[];
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
+ };
6614
+ get_floriday_cron_jobs: {
6615
+ Args: never;
6616
+ Returns: {
6617
+ active: boolean;
6618
+ jobname: string;
6619
+ schedule: string;
6620
+ url: string;
6621
+ }[];
6622
+ };
3892
6623
  get_offer_by_link_code: {
3893
6624
  Args: {
3894
6625
  p_code: string;
3895
6626
  };
3896
6627
  Returns: Json;
3897
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
+ };
3898
6660
  has_role: {
3899
6661
  Args: {
3900
6662
  _role: Database["public"]["Enums"]["app_role"];
@@ -3902,6 +6664,48 @@ export type Database = {
3902
6664
  };
3903
6665
  Returns: boolean;
3904
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
+ };
6695
+ schedule_floriday_connections_sync: {
6696
+ Args: {
6697
+ p_apikey: string;
6698
+ p_url: string;
6699
+ };
6700
+ Returns: number;
6701
+ };
6702
+ schedule_floriday_customer_organizations_sync: {
6703
+ Args: {
6704
+ p_apikey: string;
6705
+ p_url: string;
6706
+ };
6707
+ Returns: number;
6708
+ };
3905
6709
  schedule_floriday_network_sync: {
3906
6710
  Args: {
3907
6711
  p_apikey: string;
@@ -3909,6 +6713,13 @@ export type Database = {
3909
6713
  };
3910
6714
  Returns: number;
3911
6715
  };
6716
+ schedule_floriday_salesorders_sync: {
6717
+ Args: {
6718
+ p_apikey: string;
6719
+ p_url: string;
6720
+ };
6721
+ Returns: number;
6722
+ };
3912
6723
  schedule_floriday_token_refresh: {
3913
6724
  Args: {
3914
6725
  p_apikey: string;
@@ -3916,6 +6727,55 @@ export type Database = {
3916
6727
  };
3917
6728
  Returns: number;
3918
6729
  };
6730
+ schedule_floriday_trade_items_sync: {
6731
+ Args: {
6732
+ p_apikey: string;
6733
+ p_url: string;
6734
+ };
6735
+ Returns: number;
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
+ };
3919
6779
  show_limit: {
3920
6780
  Args: never;
3921
6781
  Returns: number;
@@ -3926,10 +6786,23 @@ export type Database = {
3926
6786
  };
3927
6787
  Returns: string[];
3928
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
+ };
3929
6801
  };
3930
6802
  Enums: {
3931
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer";
6803
+ app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie";
3932
6804
  exact_env: "staging" | "live";
6805
+ quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
3933
6806
  };
3934
6807
  CompositeTypes: {
3935
6808
  [_ in never]: never;
@@ -3988,8 +6861,9 @@ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof Defaul
3988
6861
  export declare const Constants: {
3989
6862
  readonly public: {
3990
6863
  readonly Enums: {
3991
- readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer"];
6864
+ readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer", "receptie"];
3992
6865
  readonly exact_env: readonly ["staging", "live"];
6866
+ readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"];
3993
6867
  };
3994
6868
  };
3995
6869
  };