@flowselections/admin-installatietechniek 1.0.5 → 1.0.7

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 (27) hide show
  1. package/dist-lib/components/AdminForInstallatieTechniek.d.ts.map +1 -1
  2. package/dist-lib/components/AdminForInstallatieTechniek.js +265 -21
  3. package/dist-lib/hooks/useModulePermission.d.ts +2 -1
  4. package/dist-lib/hooks/useModulePermission.d.ts.map +1 -1
  5. package/dist-lib/index.d.ts +5 -4
  6. package/dist-lib/index.d.ts.map +1 -1
  7. package/dist-lib/index.js +3 -3
  8. package/dist-lib/integrations/supabase/auth-attacher.d.ts.map +1 -1
  9. package/dist-lib/integrations/supabase/auth-attacher.js +11 -1
  10. package/dist-lib/integrations/supabase/auth-middleware.d.ts +841 -155
  11. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  12. package/dist-lib/integrations/supabase/client.d.ts +841 -155
  13. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  14. package/dist-lib/integrations/supabase/client.server.d.ts +841 -155
  15. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  16. package/dist-lib/integrations/supabase/types.d.ts +870 -157
  17. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  18. package/dist-lib/integrations/supabase/types.js +3 -0
  19. package/dist-lib/lib/admin.functions.d.ts +146927 -1852
  20. package/dist-lib/lib/admin.functions.d.ts.map +1 -1
  21. package/dist-lib/lib/admin.functions.js +446 -25
  22. package/dist-lib/lib/permission-types.d.ts +7 -0
  23. package/dist-lib/lib/permission-types.d.ts.map +1 -0
  24. package/dist-lib/lib/permission-types.js +1 -0
  25. package/dist-lib/lib/permissions.server.d.ts +1 -1
  26. package/dist-lib/lib/permissions.server.d.ts.map +1 -1
  27. package/package.json +3 -3
@@ -7542,6 +7542,63 @@ export type Database = {
7542
7542
  };
7543
7543
  Relationships: [];
7544
7544
  };
