@flowselections/layout-maker 1.7.2 → 1.8.0

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 (99) hide show
  1. package/README.md +78 -1
  2. package/dist-lib/components/AfdrukKnop.d.ts +1 -1
  3. package/dist-lib/components/AfdrukKnop.js +2 -2
  4. package/dist-lib/components/AiLayoutImportDialog.js +4 -4
  5. package/dist-lib/components/BlokOntwerperPage.js +5 -5
  6. package/dist-lib/components/ComputersLijst.js +2 -2
  7. package/dist-lib/components/DocumentSettingsPanel.d.ts +2 -2
  8. package/dist-lib/components/DocumentSettingsPanel.js +3 -3
  9. package/dist-lib/components/FormaatOrientatieBar.d.ts +1 -1
  10. package/dist-lib/components/FormaatOrientatieBar.js +2 -2
  11. package/dist-lib/components/LayoutsPage.js +4 -4
  12. package/dist-lib/components/LogoBibliotheekDialog.d.ts +1 -1
  13. package/dist-lib/components/LogoBibliotheekDialog.js +2 -2
  14. package/dist-lib/components/LogosPage.d.ts +1 -1
  15. package/dist-lib/components/LogosPage.js +2 -2
  16. package/dist-lib/components/NetwerkPrintersDialog.js +2 -2
  17. package/dist-lib/components/PakbonBuilderPage.js +8 -8
  18. package/dist-lib/components/PakbonPreview.d.ts +1 -1
  19. package/dist-lib/components/PakbonPreview.js +3 -3
  20. package/dist-lib/components/PakbonSectiesPanel.d.ts +1 -1
  21. package/dist-lib/components/PakbonSectiesPanel.js +4 -4
  22. package/dist-lib/components/PrintQueuePage.d.ts.map +1 -1
  23. package/dist-lib/components/PrintQueuePage.js +7 -6
  24. package/dist-lib/components/PrinterSetupWizard.js +5 -5
  25. package/dist-lib/components/PrintersPage.js +7 -7
  26. package/dist-lib/components/ProductiebonBlokkenPanel.d.ts +1 -1
  27. package/dist-lib/components/ProductiebonBlokkenPanel.js +1 -1
  28. package/dist-lib/components/ProductiebonBuilderPage.js +6 -6
  29. package/dist-lib/components/ProductiebonPreview.d.ts +1 -1
  30. package/dist-lib/components/ProductiebonPreview.js +2 -2
  31. package/dist-lib/components/WerkplekConfiguratiePage.js +7 -7
  32. package/dist-lib/index.d.ts +62 -46
  33. package/dist-lib/index.d.ts.map +1 -1
  34. package/dist-lib/index.js +47 -47
  35. package/dist-lib/integrations/supabase/auth-attacher.js +1 -1
  36. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1600 -780
  37. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  38. package/dist-lib/integrations/supabase/client.d.ts +1 -1
  39. package/dist-lib/integrations/supabase/client.js +1 -1
  40. package/dist-lib/integrations/supabase/client.server.d.ts +1600 -780
  41. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  42. package/dist-lib/integrations/supabase/client.server.js +1 -1
  43. package/dist-lib/integrations/supabase/types.d.ts +1001 -165
  44. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  45. package/dist-lib/integrations/supabase/types.js +3 -0
  46. package/dist-lib/lib/aiLayout.functions.d.ts +1679 -859
  47. package/dist-lib/lib/aiLayout.functions.d.ts.map +1 -1
  48. package/dist-lib/lib/aiLayout.functions.js +2 -2
  49. package/dist-lib/lib/aiLayout.server.d.ts +1 -1
  50. package/dist-lib/lib/browserPrint.d.ts +1 -1
  51. package/dist-lib/lib/browserPrint.js +3 -3
  52. package/dist-lib/lib/directPrint.d.ts +1 -1
  53. package/dist-lib/lib/directPrint.js +4 -4
  54. package/dist-lib/lib/documentPdf.d.ts +1 -1
  55. package/dist-lib/lib/documentProfiles.d.ts +1 -1
  56. package/dist-lib/lib/documentProfiles.d.ts.map +1 -1
  57. package/dist-lib/lib/documentProfiles.js +3 -0
  58. package/dist-lib/lib/documentTypes.d.ts +1 -1
  59. package/dist-lib/lib/documentTypes.d.ts.map +1 -1
  60. package/dist-lib/lib/documentTypes.js +3 -0
  61. package/dist-lib/lib/formaatPrinters.js +1 -1
  62. package/dist-lib/lib/htmlNaarPdf.server.js +1 -1
  63. package/dist-lib/lib/layoutPreview.d.ts +1 -1
  64. package/dist-lib/lib/layoutPreview.js +1 -1
  65. package/dist-lib/lib/logoLibrary.js +1 -1
  66. package/dist-lib/lib/orderData.server.d.ts +2 -1
  67. package/dist-lib/lib/orderData.server.d.ts.map +1 -1
  68. package/dist-lib/lib/orderData.server.js +7 -8
  69. package/dist-lib/lib/pakbonBuilder.d.ts +1 -1
  70. package/dist-lib/lib/pakbonHtml.d.ts +1 -1
  71. package/dist-lib/lib/pakbonHtml.js +2 -2
  72. package/dist-lib/lib/printApi.d.ts +72 -1
  73. package/dist-lib/lib/printApi.d.ts.map +1 -1
  74. package/dist-lib/lib/printApi.js +155 -15
  75. package/dist-lib/lib/printQueue.server.d.ts +12 -3
  76. package/dist-lib/lib/printQueue.server.d.ts.map +1 -1
  77. package/dist-lib/lib/printQueue.server.js +66 -48
  78. package/dist-lib/lib/printService.functions.d.ts +6628 -24446
  79. package/dist-lib/lib/printService.functions.d.ts.map +1 -1
  80. package/dist-lib/lib/printService.functions.js +5 -31
  81. package/dist-lib/lib/printService.server.js +1 -1
  82. package/dist-lib/lib/productiebonBuilder.d.ts +1 -1
  83. package/dist-lib/lib/productiebonHtml.js +2 -2
  84. package/dist-lib/lib/profielHtml.js +2 -2
  85. package/dist-lib/lib/queueTick.d.ts +11 -3
  86. package/dist-lib/lib/queueTick.d.ts.map +1 -1
  87. package/dist-lib/lib/queueTick.js +68 -21
  88. package/dist-lib/lib/queueTickClient.d.ts +8 -0
  89. package/dist-lib/lib/queueTickClient.d.ts.map +1 -0
  90. package/dist-lib/lib/queueTickClient.js +37 -0
  91. package/dist-lib/lib/runnerRegistry.server.d.ts +3 -2
  92. package/dist-lib/lib/runnerRegistry.server.d.ts.map +1 -1
  93. package/dist-lib/lib/runnerRegistry.server.js +6 -8
  94. package/dist-lib/lib/supabaseClient.d.ts +1 -1
  95. package/dist-lib/lib/testpagina.js +2 -2
  96. package/dist-lib/lib/useDocumentData.d.ts +1 -1
  97. package/dist-lib/lib/useDocumentData.js +1 -1
  98. package/dist-lib/lib/useNetwerkPrinters.js +1 -1
  99. package/package.json +2 -2
@@ -895,6 +895,126 @@ export type Database = {
895
895
  };
896
896
  Relationships: [];
897
897
  };
