@flowselections/admin-installatietechniek 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist-lib/components/AdminForInstallatieTechniek.d.ts.map +1 -1
  2. package/dist-lib/components/AdminForInstallatieTechniek.js +15 -4
  3. package/dist-lib/components/ModuleAccessGuard.d.ts +15 -0
  4. package/dist-lib/components/ModuleAccessGuard.d.ts.map +1 -0
  5. package/dist-lib/components/ModuleAccessGuard.js +40 -0
  6. package/dist-lib/hooks/useModulePermission.d.ts +8 -2
  7. package/dist-lib/hooks/useModulePermission.d.ts.map +1 -1
  8. package/dist-lib/hooks/useModulePermission.js +26 -23
  9. package/dist-lib/index.d.ts +2 -0
  10. package/dist-lib/index.d.ts.map +1 -1
  11. package/dist-lib/index.js +2 -0
  12. package/dist-lib/integrations/supabase/auth-attacher.d.ts.map +1 -1
  13. package/dist-lib/integrations/supabase/auth-attacher.js +5 -1
  14. package/dist-lib/integrations/supabase/auth-middleware.d.ts +555 -117
  15. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  16. package/dist-lib/integrations/supabase/auth-middleware.js +21 -7
  17. package/dist-lib/integrations/supabase/client.d.ts +555 -117
  18. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  19. package/dist-lib/integrations/supabase/client.server.d.ts +555 -117
  20. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  21. package/dist-lib/integrations/supabase/types.d.ts +567 -128
  22. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  23. package/dist-lib/lib/admin.functions.d.ts +30013 -1785
  24. package/dist-lib/lib/admin.functions.d.ts.map +1 -1
  25. package/dist-lib/lib/admin.functions.js +19 -1
  26. package/dist-lib/lib/permissions.server.d.ts +14 -0
  27. package/dist-lib/lib/permissions.server.d.ts.map +1 -0
  28. package/dist-lib/lib/permissions.server.js +26 -0
  29. package/package.json +87 -87
@@ -871,6 +871,126 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
871
871
  };
872
872
  Relationships: [];
873
873
  };
874
+ cao_holidays: {
875
+ Row: {
876
+ created_at: string;
877
+ description: string | null;
878
+ holiday_date: string;
879
+ id: string;
880
+ updated_at: string;
881
+ };
882
+ Insert: {
883
+ created_at?: string;
884
+ description?: string | null;
885
+ holiday_date: string;
886
+ id?: string;
887
+ updated_at?: string;
888
+ };
889
+ Update: {
890
+ created_at?: string;
891
+ description?: string | null;
892
+ holiday_date?: string;
893
+ id?: string;
894
+ updated_at?: string;
895
+ };
896
+ Relationships: [];
897
+ };
898
+ cao_settings: {
899
+ Row: {
900
+ auto_break_after_hours: number;
901
+ auto_break_minutes: number;
902
+ auto_break_unpaid: boolean;
903
+ auto_stop_after_hours: number;
904
+ callout_fee: number;
905
+ created_at: string;
906
+ daily_regular_hours: number;
907
+ default_hourly_rate: number;
908
+ id: string;
909
+ materials_markup_percent: number;
910
+ max_daily_hours: number;
911
+ max_weekly_hours: number;
912
+ meal_allowance_amount: number;
913
+ overtime_pct_178: number;
914
+ overtime_pct_189: number;
915
+ overtime_pct_212: number;
916
+ reminder_after_hours: number;
917
+ standby_evening_amount: number;
918
+ standby_weekend_amount: number;
919
+ travel_cost_per_km: number | null;
920
+ travel_cost_threshold_km: number | null;
921
+ travel_counts_as_work: boolean;
922
+ travel_hourly_rate: number;
923
+ travel_rate_per_hour: number;
924
+ travel_threshold_minutes: number;
925
+ updated_at: string;
926
+ weekend_always_212: boolean;
927
+ window_end: string;
928
+ window_start: string;
929
+ };
930
+ Insert: {
931
+ auto_break_after_hours?: number;
932
+ auto_break_minutes?: number;
933
+ auto_break_unpaid?: boolean;
934
+ auto_stop_after_hours?: number;
935
+ callout_fee?: number;
936
+ created_at?: string;
937
+ daily_regular_hours?: number;
938
+ default_hourly_rate?: number;
939
+ id?: string;
940
+ materials_markup_percent?: number;
941
+ max_daily_hours?: number;
942
+ max_weekly_hours?: number;
943
+ meal_allowance_amount?: number;
944
+ overtime_pct_178?: number;
945
+ overtime_pct_189?: number;
946
+ overtime_pct_212?: number;
947
+ reminder_after_hours?: number;
948
+ standby_evening_amount?: number;
949
+ standby_weekend_amount?: number;
950
+ travel_cost_per_km?: number | null;
951
+ travel_cost_threshold_km?: number | null;
952
+ travel_counts_as_work?: boolean;
953
+ travel_hourly_rate?: number;
954
+ travel_rate_per_hour?: number;
955
+ travel_threshold_minutes?: number;
956
+ updated_at?: string;
957
+ weekend_always_212?: boolean;
958
+ window_end?: string;
959
+ window_start?: string;
960
+ };
961
+ Update: {
962
+ auto_break_after_hours?: number;
963
+ auto_break_minutes?: number;
964
+ auto_break_unpaid?: boolean;
965
+ auto_stop_after_hours?: number;
966
+ callout_fee?: number;
967
+ created_at?: string;
968
+ daily_regular_hours?: number;
969
+ default_hourly_rate?: number;
970
+ id?: string;
971
+ materials_markup_percent?: number;
972
+ max_daily_hours?: number;
973
+ max_weekly_hours?: number;
974
+ meal_allowance_amount?: number;
975
+ overtime_pct_178?: number;
976
+ overtime_pct_189?: number;
977
+ overtime_pct_212?: number;
978
+ reminder_after_hours?: number;
979
+ standby_evening_amount?: number;
980
+ standby_weekend_amount?: number;
981
+ travel_cost_per_km?: number | null;
982
+ travel_cost_threshold_km?: number | null;
983
+ travel_counts_as_work?: boolean;
984
+ travel_hourly_rate?: number;
985
+ travel_rate_per_hour?: number;
986
+ travel_threshold_minutes?: number;
987
+ updated_at?: string;
988
+ weekend_always_212?: boolean;
989
+ window_end?: string;
990
+ window_start?: string;
991
+ };
992
+ Relationships: [];
993
+ };
874
994
  carrier_shipping_rates: {
875
995
  Row: {
876
996
  carrier_id: string;
@@ -7765,7 +7885,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
7765
7885
  start_date: string;
7766
7886
  start_time: string | null;
7767
7887
  status: string;
7768
- tenant_id: string;
7769
7888
  updated_at: string;
7770
7889
  user_id: string;
7771
7890
  };
@@ -7783,7 +7902,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
7783
7902
  start_date: string;
7784
7903
  start_time?: string | null;
7785
7904
  status?: string;
7786
- tenant_id?: string;
7787
7905
  updated_at?: string;
7788
7906
  user_id: string;
7789
7907
  };