7545
+ invoice_items: {
7546
+ Row: {
7547
+ created_at: string;
7548
+ description: string;
7549
+ id: string;
7550
+ invoice_id: string;
7551
+ kind: string;
7552
+ quantity: number;
7553
+ sort_order: number;
7554
+ source_line_ref: string | null;
7555
+ total_cents: number;
7556
+ unit: string;
7557
+ unit_price_cents: number;
7558
+ };
7559
+ Insert: {
7560
+ created_at?: string;
7561
+ description?: string;
7562
+ id?: string;
7563
+ invoice_id: string;
7564
+ kind?: string;
7565
+ quantity?: number;
7566
+ sort_order?: number;
7567
+ source_line_ref?: string | null;
7568
+ total_cents?: number;
7569
+ unit?: string;
7570
+ unit_price_cents?: number;
7571
+ };
7572
+ Update: {
7573
+ created_at?: string;
7574
+ description?: string;
7575
+ id?: string;
7576
+ invoice_id?: string;
7577
+ kind?: string;
7578
+ quantity?: number;
7579
+ sort_order?: number;
7580
+ source_line_ref?: string | null;
7581
+ total_cents?: number;
7582
+ unit?: string;
7583
+ unit_price_cents?: number;
7584
+ };
7585
+ Relationships: [
7586
+ {
7587
+ foreignKeyName: "invoice_items_invoice_id_fkey";
7588
+ columns: ["invoice_id"];
7589
+ isOneToOne: false;
7590
+ referencedRelation: "invoices";
7591
+ referencedColumns: ["id"];
7592
+ },
7593
+ {
7594
+ foreignKeyName: "invoice_items_invoice_id_fkey";
7595
+ columns: ["invoice_id"];
7596
+ isOneToOne: false;
7597
+ referencedRelation: "uren_facturen";
7598
+ referencedColumns: ["id"];
7599
+ }
7600
+ ];
7601
+ };
7545
7602
  invoice_post_idempotency: {
7546
7603
  Row: {
7547
7604
  client_request_id: string;
@@ -7772,6 +7829,77 @@ export type Database = {
7772
7829
  };
7773
7830
  Relationships: [];
7774
7831
  };
7832
+ invoices: {
7833
+ Row: {
7834
+ created_at: string;
7835
+ created_by: string | null;
7836
+ customer_id: string | null;
7837
+ customer_name: string | null;
7838
+ due_date: string | null;
7839
+ id: string;
7840
+ invoice_date: string;
7841
+ invoice_number: string | null;
7842
+ note: string | null;
7843
+ source_number: string | null;
7844
+ source_ref: string | null;
7845
+ source_type: string;
7846
+ status: string;
7847
+ subtotal_cents: number;
7848
+ total_cents: number;
7849
+ updated_at: string;
7850
+ vat_cents: number;
7851
+ vat_rate: number;
7852
+ };
7853
+ Insert: {
7854
+ created_at?: string;
7855
+ created_by?: string | null;
7856
+ customer_id?: string | null;
7857
+ customer_name?: string | null;
7858
+ due_date?: string | null;
7859
+ id?: string;
7860
+ invoice_date?: string;
7861
+ invoice_number?: string | null;
7862
+ note?: string | null;
7863
+ source_number?: string | null;
7864
+ source_ref?: string | null;
7865
+ source_type?: string;
7866
+ status?: string;
7867
+ subtotal_cents?: number;
7868
+ total_cents?: number;
7869
+ updated_at?: string;
7870
+ vat_cents?: number;
7871
+ vat_rate?: number;
7872
+ };
7873
+ Update: {
7874
+ created_at?: string;
7875
+ created_by?: string | null;
7876
+ customer_id?: string | null;
7877
+ customer_name?: string | null;
7878
+ due_date?: string | null;
7879
+ id?: string;
7880
+ invoice_date?: string;
7881
+ invoice_number?: string | null;
7882
+ note?: string | null;
7883
+ source_number?: string | null;
7884
+ source_ref?: string | null;
7885
+ source_type?: string;
7886
+ status?: string;
7887
+ subtotal_cents?: number;
7888
+ total_cents?: number;
7889
+ updated_at?: string;
7890
+ vat_cents?: number;
7891
+ vat_rate?: number;
7892
+ };
7893
+ Relationships: [
7894
+ {
7895
+ foreignKeyName: "invoices_customer_id_fkey";
7896
+ columns: ["customer_id"];
7897
+ isOneToOne: false;
7898
+ referencedRelation: "itk_customers";
7899
+ referencedColumns: ["id"];
7900
+ }
7901
+ ];
7902
+ };
7775
7903
  itk_contact_persons: {
7776
7904
  Row: {
7777
7905
  created_at: string;
@@ -7976,6 +8104,269 @@ export type Database = {
7976
8104
  };
7977
8105
  Relationships: [];
7978
8106
  };
8107
+ itk_offerte_events: {
8108
+ Row: {
8109
+ created_at: string;
8110
+ event_type: string;
8111
+ id: string;
8112
+ metadata: Json;
8113
+ offerte_id: string;
8114
+ omschrijving: string | null;
8115
+ user_id: string | null;
8116
+ };
8117
+ Insert: {
8118
+ created_at?: string;
8119
+ event_type: string;
8120
+ id?: string;
8121
+ metadata?: Json;
8122
+ offerte_id: string;
8123
+ omschrijving?: string | null;
8124
+ user_id?: string | null;
8125
+ };
8126
+ Update: {
8127
+ created_at?: string;
8128
+ event_type?: string;
8129
+ id?: string;
8130
+ metadata?: Json;
8131
+ offerte_id?: string;
8132
+ omschrijving?: string | null;
8133
+ user_id?: string | null;
8134
+ };
8135
+ Relationships: [
8136
+ {
8137
+ foreignKeyName: "itk_offerte_events_offerte_id_fkey";
8138
+ columns: ["offerte_id"];
8139
+ isOneToOne: false;
8140
+ referencedRelation: "itk_offertes";
8141
+ referencedColumns: ["id"];
8142
+ }
8143
+ ];
8144
+ };
8145
+ itk_offerte_regels: {
8146
+ Row: {
8147
+ created_at: string;
8148
+ id: string;
8149
+ line_total_cents: number;
8150
+ offerte_id: string;
8151
+ omschrijving: string;
8152
+ package_id: string | null;
8153
+ quantity: number;
8154
+ sort_order: number;
8155
+ source: string;
8156
+ unit_price_cents: number;
8157
+ updated_at: string;
8158
+ };
8159
+ Insert: {
8160
+ created_at?: string;
8161
+ id?: string;
8162
+ line_total_cents?: number;
8163
+ offerte_id: string;
8164
+ omschrijving?: string;
8165
+ package_id?: string | null;
8166
+ quantity?: number;
8167
+ sort_order?: number;
8168
+ source?: string;
8169
+ unit_price_cents?: number;
8170
+ updated_at?: string;
8171
+ };
8172
+ Update: {
8173
+ created_at?: string;
8174
+ id?: string;
8175
+ line_total_cents?: number;
8176
+ offerte_id?: string;
8177
+ omschrijving?: string;
8178
+ package_id?: string | null;
8179
+ quantity?: number;
8180
+ sort_order?: number;
8181
+ source?: string;
8182
+ unit_price_cents?: number;
8183
+ updated_at?: string;
8184
+ };
8185
+ Relationships: [
8186
+ {
8187
+ foreignKeyName: "itk_offerte_regels_offerte_id_fkey";
8188
+ columns: ["offerte_id"];
8189
+ isOneToOne: false;
8190
+ referencedRelation: "itk_offertes";
8191
+ referencedColumns: ["id"];
8192
+ },
8193
+ {
8194
+ foreignKeyName: "itk_offerte_regels_package_id_fkey";
8195
+ columns: ["package_id"];
8196
+ isOneToOne: false;
8197
+ referencedRelation: "werkbon_packages";
8198
+ referencedColumns: ["id"];
8199
+ }
8200
+ ];
8201
+ };
8202
+ itk_offerte_settings: {
8203
+ Row: {
8204
+ auto_convert_binnen_mandaat: boolean;
8205
+ created_at: string;
8206
+ default_geldigheid_dagen: number;
8207
+ default_vat_rate: number;
8208
+ id: string;
8209
+ singleton: boolean;
8210
+ updated_at: string;
8211
+ };
8212
+ Insert: {
8213
+ auto_convert_binnen_mandaat?: boolean;
8214
+ created_at?: string;
8215
+ default_geldigheid_dagen?: number;
8216
+ default_vat_rate?: number;
8217
+ id?: string;
8218
+ singleton?: boolean;
8219
+ updated_at?: string;
8220
+ };
8221
+ Update: {
8222
+ auto_convert_binnen_mandaat?: boolean;
8223
+ created_at?: string;
8224
+ default_geldigheid_dagen?: number;
8225
+ default_vat_rate?: number;
8226
+ id?: string;
8227
+ singleton?: boolean;
8228
+ updated_at?: string;
8229
+ };
8230
+ Relationships: [];
8231
+ };
8232
+ itk_offertes: {
8233
+ Row: {
8234
+ ai_generated: boolean;
8235
+ approved_at: string | null;
8236
+ binnen_mandaat: boolean;
8237
+ contact_id: string | null;
8238
+ converted_at: string | null;
8239
+ created_at: string;
8240
+ created_by: string | null;
8241
+ customer_id: string | null;
8242
+ follow_up_werkbon_id: string | null;
8243
+ id: string;
8244
+ jaar: number;
8245
+ mandaat_restant_cents: number;
8246
+ notities: string | null;
8247
+ offerte_number: string | null;
8248
+ omschrijving: string;
8249
+ rejected_at: string | null;
8250
+ sent_at: string | null;
8251
+ source_number: string | null;
8252
+ source_ref: string | null;
8253
+ source_type: string;
8254
+ status: string;
8255
+ subtotal_cents: number;
8256
+ total_cents: number;
8257
+ updated_at: string;
8258
+ valid_until: string | null;
8259
+ vat_cents: number;
8260
+ vat_rate: number;
8261
+ viewed_at: string | null;
8262
+ volgnummer: number | null;
8263
+ werkbon_id: string | null;
8264
+ work_location_id: string | null;
8265
+ };
8266
+ Insert: {
8267
+ ai_generated?: boolean;
8268
+ approved_at?: string | null;
8269
+ binnen_mandaat?: boolean;
8270
+ contact_id?: string | null;
8271
+ converted_at?: string | null;
8272
+ created_at?: string;
8273
+ created_by?: string | null;
8274
+ customer_id?: string | null;
8275
+ follow_up_werkbon_id?: string | null;
8276
+ id?: string;
8277
+ jaar?: number;
8278
+ mandaat_restant_cents?: number;
8279
+ notities?: string | null;
8280
+ offerte_number?: string | null;
8281
+ omschrijving?: string;
8282
+ rejected_at?: string | null;
8283
+ sent_at?: string | null;
8284
+ source_number?: string | null;
8285
+ source_ref?: string | null;
8286
+ source_type?: string;
8287
+ status?: string;
8288
+ subtotal_cents?: number;
8289
+ total_cents?: number;
8290
+ updated_at?: string;
8291
+ valid_until?: string | null;
8292
+ vat_cents?: number;
8293
+ vat_rate?: number;
8294
+ viewed_at?: string | null;
8295
+ volgnummer?: number | null;
8296
+ werkbon_id?: string | null;
8297
+ work_location_id?: string | null;
8298
+ };
8299
+ Update: {
8300
+ ai_generated?: boolean;
8301
+ approved_at?: string | null;
8302
+ binnen_mandaat?: boolean;
8303
+ contact_id?: string | null;
8304
+ converted_at?: string | null;
8305
+ created_at?: string;
8306
+ created_by?: string | null;
8307
+ customer_id?: string | null;
8308
+ follow_up_werkbon_id?: string | null;
8309
+ id?: string;
8310
+ jaar?: number;
8311
+ mandaat_restant_cents?: number;
8312
+ notities?: string | null;
8313
+ offerte_number?: string | null;
8314
+ omschrijving?: string;
8315
+ rejected_at?: string | null;
8316
+ sent_at?: string | null;
8317
+ source_number?: string | null;
8318
+ source_ref?: string | null;
8319
+ source_type?: string;
8320
+ status?: string;
8321
+ subtotal_cents?: number;
8322
+ total_cents?: number;
8323
+ updated_at?: string;
8324
+ valid_until?: string | null;
8325
+ vat_cents?: number;
8326
+ vat_rate?: number;
8327
+ viewed_at?: string | null;
8328
+ volgnummer?: number | null;
8329
+ werkbon_id?: string | null;
8330
+ work_location_id?: string | null;
8331
+ };
8332
+ Relationships: [
8333
+ {
8334
+ foreignKeyName: "itk_offertes_contact_id_fkey";
8335
+ columns: ["contact_id"];
8336
+ isOneToOne: false;
8337
+ referencedRelation: "itk_contact_persons";
8338
+ referencedColumns: ["id"];
8339
+ },
8340
+ {
8341
+ foreignKeyName: "itk_offertes_customer_id_fkey";
8342
+ columns: ["customer_id"];
8343
+ isOneToOne: false;
8344
+ referencedRelation: "itk_customers";
8345
+ referencedColumns: ["id"];
8346
+ },
8347
+ {
8348
+ foreignKeyName: "itk_offertes_follow_up_werkbon_id_fkey";
8349
+ columns: ["follow_up_werkbon_id"];
8350
+ isOneToOne: false;
8351
+ referencedRelation: "werkbonnen";
8352
+ referencedColumns: ["id"];
8353
+ },
8354
+ {
8355
+ foreignKeyName: "itk_offertes_werkbon_id_fkey";
8356
+ columns: ["werkbon_id"];
8357
+ isOneToOne: false;
8358
+ referencedRelation: "werkbonnen";
8359
+ referencedColumns: ["id"];
8360
+ },
8361
+ {
8362
+ foreignKeyName: "itk_offertes_work_location_id_fkey";
8363
+ columns: ["work_location_id"];
8364
+ isOneToOne: false;
8365
+ referencedRelation: "itk_work_locations";
8366
+ referencedColumns: ["id"];
8367
+ }
8368
+ ];
8369
+ };
7979
8370
  itk_work_locations: {
7980
8371
  Row: {
7981
8372
  city: string | null;
@@ -10410,6 +10801,65 @@ export type Database = {
10410
10801
  }
10411
10802
  ];
10412
10803
  };
10804
+ medewerker_details: {
10805
+ Row: {
10806
+ color: string | null;
10807
+ created_at: string;
10808
+ hours_fri: number | null;
10809
+ hours_mon: number | null;
10810
+ hours_thu: number | null;
10811
+ hours_tue: number | null;
10812
+ hours_wed: number | null;
10813
+ id: string;
10814
+ is_active: boolean;
10815
+ leave_balance_hours: number;
10816
+ persnr: string | null;
10817
+ phone: string | null;
10818
+ profile_id: string;
10819
+ updated_at: string;
10820
+ };
10821
+ Insert: {
10822
+ color?: string | null;
10823
+ created_at?: string;
10824
+ hours_fri?: number | null;
10825
+ hours_mon?: number | null;
10826
+ hours_thu?: number | null;
10827
+ hours_tue?: number | null;
10828
+ hours_wed?: number | null;
10829
+ id?: string;
10830
+ is_active?: boolean;
10831
+ leave_balance_hours?: number;
10832
+ persnr?: string | null;
10833
+ phone?: string | null;
10834
+ profile_id: string;
10835
+ updated_at?: string;
10836
+ };
10837
+ Update: {
10838
+ color?: string | null;
10839
+ created_at?: string;
10840
+ hours_fri?: number | null;
10841
+ hours_mon?: number | null;
10842
+ hours_thu?: number | null;
10843
+ hours_tue?: number | null;
10844
+ hours_wed?: number | null;
10845
+ id?: string;
10846
+ is_active?: boolean;
10847
+ leave_balance_hours?: number;
10848
+ persnr?: string | null;
10849
+ phone?: string | null;
10850
+ profile_id?: string;
10851
+ updated_at?: string;
10852
+ };
10853
+ Relationships: [
10854
+ {
10855
+ foreignKeyName: "medewerker_details_profile_id_fkey";
10856
+ columns: ["profile_id"];
10857
+ isOneToOne: true;
10858
+ referencedRelation: "profiles";
10859
+ referencedColumns: ["id"];
10860
+ }
10861
+ ];
10862
+ };
10413
10863
  module_features: {
10414
10864
  Row: {
10415
10865
  created_at: string;
@@ -11744,6 +12194,8 @@ export type Database = {
11744
12194
  orders: {
11745
12195
  Row: {
11746
12196
  buffer_id: string | null;
12197
+ cancel_reason: string | null;
12198
+ cancelled_at: string | null;
11747
12199
  created_at: string;
11748
12200
  custom_fields: Json;
11749
12201
  customer_id: string | null;
@@ -11766,6 +12218,8 @@ export type Database = {
11766
12218
  };
11767
12219
  Insert: {
11768
12220
  buffer_id?: string | null;
12221
+ cancel_reason?: string | null;
12222
+ cancelled_at?: string | null;
11769
12223
  created_at?: string;
11770
12224
  custom_fields?: Json;
11771
12225
  customer_id?: string | null;
@@ -11788,6 +12242,8 @@ export type Database = {
11788
12242
  };
11789
12243
  Update: {
11790
12244
  buffer_id?: string | null;
12245
+ cancel_reason?: string | null;
12246
+ cancelled_at?: string | null;
11791
12247
  created_at?: string;
11792
12248
  custom_fields?: Json;
11793
12249
  customer_id?: string | null;
@@ -13922,6 +14378,71 @@ export type Database = {
13922
14378
  };
13923
14379
  Relationships: [];
13924
14380
  };
14381
+ profile_modules: {
14382
+ Row: {
14383
+ created_at: string;
14384
+ id: string;
14385
+ module_id: string;
14386
+ profile_id: string;
14387
+ };
14388
+ Insert: {
14389
+ created_at?: string;
14390
+ id?: string;
14391
+ module_id: string;
14392
+ profile_id: string;
14393
+ };
14394
+ Update: {
14395
+ created_at?: string;
14396
+ id?: string;
14397
+ module_id?: string;
14398
+ profile_id?: string;
14399
+ };
14400
+ Relationships: [
14401
+ {
14402
+ foreignKeyName: "profile_modules_profile_id_fkey";
14403
+ columns: ["profile_id"];
14404
+ isOneToOne: false;
14405
+ referencedRelation: "profiles_org";
14406
+ referencedColumns: ["id"];
14407
+ }
14408
+ ];
14409
+ };
14410
+ profile_roles: {
14411
+ Row: {
14412
+ created_at: string;
14413
+ id: string;
14414
+ profile_id: string;
14415
+ role_id: string;
14416
+ };
14417
+ Insert: {
14418
+ created_at?: string;
14419
+ id?: string;
14420
+ profile_id: string;
14421
+ role_id: string;
14422
+ };
14423
+ Update: {
14424
+ created_at?: string;
14425
+ id?: string;
14426
+ profile_id?: string;
14427
+ role_id?: string;
14428
+ };
14429
+ Relationships: [
14430
+ {
14431
+ foreignKeyName: "profile_roles_profile_id_fkey";
14432
+ columns: ["profile_id"];
14433
+ isOneToOne: false;
14434
+ referencedRelation: "profiles_org";
14435
+ referencedColumns: ["id"];
14436
+ },
14437
+ {
14438
+ foreignKeyName: "profile_roles_role_id_fkey";
14439
+ columns: ["role_id"];
14440
+ isOneToOne: false;
14441
+ referencedRelation: "roles";
14442
+ referencedColumns: ["id"];
14443
+ }
14444
+ ];
14445
+ };
13925
14446
  profiles: {
13926
14447
  Row: {
13927
14448
  address: string | null;
@@ -13969,6 +14490,41 @@ export type Database = {
13969
14490
  }
13970
14491
  ];
13971
14492
  };
14493
+ profiles_org: {
14494
+ Row: {
14495
+ created_at: string;
14496
+ id: string;
14497
+ is_default: boolean;
14498
+ name: string;
14499
+ tenant_id: string | null;
14500
+ updated_at: string;
14501
+ };
14502
+ Insert: {
14503
+ created_at?: string;
14504
+ id?: string;
14505
+ is_default?: boolean;
14506
+ name: string;
14507
+ tenant_id?: string | null;
14508
+ updated_at?: string;
14509
+ };
14510
+ Update: {
14511
+ created_at?: string;
14512
+ id?: string;
14513
+ is_default?: boolean;
14514
+ name?: string;
14515
+ tenant_id?: string | null;
14516
+ updated_at?: string;
14517
+ };
14518
+ Relationships: [
14519
+ {
14520
+ foreignKeyName: "profiles_org_tenant_id_fkey";
14521
+ columns: ["tenant_id"];
14522
+ isOneToOne: false;
14523
+ referencedRelation: "tenants";
14524
+ referencedColumns: ["id"];
14525
+ }
14526
+ ];
14527
+ };
13972
14528
  projects: {
13973
14529
  Row: {
13974
14530
  contact_name: string | null;
@@ -15186,6 +15742,7 @@ export type Database = {
15186
15742
  type: string;
15187
15743
  updated_at: string;
15188
15744
  vereist_medewerker: boolean;
15745
+ werkplek: string | null;
15189
15746
  };
15190
15747
  Insert: {
15191
15748
  actief?: boolean;
@@ -15199,6 +15756,7 @@ export type Database = {
15199
15756
  type?: string;
15200
15757
  updated_at?: string;
15201
15758
  vereist_medewerker?: boolean;
15759
+ werkplek?: string | null;
15202
15760
  };
15203
15761
  Update: {
15204
15762
  actief?: boolean;
@@ -15212,9 +15770,48 @@ export type Database = {
15212
15770
  type?: string;
15213
15771
  updated_at?: string;
15214
15772
  vereist_medewerker?: boolean;
15773
+ werkplek?: string | null;
15215
15774
  };
15216
15775
  Relationships: [];
15217
15776
  };
15777
+ sick_periods: {
15778
+ Row: {
15779
+ created_at: string;
15780
+ employee_id: string;
15781
+ end_date: string | null;
15782
+ id: string;
15783
+ notes: string | null;
15784
+ start_date: string;
15785
+ updated_at: string;
15786
+ };
15787
+ Insert: {
15788
+ created_at?: string;
15789
+ employee_id: string;
15790
+ end_date?: string | null;
15791
+ id?: string;
15792
+ notes?: string | null;
15793
+ start_date: string;
15794
+ updated_at?: string;
15795
+ };
15796
+ Update: {
15797
+ created_at?: string;
15798
+ employee_id?: string;
15799
+ end_date?: string | null;
15800
+ id?: string;
15801
+ notes?: string | null;
15802
+ start_date?: string;
15803
+ updated_at?: string;
15804
+ };
15805
+ Relationships: [
15806
+ {
15807
+ foreignKeyName: "sick_periods_employee_id_fkey";
15808
+ columns: ["employee_id"];
15809
+ isOneToOne: false;
15810
+ referencedRelation: "profiles";
15811
+ referencedColumns: ["id"];
15812
+ }
15813
+ ];
15814
+ };
15218
15815
  sidebar_config: {
15219
15816
  Row: {
15220
15817
  id: string;
@@ -17023,182 +17620,69 @@ export type Database = {
17023
17620
  hours?: number;
17024
17621
  id?: string;
17025
17622
  kind?: string;
17026
- monteur_id: string;
17027
- note?: string | null;
17028
- source?: string;
17029
- travel_km?: number;
17030
- updated_at?: string;
17031
- werkbon_id?: string | null;
17032
- };
17033
- Update: {
17034
- created_at?: string;
17035
- created_by?: string | null;
17036
- entry_date?: string;
17037
- hours?: number;
17038
- id?: string;
17039
- kind?: string;
17040
- monteur_id?: string;
17041
- note?: string | null;
17042
- source?: string;
17043
- travel_km?: number;
17044
- updated_at?: string;
17045
- werkbon_id?: string | null;
17046
- };
17047
- Relationships: [
17048
- {
17049
- foreignKeyName: "uren_entries_werkbon_id_fkey";
17050
- columns: ["werkbon_id"];
17051
- isOneToOne: false;
17052
- referencedRelation: "werkbonnen";
17053
- referencedColumns: ["id"];
17054
- }
17055
- ];
17056
- };
17057
- uren_exports: {
17058
- Row: {
17059
- created_at: string;
17060
- created_by: string | null;
17061
- file_name: string | null;
17062
- id: string;
17063
- monteur_ids: string[];
17064
- period_end: string;
17065
- period_start: string;
17066
- row_count: number;
17067
- };
17068
- Insert: {
17069
- created_at?: string;
17070
- created_by?: string | null;
17071
- file_name?: string | null;
17072
- id?: string;
17073
- monteur_ids?: string[];
17074
- period_end: string;
17075
- period_start: string;
17076
- row_count?: number;
17077
- };
17078
- Update: {
17079
- created_at?: string;
17080
- created_by?: string | null;
17081
- file_name?: string | null;
17082
- id?: string;
17083
- monteur_ids?: string[];
17084
- period_end?: string;
17085
- period_start?: string;
17086
- row_count?: number;
17087
- };
17088
- Relationships: [];
17089
- };
17090
- uren_facturen: {
17091
- Row: {
17092
- created_at: string;
17093
- created_by: string | null;
17094
- customer_id: string | null;
17095
- customer_name: string | null;
17096
- id: string;
17097
- invoice_number: string | null;
17098
- note: string | null;
17099
- status: string;
17100
- total_excl_cents: number;
17101
- total_incl_cents: number;
17102
- updated_at: string;
17103
- vat_cents: number;
17104
- vat_percentage: number;
17105
- werkbon_id: string | null;
17106
- };
17107
- Insert: {
17108
- created_at?: string;
17109
- created_by?: string | null;
17110
- customer_id?: string | null;
17111
- customer_name?: string | null;
17112
- id?: string;
17113
- invoice_number?: string | null;
17623
+ monteur_id: string;
17114
17624
  note?: string | null;
17115
- status?: string;
17116
- total_excl_cents?: number;
17117
- total_incl_cents?: number;
17625
+ source?: string;
17626
+ travel_km?: number;
17118
17627
  updated_at?: string;
17119
- vat_cents?: number;
17120
- vat_percentage?: number;
17121
17628
  werkbon_id?: string | null;
17122
17629
  };
17123
17630
  Update: {
17124
17631
  created_at?: string;
17125
17632
  created_by?: string | null;
17126
- customer_id?: string | null;
17127
- customer_name?: string | null;
17633
+ entry_date?: string;
17634
+ hours?: number;
17128
17635
  id?: string;
17129
- invoice_number?: string | null;
17636
+ kind?: string;
17637
+ monteur_id?: string;
17130
17638
  note?: string | null;
17131
- status?: string;
17132
- total_excl_cents?: number;
17133
- total_incl_cents?: number;
17639
+ source?: string;
17640
+ travel_km?: number;
17134
17641
  updated_at?: string;
17135
- vat_cents?: number;
17136
- vat_percentage?: number;
17137
17642
  werkbon_id?: string | null;
17138
17643
  };
17139
17644
  Relationships: [
17140
17645
  {
17141
- foreignKeyName: "uren_facturen_customer_id_fkey";
17142
- columns: ["customer_id"];
17143
- isOneToOne: false;
17144
- referencedRelation: "itk_customers";
17145
- referencedColumns: ["id"];
17146
- },
17147
- {
17148
- foreignKeyName: "uren_facturen_werkbon_id_fkey";
17646
+ foreignKeyName: "uren_entries_werkbon_id_fkey";
17149
17647
  columns: ["werkbon_id"];
17150
- isOneToOne: true;
17648
+ isOneToOne: false;
17151
17649
  referencedRelation: "werkbonnen";
17152
17650
  referencedColumns: ["id"];
17153
17651
  }
17154
17652
  ];
17155
17653
  };
17156
- uren_factuur_regels: {
17654
+ uren_exports: {
17157
17655
  Row: {
17158
17656
  created_at: string;
17159
- description: string;
17160
- factuur_id: string;
17657
+ created_by: string | null;
17658
+ file_name: string | null;
17161
17659
  id: string;
17162
- kind: string | null;
17163
- quantity: number;
17164
- sort_order: number;
17165
- total_cents: number;
17166
- unit: string;
17167
- unit_price_cents: number;
17660
+ monteur_ids: string[];
17661
+ period_end: string;
17662
+ period_start: string;
17663
+ row_count: number;
17168
17664
  };
17169
17665
  Insert: {
17170
17666
  created_at?: string;
17171
- description: string;
17172
- factuur_id: string;
17667
+ created_by?: string | null;
17668
+ file_name?: string | null;
17173
17669
  id?: string;
17174
- kind?: string | null;
17175
- quantity?: number;
17176
- sort_order?: number;
17177
- total_cents?: number;
17178
- unit?: string;
17179
- unit_price_cents?: number;
17670
+ monteur_ids?: string[];
17671
+ period_end: string;
17672
+ period_start: string;
17673
+ row_count?: number;
17180
17674
  };
17181
17675
  Update: {
17182
17676
  created_at?: string;
17183
- description?: string;
17184
- factuur_id?: string;
17677
+ created_by?: string | null;
17678
+ file_name?: string | null;
17185
17679
  id?: string;
17186
- kind?: string | null;
17187
- quantity?: number;
17188
- sort_order?: number;
17189
- total_cents?: number;
17190
- unit?: string;
17191
- unit_price_cents?: number;
17680
+ monteur_ids?: string[];
17681
+ period_end?: string;
17682
+ period_start?: string;
17683
+ row_count?: number;
17192
17684
  };
17193
- Relationships: [
17194
- {
17195
- foreignKeyName: "uren_factuur_regels_factuur_id_fkey";
17196
- columns: ["factuur_id"];
17197
- isOneToOne: false;
17198
- referencedRelation: "uren_facturen";
17199
- referencedColumns: ["id"];
17200
- }
17201
- ];
17685
+ Relationships: [];
17202
17686
  };
17203
17687
  uren_offerte_regels: {
17204
17688
  Row: {
@@ -19082,6 +19566,119 @@ export type Database = {
19082
19566
  };
19083
19567
  Relationships: [];
19084
19568
  };
19569
+ uren_facturen: {
19570
+ Row: {
19571
+ created_at: string | null;
19572
+ created_by: string | null;
19573
+ customer_id: string | null;
19574
+ customer_name: string | null;
19575
+ id: string | null;
19576
+ invoice_number: string | null;
19577
+ note: string | null;
19578
+ status: string | null;
19579
+ total_excl_cents: number | null;
19580
+ total_incl_cents: number | null;
19581
+ updated_at: string | null;
19582
+ vat_cents: number | null;
19583
+ vat_percentage: number | null;
19584
+ werkbon_id: string | null;
19585
+ };
19586
+ Insert: {
19587
+ created_at?: string | null;
19588
+ created_by?: string | null;
19589
+ customer_id?: string | null;
19590
+ customer_name?: string | null;
19591
+ id?: string | null;
19592
+ invoice_number?: string | null;
19593
+ note?: string | null;
19594
+ status?: string | null;
19595
+ total_excl_cents?: number | null;
19596
+ total_incl_cents?: number | null;
19597
+ updated_at?: string | null;
19598
+ vat_cents?: number | null;
19599
+ vat_percentage?: number | null;
19600
+ werkbon_id?: never;
19601
+ };
19602
+ Update: {
19603
+ created_at?: string | null;
19604
+ created_by?: string | null;
19605
+ customer_id?: string | null;
19606
+ customer_name?: string | null;
19607
+ id?: string | null;
19608
+ invoice_number?: string | null;
19609
+ note?: string | null;
19610
+ status?: string | null;
19611
+ total_excl_cents?: number | null;
19612
+ total_incl_cents?: number | null;
19613
+ updated_at?: string | null;
19614
+ vat_cents?: number | null;
19615
+ vat_percentage?: number | null;
19616
+ werkbon_id?: never;
19617
+ };
19618
+ Relationships: [
19619
+ {
19620
+ foreignKeyName: "invoices_customer_id_fkey";
19621
+ columns: ["customer_id"];
19622
+ isOneToOne: false;
19623
+ referencedRelation: "itk_customers";
19624
+ referencedColumns: ["id"];
19625
+ }
19626
+ ];
19627
+ };
19628
+ uren_factuur_regels: {
19629
+ Row: {
19630
+ created_at: string | null;
19631
+ description: string | null;
19632
+ factuur_id: string | null;
19633
+ id: string | null;
19634
+ kind: string | null;
19635
+ quantity: number | null;
19636
+ sort_order: number | null;
19637
+ total_cents: number | null;
19638
+ unit: string | null;
19639
+ unit_price_cents: number | null;
19640
+ };
19641
+ Insert: {
19642
+ created_at?: string | null;
19643
+ description?: string | null;
19644
+ factuur_id?: string | null;
19645
+ id?: string | null;
19646
+ kind?: string | null;
19647
+ quantity?: number | null;
19648
+ sort_order?: number | null;
19649
+ total_cents?: number | null;
19650
+ unit?: string | null;
19651
+ unit_price_cents?: number | null;
19652
+ };
19653
+ Update: {
19654
+ created_at?: string | null;
19655
+ description?: string | null;
19656
+ factuur_id?: string | null;
19657
+ id?: string | null;
19658
+ kind?: string | null;
19659
+ quantity?: number | null;
19660
+ sort_order?: number | null;
19661
+ total_cents?: number | null;
19662
+ unit?: string | null;
19663
+ unit_price_cents?: number | null;
19664
+ };
19665
+ Relationships: [
19666
+ {
19667
+ foreignKeyName: "invoice_items_invoice_id_fkey";
19668
+ columns: ["factuur_id"];
19669
+ isOneToOne: false;
19670
+ referencedRelation: "invoices";
19671
+ referencedColumns: ["id"];
19672
+ },
19673
+ {
19674
+ foreignKeyName: "invoice_items_invoice_id_fkey";
19675
+ columns: ["factuur_id"];
19676
+ isOneToOne: false;
19677
+ referencedRelation: "uren_facturen";
19678
+ referencedColumns: ["id"];
19679
+ }
19680
+ ];
19681
+ };
19085
19682
  v_external_customers_exact: {
19086
19683
  Row: {
19087
19684
  account_number: string | null;
@@ -19987,6 +20584,13 @@ export type Database = {
19987
20584
  };
19988
20585
  Returns: string;
19989
20586
  };
20587
+ employee_day_hours: {
20588
+ Args: {
20589
+ _day: string;
20590
+ _employee_id: string;
20591
+ };
20592
+ Returns: number;
20593
+ };
19990
20594
  enqueue_cart_replan_if_unlocked: {
19991
20595
  Args: {
19992
20596
  p_order_id: string;
@@ -20311,6 +20915,46 @@ export type Database = {
20311
20915
  Args: never;
20312
20916
  Returns: boolean;
20313
20917
  };
20918
+ invoice_create_from_source: {
20919
+ Args: {
20920
+ _payload?: Json;
20921
+ _source_id: string;
20922
+ _source_type: string;
20923
+ };
20924
+ Returns: Json;
20925
+ };
20926
+ invoice_get_billable_lines: {
20927
+ Args: {
20928
+ _invoice_id: string;
20929
+ };
20930
+ Returns: Json;
20931
+ };
20932
+ invoice_get_for_source: {
20933
+ Args: {
20934
+ _source_id: string;
20935
+ _source_type: string;
20936
+ };
20937
+ Returns: Json;
20938
+ };
20939
+ invoice_get_summary: {
20940
+ Args: {
20941
+ _invoice_id: string;
20942
+ };
20943
+ Returns: Json;
20944
+ };
20945
+ invoice_list_sources: {
20946
+ Args: {
20947
+ _limit?: number;
20948
+ _source_type?: string;
20949
+ };
20950
+ Returns: Json;
20951
+ };
20952
+ invoice_recalc_totals: {
20953
+ Args: {
20954
+ _invoice_id: string;
20955
+ };
20956
+ Returns: Json;
20957
+ };
20314
20958
  is_authenticated: {
20315
20959
  Args: never;
20316
20960
  Returns: boolean;
@@ -20340,6 +20984,19 @@ export type Database = {
20340
20984
  Args: never;
20341
20985
  Returns: boolean;
20342
20986
  };
20987
+ itk_offerte_naar_werkbon: {
20988
+ Args: {
20989
+ _offerte_id: string;
20990
+ };
20991
+ Returns: string;
20992
+ };
20993
+ itk_offerte_restant_mandaat: {
20994
+ Args: {
20995
+ _exclude_offerte_id?: string;
20996
+ _werkbon_id: string;
20997
+ };
20998
+ Returns: number;
20999
+ };
20343
21000
  jwt_has_role: {
20344
21001
  Args: {
20345
21002
  _role: Database["public"]["Enums"]["app_role"];
@@ -20350,9 +21007,19 @@ export type Database = {
20350
21007
  Args: never;
20351
21008
  Returns: {
20352
21009
  avatar_url: string;
21010
+ color: string;
20353
21011
  display_name: string;
20354
21012
  email: string;
21013
+ hours_fri: number;
21014
+ hours_mon: number;
21015
+ hours_thu: number;
21016
+ hours_tue: number;
21017
+ hours_wed: number;
20355
21018
  id: string;
21019
+ is_active: boolean;
21020
+ leave_balance_hours: number;
21021
+ persnr: string;
21022
+ phone: string;
20356
21023
  roles: string[];
20357
21024
  }[];
20358
21025
  };
@@ -20679,17 +21346,6 @@ export type Database = {
20679
21346
  Returns: string;
20680
21347
  };
20681
21348
  logistics_emit_event: {
20682
- Args: {
20683
- p_event_type: string;
20684
- p_idempotency_key?: string;
20685
- p_order_ref: string;
20686
- p_payload?: Json;
20687
- p_shadow?: boolean;
20688
- p_source_module: string;
20689
- p_strategy_id?: string;
20690
- };
20691
- Returns: Json;
20692
- } | {
20693
21349
  Args: {
20694
21350
  p_event_type: string;
20695
21351
  p_idempotency_key?: string;
@@ -21534,6 +22190,37 @@ export type Database = {
21534
22190
  };
21535
22191
  Returns: undefined;
21536
22192
  };
22193
+ quote_create_from_source: {
22194
+ Args: {
22195
+ _payload?: Json;
22196
+ _source_id: string;
22197
+ _source_type: string;
22198
+ };
22199
+ Returns: string;
22200
+ };
22201
+ quote_get_billable_lines: {
22202
+ Args: {
22203
+ _quotation_id: string;
22204
+ };
22205
+ Returns: Json;
22206
+ };
22207
+ quote_get_summary: {
22208
+ Args: {
22209
+ _quotation_id: string;
22210
+ };
22211
+ Returns: Json;
22212
+ };
22213
+ quote_list_packages: {
22214
+ Args: never;
22215
+ Returns: Json;
22216
+ };
22217
+ quote_list_sources: {
22218
+ Args: {
22219
+ _limit?: number;
22220
+ _source_type?: string;
22221
+ };
22222
+ Returns: Json;
22223
+ };
21537
22224
  recompute_all_reserved_stock: {
21538
22225
  Args: never;
21539
22226
  Returns: undefined;
@@ -22069,6 +22756,12 @@ export type Database = {
22069
22756
  };
22070
22757
  Returns: undefined;
22071
22758
  };
22759
+ sync_sick_time_off: {
22760
+ Args: {
22761
+ _period_id: string;
22762
+ };
22763
+ Returns: number;
22764
+ };
22072
22765
  trade_item_stock_duplicates: {
22073
22766
  Args: never;
22074
22767
  Returns: {
@@ -22142,11 +22835,31 @@ export type Database = {
22142
22835
  Args: never;
22143
22836
  Returns: string;
22144
22837
  };
22838
+ wo_create_from_source: {
22839
+ Args: {
22840
+ _payload?: Json;
22841
+ _source_id: string;
22842
+ _source_type: string;
22843
+ };
22844
+ Returns: string;
22845
+ };
22846
+ wo_get_billable_lines: {
22847
+ Args: {
22848
+ _work_order_id: string;
22849
+ };
22850
+ Returns: Json;
22851
+ };
22852
+ wo_get_summary: {
22853
+ Args: {
22854
+ _work_order_id: string;
22855
+ };
22856
+ Returns: Json;
22857
+ };
22145
22858
  };
22146
22859
  Enums: {
22147
22860
  ai_import_status: "nieuw" | "verwerken" | "bevestigen" | "klaar" | "mislukt";
22148
22861
  app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie";
22149
- doc_layout_type: "pakbon" | "factuur" | "offerte" | "orderbevestiging" | "etiket" | "verzendlabel" | "productlabel" | "barcode_label" | "magazijnlijst" | "controlelijst" | "transportdocument" | "vrij" | "sticker" | "productiebon";
22862
+ doc_layout_type: "pakbon" | "factuur" | "offerte" | "orderbevestiging" | "etiket" | "verzendlabel" | "productlabel" | "barcode_label" | "magazijnlijst" | "controlelijst" | "transportdocument" | "vrij" | "sticker" | "productiebon" | "veilingbon" | "afleverbrief" | "veilingbrief";
22150
22863
  doc_orientation: "portrait" | "landscape";
22151
22864
  exact_env: "staging" | "live";
22152
22865
  exact_push_status: "pending" | "sent" | "error";
@@ -22217,7 +22930,7 @@ export declare const Constants: {
22217
22930
  readonly Enums: {
22218
22931
  readonly ai_import_status: readonly ["nieuw", "verwerken", "bevestigen", "klaar", "mislukt"];
22219
22932
  readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin", "manager", "warehouse", "sales", "developer", "receptie"];
22220
- readonly doc_layout_type: readonly ["pakbon", "factuur", "offerte", "orderbevestiging", "etiket", "verzendlabel", "productlabel", "barcode_label", "magazijnlijst", "controlelijst", "transportdocument", "vrij", "sticker", "productiebon"];
22933
+ readonly doc_layout_type: readonly ["pakbon", "factuur", "offerte", "orderbevestiging", "etiket", "verzendlabel", "productlabel", "barcode_label", "magazijnlijst", "controlelijst", "transportdocument", "vrij", "sticker", "productiebon", "veilingbon", "afleverbrief", "veilingbrief"];
22221
22934
  readonly doc_orientation: readonly ["portrait", "landscape"];
22222
22935
  readonly exact_env: readonly ["staging", "live"];
22223
22936
  readonly exact_push_status: readonly ["pending", "sent", "error"];