898
+ cao_holidays: {
899
+ Row: {
900
+ created_at: string;
901
+ description: string | null;
902
+ holiday_date: string;
903
+ id: string;
904
+ updated_at: string;
905
+ };
906
+ Insert: {
907
+ created_at?: string;
908
+ description?: string | null;
909
+ holiday_date: string;
910
+ id?: string;
911
+ updated_at?: string;
912
+ };
913
+ Update: {
914
+ created_at?: string;
915
+ description?: string | null;
916
+ holiday_date?: string;
917
+ id?: string;
918
+ updated_at?: string;
919
+ };
920
+ Relationships: [];
921
+ };
922
+ cao_settings: {
923
+ Row: {
924
+ auto_break_after_hours: number;
925
+ auto_break_minutes: number;
926
+ auto_break_unpaid: boolean;
927
+ auto_stop_after_hours: number;
928
+ callout_fee: number;
929
+ created_at: string;
930
+ daily_regular_hours: number;
931
+ default_hourly_rate: number;
932
+ id: string;
933
+ materials_markup_percent: number;
934
+ max_daily_hours: number;
935
+ max_weekly_hours: number;
936
+ meal_allowance_amount: number;
937
+ overtime_pct_178: number;
938
+ overtime_pct_189: number;
939
+ overtime_pct_212: number;
940
+ reminder_after_hours: number;
941
+ standby_evening_amount: number;
942
+ standby_weekend_amount: number;
943
+ travel_cost_per_km: number | null;
944
+ travel_cost_threshold_km: number | null;
945
+ travel_counts_as_work: boolean;
946
+ travel_hourly_rate: number;
947
+ travel_rate_per_hour: number;
948
+ travel_threshold_minutes: number;
949
+ updated_at: string;
950
+ weekend_always_212: boolean;
951
+ window_end: string;
952
+ window_start: string;
953
+ };
954
+ Insert: {
955
+ auto_break_after_hours?: number;
956
+ auto_break_minutes?: number;
957
+ auto_break_unpaid?: boolean;
958
+ auto_stop_after_hours?: number;
959
+ callout_fee?: number;
960
+ created_at?: string;
961
+ daily_regular_hours?: number;
962
+ default_hourly_rate?: number;
963
+ id?: string;
964
+ materials_markup_percent?: number;
965
+ max_daily_hours?: number;
966
+ max_weekly_hours?: number;
967
+ meal_allowance_amount?: number;
968
+ overtime_pct_178?: number;
969
+ overtime_pct_189?: number;
970
+ overtime_pct_212?: number;
971
+ reminder_after_hours?: number;
972
+ standby_evening_amount?: number;
973
+ standby_weekend_amount?: number;
974
+ travel_cost_per_km?: number | null;
975
+ travel_cost_threshold_km?: number | null;
976
+ travel_counts_as_work?: boolean;
977
+ travel_hourly_rate?: number;
978
+ travel_rate_per_hour?: number;
979
+ travel_threshold_minutes?: number;
980
+ updated_at?: string;
981
+ weekend_always_212?: boolean;
982
+ window_end?: string;
983
+ window_start?: string;
984
+ };
985
+ Update: {
986
+ auto_break_after_hours?: number;
987
+ auto_break_minutes?: number;
988
+ auto_break_unpaid?: boolean;
989
+ auto_stop_after_hours?: number;
990
+ callout_fee?: number;
991
+ created_at?: string;
992
+ daily_regular_hours?: number;
993
+ default_hourly_rate?: number;
994
+ id?: string;
995
+ materials_markup_percent?: number;
996
+ max_daily_hours?: number;
997
+ max_weekly_hours?: number;
998
+ meal_allowance_amount?: number;
999
+ overtime_pct_178?: number;
1000
+ overtime_pct_189?: number;
1001
+ overtime_pct_212?: number;
1002
+ reminder_after_hours?: number;
1003
+ standby_evening_amount?: number;
1004
+ standby_weekend_amount?: number;
1005
+ travel_cost_per_km?: number | null;
1006
+ travel_cost_threshold_km?: number | null;
1007
+ travel_counts_as_work?: boolean;
1008
+ travel_hourly_rate?: number;
1009
+ travel_rate_per_hour?: number;
1010
+ travel_threshold_minutes?: number;
1011
+ updated_at?: string;
1012
+ weekend_always_212?: boolean;
1013
+ window_end?: string;
1014
+ window_start?: string;
1015
+ };
1016
+ Relationships: [];
1017
+ };
898
1018
  carrier_shipping_rates: {
899
1019
  Row: {
900
1020
  carrier_id: string;
@@ -7856,6 +7976,260 @@ export type Database = {
7856
7976
  };
7857
7977
  Relationships: [];
7858
7978
  };
7979
+ itk_offerte_events: {
7980
+ Row: {
7981
+ created_at: string;
7982
+ event_type: string;
7983
+ id: string;
7984
+ metadata: Json;
7985
+ offerte_id: string;
7986
+ omschrijving: string | null;
7987
+ user_id: string | null;
7988
+ };
7989
+ Insert: {
7990
+ created_at?: string;
7991
+ event_type: string;
7992
+ id?: string;
7993
+ metadata?: Json;
7994
+ offerte_id: string;
7995
+ omschrijving?: string | null;
7996
+ user_id?: string | null;
7997
+ };
7998
+ Update: {
7999
+ created_at?: string;
8000
+ event_type?: string;
8001
+ id?: string;
8002
+ metadata?: Json;
8003
+ offerte_id?: string;
8004
+ omschrijving?: string | null;
8005
+ user_id?: string | null;
8006
+ };
8007
+ Relationships: [
8008
+ {
8009
+ foreignKeyName: "itk_offerte_events_offerte_id_fkey";
8010
+ columns: ["offerte_id"];
8011
+ isOneToOne: false;
8012
+ referencedRelation: "itk_offertes";
8013
+ referencedColumns: ["id"];
8014
+ }
8015
+ ];
8016
+ };
8017
+ itk_offerte_regels: {
8018
+ Row: {
8019
+ created_at: string;
8020
+ id: string;
8021
+ line_total_cents: number;
8022
+ offerte_id: string;
8023
+ omschrijving: string;
8024
+ package_id: string | null;
8025
+ quantity: number;
8026
+ sort_order: number;
8027
+ source: string;
8028
+ unit_price_cents: number;
8029
+ updated_at: string;
8030
+ };
8031
+ Insert: {
8032
+ created_at?: string;
8033
+ id?: string;
8034
+ line_total_cents?: number;
8035
+ offerte_id: string;
8036
+ omschrijving?: string;
8037
+ package_id?: string | null;
8038
+ quantity?: number;
8039
+ sort_order?: number;
8040
+ source?: string;
8041
+ unit_price_cents?: number;
8042
+ updated_at?: string;
8043
+ };
8044
+ Update: {
8045
+ created_at?: string;
8046
+ id?: string;
8047
+ line_total_cents?: number;
8048
+ offerte_id?: string;
8049
+ omschrijving?: string;
8050
+ package_id?: string | null;
8051
+ quantity?: number;
8052
+ sort_order?: number;
8053
+ source?: string;
8054
+ unit_price_cents?: number;
8055
+ updated_at?: string;
8056
+ };
8057
+ Relationships: [
8058
+ {
8059
+ foreignKeyName: "itk_offerte_regels_offerte_id_fkey";
8060
+ columns: ["offerte_id"];
8061
+ isOneToOne: false;
8062
+ referencedRelation: "itk_offertes";
8063
+ referencedColumns: ["id"];
8064
+ },
8065
+ {
8066
+ foreignKeyName: "itk_offerte_regels_package_id_fkey";
8067
+ columns: ["package_id"];
8068
+ isOneToOne: false;
8069
+ referencedRelation: "werkbon_packages";
8070
+ referencedColumns: ["id"];
8071
+ }
8072
+ ];
8073
+ };
8074
+ itk_offerte_settings: {
8075
+ Row: {
8076
+ auto_convert_binnen_mandaat: boolean;
8077
+ created_at: string;
8078
+ default_geldigheid_dagen: number;
8079
+ default_vat_rate: number;
8080
+ id: string;
8081
+ singleton: boolean;
8082
+ updated_at: string;
8083
+ };
8084
+ Insert: {
8085
+ auto_convert_binnen_mandaat?: boolean;
8086
+ created_at?: string;
8087
+ default_geldigheid_dagen?: number;
8088
+ default_vat_rate?: number;
8089
+ id?: string;
8090
+ singleton?: boolean;
8091
+ updated_at?: string;
8092
+ };
8093
+ Update: {
8094
+ auto_convert_binnen_mandaat?: boolean;
8095
+ created_at?: string;
8096
+ default_geldigheid_dagen?: number;
8097
+ default_vat_rate?: number;
8098
+ id?: string;
8099
+ singleton?: boolean;
8100
+ updated_at?: string;
8101
+ };
8102
+ Relationships: [];
8103
+ };
8104
+ itk_offertes: {
8105
+ Row: {
8106
+ ai_generated: boolean;
8107
+ approved_at: string | null;
8108
+ binnen_mandaat: boolean;
8109
+ contact_id: string | null;
8110
+ converted_at: string | null;
8111
+ created_at: string;
8112
+ created_by: string | null;
8113
+ customer_id: string | null;
8114
+ follow_up_werkbon_id: string | null;
8115
+ id: string;
8116
+ jaar: number;
8117
+ mandaat_restant_cents: number;
8118
+ notities: string | null;
8119
+ offerte_number: string | null;
8120
+ omschrijving: string;
8121
+ rejected_at: string | null;
8122
+ sent_at: string | null;
8123
+ status: string;
8124
+ subtotal_cents: number;
8125
+ total_cents: number;
8126
+ updated_at: string;
8127
+ valid_until: string | null;
8128
+ vat_cents: number;
8129
+ vat_rate: number;
8130
+ viewed_at: string | null;
8131
+ volgnummer: number | null;
8132
+ werkbon_id: string | null;
8133
+ work_location_id: string | null;
8134
+ };
8135
+ Insert: {
8136
+ ai_generated?: boolean;
8137
+ approved_at?: string | null;
8138
+ binnen_mandaat?: boolean;
8139
+ contact_id?: string | null;
8140
+ converted_at?: string | null;
8141
+ created_at?: string;
8142
+ created_by?: string | null;
8143
+ customer_id?: string | null;
8144
+ follow_up_werkbon_id?: string | null;
8145
+ id?: string;
8146
+ jaar?: number;
8147
+ mandaat_restant_cents?: number;
8148
+ notities?: string | null;
8149
+ offerte_number?: string | null;
8150
+ omschrijving?: string;
8151
+ rejected_at?: string | null;
8152
+ sent_at?: string | null;
8153
+ status?: string;
8154
+ subtotal_cents?: number;
8155
+ total_cents?: number;
8156
+ updated_at?: string;
8157
+ valid_until?: string | null;
8158
+ vat_cents?: number;
8159
+ vat_rate?: number;
8160
+ viewed_at?: string | null;
8161
+ volgnummer?: number | null;
8162
+ werkbon_id?: string | null;
8163
+ work_location_id?: string | null;
8164
+ };
8165
+ Update: {
8166
+ ai_generated?: boolean;
8167
+ approved_at?: string | null;
8168
+ binnen_mandaat?: boolean;
8169
+ contact_id?: string | null;
8170
+ converted_at?: string | null;
8171
+ created_at?: string;
8172
+ created_by?: string | null;
8173
+ customer_id?: string | null;
8174
+ follow_up_werkbon_id?: string | null;
8175
+ id?: string;
8176
+ jaar?: number;
8177
+ mandaat_restant_cents?: number;
8178
+ notities?: string | null;
8179
+ offerte_number?: string | null;
8180
+ omschrijving?: string;
8181
+ rejected_at?: string | null;
8182
+ sent_at?: string | null;
8183
+ status?: string;
8184
+ subtotal_cents?: number;
8185
+ total_cents?: number;
8186
+ updated_at?: string;
8187
+ valid_until?: string | null;
8188
+ vat_cents?: number;
8189
+ vat_rate?: number;
8190
+ viewed_at?: string | null;
8191
+ volgnummer?: number | null;
8192
+ werkbon_id?: string | null;
8193
+ work_location_id?: string | null;
8194
+ };
8195
+ Relationships: [
8196
+ {
8197
+ foreignKeyName: "itk_offertes_contact_id_fkey";
8198
+ columns: ["contact_id"];
8199
+ isOneToOne: false;
8200
+ referencedRelation: "itk_contact_persons";
8201
+ referencedColumns: ["id"];
8202
+ },
8203
+ {
8204
+ foreignKeyName: "itk_offertes_customer_id_fkey";
8205
+ columns: ["customer_id"];
8206
+ isOneToOne: false;
8207
+ referencedRelation: "itk_customers";
8208
+ referencedColumns: ["id"];
8209
+ },
8210
+ {
8211
+ foreignKeyName: "itk_offertes_follow_up_werkbon_id_fkey";
8212
+ columns: ["follow_up_werkbon_id"];
8213
+ isOneToOne: false;
8214
+ referencedRelation: "werkbonnen";
8215
+ referencedColumns: ["id"];
8216
+ },
8217
+ {
8218
+ foreignKeyName: "itk_offertes_werkbon_id_fkey";
8219
+ columns: ["werkbon_id"];
8220
+ isOneToOne: false;
8221
+ referencedRelation: "werkbonnen";
8222
+ referencedColumns: ["id"];
8223
+ },
8224
+ {
8225
+ foreignKeyName: "itk_offertes_work_location_id_fkey";
8226
+ columns: ["work_location_id"];
8227
+ isOneToOne: false;
8228
+ referencedRelation: "itk_work_locations";
8229
+ referencedColumns: ["id"];
8230
+ }
8231
+ ];
8232
+ };
7859
8233
  itk_work_locations: {
7860
8234
  Row: {
7861
8235
  city: string | null;
@@ -7975,7 +8349,6 @@ export type Database = {
7975
8349
  start_date: string;
7976
8350
  start_time: string | null;
7977
8351
  status: string;
7978
- tenant_id: string;
7979
8352
  updated_at: string;
7980
8353
  user_id: string;
7981
8354
  };
@@ -7993,7 +8366,6 @@ export type Database = {
7993
8366
  start_date: string;
7994
8367
  start_time?: string | null;
7995
8368
  status?: string;
7996
- tenant_id?: string;
7997
8369
  updated_at?: string;
7998
8370
  user_id: string;
7999
8371
  };
@@ -8011,7 +8383,6 @@ export type Database = {
8011
8383
  start_date?: string;
8012
8384
  start_time?: string | null;
8013
8385
  status?: string;
8014
- tenant_id?: string;
8015
8386
  updated_at?: string;
8016
8387
  user_id?: string;
8017
8388
  };
@@ -8020,14 +8391,14 @@ export type Database = {
8020
8391
  foreignKeyName: "leave_requests_monteur_id_fkey";
8021
8392
  columns: ["monteur_id"];
8022
8393
  isOneToOne: false;
8023
- referencedRelation: "monteurs";
8394
+ referencedRelation: "profiles";
8024
8395
  referencedColumns: ["id"];
8025
8396
  },
8026
8397
  {
8027
8398
  foreignKeyName: "leave_requests_user_id_fkey";
8028
8399
  columns: ["user_id"];
8029
8400
  isOneToOne: false;
8030
- referencedRelation: "monteurs";
8401
+ referencedRelation: "profiles";
8031
8402
  referencedColumns: ["id"];
8032
8403
  }
8033
8404
  ];
@@ -10235,46 +10606,136 @@ export type Database = {
10235
10606
  };
10236
10607
  Relationships: [];
10237
10608
  };
10238
- module_permissions: {
10609
+ material_usage: {
10239
10610
  Row: {
10240
10611
  created_at: string;
10241
10612
  id: string;
10242
- module_id: string;
10243
- permission: string;
10244
- role: Database["public"]["Enums"]["app_role"];
10613
+ material_name: string;
10614
+ monteur_id: string | null;
10615
+ price_at_time: number;
10616
+ quantity_used: number;
10245
10617
  updated_at: string;
10618
+ van_inventory_id: string | null;
10619
+ work_order_id: string;
10246
10620
  };
10247
10621
  Insert: {
10248
10622
  created_at?: string;
10249
10623
  id?: string;
10250
- module_id: string;
10251
- permission: string;
10252
- role: Database["public"]["Enums"]["app_role"];
10624
+ material_name: string;
10625
+ monteur_id?: string | null;
10626
+ price_at_time?: number;
10627
+ quantity_used?: number;
10253
10628
  updated_at?: string;
10629
+ van_inventory_id?: string | null;
10630
+ work_order_id: string;
10254
10631
  };
10255
10632
  Update: {
10256
10633
  created_at?: string;
10257
10634
  id?: string;
10258
- module_id?: string;
10259
- permission?: string;
10260
- role?: Database["public"]["Enums"]["app_role"];
10635
+ material_name?: string;
10636
+ monteur_id?: string | null;
10637
+ price_at_time?: number;
10638
+ quantity_used?: number;
10261
10639
  updated_at?: string;
10640
+ van_inventory_id?: string | null;
10641
+ work_order_id?: string;
10262
10642
  };
10263
- Relationships: [];
10264
- };
10265
- module_registry: {
10266
- Row: {
10267
- created_at: string;
10268
- is_active: boolean;
10269
- last_seen_at: string;
10270
- module_id: string;
10271
- name: string;
10272
- shell_id: string | null;
10273
- sort_order: number | null;
10274
- };
10275
- Insert: {
10276
- created_at?: string;
10277
- is_active?: boolean;
10643
+ Relationships: [
10644
+ {
10645
+ foreignKeyName: "material_usage_monteur_id_fkey";
10646
+ columns: ["monteur_id"];
10647
+ isOneToOne: false;
10648
+ referencedRelation: "profiles";
10649
+ referencedColumns: ["id"];
10650
+ },
10651
+ {
10652
+ foreignKeyName: "material_usage_van_inventory_id_fkey";
10653
+ columns: ["van_inventory_id"];
10654
+ isOneToOne: false;
10655
+ referencedRelation: "van_inventories";
10656
+ referencedColumns: ["id"];
10657
+ },
10658
+ {
10659
+ foreignKeyName: "material_usage_work_order_id_fkey";
10660
+ columns: ["work_order_id"];
10661
+ isOneToOne: false;
10662
+ referencedRelation: "work_orders";
10663
+ referencedColumns: ["id"];
10664
+ }
10665
+ ];
10666
+ };
10667
+ module_features: {
10668
+ Row: {
10669
+ created_at: string;
10670
+ feature_id: string;
10671
+ id: string;
10672
+ is_active: boolean;
10673
+ last_seen_at: string;
10674
+ module_id: string;
10675
+ name: string;
10676
+ };
10677
+ Insert: {
10678
+ created_at?: string;
10679
+ feature_id: string;
10680
+ id?: string;
10681
+ is_active?: boolean;
10682
+ last_seen_at?: string;
10683
+ module_id: string;
10684
+ name: string;
10685
+ };
10686
+ Update: {
10687
+ created_at?: string;
10688
+ feature_id?: string;
10689
+ id?: string;
10690
+ is_active?: boolean;
10691
+ last_seen_at?: string;
10692
+ module_id?: string;
10693
+ name?: string;
10694
+ };
10695
+ Relationships: [];
10696
+ };
10697
+ module_permissions: {
10698
+ Row: {
10699
+ created_at: string;
10700
+ id: string;
10701
+ module_id: string;
10702
+ permission: string;
10703
+ role: Database["public"]["Enums"]["app_role"];
10704
+ updated_at: string;
10705
+ };
10706
+ Insert: {
10707
+ created_at?: string;
10708
+ id?: string;
10709
+ module_id: string;
10710
+ permission: string;
10711
+ role: Database["public"]["Enums"]["app_role"];
10712
+ updated_at?: string;
10713
+ };
10714
+ Update: {
10715
+ created_at?: string;
10716
+ id?: string;
10717
+ module_id?: string;
10718
+ permission?: string;
10719
+ role?: Database["public"]["Enums"]["app_role"];
10720
+ updated_at?: string;
10721
+ };
10722
+ Relationships: [];
10723
+ };
10724
+ module_registry: {
10725
+ Row: {
10726
+ created_at: string;
10727
+ enforce: boolean;
10728
+ is_active: boolean;
10729
+ last_seen_at: string;
10730
+ module_id: string;
10731
+ name: string;
10732
+ shell_id: string | null;
10733
+ sort_order: number | null;
10734
+ };
10735
+ Insert: {
10736
+ created_at?: string;
10737
+ enforce?: boolean;
10738
+ is_active?: boolean;
10278
10739
  last_seen_at?: string;
10279
10740
  module_id: string;
10280
10741
  name: string;
@@ -10283,6 +10744,7 @@ export type Database = {
10283
10744
  };
10284
10745
  Update: {
10285
10746
  created_at?: string;
10747
+ enforce?: boolean;
10286
10748
  is_active?: boolean;
10287
10749
  last_seen_at?: string;
10288
10750
  module_id?: string;
@@ -10343,65 +10805,6 @@ export type Database = {
10343
10805
  };
10344
10806
  Relationships: [];
10345
10807
  };
10346
- monteurs: {
10347
- Row: {
10348
- avatar_url: string | null;
10349
- color: string | null;
10350
- created_at: string;
10351
- email: string | null;
10352
- id: string;
10353
- is_active: boolean;
10354
- leave_balance_hours: number;
10355
- name: string;
10356
- persnr: number | null;
10357
- phone: string | null;
10358
- role: string;
10359
- tenant_id: string;
10360
- updated_at: string;
10361
- user_id: string | null;
10362
- };
10363
- Insert: {
10364
- avatar_url?: string | null;
10365
- color?: string | null;
10366
- created_at?: string;
10367
- email?: string | null;
10368
- id?: string;
10369
- is_active?: boolean;
10370
- leave_balance_hours?: number;
10371
- name: string;
10372
- persnr?: number | null;
10373
- phone?: string | null;
10374
- role?: string;
10375
- tenant_id: string;
10376
- updated_at?: string;
10377
- user_id?: string | null;
10378
- };
10379
- Update: {
10380
- avatar_url?: string | null;
10381
- color?: string | null;
10382
- created_at?: string;
10383
- email?: string | null;
10384
- id?: string;
10385
- is_active?: boolean;
10386
- leave_balance_hours?: number;
10387
- name?: string;
10388
- persnr?: number | null;
10389
- phone?: string | null;
10390
- role?: string;
10391
- tenant_id?: string;
10392
- updated_at?: string;
10393
- user_id?: string | null;
10394
- };
10395
- Relationships: [
10396
- {
10397
- foreignKeyName: "monteurs_tenant_id_fkey";
10398
- columns: ["tenant_id"];
10399
- isOneToOne: false;
10400
- referencedRelation: "tenants";
10401
- referencedColumns: ["id"];
10402
- }
10403
- ];
10404
- };
10405
10808
  nmbrs_component_mapping: {
10406
10809
  Row: {
10407
10810
  created_at: string;
@@ -10474,15 +10877,7 @@ export type Database = {
10474
10877
  nmbrs_employee_number?: string;
10475
10878
  updated_at?: string;
10476
10879
  };
10477
- Relationships: [
10478
- {
10479
- foreignKeyName: "nmbrs_employee_mapping_monteur_id_fkey";
10480
- columns: ["monteur_id"];
10481
- isOneToOne: true;
10482
- referencedRelation: "monteurs";
10483
- referencedColumns: ["id"];
10484
- }
10485
- ];
10880
+ Relationships: [];
10486
10881
  };
10487
10882
  nmbrs_export_lines: {
10488
10883
  Row: {
@@ -10531,13 +10926,6 @@ export type Database = {
10531
10926
  wage_code?: string;
10532
10927
  };
10533
10928
  Relationships: [
10534
- {
10535
- foreignKeyName: "nmbrs_export_lines_monteur_id_fkey";
10536
- columns: ["monteur_id"];
10537
- isOneToOne: false;
10538
- referencedRelation: "monteurs";
10539
- referencedColumns: ["id"];
10540
- },
10541
10929
  {
10542
10930
  foreignKeyName: "nmbrs_export_lines_run_id_fkey";
10543
10931
  columns: ["run_id"];
@@ -14606,6 +14994,100 @@ export type Database = {
14606
14994
  }
14607
14995
  ];
14608
14996
  };
14997
+ role_assignments: {
14998
+ Row: {
14999
+ created_at: string;
15000
+ id: string;
15001
+ role_id: string;
15002
+ user_id: string;
15003
+ };
15004
+ Insert: {
15005
+ created_at?: string;
15006
+ id?: string;
15007
+ role_id: string;
15008
+ user_id: string;
15009
+ };
15010
+ Update: {
15011
+ created_at?: string;
15012
+ id?: string;
15013
+ role_id?: string;
15014
+ user_id?: string;
15015
+ };
15016
+ Relationships: [
15017
+ {
15018
+ foreignKeyName: "role_assignments_role_id_fkey";
15019
+ columns: ["role_id"];
15020
+ isOneToOne: false;
15021
+ referencedRelation: "roles";
15022
+ referencedColumns: ["id"];
15023
+ }
15024
+ ];
15025
+ };
15026
+ role_permissions: {
15027
+ Row: {
15028
+ can_edit: boolean;
15029
+ can_view: boolean;
15030
+ feature_id: string;
15031
+ id: string;
15032
+ module_id: string;
15033
+ role_id: string;
15034
+ updated_at: string;
15035
+ };
15036
+ Insert: {
15037
+ can_edit?: boolean;
15038
+ can_view?: boolean;
15039
+ feature_id?: string;
15040
+ id?: string;
15041
+ module_id: string;
15042
+ role_id: string;
15043
+ updated_at?: string;
15044
+ };
15045
+ Update: {
15046
+ can_edit?: boolean;
15047
+ can_view?: boolean;
15048
+ feature_id?: string;
15049
+ id?: string;
15050
+ module_id?: string;
15051
+ role_id?: string;
15052
+ updated_at?: string;
15053
+ };
15054
+ Relationships: [
15055
+ {
15056
+ foreignKeyName: "role_permissions_role_id_fkey";
15057
+ columns: ["role_id"];
15058
+ isOneToOne: false;
15059
+ referencedRelation: "roles";
15060
+ referencedColumns: ["id"];
15061
+ }
15062
+ ];
15063
+ };
15064
+ roles: {
15065
+ Row: {
15066
+ created_at: string;
15067
+ id: string;
15068
+ is_protected: boolean;
15069
+ key: string;
15070
+ name: string;
15071
+ updated_at: string;
15072
+ };
15073
+ Insert: {
15074
+ created_at?: string;
15075
+ id?: string;
15076
+ is_protected?: boolean;
15077
+ key: string;
15078
+ name: string;
15079
+ updated_at?: string;
15080
+ };
15081
+ Update: {
15082
+ created_at?: string;
15083
+ id?: string;
15084
+ is_protected?: boolean;
15085
+ key?: string;
15086
+ name?: string;
15087
+ updated_at?: string;
15088
+ };
15089
+ Relationships: [];
15090
+ };
14609
15091
  rooms: {
14610
15092
  Row: {
14611
15093
  capacity: number;
@@ -14958,6 +15440,7 @@ export type Database = {
14958
15440
  type: string;
14959
15441
  updated_at: string;
14960
15442
  vereist_medewerker: boolean;
15443
+ werkplek: string | null;
14961
15444
  };
14962
15445
  Insert: {
14963
15446
  actief?: boolean;
@@ -14971,6 +15454,7 @@ export type Database = {
14971
15454
  type?: string;
14972
15455
  updated_at?: string;
14973
15456
  vereist_medewerker?: boolean;
15457
+ werkplek?: string | null;
14974
15458
  };
14975
15459
  Update: {
14976
15460
  actief?: boolean;
@@ -14984,6 +15468,7 @@ export type Database = {
14984
15468
  type?: string;
14985
15469
  updated_at?: string;
14986
15470
  vereist_medewerker?: boolean;
15471
+ werkplek?: string | null;
14987
15472
  };
14988
15473
  Relationships: [];
14989
15474
  };
@@ -15286,6 +15771,56 @@ export type Database = {
15286
15771
  };
15287
15772
  Relationships: [];
15288
15773
  };
15774
+ time_compensation_entries: {
15775
+ Row: {
15776
+ created_at: string;
15777
+ employee_id: string;
15778
+ entry_date: string;
15779
+ id: string;
15780
+ km: number;
15781
+ meal_allowance: number;
15782
+ notes: string | null;
15783
+ standby_evening: number;
15784
+ standby_weekend: number;
15785
+ tvt_change: number;
15786
+ updated_at: string;
15787
+ };
15788
+ Insert: {
15789
+ created_at?: string;
15790
+ employee_id: string;
15791
+ entry_date: string;
15792
+ id?: string;
15793
+ km?: number;
15794
+ meal_allowance?: number;
15795
+ notes?: string | null;
15796
+ standby_evening?: number;
15797
+ standby_weekend?: number;
15798
+ tvt_change?: number;
15799
+ updated_at?: string;
15800
+ };
15801
+ Update: {
15802
+ created_at?: string;
15803
+ employee_id?: string;
15804
+ entry_date?: string;
15805
+ id?: string;
15806
+ km?: number;
15807
+ meal_allowance?: number;
15808
+ notes?: string | null;
15809
+ standby_evening?: number;
15810
+ standby_weekend?: number;
15811
+ tvt_change?: number;
15812
+ updated_at?: string;
15813
+ };
15814
+ Relationships: [
15815
+ {
15816
+ foreignKeyName: "time_compensation_entries_employee_id_fkey";
15817
+ columns: ["employee_id"];
15818
+ isOneToOne: false;
15819
+ referencedRelation: "profiles";
15820
+ referencedColumns: ["id"];
15821
+ }
15822
+ ];
15823
+ };
15289
15824
  time_entries: {
15290
15825
  Row: {
15291
15826
  created_at: string;
@@ -15320,68 +15855,174 @@ export type Database = {
15320
15855
  undertime?: number;
15321
15856
  updated_at?: string;
15322
15857
  };
15858
+ Relationships: [];
15859
+ };
15860
+ time_log_week_approvals: {
15861
+ Row: {
15862
+ approved_at: string | null;
15863
+ approved_by: string | null;
15864
+ created_at: string;
15865
+ employee_id: string;
15866
+ id: string;
15867
+ locked: boolean;
15868
+ notes: string | null;
15869
+ status: string;
15870
+ submitted_at: string | null;
15871
+ updated_at: string;
15872
+ week_start: string;
15873
+ };
15874
+ Insert: {
15875
+ approved_at?: string | null;
15876
+ approved_by?: string | null;
15877
+ created_at?: string;
15878
+ employee_id: string;
15879
+ id?: string;
15880
+ locked?: boolean;
15881
+ notes?: string | null;
15882
+ status?: string;
15883
+ submitted_at?: string | null;
15884
+ updated_at?: string;
15885
+ week_start: string;
15886
+ };
15887
+ Update: {
15888
+ approved_at?: string | null;
15889
+ approved_by?: string | null;
15890
+ created_at?: string;
15891
+ employee_id?: string;
15892
+ id?: string;
15893
+ locked?: boolean;
15894
+ notes?: string | null;
15895
+ status?: string;
15896
+ submitted_at?: string | null;
15897
+ updated_at?: string;
15898
+ week_start?: string;
15899
+ };
15323
15900
  Relationships: [
15324
15901
  {
15325
- foreignKeyName: "time_entries_employee_id_fkey";
15902
+ foreignKeyName: "time_log_week_approvals_employee_id_fkey";
15326
15903
  columns: ["employee_id"];
15327
15904
  isOneToOne: false;
15328
- referencedRelation: "monteurs";
15905
+ referencedRelation: "profiles";
15329
15906
  referencedColumns: ["id"];
15330
15907
  }
15331
15908
  ];
15332
15909
  };
15333
15910
  time_logs: {
15334
15911
  Row: {
15912
+ auto_stop_reason: string | null;
15913
+ auto_stopped: boolean;
15335
15914
  created_at: string;
15915
+ current_latitude: number | null;
15916
+ current_longitude: number | null;
15917
+ current_position_updated_at: string | null;
15336
15918
  employee_id: string;
15919
+ end_latitude: number | null;
15920
+ end_longitude: number | null;
15337
15921
  end_time: string | null;
15922
+ eta_distance_km: number | null;
15923
+ eta_minutes: number | null;
15924
+ eta_updated_at: string | null;
15925
+ hour_category: string | null;
15338
15926
  id: string;
15927
+ last_reminder_at: string | null;
15339
15928
  notes: string | null;
15340
15929
  overtime_hours: number;
15341
15930
  overtime_type: string | null;
15342
15931
  regular_hours: number;
15932
+ reminder_count: number;
15933
+ requires_review: boolean;
15934
+ start_latitude: number | null;
15935
+ start_longitude: number | null;
15343
15936
  start_time: string;
15344
15937
  travel_cost: number | null;
15345
15938
  travel_distance_km: number | null;
15939
+ travel_duration_min: number | null;
15940
+ travel_time_minutes: number | null;
15346
15941
  type: string;
15347
15942
  updated_at: string;
15943
+ work_order_id: string | null;
15348
15944
  };
15349
15945
  Insert: {
15946
+ auto_stop_reason?: string | null;
15947
+ auto_stopped?: boolean;
15350
15948
  created_at?: string;
15949
+ current_latitude?: number | null;
15950
+ current_longitude?: number | null;
15951
+ current_position_updated_at?: string | null;
15351
15952
  employee_id: string;
15953
+ end_latitude?: number | null;
15954
+ end_longitude?: number | null;
15352
15955
  end_time?: string | null;
15956
+ eta_distance_km?: number | null;
15957
+ eta_minutes?: number | null;
15958
+ eta_updated_at?: string | null;
15959
+ hour_category?: string | null;
15353
15960
  id?: string;
15961
+ last_reminder_at?: string | null;
15354
15962
  notes?: string | null;
15355
15963
  overtime_hours?: number;
15356
15964
  overtime_type?: string | null;
15357
15965
  regular_hours?: number;
15966
+ reminder_count?: number;
15967
+ requires_review?: boolean;
15968
+ start_latitude?: number | null;
15969
+ start_longitude?: number | null;
15358
15970
  start_time?: string;
15359
15971
  travel_cost?: number | null;
15360
15972
  travel_distance_km?: number | null;
15973
+ travel_duration_min?: number | null;
15974
+ travel_time_minutes?: number | null;
15361
15975
  type: string;
15362
15976
  updated_at?: string;
15977
+ work_order_id?: string | null;
15363
15978
  };
15364
15979
  Update: {
15980
+ auto_stop_reason?: string | null;
15981
+ auto_stopped?: boolean;
15365
15982
  created_at?: string;
15983
+ current_latitude?: number | null;
15984
+ current_longitude?: number | null;
15985
+ current_position_updated_at?: string | null;
15366
15986
  employee_id?: string;
15987
+ end_latitude?: number | null;
15988
+ end_longitude?: number | null;
15367
15989
  end_time?: string | null;
15990
+ eta_distance_km?: number | null;
15991
+ eta_minutes?: number | null;
15992
+ eta_updated_at?: string | null;
15993
+ hour_category?: string | null;
15368
15994
  id?: string;
15995
+ last_reminder_at?: string | null;
15369
15996
  notes?: string | null;
15370
15997
  overtime_hours?: number;
15371
15998
  overtime_type?: string | null;
15372
15999
  regular_hours?: number;
16000
+ reminder_count?: number;
16001
+ requires_review?: boolean;
16002
+ start_latitude?: number | null;
16003
+ start_longitude?: number | null;
15373
16004
  start_time?: string;
15374
16005
  travel_cost?: number | null;
15375
16006
  travel_distance_km?: number | null;
16007
+ travel_duration_min?: number | null;
16008
+ travel_time_minutes?: number | null;
15376
16009
  type?: string;
15377
16010
  updated_at?: string;
16011
+ work_order_id?: string | null;
15378
16012
  };
15379
16013
  Relationships: [
15380
16014
  {
15381
16015
  foreignKeyName: "time_logs_employee_id_fkey";
15382
16016
  columns: ["employee_id"];
15383
16017
  isOneToOne: false;
15384
- referencedRelation: "monteurs";
16018
+ referencedRelation: "profiles";
16019
+ referencedColumns: ["id"];
16020
+ },
16021
+ {
16022
+ foreignKeyName: "time_logs_work_order_id_fkey";
16023
+ columns: ["work_order_id"];
16024
+ isOneToOne: false;
16025
+ referencedRelation: "work_orders";
15385
16026
  referencedColumns: ["id"];
15386
16027
  }
15387
16028
  ];
@@ -15422,7 +16063,7 @@ export type Database = {
15422
16063
  foreignKeyName: "time_off_entries_employee_id_fkey";
15423
16064
  columns: ["employee_id"];
15424
16065
  isOneToOne: false;
15425
- referencedRelation: "monteurs";
16066
+ referencedRelation: "profiles";
15426
16067
  referencedColumns: ["id"];
15427
16068
  }
15428
16069
  ];
@@ -15735,6 +16376,39 @@ export type Database = {
15735
16376
  };
15736
16377
  Relationships: [];
15737
16378
  };
16379
+ twinfield_cron_locks: {
16380
+ Row: {
16381
+ created_at: string;
16382
+ heartbeat_at: string;
16383
+ job_name: string;
16384
+ last_error: string | null;
16385
+ last_finished_at: string | null;
16386
+ locked_at: string;
16387
+ run_id: string;
16388
+ updated_at: string;
16389
+ };
16390
+ Insert: {
16391
+ created_at?: string;
16392
+ heartbeat_at?: string;
16393
+ job_name: string;
16394
+ last_error?: string | null;
16395
+ last_finished_at?: string | null;
16396
+ locked_at?: string;
16397
+ run_id?: string;
16398
+ updated_at?: string;
16399
+ };
16400
+ Update: {
16401
+ created_at?: string;
16402
+ heartbeat_at?: string;
16403
+ job_name?: string;
16404
+ last_error?: string | null;
16405
+ last_finished_at?: string | null;
16406
+ locked_at?: string;
16407
+ run_id?: string;
16408
+ updated_at?: string;
16409
+ };
16410
+ Relationships: [];
16411
+ };
15738
16412
  twinfield_customers: {
15739
16413
  Row: {
15740
16414
  address: string | null;
@@ -16013,6 +16687,7 @@ export type Database = {
16013
16687
  invoice_enabled_mo: boolean;
16014
16688
  payment_gl_account: string;
16015
16689
  payment_journal_code: string;
16690
+ print_werkplek: string | null;
16016
16691
  updated_at: string;
16017
16692
  user_id: string;
16018
16693
  vat_code_eu_reverse: string | null;
@@ -16035,6 +16710,7 @@ export type Database = {
16035
16710
  invoice_enabled_mo?: boolean;
16036
16711
  payment_gl_account?: string;
16037
16712
  payment_journal_code?: string;
16713
+ print_werkplek?: string | null;
16038
16714
  updated_at?: string;
16039
16715
  user_id: string;
16040
16716
  vat_code_eu_reverse?: string | null;
@@ -16057,6 +16733,7 @@ export type Database = {
16057
16733
  invoice_enabled_mo?: boolean;
16058
16734
  payment_gl_account?: string;
16059
16735
  payment_journal_code?: string;
16736
+ print_werkplek?: string | null;
16060
16737
  updated_at?: string;
16061
16738
  user_id?: string;
16062
16739
  vat_code_eu_reverse?: string | null;
@@ -16345,6 +17022,7 @@ export type Database = {
16345
17022
  twinfield_push_queue: {
16346
17023
  Row: {
16347
17024
  action: string;
17025
+ attempt_started_at: string | null;
16348
17026
  attempts: number;
16349
17027
  connection_id: string | null;
16350
17028
  created_at: string;
@@ -16361,6 +17039,7 @@ export type Database = {
16361
17039
  };
16362
17040
  Insert: {
16363
17041
  action?: string;
17042
+ attempt_started_at?: string | null;
16364
17043
  attempts?: number;
16365
17044
  connection_id?: string | null;
16366
17045
  created_at?: string;
@@ -16377,6 +17056,7 @@ export type Database = {
16377
17056
  };
16378
17057
  Update: {
16379
17058
  action?: string;
17059
+ attempt_started_at?: string | null;
16380
17060
  attempts?: number;
16381
17061
  connection_id?: string | null;
16382
17062
  created_at?: string;
@@ -16579,15 +17259,7 @@ export type Database = {
16579
17259
  workday_end?: string | null;
16580
17260
  workday_start?: string | null;
16581
17261
  };
16582
- Relationships: [
16583
- {
16584
- foreignKeyName: "uren_cao_profiles_monteur_id_fkey";
16585
- columns: ["monteur_id"];
16586
- isOneToOne: true;
16587
- referencedRelation: "monteurs";
16588
- referencedColumns: ["id"];
16589
- }
16590
- ];
17262
+ Relationships: [];
16591
17263
  };
16592
17264
  uren_entries: {
16593
17265
  Row: {
@@ -16633,13 +17305,6 @@ export type Database = {
16633
17305
  werkbon_id?: string | null;
16634
17306
  };
16635
17307
  Relationships: [
16636
- {
16637
- foreignKeyName: "uren_entries_monteur_id_fkey";
16638
- columns: ["monteur_id"];
16639
- isOneToOne: false;
16640
- referencedRelation: "monteurs";
16641
- referencedColumns: ["id"];
16642
- },
16643
17308
  {
16644
17309
  foreignKeyName: "uren_entries_werkbon_id_fkey";
16645
17310
  columns: ["werkbon_id"];
@@ -17121,19 +17786,12 @@ export type Database = {
17121
17786
  submitted_at?: string | null;
17122
17787
  updated_at?: string;
17123
17788
  };
17124
- Relationships: [
17125
- {
17126
- foreignKeyName: "uren_weekstaten_monteur_id_fkey";
17127
- columns: ["monteur_id"];
17128
- isOneToOne: false;
17129
- referencedRelation: "monteurs";
17130
- referencedColumns: ["id"];
17131
- }
17132
- ];
17789
+ Relationships: [];
17133
17790
  };
17134
17791
  user_module_permissions: {
17135
17792
  Row: {
17136
17793
  created_at: string;
17794
+ feature_id: string;
17137
17795
  id: string;
17138
17796
  module_id: string;
17139
17797
  permission: string;
@@ -17142,6 +17800,7 @@ export type Database = {
17142
17800
  };
17143
17801
  Insert: {
17144
17802
  created_at?: string;
17803
+ feature_id?: string;
17145
17804
  id?: string;
17146
17805
  module_id: string;
17147
17806
  permission: string;
@@ -17150,6 +17809,7 @@ export type Database = {
17150
17809
  };
17151
17810
  Update: {
17152
17811
  created_at?: string;
17812
+ feature_id?: string;
17153
17813
  id?: string;
17154
17814
  module_id?: string;
17155
17815
  permission?: string;
@@ -17187,6 +17847,53 @@ export type Database = {
17187
17847
  }
17188
17848
  ];
17189
17849
  };
17850
+ van_inventories: {
17851
+ Row: {
17852
+ barcode: string | null;
17853
+ created_at: string;
17854
+ id: string;
17855
+ monteur_id: string | null;
17856
+ price_per_unit: number;
17857
+ product_name: string;
17858
+ quantity_current: number;
17859
+ quantity_min: number;
17860
+ unit: string;
17861
+ updated_at: string;
17862
+ };
17863
+ Insert: {
17864
+ barcode?: string | null;
17865
+ created_at?: string;
17866
+ id?: string;
17867
+ monteur_id?: string | null;
17868
+ price_per_unit?: number;
17869
+ product_name: string;
17870
+ quantity_current?: number;
17871
+ quantity_min?: number;
17872
+ unit?: string;
17873
+ updated_at?: string;
17874
+ };
17875
+ Update: {
17876
+ barcode?: string | null;
17877
+ created_at?: string;
17878
+ id?: string;
17879
+ monteur_id?: string | null;
17880
+ price_per_unit?: number;
17881
+ product_name?: string;
17882
+ quantity_current?: number;
17883
+ quantity_min?: number;
17884
+ unit?: string;
17885
+ updated_at?: string;
17886
+ };
17887
+ Relationships: [
17888
+ {
17889
+ foreignKeyName: "van_inventories_monteur_id_fkey";
17890
+ columns: ["monteur_id"];
17891
+ isOneToOne: false;
17892
+ referencedRelation: "profiles";
17893
+ referencedColumns: ["id"];
17894
+ }
17895
+ ];
17896
+ };
17190
17897
  voorraad_custom_fields: {
17191
17898
  Row: {
17192
17899
  created_at: string;
@@ -18160,7 +18867,7 @@ export type Database = {
18160
18867
  foreignKeyName: "work_order_monteurs_monteur_id_fkey";
18161
18868
  columns: ["monteur_id"];
18162
18869
  isOneToOne: false;
18163
- referencedRelation: "monteurs";
18870
+ referencedRelation: "profiles";
18164
18871
  referencedColumns: ["id"];
18165
18872
  },
18166
18873
  {
@@ -18172,6 +18879,63 @@ export type Database = {
18172
18879
  }
18173
18880
  ];
18174
18881
  };
18882
+ work_order_photos: {
18883
+ Row: {
18884
+ ai_caption: string | null;
18885
+ ai_categorized_at: string | null;
18886
+ ai_labels: Json | null;
18887
+ caption: string | null;
18888
+ created_at: string;
18889
+ id: string;
18890
+ monteur_id: string | null;
18891
+ photo_type: string;
18892
+ storage_path: string;
18893
+ updated_at: string;
18894
+ work_order_id: string;
18895
+ };
18896
+ Insert: {
18897
+ ai_caption?: string | null;
18898
+ ai_categorized_at?: string | null;
18899
+ ai_labels?: Json | null;
18900
+ caption?: string | null;
18901
+ created_at?: string;
18902
+ id?: string;
18903
+ monteur_id?: string | null;
18904
+ photo_type?: string;
18905
+ storage_path: string;
18906
+ updated_at?: string;
18907
+ work_order_id: string;
18908
+ };
18909
+ Update: {
18910
+ ai_caption?: string | null;
18911
+ ai_categorized_at?: string | null;
18912
+ ai_labels?: Json | null;
18913
+ caption?: string | null;
18914
+ created_at?: string;
18915
+ id?: string;
18916
+ monteur_id?: string | null;
18917
+ photo_type?: string;
18918
+ storage_path?: string;
18919
+ updated_at?: string;
18920
+ work_order_id?: string;
18921
+ };
18922
+ Relationships: [
18923
+ {
18924
+ foreignKeyName: "work_order_photos_monteur_id_fkey";
18925
+ columns: ["monteur_id"];
18926
+ isOneToOne: false;
18927
+ referencedRelation: "profiles";
18928
+ referencedColumns: ["id"];
18929
+ },
18930
+ {
18931
+ foreignKeyName: "work_order_photos_work_order_id_fkey";
18932
+ columns: ["work_order_id"];
18933
+ isOneToOne: false;
18934
+ referencedRelation: "work_orders";
18935
+ referencedColumns: ["id"];
18936
+ }
18937
+ ];
18938
+ };
18175
18939
  work_orders: {
18176
18940
  Row: {
18177
18941
  assigned_to: string | null;
@@ -18203,7 +18967,6 @@ export type Database = {
18203
18967
  scheduled_end_time: string | null;
18204
18968
  scheduled_start_time: string | null;
18205
18969
  status: string;
18206
- tenant_id: string;
18207
18970
  total_hours_worked: number | null;
18208
18971
  total_price: number | null;
18209
18972
  travel_time_minutes: number | null;
@@ -18241,7 +19004,6 @@ export type Database = {
18241
19004
  scheduled_end_time?: string | null;
18242
19005
  scheduled_start_time?: string | null;
18243
19006
  status?: string;
18244
- tenant_id: string;
18245
19007
  total_hours_worked?: number | null;
18246
19008
  total_price?: number | null;
18247
19009
  travel_time_minutes?: number | null;
@@ -18279,7 +19041,6 @@ export type Database = {
18279
19041
  scheduled_end_time?: string | null;
18280
19042
  scheduled_start_time?: string | null;
18281
19043
  status?: string;
18282
- tenant_id?: string;
18283
19044
  total_hours_worked?: number | null;
18284
19045
  total_price?: number | null;
18285
19046
  travel_time_minutes?: number | null;
@@ -18294,13 +19055,6 @@ export type Database = {
18294
19055
  isOneToOne: false;
18295
19056
  referencedRelation: "work_orders";
18296
19057
  referencedColumns: ["id"];
18297
- },
18298
- {
18299
- foreignKeyName: "work_orders_tenant_id_fkey";
18300
- columns: ["tenant_id"];
18301
- isOneToOne: false;
18302
- referencedRelation: "tenants";
18303
- referencedColumns: ["id"];
18304
19058
  }
18305
19059
  ];
18306
19060
  };
@@ -18998,6 +19752,19 @@ export type Database = {
18998
19752
  };
18999
19753
  Returns: undefined;
19000
19754
  };
19755
+ approve_mailbox_order_proposal: {
19756
+ Args: {
19757
+ p_custom_fields: Json;
19758
+ p_customer_id: string;
19759
+ p_delivery_date: string;
19760
+ p_field_values?: Json;
19761
+ p_lines: Json;
19762
+ p_notes: string;
19763
+ p_proposal_id: string;
19764
+ p_reviewed_by: string;
19765
+ };
19766
+ Returns: Json;
19767
+ };
19001
19768
  assign_cart_numbers: {
19002
19769
  Args: {
19003
19770
  p_carts: Json;
@@ -19049,6 +19816,10 @@ export type Database = {
19049
19816
  };
19050
19817
  Returns: number;
19051
19818
  };
19819
+ can_manage_hours: {
19820
+ Args: never;
19821
+ Returns: boolean;
19822
+ };
19052
19823
  check_offer_product_available_stock: {
19053
19824
  Args: {
19054
19825
  p_campaign_product_id: string;
@@ -19238,6 +20009,7 @@ export type Database = {
19238
20009
  };
19239
20010
  Returns: {
19240
20011
  action: string;
20012
+ attempt_started_at: string | null;
19241
20013
  attempts: number;
19242
20014
  connection_id: string | null;
19243
20015
  created_at: string;
@@ -19325,6 +20097,30 @@ export type Database = {
19325
20097
  agent_naam: string;
19326
20098
  }[];
19327
20099
  };
20100
+ consume_van_inventory: {
20101
+ Args: {
20102
+ p_inventory_id: string;
20103
+ p_quantity: number;
20104
+ };
20105
+ Returns: {
20106
+ barcode: string | null;
20107
+ created_at: string;
20108
+ id: string;
20109
+ monteur_id: string | null;
20110
+ price_per_unit: number;
20111
+ product_name: string;
20112
+ quantity_current: number;
20113
+ quantity_min: number;
20114
+ unit: string;
20115
+ updated_at: string;
20116
+ };
20117
+ SetofOptions: {
20118
+ from: "*";
20119
+ to: "van_inventories";
20120
+ isOneToOne: true;
20121
+ isSetofReturn: false;
20122
+ };
20123
+ };
19328
20124
  control_get_todays_carts: {
19329
20125
  Args: never;
19330
20126
  Returns: {
@@ -19398,6 +20194,13 @@ export type Database = {
19398
20194
  _user_id: string;
19399
20195
  };
19400
20196
  Returns: string;
20197
+ } | {
20198
+ Args: {
20199
+ _feature_id: string;
20200
+ _module_id: string;
20201
+ _user_id: string;
20202
+ };
20203
+ Returns: string;
19401
20204
  };
19402
20205
  email_auth_decrypt: {
19403
20206
  Args: {
@@ -19749,12 +20552,6 @@ export type Database = {
19749
20552
  Args: never;
19750
20553
  Returns: string;
19751
20554
  };
19752
- get_work_order_tenant_id: {
19753
- Args: {
19754
- wo_id: string;
19755
- };
19756
- Returns: string;
19757
- };
19758
20555
  has_module_permission: {
19759
20556
  Args: {
19760
20557
  _min: string;
@@ -19788,6 +20585,13 @@ export type Database = {
19788
20585
  };
19789
20586
  Returns: boolean;
19790
20587
  };
20588
+ is_time_log_week_locked: {
20589
+ Args: {
20590
+ p_employee_id: string;
20591
+ p_start_time: string;
20592
+ };
20593
+ Returns: boolean;
20594
+ };
19791
20595
  is_user_admin: {
19792
20596
  Args: never;
19793
20597
  Returns: boolean;
@@ -19796,19 +20600,33 @@ export type Database = {
19796
20600
  Args: never;
19797
20601
  Returns: boolean;
19798
20602
  };
20603
+ itk_offerte_naar_werkbon: {
20604
+ Args: {
20605
+ _offerte_id: string;
20606
+ };
20607
+ Returns: string;
20608
+ };
20609
+ itk_offerte_restant_mandaat: {
20610
+ Args: {
20611
+ _exclude_offerte_id?: string;
20612
+ _werkbon_id: string;
20613
+ };
20614
+ Returns: number;
20615
+ };
19799
20616
  jwt_has_role: {
19800
20617
  Args: {
19801
20618
  _role: Database["public"]["Enums"]["app_role"];
19802
20619
  };
19803
20620
  Returns: boolean;
19804
20621
  };
19805
- list_monteurs: {
20622
+ list_medewerkers: {
19806
20623
  Args: never;
19807
20624
  Returns: {
19808
20625
  avatar_url: string;
19809
20626
  display_name: string;
19810
20627
  email: string;
19811
20628
  id: string;
20629
+ roles: string[];
19812
20630
  }[];
19813
20631
  };
19814
20632
  list_my_planning_items: {
@@ -20134,17 +20952,6 @@ export type Database = {
20134
20952
  Returns: string;
20135
20953
  };
20136
20954
  logistics_emit_event: {
20137
- Args: {
20138
- p_event_type: string;
20139
- p_idempotency_key?: string;
20140
- p_order_ref: string;
20141
- p_payload?: Json;
20142
- p_shadow?: boolean;
20143
- p_source_module: string;
20144
- p_strategy_id?: string;
20145
- };
20146
- Returns: Json;
20147
- } | {
20148
20955
  Args: {
20149
20956
  p_event_type: string;
20150
20957
  p_idempotency_key?: string;
@@ -20599,6 +21406,7 @@ export type Database = {
20599
21406
  my_module_permissions: {
20600
21407
  Args: never;
20601
21408
  Returns: {
21409
+ feature_id: string;
20602
21410
  module_id: string;
20603
21411
  permission: string;
20604
21412
  }[];
@@ -21479,6 +22287,16 @@ export type Database = {
21479
22287
  };
21480
22288
  Returns: string[];
21481
22289
  };
22290
+ switch_time_log: {
22291
+ Args: {
22292
+ p_employee_id: string;
22293
+ p_start_lat?: number;
22294
+ p_start_lng?: number;
22295
+ p_type: string;
22296
+ p_work_order_id?: string;
22297
+ };
22298
+ Returns: Json;
22299
+ };
21482
22300
  sync_all_layer_stocks: {
21483
22301
  Args: never;
21484
22302
  Returns: undefined;
@@ -21529,6 +22347,24 @@ export type Database = {
21529
22347
  };
21530
22348
  Returns: boolean;
21531
22349
  };
22350
+ twinfield_cron_lock_acquire: {
22351
+ Args: {
22352
+ _job_name: string;
22353
+ _stale_seconds?: number;
22354
+ };
22355
+ Returns: boolean;
22356
+ };
22357
+ twinfield_cron_lock_release: {
22358
+ Args: {
22359
+ _error?: string;
22360
+ _job_name: string;
22361
+ };
22362
+ Returns: undefined;
22363
+ };
22364
+ twinfield_prune_push_queue: {
22365
+ Args: never;
22366
+ Returns: number;
22367
+ };
21532
22368
  twinfield_register_cron: {
21533
22369
  Args: {
21534
22370
  apikey?: string;
@@ -21572,7 +22408,7 @@ export type Database = {
21572
22408
  Enums: {
21573
22409
  ai_import_status: "nieuw" | "verwerken" | "bevestigen" | "klaar" | "mislukt";
21574
22410
  app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie";
21575
- doc_layout_type: "pakbon" | "factuur" | "offerte" | "orderbevestiging" | "etiket" | "verzendlabel" | "productlabel" | "barcode_label" | "magazijnlijst" | "controlelijst" | "transportdocument" | "vrij" | "sticker" | "productiebon";
22411
+ doc_layout_type: "pakbon" | "factuur" | "offerte" | "orderbevestiging" | "etiket" | "verzendlabel" | "productlabel" | "barcode_label" | "magazijnlijst" | "controlelijst" | "transportdocument" | "vrij" | "sticker" | "productiebon" | "veilingbon" | "afleverbrief" | "veilingbrief";
21576
22412
  doc_orientation: "portrait" | "landscape";
21577
22413
  exact_env: "staging" | "live";
21578
22414
  exact_push_status: "pending" | "sent" | "error";
@@ -21643,7 +22479,7 @@ export declare const Constants: {
21643
22479
  readonly Enums: {
21644
22480
  readonly ai_import_status: readonly ["nieuw", "verwerken", "bevestigen", "klaar", "mislukt"];
21645
22481
  readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin", "manager", "warehouse", "sales", "developer", "receptie"];
21646
- readonly doc_layout_type: readonly ["pakbon", "factuur", "offerte", "orderbevestiging", "etiket", "verzendlabel", "productlabel", "barcode_label", "magazijnlijst", "controlelijst", "transportdocument", "vrij", "sticker", "productiebon"];
22482
+ readonly doc_layout_type: readonly ["pakbon", "factuur", "offerte", "orderbevestiging", "etiket", "verzendlabel", "productlabel", "barcode_label", "magazijnlijst", "controlelijst", "transportdocument", "vrij", "sticker", "productiebon", "veilingbon", "afleverbrief", "veilingbrief"];
21647
22483
  readonly doc_orientation: readonly ["portrait", "landscape"];
21648
22484
  readonly exact_env: readonly ["staging", "live"];
21649
22485
  readonly exact_push_status: readonly ["pending", "sent", "error"];