@@ -7801,7 +7919,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
7801
7919
  start_date?: string;
7802
7920
  start_time?: string | null;
7803
7921
  status?: string;
7804
- tenant_id?: string;
7805
7922
  updated_at?: string;
7806
7923
  user_id?: string;
7807
7924
  };
@@ -7809,13 +7926,13 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
7809
7926
  foreignKeyName: "leave_requests_monteur_id_fkey";
7810
7927
  columns: ["monteur_id"];
7811
7928
  isOneToOne: false;
7812
- referencedRelation: "monteurs";
7929
+ referencedRelation: "profiles";
7813
7930
  referencedColumns: ["id"];
7814
7931
  }, {
7815
7932
  foreignKeyName: "leave_requests_user_id_fkey";
7816
7933
  columns: ["user_id"];
7817
7934
  isOneToOne: false;
7818
- referencedRelation: "monteurs";
7935
+ referencedRelation: "profiles";
7819
7936
  referencedColumns: ["id"];
7820
7937
  }];
7821
7938
  };
@@ -9970,6 +10087,60 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9970
10087
  };
9971
10088
  Relationships: [];
9972
10089
  };
10090
+ material_usage: {
10091
+ Row: {
10092
+ created_at: string;
10093
+ id: string;
10094
+ material_name: string;
10095
+ monteur_id: string | null;
10096
+ price_at_time: number;
10097
+ quantity_used: number;
10098
+ updated_at: string;
10099
+ van_inventory_id: string | null;
10100
+ work_order_id: string;
10101
+ };
10102
+ Insert: {
10103
+ created_at?: string;
10104
+ id?: string;
10105
+ material_name: string;
10106
+ monteur_id?: string | null;
10107
+ price_at_time?: number;
10108
+ quantity_used?: number;
10109
+ updated_at?: string;
10110
+ van_inventory_id?: string | null;
10111
+ work_order_id: string;
10112
+ };
10113
+ Update: {
10114
+ created_at?: string;
10115
+ id?: string;
10116
+ material_name?: string;
10117
+ monteur_id?: string | null;
10118
+ price_at_time?: number;
10119
+ quantity_used?: number;
10120
+ updated_at?: string;
10121
+ van_inventory_id?: string | null;
10122
+ work_order_id?: string;
10123
+ };
10124
+ Relationships: [{
10125
+ foreignKeyName: "material_usage_monteur_id_fkey";
10126
+ columns: ["monteur_id"];
10127
+ isOneToOne: false;
10128
+ referencedRelation: "profiles";
10129
+ referencedColumns: ["id"];
10130
+ }, {
10131
+ foreignKeyName: "material_usage_van_inventory_id_fkey";
10132
+ columns: ["van_inventory_id"];
10133
+ isOneToOne: false;
10134
+ referencedRelation: "van_inventories";
10135
+ referencedColumns: ["id"];
10136
+ }, {
10137
+ foreignKeyName: "material_usage_work_order_id_fkey";
10138
+ columns: ["work_order_id"];
10139
+ isOneToOne: false;
10140
+ referencedRelation: "work_orders";
10141
+ referencedColumns: ["id"];
10142
+ }];
10143
+ };
9973
10144
  module_features: {
9974
10145
  Row: {
9975
10146
  created_at: string;
@@ -10030,6 +10201,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
10030
10201
  module_registry: {
10031
10202
  Row: {
10032
10203
  created_at: string;
10204
+ enforce: boolean;
10033
10205
  is_active: boolean;
10034
10206
  last_seen_at: string;
10035
10207
  module_id: string;
@@ -10039,6 +10211,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
10039
10211
  };
10040
10212
  Insert: {
10041
10213
  created_at?: string;
10214
+ enforce?: boolean;
10042
10215
  is_active?: boolean;
10043
10216
  last_seen_at?: string;
10044
10217
  module_id: string;
@@ -10048,6 +10221,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
10048
10221
  };
10049
10222
  Update: {
10050
10223
  created_at?: string;
10224
+ enforce?: boolean;
10051
10225
  is_active?: boolean;
10052
10226
  last_seen_at?: string;
10053
10227
  module_id?: string;
@@ -10108,63 +10282,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
10108
10282
  };
10109
10283
  Relationships: [];
10110
10284
  };
10111
- monteurs: {
10112
- Row: {
10113
- avatar_url: string | null;
10114
- color: string | null;
10115
- created_at: string;
10116
- email: string | null;
10117
- id: string;
10118
- is_active: boolean;
10119
- leave_balance_hours: number;
10120
- name: string;
10121
- persnr: number | null;
10122
- phone: string | null;
10123
- role: string;
10124
- tenant_id: string;
10125
- updated_at: string;
10126
- user_id: string | null;
10127
- };
10128
- Insert: {
10129
- avatar_url?: string | null;
10130
- color?: string | null;
10131
- created_at?: string;
10132
- email?: string | null;
10133
- id?: string;
10134
- is_active?: boolean;
10135
- leave_balance_hours?: number;
10136
- name: string;
10137
- persnr?: number | null;
10138
- phone?: string | null;
10139
- role?: string;
10140
- tenant_id: string;
10141
- updated_at?: string;
10142
- user_id?: string | null;
10143
- };
10144
- Update: {
10145
- avatar_url?: string | null;
10146
- color?: string | null;
10147
- created_at?: string;
10148
- email?: string | null;
10149
- id?: string;
10150
- is_active?: boolean;
10151
- leave_balance_hours?: number;
10152
- name?: string;
10153
- persnr?: number | null;
10154
- phone?: string | null;
10155
- role?: string;
10156
- tenant_id?: string;
10157
- updated_at?: string;
10158
- user_id?: string | null;
10159
- };
10160
- Relationships: [{
10161
- foreignKeyName: "monteurs_tenant_id_fkey";
10162
- columns: ["tenant_id"];
10163
- isOneToOne: false;
10164
- referencedRelation: "tenants";
10165
- referencedColumns: ["id"];
10166
- }];
10167
- };
10168
10285
  nmbrs_component_mapping: {
10169
10286
  Row: {
10170
10287
  created_at: string;
@@ -10235,13 +10352,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
10235
10352
  nmbrs_employee_number?: string;
10236
10353
  updated_at?: string;
10237
10354
  };
10238
- Relationships: [{
10239
- foreignKeyName: "nmbrs_employee_mapping_monteur_id_fkey";
10240
- columns: ["monteur_id"];
10241
- isOneToOne: true;
10242
- referencedRelation: "monteurs";
10243
- referencedColumns: ["id"];
10244
- }];
10355
+ Relationships: [];
10245
10356
  };
10246
10357
  nmbrs_export_lines: {
10247
10358
  Row: {
@@ -10290,12 +10401,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
10290
10401
  wage_code?: string;
10291
10402
  };
10292
10403
  Relationships: [{
10293
- foreignKeyName: "nmbrs_export_lines_monteur_id_fkey";
10294
- columns: ["monteur_id"];
10295
- isOneToOne: false;
10296
- referencedRelation: "monteurs";
10297
- referencedColumns: ["id"];
10298
- }, {
10299
10404
  foreignKeyName: "nmbrs_export_lines_run_id_fkey";
10300
10405
  columns: ["run_id"];
10301
10406
  isOneToOne: false;
@@ -14980,6 +15085,54 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
14980
15085
  };
14981
15086
  Relationships: [];
14982
15087
  };
15088
+ time_compensation_entries: {
15089
+ Row: {
15090
+ created_at: string;
15091
+ employee_id: string;
15092
+ entry_date: string;
15093
+ id: string;
15094
+ km: number;
15095
+ meal_allowance: number;
15096
+ notes: string | null;
15097
+ standby_evening: number;
15098
+ standby_weekend: number;
15099
+ tvt_change: number;
15100
+ updated_at: string;
15101
+ };
15102
+ Insert: {
15103
+ created_at?: string;
15104
+ employee_id: string;
15105
+ entry_date: string;
15106
+ id?: string;
15107
+ km?: number;
15108
+ meal_allowance?: number;
15109
+ notes?: string | null;
15110
+ standby_evening?: number;
15111
+ standby_weekend?: number;
15112
+ tvt_change?: number;
15113
+ updated_at?: string;
15114
+ };
15115
+ Update: {
15116
+ created_at?: string;
15117
+ employee_id?: string;
15118
+ entry_date?: string;
15119
+ id?: string;
15120
+ km?: number;
15121
+ meal_allowance?: number;
15122
+ notes?: string | null;
15123
+ standby_evening?: number;
15124
+ standby_weekend?: number;
15125
+ tvt_change?: number;
15126
+ updated_at?: string;
15127
+ };
15128
+ Relationships: [{
15129
+ foreignKeyName: "time_compensation_entries_employee_id_fkey";
15130
+ columns: ["employee_id"];
15131
+ isOneToOne: false;
15132
+ referencedRelation: "profiles";
15133
+ referencedColumns: ["id"];
15134
+ }];
15135
+ };
14983
15136
  time_entries: {
14984
15137
  Row: {
14985
15138
  created_at: string;
@@ -15014,65 +15167,170 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
15014
15167
  undertime?: number;
15015
15168
  updated_at?: string;
15016
15169
  };
15170
+ Relationships: [];
15171
+ };
15172
+ time_log_week_approvals: {
15173
+ Row: {
15174
+ approved_at: string | null;
15175
+ approved_by: string | null;
15176
+ created_at: string;
15177
+ employee_id: string;
15178
+ id: string;
15179
+ locked: boolean;
15180
+ notes: string | null;
15181
+ status: string;
15182
+ submitted_at: string | null;
15183
+ updated_at: string;
15184
+ week_start: string;
15185
+ };
15186
+ Insert: {
15187
+ approved_at?: string | null;
15188
+ approved_by?: string | null;
15189
+ created_at?: string;
15190
+ employee_id: string;
15191
+ id?: string;
15192
+ locked?: boolean;
15193
+ notes?: string | null;
15194
+ status?: string;
15195
+ submitted_at?: string | null;
15196
+ updated_at?: string;
15197
+ week_start: string;
15198
+ };
15199
+ Update: {
15200
+ approved_at?: string | null;
15201
+ approved_by?: string | null;
15202
+ created_at?: string;
15203
+ employee_id?: string;
15204
+ id?: string;
15205
+ locked?: boolean;
15206
+ notes?: string | null;
15207
+ status?: string;
15208
+ submitted_at?: string | null;
15209
+ updated_at?: string;
15210
+ week_start?: string;
15211
+ };
15017
15212
  Relationships: [{
15018
- foreignKeyName: "time_entries_employee_id_fkey";
15213
+ foreignKeyName: "time_log_week_approvals_employee_id_fkey";
15019
15214
  columns: ["employee_id"];
15020
15215
  isOneToOne: false;
15021
- referencedRelation: "monteurs";
15216
+ referencedRelation: "profiles";
15022
15217
  referencedColumns: ["id"];
15023
15218
  }];
15024
15219
  };
15025
15220
  time_logs: {
15026
15221
  Row: {
15222
+ auto_stop_reason: string | null;
15223
+ auto_stopped: boolean;
15027
15224
  created_at: string;
15225
+ current_latitude: number | null;
15226
+ current_longitude: number | null;
15227
+ current_position_updated_at: string | null;
15028
15228
  employee_id: string;
15229
+ end_latitude: number | null;
15230
+ end_longitude: number | null;
15029
15231
  end_time: string | null;
15232
+ eta_distance_km: number | null;
15233
+ eta_minutes: number | null;
15234
+ eta_updated_at: string | null;
15235
+ hour_category: string | null;
15030
15236
  id: string;
15237
+ last_reminder_at: string | null;
15031
15238
  notes: string | null;
15032
15239
  overtime_hours: number;
15033
15240
  overtime_type: string | null;
15034
15241
  regular_hours: number;
15242
+ reminder_count: number;
15243
+ requires_review: boolean;
15244
+ start_latitude: number | null;
15245
+ start_longitude: number | null;
15035
15246
  start_time: string;
15036
15247
  travel_cost: number | null;
15037
15248
  travel_distance_km: number | null;
15249
+ travel_duration_min: number | null;
15250
+ travel_time_minutes: number | null;
15038
15251
  type: string;
15039
15252
  updated_at: string;
15253
+ work_order_id: string | null;
15040
15254
  };
15041
15255
  Insert: {
15256
+ auto_stop_reason?: string | null;
15257
+ auto_stopped?: boolean;
15042
15258
  created_at?: string;
15259
+ current_latitude?: number | null;
15260
+ current_longitude?: number | null;
15261
+ current_position_updated_at?: string | null;
15043
15262
  employee_id: string;
15263
+ end_latitude?: number | null;
15264
+ end_longitude?: number | null;
15044
15265
  end_time?: string | null;
15266
+ eta_distance_km?: number | null;
15267
+ eta_minutes?: number | null;
15268
+ eta_updated_at?: string | null;
15269
+ hour_category?: string | null;
15045
15270
  id?: string;
15271
+ last_reminder_at?: string | null;
15046
15272
  notes?: string | null;
15047
15273
  overtime_hours?: number;
15048
15274
  overtime_type?: string | null;
15049
15275
  regular_hours?: number;
15276
+ reminder_count?: number;
15277
+ requires_review?: boolean;
15278
+ start_latitude?: number | null;
15279
+ start_longitude?: number | null;
15050
15280
  start_time?: string;
15051
15281
  travel_cost?: number | null;
15052
15282
  travel_distance_km?: number | null;
15283
+ travel_duration_min?: number | null;
15284
+ travel_time_minutes?: number | null;
15053
15285
  type: string;
15054
15286
  updated_at?: string;
15287
+ work_order_id?: string | null;
15055
15288
  };
15056
15289
  Update: {
15290
+ auto_stop_reason?: string | null;
15291
+ auto_stopped?: boolean;
15057
15292
  created_at?: string;
15293
+ current_latitude?: number | null;
15294
+ current_longitude?: number | null;
15295
+ current_position_updated_at?: string | null;
15058
15296
  employee_id?: string;
15297
+ end_latitude?: number | null;
15298
+ end_longitude?: number | null;
15059
15299
  end_time?: string | null;
15300
+ eta_distance_km?: number | null;
15301
+ eta_minutes?: number | null;
15302
+ eta_updated_at?: string | null;
15303
+ hour_category?: string | null;
15060
15304
  id?: string;
15305
+ last_reminder_at?: string | null;
15061
15306
  notes?: string | null;
15062
15307
  overtime_hours?: number;
15063
15308
  overtime_type?: string | null;
15064
15309
  regular_hours?: number;
15310
+ reminder_count?: number;
15311
+ requires_review?: boolean;
15312
+ start_latitude?: number | null;
15313
+ start_longitude?: number | null;
15065
15314
  start_time?: string;
15066
15315
  travel_cost?: number | null;
15067
15316
  travel_distance_km?: number | null;
15317
+ travel_duration_min?: number | null;
15318
+ travel_time_minutes?: number | null;
15068
15319
  type?: string;
15069
15320
  updated_at?: string;
15321
+ work_order_id?: string | null;
15070
15322
  };
15071
15323
  Relationships: [{
15072
15324
  foreignKeyName: "time_logs_employee_id_fkey";
15073
15325
  columns: ["employee_id"];
15074
15326
  isOneToOne: false;
15075
- referencedRelation: "monteurs";
15327
+ referencedRelation: "profiles";
15328
+ referencedColumns: ["id"];
15329
+ }, {
15330
+ foreignKeyName: "time_logs_work_order_id_fkey";
15331
+ columns: ["work_order_id"];
15332
+ isOneToOne: false;
15333
+ referencedRelation: "work_orders";
15076
15334
  referencedColumns: ["id"];
15077
15335
  }];
15078
15336
  };
@@ -15111,7 +15369,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
15111
15369
  foreignKeyName: "time_off_entries_employee_id_fkey";
15112
15370
  columns: ["employee_id"];
15113
15371
  isOneToOne: false;
15114
- referencedRelation: "monteurs";
15372
+ referencedRelation: "profiles";
15115
15373
  referencedColumns: ["id"];
15116
15374
  }];
15117
15375
  };
@@ -15421,6 +15679,39 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
15421
15679
  };
15422
15680
  Relationships: [];
15423
15681
  };
15682
+ twinfield_cron_locks: {
15683
+ Row: {
15684
+ created_at: string;
15685
+ heartbeat_at: string;
15686
+ job_name: string;
15687
+ last_error: string | null;
15688
+ last_finished_at: string | null;
15689
+ locked_at: string;
15690
+ run_id: string;
15691
+ updated_at: string;
15692
+ };
15693
+ Insert: {
15694
+ created_at?: string;
15695
+ heartbeat_at?: string;
15696
+ job_name: string;
15697
+ last_error?: string | null;
15698
+ last_finished_at?: string | null;
15699
+ locked_at?: string;
15700
+ run_id?: string;
15701
+ updated_at?: string;
15702
+ };
15703
+ Update: {
15704
+ created_at?: string;
15705
+ heartbeat_at?: string;
15706
+ job_name?: string;
15707
+ last_error?: string | null;
15708
+ last_finished_at?: string | null;
15709
+ locked_at?: string;
15710
+ run_id?: string;
15711
+ updated_at?: string;
15712
+ };
15713
+ Relationships: [];
15714
+ };
15424
15715
  twinfield_customers: {
15425
15716
  Row: {
15426
15717
  address: string | null;
@@ -16021,6 +16312,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
16021
16312
  twinfield_push_queue: {
16022
16313
  Row: {
16023
16314
  action: string;
16315
+ attempt_started_at: string | null;
16024
16316
  attempts: number;
16025
16317
  connection_id: string | null;
16026
16318
  created_at: string;
@@ -16037,6 +16329,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
16037
16329
  };
16038
16330
  Insert: {
16039
16331
  action?: string;
16332
+ attempt_started_at?: string | null;
16040
16333
  attempts?: number;
16041
16334
  connection_id?: string | null;
16042
16335
  created_at?: string;
@@ -16053,6 +16346,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
16053
16346
  };
16054
16347
  Update: {
16055
16348
  action?: string;
16349
+ attempt_started_at?: string | null;
16056
16350
  attempts?: number;
16057
16351
  connection_id?: string | null;
16058
16352
  created_at?: string;
@@ -16250,13 +16544,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
16250
16544
  workday_end?: string | null;
16251
16545
  workday_start?: string | null;
16252
16546
  };
16253
- Relationships: [{
16254
- foreignKeyName: "uren_cao_profiles_monteur_id_fkey";
16255
- columns: ["monteur_id"];
16256
- isOneToOne: true;
16257
- referencedRelation: "monteurs";
16258
- referencedColumns: ["id"];
16259
- }];
16547
+ Relationships: [];
16260
16548
  };
16261
16549
  uren_entries: {
16262
16550
  Row: {
@@ -16302,12 +16590,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
16302
16590
  werkbon_id?: string | null;
16303
16591
  };
16304
16592
  Relationships: [{
16305
- foreignKeyName: "uren_entries_monteur_id_fkey";
16306
- columns: ["monteur_id"];
16307
- isOneToOne: false;
16308
- referencedRelation: "monteurs";
16309
- referencedColumns: ["id"];
16310
- }, {
16311
16593
  foreignKeyName: "uren_entries_werkbon_id_fkey";
16312
16594
  columns: ["werkbon_id"];
16313
16595
  isOneToOne: false;
@@ -16775,13 +17057,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
16775
17057
  submitted_at?: string | null;
16776
17058
  updated_at?: string;
16777
17059
  };
16778
- Relationships: [{
16779
- foreignKeyName: "uren_weekstaten_monteur_id_fkey";
16780
- columns: ["monteur_id"];
16781
- isOneToOne: false;
16782
- referencedRelation: "monteurs";
16783
- referencedColumns: ["id"];
16784
- }];
17060
+ Relationships: [];
16785
17061
  };
16786
17062
  user_module_permissions: {
16787
17063
  Row: {
@@ -16840,6 +17116,51 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
16840
17116
  referencedColumns: ["id"];
16841
17117
  }];
16842
17118
  };
17119
+ van_inventories: {
17120
+ Row: {
17121
+ barcode: string | null;
17122
+ created_at: string;
17123
+ id: string;
17124
+ monteur_id: string | null;
17125
+ price_per_unit: number;
17126
+ product_name: string;
17127
+ quantity_current: number;
17128
+ quantity_min: number;
17129
+ unit: string;
17130
+ updated_at: string;
17131
+ };
17132
+ Insert: {
17133
+ barcode?: string | null;
17134
+ created_at?: string;
17135
+ id?: string;
17136
+ monteur_id?: string | null;
17137
+ price_per_unit?: number;
17138
+ product_name: string;
17139
+ quantity_current?: number;
17140
+ quantity_min?: number;
17141
+ unit?: string;
17142
+ updated_at?: string;
17143
+ };
17144
+ Update: {
17145
+ barcode?: string | null;
17146
+ created_at?: string;
17147
+ id?: string;
17148
+ monteur_id?: string | null;
17149
+ price_per_unit?: number;
17150
+ product_name?: string;
17151
+ quantity_current?: number;
17152
+ quantity_min?: number;
17153
+ unit?: string;
17154
+ updated_at?: string;
17155
+ };
17156
+ Relationships: [{
17157
+ foreignKeyName: "van_inventories_monteur_id_fkey";
17158
+ columns: ["monteur_id"];
17159
+ isOneToOne: false;
17160
+ referencedRelation: "profiles";
17161
+ referencedColumns: ["id"];
17162
+ }];
17163
+ };
16843
17164
  voorraad_custom_fields: {
16844
17165
  Row: {
16845
17166
  created_at: string;
@@ -17790,7 +18111,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
17790
18111
  foreignKeyName: "work_order_monteurs_monteur_id_fkey";
17791
18112
  columns: ["monteur_id"];
17792
18113
  isOneToOne: false;
17793
- referencedRelation: "monteurs";
18114
+ referencedRelation: "profiles";
17794
18115
  referencedColumns: ["id"];
17795
18116
  }, {
17796
18117
  foreignKeyName: "work_order_monteurs_work_order_id_fkey";
@@ -17800,6 +18121,60 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
17800
18121
  referencedColumns: ["id"];
17801
18122
  }];
17802
18123
  };
18124
+ work_order_photos: {
18125
+ Row: {
18126
+ ai_caption: string | null;
18127
+ ai_categorized_at: string | null;
18128
+ ai_labels: import("./types").Json | null;
18129
+ caption: string | null;
18130
+ created_at: string;
18131
+ id: string;
18132
+ monteur_id: string | null;
18133
+ photo_type: string;
18134
+ storage_path: string;
18135
+ updated_at: string;
18136
+ work_order_id: string;
18137
+ };
18138
+ Insert: {
18139
+ ai_caption?: string | null;
18140
+ ai_categorized_at?: string | null;
18141
+ ai_labels?: import("./types").Json | null;
18142
+ caption?: string | null;
18143
+ created_at?: string;
18144
+ id?: string;
18145
+ monteur_id?: string | null;
18146
+ photo_type?: string;
18147
+ storage_path: string;
18148
+ updated_at?: string;
18149
+ work_order_id: string;
18150
+ };
18151
+ Update: {
18152
+ ai_caption?: string | null;
18153
+ ai_categorized_at?: string | null;
18154
+ ai_labels?: import("./types").Json | null;
18155
+ caption?: string | null;
18156
+ created_at?: string;
18157
+ id?: string;
18158
+ monteur_id?: string | null;
18159
+ photo_type?: string;
18160
+ storage_path?: string;
18161
+ updated_at?: string;
18162
+ work_order_id?: string;
18163
+ };
18164
+ Relationships: [{
18165
+ foreignKeyName: "work_order_photos_monteur_id_fkey";
18166
+ columns: ["monteur_id"];
18167
+ isOneToOne: false;
18168
+ referencedRelation: "profiles";
18169
+ referencedColumns: ["id"];
18170
+ }, {
18171
+ foreignKeyName: "work_order_photos_work_order_id_fkey";
18172
+ columns: ["work_order_id"];
18173
+ isOneToOne: false;
18174
+ referencedRelation: "work_orders";
18175
+ referencedColumns: ["id"];
18176
+ }];
18177
+ };
17803
18178
  work_orders: {
17804
18179
  Row: {
17805
18180
  assigned_to: string | null;
@@ -17831,7 +18206,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
17831
18206
  scheduled_end_time: string | null;
17832
18207
  scheduled_start_time: string | null;
17833
18208
  status: string;
17834
- tenant_id: string;
17835
18209
  total_hours_worked: number | null;
17836
18210
  total_price: number | null;
17837
18211
  travel_time_minutes: number | null;
@@ -17869,7 +18243,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
17869
18243
  scheduled_end_time?: string | null;
17870
18244
  scheduled_start_time?: string | null;
17871
18245
  status?: string;
17872
- tenant_id: string;
17873
18246
  total_hours_worked?: number | null;
17874
18247
  total_price?: number | null;
17875
18248
  travel_time_minutes?: number | null;
@@ -17907,7 +18280,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
17907
18280
  scheduled_end_time?: string | null;
17908
18281
  scheduled_start_time?: string | null;
17909
18282
  status?: string;
17910
- tenant_id?: string;
17911
18283
  total_hours_worked?: number | null;
17912
18284
  total_price?: number | null;
17913
18285
  travel_time_minutes?: number | null;
@@ -17921,12 +18293,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
17921
18293
  isOneToOne: false;
17922
18294
  referencedRelation: "work_orders";
17923
18295
  referencedColumns: ["id"];
17924
- }, {
17925
- foreignKeyName: "work_orders_tenant_id_fkey";
17926
- columns: ["tenant_id"];
17927
- isOneToOne: false;
17928
- referencedRelation: "tenants";
17929
- referencedColumns: ["id"];
17930
18296
  }];
17931
18297
  };
17932
18298
  };
@@ -18611,6 +18977,19 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
18611
18977
  };
18612
18978
  Returns: undefined;
18613
18979
  };
18980
+ approve_mailbox_order_proposal: {
18981
+ Args: {
18982
+ p_custom_fields: import("./types").Json;
18983
+ p_customer_id: string;
18984
+ p_delivery_date: string;
18985
+ p_field_values?: import("./types").Json;
18986
+ p_lines: import("./types").Json;
18987
+ p_notes: string;
18988
+ p_proposal_id: string;
18989
+ p_reviewed_by: string;
18990
+ };
18991
+ Returns: import("./types").Json;
18992
+ };
18614
18993
  assign_cart_numbers: {
18615
18994
  Args: {
18616
18995
  p_carts: import("./types").Json;
@@ -18662,6 +19041,10 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
18662
19041
  };
18663
19042
  Returns: number;
18664
19043
  };
19044
+ can_manage_hours: {
19045
+ Args: never;
19046
+ Returns: boolean;
19047
+ };
18665
19048
  check_offer_product_available_stock: {
18666
19049
  Args: {
18667
19050
  p_campaign_product_id: string;
@@ -18851,6 +19234,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
18851
19234
  };
18852
19235
  Returns: {
18853
19236
  action: string;
19237
+ attempt_started_at: string | null;
18854
19238
  attempts: number;
18855
19239
  connection_id: string | null;
18856
19240
  created_at: string;
@@ -18938,6 +19322,30 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
18938
19322
  agent_naam: string;
18939
19323
  }[];
18940
19324
  };
19325
+ consume_van_inventory: {
19326
+ Args: {
19327
+ p_inventory_id: string;
19328
+ p_quantity: number;
19329
+ };
19330
+ Returns: {
19331
+ barcode: string | null;
19332
+ created_at: string;
19333
+ id: string;
19334
+ monteur_id: string | null;
19335
+ price_per_unit: number;
19336
+ product_name: string;
19337
+ quantity_current: number;
19338
+ quantity_min: number;
19339
+ unit: string;
19340
+ updated_at: string;
19341
+ };
19342
+ SetofOptions: {
19343
+ from: "*";
19344
+ to: "van_inventories";
19345
+ isOneToOne: true;
19346
+ isSetofReturn: false;
19347
+ };
19348
+ };
18941
19349
  control_get_todays_carts: {
18942
19350
  Args: never;
18943
19351
  Returns: {
@@ -19013,7 +19421,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
19013
19421
  Returns: string;
19014
19422
  } | {
19015
19423
  Args: {
19016
- _feature_id?: string;
19424
+ _feature_id: string;
19017
19425
  _module_id: string;
19018
19426
  _user_id: string;
19019
19427
  };
@@ -19369,12 +19777,6 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
19369
19777
  Args: never;
19370
19778
  Returns: string;
19371
19779
  };
19372
- get_work_order_tenant_id: {
19373
- Args: {
19374
- wo_id: string;
19375
- };
19376
- Returns: string;
19377
- };
19378
19780
  has_module_permission: {
19379
19781
  Args: {
19380
19782
  _min: string;
@@ -19408,6 +19810,13 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
19408
19810
  };
19409
19811
  Returns: boolean;
19410
19812
  };
19813
+ is_time_log_week_locked: {
19814
+ Args: {
19815
+ p_employee_id: string;
19816
+ p_start_time: string;
19817
+ };
19818
+ Returns: boolean;
19819
+ };
19411
19820
  is_user_admin: {
19412
19821
  Args: never;
19413
19822
  Returns: boolean;
@@ -19422,13 +19831,14 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
19422
19831
  };
19423
19832
  Returns: boolean;
19424
19833
  };
19425
- list_monteurs: {
19834
+ list_medewerkers: {
19426
19835
  Args: never;
19427
19836
  Returns: {
19428
19837
  avatar_url: string;
19429
19838
  display_name: string;
19430
19839
  email: string;
19431
19840
  id: string;
19841
+ roles: string[];
19432
19842
  }[];
19433
19843
  };
19434
19844
  list_my_planning_items: {
@@ -21100,6 +21510,16 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
21100
21510
  };
21101
21511
  Returns: string[];
21102
21512
  };
21513
+ switch_time_log: {
21514
+ Args: {
21515
+ p_employee_id: string;
21516
+ p_start_lat?: number;
21517
+ p_start_lng?: number;
21518
+ p_type: string;
21519
+ p_work_order_id?: string;
21520
+ };
21521
+ Returns: import("./types").Json;
21522
+ };
21103
21523
  sync_all_layer_stocks: {
21104
21524
  Args: never;
21105
21525
  Returns: undefined;
@@ -21150,6 +21570,24 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
21150
21570
  };
21151
21571
  Returns: boolean;
21152
21572
  };
21573
+ twinfield_cron_lock_acquire: {
21574
+ Args: {
21575
+ _job_name: string;
21576
+ _stale_seconds?: number;
21577
+ };
21578
+ Returns: boolean;
21579
+ };
21580
+ twinfield_cron_lock_release: {
21581
+ Args: {
21582
+ _error?: string;
21583
+ _job_name: string;
21584
+ };
21585
+ Returns: undefined;
21586
+ };
21587
+ twinfield_prune_push_queue: {
21588
+ Args: never;
21589
+ Returns: number;
21590
+ };
21153
21591
  twinfield_register_cron: {
21154
21592
  Args: {
21155
21593
  apikey?: string;