export type Json = string | number | boolean | null | { [key: string]: Json | undefined; } | Json[]; export type Database = { __InternalSupabase: { PostgrestVersion: "14.5"; }; public: { Tables: { afhandeling_settings: { Row: { auto_print_delivery_note: boolean; auto_process_paused: boolean; created_at: string; extra_pick_days_with_stickers: number; id: string; max_workdays_earlier_pick: number; pick_days_before_transport: number; pick_distribution_enabled: boolean; pick_weekdays: number[]; signup_mail_enabled: boolean; signup_mail_lead_minutes: number; signup_mail_purpose: string; transport_register_days_before: number; updated_at: string; user_id: string; }; Insert: { auto_print_delivery_note?: boolean; auto_process_paused?: boolean; created_at?: string; extra_pick_days_with_stickers?: number; id?: string; max_workdays_earlier_pick?: number; pick_days_before_transport?: number; pick_distribution_enabled?: boolean; pick_weekdays?: number[]; signup_mail_enabled?: boolean; signup_mail_lead_minutes?: number; signup_mail_purpose?: string; transport_register_days_before?: number; updated_at?: string; user_id: string; }; Update: { auto_print_delivery_note?: boolean; auto_process_paused?: boolean; created_at?: string; extra_pick_days_with_stickers?: number; id?: string; max_workdays_earlier_pick?: number; pick_days_before_transport?: number; pick_distribution_enabled?: boolean; pick_weekdays?: number[]; signup_mail_enabled?: boolean; signup_mail_lead_minutes?: number; signup_mail_purpose?: string; transport_register_days_before?: number; updated_at?: string; user_id?: string; }; Relationships: []; }; agenda_connections: { Row: { account_email: string | null; created_at: string; id: string; last_error: string | null; last_synced_at: string | null; provider: string; selected_calendars: Json; status: string; sync_mode: string; updated_at: string; user_id: string; }; Insert: { account_email?: string | null; created_at?: string; id?: string; last_error?: string | null; last_synced_at?: string | null; provider: string; selected_calendars?: Json; status?: string; sync_mode?: string; updated_at?: string; user_id: string; }; Update: { account_email?: string | null; created_at?: string; id?: string; last_error?: string | null; last_synced_at?: string | null; provider?: string; selected_calendars?: Json; status?: string; sync_mode?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; agenda_events: { Row: { all_day: boolean; calendar_id: string; category: string | null; color: string; created_at: string; description: string | null; end_at: string; external_id: string | null; external_provider: string | null; id: string; linked_data: Json; location: string | null; notes: string | null; recurrence: string | null; reminders: Json; source_id: string | null; source_module: string; source_type: string | null; start_at: string; status: string; title: string; updated_at: string; user_id: string; }; Insert: { all_day?: boolean; calendar_id?: string; category?: string | null; color?: string; created_at?: string; description?: string | null; end_at: string; external_id?: string | null; external_provider?: string | null; id?: string; linked_data?: Json; location?: string | null; notes?: string | null; recurrence?: string | null; reminders?: Json; source_id?: string | null; source_module?: string; source_type?: string | null; start_at: string; status?: string; title: string; updated_at?: string; user_id: string; }; Update: { all_day?: boolean; calendar_id?: string; category?: string | null; color?: string; created_at?: string; description?: string | null; end_at?: string; external_id?: string | null; external_provider?: string | null; id?: string; linked_data?: Json; location?: string | null; notes?: string | null; recurrence?: string | null; reminders?: Json; source_id?: string | null; source_module?: string; source_type?: string | null; start_at?: string; status?: string; title?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; agenda_oauth_tokens: { Row: { access_token: string | null; created_at: string; id: string; provider: string; refresh_token: string | null; scope: string | null; token_expires_at: string | null; updated_at: string; user_id: string; }; Insert: { access_token?: string | null; created_at?: string; id?: string; provider: string; refresh_token?: string | null; scope?: string | null; token_expires_at?: string | null; updated_at?: string; user_id: string; }; Update: { access_token?: string | null; created_at?: string; id?: string; provider?: string; refresh_token?: string | null; scope?: string | null; token_expires_at?: string | null; updated_at?: string; user_id?: string; }; Relationships: []; }; agenda_settings: { Row: { color_map: Json; created_at: string; default_calendar_id: string; default_view: string; settings: Json; updated_at: string; user_id: string; }; Insert: { color_map?: Json; created_at?: string; default_calendar_id?: string; default_view?: string; settings?: Json; updated_at?: string; user_id: string; }; Update: { color_map?: Json; created_at?: string; default_calendar_id?: string; default_view?: string; settings?: Json; updated_at?: string; user_id?: string; }; Relationships: []; }; ai_admin_credentials: { Row: { active: boolean; admin_key: string; created_at: string; id: string; label: string; provider_id: string; updated_at: string; }; Insert: { active?: boolean; admin_key: string; created_at?: string; id?: string; label: string; provider_id: string; updated_at?: string; }; Update: { active?: boolean; admin_key?: string; created_at?: string; id?: string; label?: string; provider_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "ai_admin_credentials_provider_id_fkey"; columns: ["provider_id"]; isOneToOne: true; referencedRelation: "ai_providers"; referencedColumns: ["id"]; } ]; }; ai_call_log: { Row: { consumer_module_id: string; cost_usd: number | null; created_at: string; created_by: string | null; duration_ms: number | null; error_code: string | null; error_message: string | null; id: string; input_tokens: number; model_slug: string | null; output_tokens: number; provider_slug: string | null; status: string; total_tokens: number; }; Insert: { consumer_module_id: string; cost_usd?: number | null; created_at?: string; created_by?: string | null; duration_ms?: number | null; error_code?: string | null; error_message?: string | null; id?: string; input_tokens?: number; model_slug?: string | null; output_tokens?: number; provider_slug?: string | null; status: string; total_tokens?: number; }; Update: { consumer_module_id?: string; cost_usd?: number | null; created_at?: string; created_by?: string | null; duration_ms?: number | null; error_code?: string | null; error_message?: string | null; id?: string; input_tokens?: number; model_slug?: string | null; output_tokens?: number; provider_slug?: string | null; status?: string; total_tokens?: number; }; Relationships: []; }; ai_credentials: { Row: { active: boolean; api_key: string; created_at: string; id: string; label: string; provider_id: string; updated_at: string; }; Insert: { active?: boolean; api_key: string; created_at?: string; id?: string; label: string; provider_id: string; updated_at?: string; }; Update: { active?: boolean; api_key?: string; created_at?: string; id?: string; label?: string; provider_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "ai_credentials_provider_id_fkey"; columns: ["provider_id"]; isOneToOne: false; referencedRelation: "ai_providers"; referencedColumns: ["id"]; } ]; }; ai_goals: { Row: { active: boolean; created_at: string; description: string | null; key: string; label: string; sort_order: number; updated_at: string; }; Insert: { active?: boolean; created_at?: string; description?: string | null; key: string; label: string; sort_order?: number; updated_at?: string; }; Update: { active?: boolean; created_at?: string; description?: string | null; key?: string; label?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; ai_layout_imports: { Row: { analyse_json: Json; bestand_url: string | null; bestandsnaam: string; bevestigd: boolean; created_at: string; created_by: string | null; foutmelding: string | null; id: string; layout_id: string | null; mime_type: string; onzekere_velden: Json; status: Database["public"]["Enums"]["ai_import_status"]; updated_at: string; voorstel: Json; }; Insert: { analyse_json?: Json; bestand_url?: string | null; bestandsnaam?: string; bevestigd?: boolean; created_at?: string; created_by?: string | null; foutmelding?: string | null; id?: string; layout_id?: string | null; mime_type?: string; onzekere_velden?: Json; status?: Database["public"]["Enums"]["ai_import_status"]; updated_at?: string; voorstel?: Json; }; Update: { analyse_json?: Json; bestand_url?: string | null; bestandsnaam?: string; bevestigd?: boolean; created_at?: string; created_by?: string | null; foutmelding?: string | null; id?: string; layout_id?: string | null; mime_type?: string; onzekere_velden?: Json; status?: Database["public"]["Enums"]["ai_import_status"]; updated_at?: string; voorstel?: Json; }; Relationships: [ { foreignKeyName: "ai_layout_imports_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; } ]; }; ai_model_pricing: { Row: { created_at: string; currency: string; fetched_at: string; id: string; input_per_mtok: number | null; model_slug: string; output_per_mtok: number | null; provider_slug: string; source: string; updated_at: string; }; Insert: { created_at?: string; currency?: string; fetched_at?: string; id?: string; input_per_mtok?: number | null; model_slug: string; output_per_mtok?: number | null; provider_slug: string; source?: string; updated_at?: string; }; Update: { created_at?: string; currency?: string; fetched_at?: string; id?: string; input_per_mtok?: number | null; model_slug?: string; output_per_mtok?: number | null; provider_slug?: string; source?: string; updated_at?: string; }; Relationships: []; }; ai_models: { Row: { active: boolean; context_window: number | null; created_at: string; display_name: string; id: string; is_default: boolean; modality: string; provider_id: string; slug: string; updated_at: string; }; Insert: { active?: boolean; context_window?: number | null; created_at?: string; display_name: string; id?: string; is_default?: boolean; modality?: string; provider_id: string; slug: string; updated_at?: string; }; Update: { active?: boolean; context_window?: number | null; created_at?: string; display_name?: string; id?: string; is_default?: boolean; modality?: string; provider_id?: string; slug?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "ai_models_provider_id_fkey"; columns: ["provider_id"]; isOneToOne: false; referencedRelation: "ai_providers"; referencedColumns: ["id"]; } ]; }; ai_module_bindings: { Row: { consumer_module_id: string; created_at: string; credential_id: string; id: string; is_default: boolean; label: string | null; model_id: string; notes: string | null; updated_at: string; }; Insert: { consumer_module_id: string; created_at?: string; credential_id: string; id?: string; is_default?: boolean; label?: string | null; model_id: string; notes?: string | null; updated_at?: string; }; Update: { consumer_module_id?: string; created_at?: string; credential_id?: string; id?: string; is_default?: boolean; label?: string | null; model_id?: string; notes?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "ai_module_bindings_credential_id_fkey"; columns: ["credential_id"]; isOneToOne: false; referencedRelation: "ai_credentials"; referencedColumns: ["id"]; }, { foreignKeyName: "ai_module_bindings_model_id_fkey"; columns: ["model_id"]; isOneToOne: false; referencedRelation: "ai_models"; referencedColumns: ["id"]; } ]; }; ai_modules: { Row: { ai_enabled: boolean; created_at: string; id: string; module_key: string; module_name: string; updated_at: string; }; Insert: { ai_enabled?: boolean; created_at?: string; id?: string; module_key: string; module_name: string; updated_at?: string; }; Update: { ai_enabled?: boolean; created_at?: string; id?: string; module_key?: string; module_name?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "ai_modules_module_key_fkey"; columns: ["module_key"]; isOneToOne: true; referencedRelation: "modules"; referencedColumns: ["module_key"]; } ]; }; ai_providers: { Row: { active: boolean; auth_type: string; base_url: string | null; created_at: string; id: string; name: string; slug: string; updated_at: string; }; Insert: { active?: boolean; auth_type?: string; base_url?: string | null; created_at?: string; id?: string; name: string; slug: string; updated_at?: string; }; Update: { active?: boolean; auth_type?: string; base_url?: string | null; created_at?: string; id?: string; name?: string; slug?: string; updated_at?: string; }; Relationships: []; }; app_settings: { Row: { created_at: string; id: string; key: string; updated_at: string; value: string | null; }; Insert: { created_at?: string; id?: string; key: string; updated_at?: string; value?: string | null; }; Update: { created_at?: string; id?: string; key?: string; updated_at?: string; value?: string | null; }; Relationships: []; }; artikelen_cache: { Row: { artikelcode: string; bron: string; bruto_prijs_cent: number | null; created_at: string; eenheid: string; fabrikant: string | null; fetched_at: string; gtin: string | null; id: string; naam: string; netto_prijs_cent: number | null; omschrijving: string | null; raw: Json; updated_at: string; valuta: string; velden: Json; }; Insert: { artikelcode: string; bron?: string; bruto_prijs_cent?: number | null; created_at?: string; eenheid?: string; fabrikant?: string | null; fetched_at?: string; gtin?: string | null; id?: string; naam: string; netto_prijs_cent?: number | null; omschrijving?: string | null; raw?: Json; updated_at?: string; valuta?: string; velden?: Json; }; Update: { artikelcode?: string; bron?: string; bruto_prijs_cent?: number | null; created_at?: string; eenheid?: string; fabrikant?: string | null; fetched_at?: string; gtin?: string | null; id?: string; naam?: string; netto_prijs_cent?: number | null; omschrijving?: string | null; raw?: Json; updated_at?: string; valuta?: string; velden?: Json; }; Relationships: []; }; artikelen_veldconfig: { Row: { bron_pad: string; created_at: string; id: string; label: string; sort_order: number; type: string; updated_at: string; veld_key: string; zichtbaar_in_detail: boolean; zichtbaar_in_lijst: boolean; }; Insert: { bron_pad: string; created_at?: string; id?: string; label: string; sort_order?: number; type?: string; updated_at?: string; veld_key: string; zichtbaar_in_detail?: boolean; zichtbaar_in_lijst?: boolean; }; Update: { bron_pad?: string; created_at?: string; id?: string; label?: string; sort_order?: number; type?: string; updated_at?: string; veld_key?: string; zichtbaar_in_detail?: boolean; zichtbaar_in_lijst?: boolean; }; Relationships: []; }; booking_items: { Row: { booking_id: string; created_at: string; extra_id: string; id: string; original_unit_price: number | null; override_reason: string | null; override_unit_price: number | null; quantity: number; total_price: number; unit_price: number; }; Insert: { booking_id: string; created_at?: string; extra_id: string; id?: string; original_unit_price?: number | null; override_reason?: string | null; override_unit_price?: number | null; quantity?: number; total_price?: number; unit_price?: number; }; Update: { booking_id?: string; created_at?: string; extra_id?: string; id?: string; original_unit_price?: number | null; override_reason?: string | null; override_unit_price?: number | null; quantity?: number; total_price?: number; unit_price?: number; }; Relationships: [ { foreignKeyName: "booking_items_booking_id_fkey"; columns: ["booking_id"]; isOneToOne: false; referencedRelation: "bookings"; referencedColumns: ["id"]; }, { foreignKeyName: "booking_items_extra_id_fkey"; columns: ["extra_id"]; isOneToOne: false; referencedRelation: "extras"; referencedColumns: ["id"]; } ]; }; bookings: { Row: { archive_reason: string | null; archived_at: string | null; archived_by: string | null; company_name: string | null; conflict_checked_at: string | null; conflict_reason: string | null; created_at: string; created_by_role: string | null; customer_address: string | null; customer_email: string | null; customer_name: string | null; end_time: string; exact_debiteur_id: string | null; has_conflict: boolean; id: string; invoice_run_id: string | null; invoice_status: string | null; invoiced_at: string | null; notes: string | null; number_of_people: number; overridden_at: string | null; overridden_by: string | null; override_reason: string | null; price_override: boolean; room_id: string; room_price_override: number | null; start_time: string; status: string; total_excl_vat: number | null; total_incl_vat: number | null; user_id: string | null; vat_amount: number | null; }; Insert: { archive_reason?: string | null; archived_at?: string | null; archived_by?: string | null; company_name?: string | null; conflict_checked_at?: string | null; conflict_reason?: string | null; created_at?: string; created_by_role?: string | null; customer_address?: string | null; customer_email?: string | null; customer_name?: string | null; end_time: string; exact_debiteur_id?: string | null; has_conflict?: boolean; id?: string; invoice_run_id?: string | null; invoice_status?: string | null; invoiced_at?: string | null; notes?: string | null; number_of_people?: number; overridden_at?: string | null; overridden_by?: string | null; override_reason?: string | null; price_override?: boolean; room_id: string; room_price_override?: number | null; start_time: string; status?: string; total_excl_vat?: number | null; total_incl_vat?: number | null; user_id?: string | null; vat_amount?: number | null; }; Update: { archive_reason?: string | null; archived_at?: string | null; archived_by?: string | null; company_name?: string | null; conflict_checked_at?: string | null; conflict_reason?: string | null; created_at?: string; created_by_role?: string | null; customer_address?: string | null; customer_email?: string | null; customer_name?: string | null; end_time?: string; exact_debiteur_id?: string | null; has_conflict?: boolean; id?: string; invoice_run_id?: string | null; invoice_status?: string | null; invoiced_at?: string | null; notes?: string | null; number_of_people?: number; overridden_at?: string | null; overridden_by?: string | null; override_reason?: string | null; price_override?: boolean; room_id?: string; room_price_override?: number | null; start_time?: string; status?: string; total_excl_vat?: number | null; total_incl_vat?: number | null; user_id?: string | null; vat_amount?: number | null; }; Relationships: [ { foreignKeyName: "bookings_room_id_fkey"; columns: ["room_id"]; isOneToOne: false; referencedRelation: "rooms"; referencedColumns: ["id"]; } ]; }; bugs: { Row: { attachment_url: string | null; created_at: string; description: string; id: string; priority: string; status: string; title: string; updated_at: string; user_id: string; }; Insert: { attachment_url?: string | null; created_at?: string; description: string; id?: string; priority?: string; status?: string; title: string; updated_at?: string; user_id: string; }; Update: { attachment_url?: string | null; created_at?: string; description?: string; id?: string; priority?: string; status?: string; title?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; cao_holidays: { Row: { created_at: string; description: string | null; holiday_date: string; id: string; updated_at: string; }; Insert: { created_at?: string; description?: string | null; holiday_date: string; id?: string; updated_at?: string; }; Update: { created_at?: string; description?: string | null; holiday_date?: string; id?: string; updated_at?: string; }; Relationships: []; }; cao_settings: { Row: { auto_break_after_hours: number; auto_break_minutes: number; auto_break_unpaid: boolean; auto_stop_after_hours: number; callout_fee: number; created_at: string; daily_regular_hours: number; default_hourly_rate: number; id: string; materials_markup_percent: number; max_daily_hours: number; max_weekly_hours: number; meal_allowance_amount: number; overtime_pct_178: number; overtime_pct_189: number; overtime_pct_212: number; reminder_after_hours: number; standby_evening_amount: number; standby_weekend_amount: number; travel_cost_per_km: number | null; travel_cost_threshold_km: number | null; travel_counts_as_work: boolean; travel_hourly_rate: number; travel_rate_per_hour: number; travel_threshold_minutes: number; updated_at: string; weekend_always_212: boolean; window_end: string; window_start: string; }; Insert: { auto_break_after_hours?: number; auto_break_minutes?: number; auto_break_unpaid?: boolean; auto_stop_after_hours?: number; callout_fee?: number; created_at?: string; daily_regular_hours?: number; default_hourly_rate?: number; id?: string; materials_markup_percent?: number; max_daily_hours?: number; max_weekly_hours?: number; meal_allowance_amount?: number; overtime_pct_178?: number; overtime_pct_189?: number; overtime_pct_212?: number; reminder_after_hours?: number; standby_evening_amount?: number; standby_weekend_amount?: number; travel_cost_per_km?: number | null; travel_cost_threshold_km?: number | null; travel_counts_as_work?: boolean; travel_hourly_rate?: number; travel_rate_per_hour?: number; travel_threshold_minutes?: number; updated_at?: string; weekend_always_212?: boolean; window_end?: string; window_start?: string; }; Update: { auto_break_after_hours?: number; auto_break_minutes?: number; auto_break_unpaid?: boolean; auto_stop_after_hours?: number; callout_fee?: number; created_at?: string; daily_regular_hours?: number; default_hourly_rate?: number; id?: string; materials_markup_percent?: number; max_daily_hours?: number; max_weekly_hours?: number; meal_allowance_amount?: number; overtime_pct_178?: number; overtime_pct_189?: number; overtime_pct_212?: number; reminder_after_hours?: number; standby_evening_amount?: number; standby_weekend_amount?: number; travel_cost_per_km?: number | null; travel_cost_threshold_km?: number | null; travel_counts_as_work?: boolean; travel_hourly_rate?: number; travel_rate_per_hour?: number; travel_threshold_minutes?: number; updated_at?: string; weekend_always_212?: boolean; window_end?: string; window_start?: string; }; Relationships: []; }; carrier_shipping_rates: { Row: { carrier_id: string; country_code: string; created_at: string; id: string; price_per_trolley: number; }; Insert: { carrier_id: string; country_code: string; created_at?: string; id?: string; price_per_trolley: number; }; Update: { carrier_id?: string; country_code?: string; created_at?: string; id?: string; price_per_trolley?: number; }; Relationships: [ { foreignKeyName: "carrier_shipping_rates_carrier_id_fkey"; columns: ["carrier_id"]; isOneToOne: false; referencedRelation: "carriers"; referencedColumns: ["id"]; } ]; }; carrier_signup_dispatch_runs: { Row: { detail: Json | null; error: string | null; finished_at: string | null; groups: number; id: string; ok: boolean; reason: string | null; sent: number; skipped: Json; started_at: string; unassigned: Json; }; Insert: { detail?: Json | null; error?: string | null; finished_at?: string | null; groups?: number; id?: string; ok?: boolean; reason?: string | null; sent?: number; skipped?: Json; started_at?: string; unassigned?: Json; }; Update: { detail?: Json | null; error?: string | null; finished_at?: string | null; groups?: number; id?: string; ok?: boolean; reason?: string | null; sent?: number; skipped?: Json; started_at?: string; unassigned?: Json; }; Relationships: []; }; carrier_signup_dispatches: { Row: { carrier_id: string; cart_count: number; created_at: string; id: string; order_count: number; outbox_id: string | null; pickup_date: string; pickup_moment_key: string; sent_at: string; signup_deadline: string; }; Insert: { carrier_id: string; cart_count?: number; created_at?: string; id?: string; order_count?: number; outbox_id?: string | null; pickup_date: string; pickup_moment_key: string; sent_at?: string; signup_deadline: string; }; Update: { carrier_id?: string; cart_count?: number; created_at?: string; id?: string; order_count?: number; outbox_id?: string | null; pickup_date?: string; pickup_moment_key?: string; sent_at?: string; signup_deadline?: string; }; Relationships: [ { foreignKeyName: "carrier_signup_dispatches_carrier_id_fkey"; columns: ["carrier_id"]; isOneToOne: false; referencedRelation: "carriers"; referencedColumns: ["id"]; } ]; }; carriers: { Row: { address: string | null; contact_person: string | null; created_at: string; delivery_days: number | null; delivery_weekdays: number[]; email: string | null; id: string; is_default: boolean; name: string; notes: string | null; phone: string | null; pickup_moments: Json; pickup_weekdays: number[]; service_cities: string[]; service_countries: string[]; service_provinces: string[]; signup_days_before_delivery: number; signup_time_1: string | null; signup_time_2: string | null; sort_order: number; updated_at: string; user_id: string; }; Insert: { address?: string | null; contact_person?: string | null; created_at?: string; delivery_days?: number | null; delivery_weekdays?: number[]; email?: string | null; id?: string; is_default?: boolean; name: string; notes?: string | null; phone?: string | null; pickup_moments?: Json; pickup_weekdays?: number[]; service_cities?: string[]; service_countries?: string[]; service_provinces?: string[]; signup_days_before_delivery?: number; signup_time_1?: string | null; signup_time_2?: string | null; sort_order?: number; updated_at?: string; user_id: string; }; Update: { address?: string | null; contact_person?: string | null; created_at?: string; delivery_days?: number | null; delivery_weekdays?: number[]; email?: string | null; id?: string; is_default?: boolean; name?: string; notes?: string | null; phone?: string | null; pickup_moments?: Json; pickup_weekdays?: number[]; service_cities?: string[]; service_countries?: string[]; service_provinces?: string[]; signup_days_before_delivery?: number; signup_time_1?: string | null; signup_time_2?: string | null; sort_order?: number; updated_at?: string; user_id?: string; }; Relationships: []; }; cart_control_draft: { Row: { cart_states: Json; checked_keys: Json; draft_date: string; form_state: Json; notes: string; updated_at: string; user_id: string; }; Insert: { cart_states?: Json; checked_keys?: Json; draft_date: string; form_state?: Json; notes?: string; updated_at?: string; user_id: string; }; Update: { cart_states?: Json; checked_keys?: Json; draft_date?: string; form_state?: Json; notes?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; cart_control_items: { Row: { action: string; block_reason: string | null; carrier_name: string | null; cart_index: number; cart_number_id: string | null; cart_number_label: string | null; created_at: string; customer_name: string | null; delivery_date: string | null; id: string; new_pick_date: string | null; order_id: string; order_number: string | null; order_source: string; pickup_date: string | null; session_id: string; }; Insert: { action: string; block_reason?: string | null; carrier_name?: string | null; cart_index: number; cart_number_id?: string | null; cart_number_label?: string | null; created_at?: string; customer_name?: string | null; delivery_date?: string | null; id?: string; new_pick_date?: string | null; order_id: string; order_number?: string | null; order_source: string; pickup_date?: string | null; session_id: string; }; Update: { action?: string; block_reason?: string | null; carrier_name?: string | null; cart_index?: number; cart_number_id?: string | null; cart_number_label?: string | null; created_at?: string; customer_name?: string | null; delivery_date?: string | null; id?: string; new_pick_date?: string | null; order_id?: string; order_number?: string | null; order_source?: string; pickup_date?: string | null; session_id?: string; }; Relationships: [ { foreignKeyName: "cart_control_items_session_id_fkey"; columns: ["session_id"]; isOneToOne: false; referencedRelation: "cart_control_sessions"; referencedColumns: ["id"]; } ]; }; cart_control_sessions: { Row: { blocked_count: number; checked_count: number; control_date: string; created_at: string; id: string; notes: string | null; performed_at: string; rescheduled_count: number; stock_consumed_at: string | null; total_carts: number; updated_at: string; user_id: string; }; Insert: { blocked_count?: number; checked_count?: number; control_date?: string; created_at?: string; id?: string; notes?: string | null; performed_at?: string; rescheduled_count?: number; stock_consumed_at?: string | null; total_carts?: number; updated_at?: string; user_id: string; }; Update: { blocked_count?: number; checked_count?: number; control_date?: string; created_at?: string; id?: string; notes?: string | null; performed_at?: string; rescheduled_count?: number; stock_consumed_at?: string | null; total_carts?: number; updated_at?: string; user_id?: string; }; Relationships: []; }; cart_numbers: { Row: { assigned_at: string; cart_index: number; cart_number: string | null; day_seq: number | null; delivered_at: string | null; id: string; order_id: string; order_source: string; pick_date: string; status: string; }; Insert: { assigned_at?: string; cart_index: number; cart_number?: string | null; day_seq?: number | null; delivered_at?: string | null; id?: string; order_id: string; order_source: string; pick_date: string; status?: string; }; Update: { assigned_at?: string; cart_index?: number; cart_number?: string | null; day_seq?: number | null; delivered_at?: string | null; id?: string; order_id?: string; order_source?: string; pick_date?: string; status?: string; }; Relationships: []; }; cart_pick_overrides: { Row: { cart_index: number; created_at: string; id: string; moved_from_date: string | null; notes: string | null; order_id: string; order_source: string; pick_date: string; status: string; updated_at: string; }; Insert: { cart_index: number; created_at?: string; id?: string; moved_from_date?: string | null; notes?: string | null; order_id: string; order_source: string; pick_date: string; status?: string; updated_at?: string; }; Update: { cart_index?: number; created_at?: string; id?: string; moved_from_date?: string | null; notes?: string | null; order_id?: string; order_source?: string; pick_date?: string; status?: string; updated_at?: string; }; Relationships: []; }; cart_planning_pick_times: { Row: { created_at: string; id: string; pot_size: string; seconds_per_cart: number; updated_at: string; }; Insert: { created_at?: string; id?: string; pot_size: string; seconds_per_cart: number; updated_at?: string; }; Update: { created_at?: string; id?: string; pot_size?: string; seconds_per_cart?: number; updated_at?: string; }; Relationships: []; }; cart_planning_product_overrides: { Row: { created_at: string; id: string; max_party_share_per_layer_pct_override: number | null; never_mix: boolean; notes: string | null; product_id: string; updated_at: string; }; Insert: { created_at?: string; id?: string; max_party_share_per_layer_pct_override?: number | null; never_mix?: boolean; notes?: string | null; product_id: string; updated_at?: string; }; Update: { created_at?: string; id?: string; max_party_share_per_layer_pct_override?: number | null; never_mix?: boolean; notes?: string | null; product_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "cart_planning_product_overrides_product_id_fkey"; columns: ["product_id"]; isOneToOne: true; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "cart_planning_product_overrides_product_id_fkey"; columns: ["product_id"]; isOneToOne: true; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; cart_planning_settings: { Row: { allow_editing_after_pickstation_send: boolean; buffer_grouping_mode: string; combine_floriday_orders: boolean; combine_floriday_orders_window: string; combine_orders_scope: string; default_workers: number; id: number; max_beladingen_per_layer: number; max_customers_per_cart: number; max_one_customer_per_layer: boolean; max_party_share_per_layer_pct: number; optimization_strategy: string; own_cart_from_layers: number; pick_time_mode: string; plants_per_day: number; plants_per_hour: number; require_same_carrier: boolean; require_same_crate_type: boolean; require_same_delivery_date: boolean; require_same_delivery_location: boolean; uniform_pick_time: boolean; uniform_pick_time_seconds: number; updated_at: string; updated_by: string | null; }; Insert: { allow_editing_after_pickstation_send?: boolean; buffer_grouping_mode?: string; combine_floriday_orders?: boolean; combine_floriday_orders_window?: string; combine_orders_scope?: string; default_workers?: number; id?: number; max_beladingen_per_layer?: number; max_customers_per_cart?: number; max_one_customer_per_layer?: boolean; max_party_share_per_layer_pct?: number; optimization_strategy?: string; own_cart_from_layers?: number; pick_time_mode?: string; plants_per_day?: number; plants_per_hour?: number; require_same_carrier?: boolean; require_same_crate_type?: boolean; require_same_delivery_date?: boolean; require_same_delivery_location?: boolean; uniform_pick_time?: boolean; uniform_pick_time_seconds?: number; updated_at?: string; updated_by?: string | null; }; Update: { allow_editing_after_pickstation_send?: boolean; buffer_grouping_mode?: string; combine_floriday_orders?: boolean; combine_floriday_orders_window?: string; combine_orders_scope?: string; default_workers?: number; id?: number; max_beladingen_per_layer?: number; max_customers_per_cart?: number; max_one_customer_per_layer?: boolean; max_party_share_per_layer_pct?: number; optimization_strategy?: string; own_cart_from_layers?: number; pick_time_mode?: string; plants_per_day?: number; plants_per_hour?: number; require_same_carrier?: boolean; require_same_crate_type?: boolean; require_same_delivery_date?: boolean; require_same_delivery_location?: boolean; uniform_pick_time?: boolean; uniform_pick_time_seconds?: number; updated_at?: string; updated_by?: string | null; }; Relationships: []; }; cart_replan_queue: { Row: { attempts: number; last_error: string | null; order_id: string; processed_at: string | null; requested_at: string; }; Insert: { attempts?: number; last_error?: string | null; order_id: string; processed_at?: string | null; requested_at?: string; }; Update: { attempts?: number; last_error?: string | null; order_id?: string; processed_at?: string | null; requested_at?: string; }; Relationships: [ { foreignKeyName: "cart_replan_queue_order_id_fkey"; columns: ["order_id"]; isOneToOne: true; referencedRelation: "orders"; referencedColumns: ["id"]; } ]; }; cart_types: { Row: { created_at: string; id: string; is_default: boolean; layer_length_cm: number; layer_width_cm: number; layers_per_cart: number; name: string; updated_at: string; }; Insert: { created_at?: string; id?: string; is_default?: boolean; layer_length_cm: number; layer_width_cm: number; layers_per_cart?: number; name: string; updated_at?: string; }; Update: { created_at?: string; id?: string; is_default?: boolean; layer_length_cm?: number; layer_width_cm?: number; layers_per_cart?: number; name?: string; updated_at?: string; }; Relationships: []; }; catalog_articles_cache: { Row: { created_at: string; default_price: number; default_vat_rate_ref: string | null; external_ref: string; id: string; name: string; updated_at: string; user_id: string; }; Insert: { created_at?: string; default_price?: number; default_vat_rate_ref?: string | null; external_ref: string; id?: string; name: string; updated_at?: string; user_id: string; }; Update: { created_at?: string; default_price?: number; default_vat_rate_ref?: string | null; external_ref?: string; id?: string; name?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; catalog_vat_rates_cache: { Row: { created_at: string; external_ref: string; id: string; label: string; percentage: number; updated_at: string; user_id: string; }; Insert: { created_at?: string; external_ref: string; id?: string; label: string; percentage?: number; updated_at?: string; user_id: string; }; Update: { created_at?: string; external_ref?: string; id?: string; label?: string; percentage?: number; updated_at?: string; user_id?: string; }; Relationships: []; }; collections: { Row: { created_at: string; created_by: string | null; id: string; name: string; updated_at: string; }; Insert: { created_at?: string; created_by?: string | null; id?: string; name: string; updated_at?: string; }; Update: { created_at?: string; created_by?: string | null; id?: string; name?: string; updated_at?: string; }; Relationships: []; }; crate_types: { Row: { created_at: string; id: string; length_cm: number; name: string; plants_per_crate: number; updated_at: string; width_cm: number; }; Insert: { created_at?: string; id?: string; length_cm: number; name: string; plants_per_crate?: number; updated_at?: string; width_cm: number; }; Update: { created_at?: string; id?: string; length_cm?: number; name?: string; plants_per_crate?: number; updated_at?: string; width_cm?: number; }; Relationships: []; }; customer_audit_log: { Row: { action: string; changes: Json; created_at: string; customer_id: string; id: string; user_id: string | null; }; Insert: { action: string; changes?: Json; created_at?: string; customer_id: string; id?: string; user_id?: string | null; }; Update: { action?: string; changes?: Json; created_at?: string; customer_id?: string; id?: string; user_id?: string | null; }; Relationships: []; }; customer_contacts: { Row: { created_at: string; customer_id: string; email: string | null; floriday_contact_id: string | null; full_name: string; id: string; is_active: boolean; job_title: string | null; phone: string | null; photo_url: string | null; raw: Json | null; updated_at: string; }; Insert: { created_at?: string; customer_id: string; email?: string | null; floriday_contact_id?: string | null; full_name: string; id?: string; is_active?: boolean; job_title?: string | null; phone?: string | null; photo_url?: string | null; raw?: Json | null; updated_at?: string; }; Update: { created_at?: string; customer_id?: string; email?: string | null; floriday_contact_id?: string | null; full_name?: string; id?: string; is_active?: boolean; job_title?: string | null; phone?: string | null; photo_url?: string | null; raw?: Json | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "customer_contacts_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; } ]; }; customer_delivery_locations: { Row: { address_line: string | null; carrier_assignment_source: string; carrier_id: string | null; city: string | null; country: string | null; created_at: string; customer_id: string; external_key: string | null; external_provider: string | null; floriday_location_id: string | null; gln: string | null; group_key: string | null; house_number: string | null; id: string; is_primary: boolean; name: string | null; postal_code: string | null; province: string | null; raw: Json | null; self_pickup: boolean; street: string | null; updated_at: string; }; Insert: { address_line?: string | null; carrier_assignment_source?: string; carrier_id?: string | null; city?: string | null; country?: string | null; created_at?: string; customer_id: string; external_key?: string | null; external_provider?: string | null; floriday_location_id?: string | null; gln?: string | null; group_key?: string | null; house_number?: string | null; id?: string; is_primary?: boolean; name?: string | null; postal_code?: string | null; province?: string | null; raw?: Json | null; self_pickup?: boolean; street?: string | null; updated_at?: string; }; Update: { address_line?: string | null; carrier_assignment_source?: string; carrier_id?: string | null; city?: string | null; country?: string | null; created_at?: string; customer_id?: string; external_key?: string | null; external_provider?: string | null; floriday_location_id?: string | null; gln?: string | null; group_key?: string | null; house_number?: string | null; id?: string; is_primary?: boolean; name?: string | null; postal_code?: string | null; province?: string | null; raw?: Json | null; self_pickup?: boolean; street?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "customer_delivery_locations_carrier_id_fkey"; columns: ["carrier_id"]; isOneToOne: false; referencedRelation: "carriers"; referencedColumns: ["id"]; }, { foreignKeyName: "customer_delivery_locations_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; } ]; }; customer_field_options: { Row: { created_at: string; field_setting_id: string; id: string; label: string; sort_order: number; }; Insert: { created_at?: string; field_setting_id: string; id?: string; label: string; sort_order?: number; }; Update: { created_at?: string; field_setting_id?: string; id?: string; label?: string; sort_order?: number; }; Relationships: [ { foreignKeyName: "customer_field_options_field_setting_id_fkey"; columns: ["field_setting_id"]; isOneToOne: false; referencedRelation: "customer_field_settings"; referencedColumns: ["id"]; } ]; }; customer_field_settings: { Row: { created_at: string; field_key: string; field_label: string; field_type: string; id: string; is_custom: boolean; sort_order: number; updated_at: string; }; Insert: { created_at?: string; field_key: string; field_label: string; field_type?: string; id?: string; is_custom?: boolean; sort_order?: number; updated_at?: string; }; Update: { created_at?: string; field_key?: string; field_label?: string; field_type?: string; id?: string; is_custom?: boolean; sort_order?: number; updated_at?: string; }; Relationships: []; }; customer_logistics_strategy: { Row: { created_at: string; id: string; ref_key: string; scope: string; strategy_id: string | null; updated_at: string; }; Insert: { created_at?: string; id?: string; ref_key: string; scope: string; strategy_id?: string | null; updated_at?: string; }; Update: { created_at?: string; id?: string; ref_key?: string; scope?: string; strategy_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "customer_logistics_strategy_strategy_id_fkey"; columns: ["strategy_id"]; isOneToOne: false; referencedRelation: "logistics_strategies"; referencedColumns: ["id"]; } ]; }; customer_notes: { Row: { created_at: string; customer_id: string | null; group_key: string | null; id: string; notes: string | null; updated_at: string; }; Insert: { created_at?: string; customer_id?: string | null; group_key?: string | null; id?: string; notes?: string | null; updated_at?: string; }; Update: { created_at?: string; customer_id?: string | null; group_key?: string | null; id?: string; notes?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "customer_notes_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: true; referencedRelation: "customers"; referencedColumns: ["id"]; } ]; }; customer_price_group_members: { Row: { created_at: string; customer_key: string; id: string; owner_id: string; price_group_id: string; }; Insert: { created_at?: string; customer_key: string; id?: string; owner_id?: string; price_group_id: string; }; Update: { created_at?: string; customer_key?: string; id?: string; owner_id?: string; price_group_id?: string; }; Relationships: [ { foreignKeyName: "customer_price_group_members_price_group_id_fkey"; columns: ["price_group_id"]; isOneToOne: false; referencedRelation: "customer_price_groups"; referencedColumns: ["id"]; } ]; }; customer_price_groups: { Row: { calc_type: string | null; calc_value: number | null; calc_value_type: string | null; created_at: string; currency: string; distribute_over: string | null; external_id: string | null; external_synced_at: string | null; group_type: string; handling_fee: number | null; id: string; include_stickers: boolean; is_active: boolean; name: string; owner_id: string; price_scope: string; pricing_mode: string; rounding: string; rounding_step: number; sort_order: number; source: string; unit: string; updated_at: string; }; Insert: { calc_type?: string | null; calc_value?: number | null; calc_value_type?: string | null; created_at?: string; currency?: string; distribute_over?: string | null; external_id?: string | null; external_synced_at?: string | null; group_type?: string; handling_fee?: number | null; id?: string; include_stickers?: boolean; is_active?: boolean; name: string; owner_id?: string; price_scope?: string; pricing_mode?: string; rounding?: string; rounding_step?: number; sort_order?: number; source?: string; unit?: string; updated_at?: string; }; Update: { calc_type?: string | null; calc_value?: number | null; calc_value_type?: string | null; created_at?: string; currency?: string; distribute_over?: string | null; external_id?: string | null; external_synced_at?: string | null; group_type?: string; handling_fee?: number | null; id?: string; include_stickers?: boolean; is_active?: boolean; name?: string; owner_id?: string; price_scope?: string; pricing_mode?: string; rounding?: string; rounding_step?: number; sort_order?: number; source?: string; unit?: string; updated_at?: string; }; Relationships: []; }; customer_selected_assortment: { Row: { article_number: string | null; created_at: string; customer_id: string; floriday_item_id: string | null; id: string; price: number | null; product_group: string | null; product_name: string; raw: Json | null; unit: string | null; updated_at: string; }; Insert: { article_number?: string | null; created_at?: string; customer_id: string; floriday_item_id?: string | null; id?: string; price?: number | null; product_group?: string | null; product_name: string; raw?: Json | null; unit?: string | null; updated_at?: string; }; Update: { article_number?: string | null; created_at?: string; customer_id?: string; floriday_item_id?: string | null; id?: string; price?: number | null; product_group?: string | null; product_name?: string; raw?: Json | null; unit?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "customer_selected_assortment_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; } ]; }; customer_trade_settings: { Row: { category: string; created_at: string; customer_id: string; id: string; is_active: boolean; raw: Json | null; setting_key: string; setting_label: string; updated_at: string; }; Insert: { category?: string; created_at?: string; customer_id: string; id?: string; is_active?: boolean; raw?: Json | null; setting_key: string; setting_label: string; updated_at?: string; }; Update: { category?: string; created_at?: string; customer_id?: string; id?: string; is_active?: boolean; raw?: Json | null; setting_key?: string; setting_label?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "customer_trade_settings_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; } ]; }; customers: { Row: { address: string | null; address_line1: string | null; address_line2: string | null; address_type: string | null; attention_to: string | null; bank_account_holder: string | null; bank_account_number: string | null; bank_address_line1: string | null; bank_address_line2: string | null; bank_bic: string | null; bank_city: string | null; bank_country: string | null; bank_house_number: string | null; bank_iban: string | null; bank_name: string | null; bank_national_code: string | null; bank_postal_code: string | null; bank_state: string | null; billing_email: string | null; bio: string | null; blocked: boolean; city: string | null; coc_number: string | null; commercial_name: string | null; company_name: string; connection_status: string; contact_person: string | null; country: string | null; created_at: string; credit_limit: number; custom_fields: Json; customer_class: string | null; customer_number: string | null; discount_days: number | null; discount_percentage: number | null; discount_surcharge: string; e_invoicing: boolean; email: string | null; external_id: string | null; fax: string | null; floriday_connection_id: string | null; floriday_organization_id: string | null; floriday_raw: Json | null; gln: string | null; house_number: string | null; icp_country_code: string | null; id: string; invoice_send_as: string; is_active: boolean; language: string | null; last_synced_at: string | null; ledger_account: string | null; logo_url: string | null; markets: string[]; notes: string | null; organization_type: string | null; payment_methods: string[]; payment_spec_method: string; payment_term_days: number | null; phone: string | null; postal_code: string | null; product_groups: string[]; segments: string[]; send_reminder: string; source: string; street: string | null; sync_error: string | null; sync_status: string; trade_forms: string[]; twinfield_code: string | null; twinfield_last_hash: string | null; twinfield_sync_error: string | null; twinfield_synced_at: string | null; updated_at: string; vat_display: string | null; vat_number: string | null; website: string | null; }; Insert: { address?: string | null; address_line1?: string | null; address_line2?: string | null; address_type?: string | null; attention_to?: string | null; bank_account_holder?: string | null; bank_account_number?: string | null; bank_address_line1?: string | null; bank_address_line2?: string | null; bank_bic?: string | null; bank_city?: string | null; bank_country?: string | null; bank_house_number?: string | null; bank_iban?: string | null; bank_name?: string | null; bank_national_code?: string | null; bank_postal_code?: string | null; bank_state?: string | null; billing_email?: string | null; bio?: string | null; blocked?: boolean; city?: string | null; coc_number?: string | null; commercial_name?: string | null; company_name: string; connection_status?: string; contact_person?: string | null; country?: string | null; created_at?: string; credit_limit?: number; custom_fields?: Json; customer_class?: string | null; customer_number?: string | null; discount_days?: number | null; discount_percentage?: number | null; discount_surcharge?: string; e_invoicing?: boolean; email?: string | null; external_id?: string | null; fax?: string | null; floriday_connection_id?: string | null; floriday_organization_id?: string | null; floriday_raw?: Json | null; gln?: string | null; house_number?: string | null; icp_country_code?: string | null; id?: string; invoice_send_as?: string; is_active?: boolean; language?: string | null; last_synced_at?: string | null; ledger_account?: string | null; logo_url?: string | null; markets?: string[]; notes?: string | null; organization_type?: string | null; payment_methods?: string[]; payment_spec_method?: string; payment_term_days?: number | null; phone?: string | null; postal_code?: string | null; product_groups?: string[]; segments?: string[]; send_reminder?: string; source?: string; street?: string | null; sync_error?: string | null; sync_status?: string; trade_forms?: string[]; twinfield_code?: string | null; twinfield_last_hash?: string | null; twinfield_sync_error?: string | null; twinfield_synced_at?: string | null; updated_at?: string; vat_display?: string | null; vat_number?: string | null; website?: string | null; }; Update: { address?: string | null; address_line1?: string | null; address_line2?: string | null; address_type?: string | null; attention_to?: string | null; bank_account_holder?: string | null; bank_account_number?: string | null; bank_address_line1?: string | null; bank_address_line2?: string | null; bank_bic?: string | null; bank_city?: string | null; bank_country?: string | null; bank_house_number?: string | null; bank_iban?: string | null; bank_name?: string | null; bank_national_code?: string | null; bank_postal_code?: string | null; bank_state?: string | null; billing_email?: string | null; bio?: string | null; blocked?: boolean; city?: string | null; coc_number?: string | null; commercial_name?: string | null; company_name?: string; connection_status?: string; contact_person?: string | null; country?: string | null; created_at?: string; credit_limit?: number; custom_fields?: Json; customer_class?: string | null; customer_number?: string | null; discount_days?: number | null; discount_percentage?: number | null; discount_surcharge?: string; e_invoicing?: boolean; email?: string | null; external_id?: string | null; fax?: string | null; floriday_connection_id?: string | null; floriday_organization_id?: string | null; floriday_raw?: Json | null; gln?: string | null; house_number?: string | null; icp_country_code?: string | null; id?: string; invoice_send_as?: string; is_active?: boolean; language?: string | null; last_synced_at?: string | null; ledger_account?: string | null; logo_url?: string | null; markets?: string[]; notes?: string | null; organization_type?: string | null; payment_methods?: string[]; payment_spec_method?: string; payment_term_days?: number | null; phone?: string | null; postal_code?: string | null; product_groups?: string[]; segments?: string[]; send_reminder?: string; source?: string; street?: string | null; sync_error?: string | null; sync_status?: string; trade_forms?: string[]; twinfield_code?: string | null; twinfield_last_hash?: string | null; twinfield_sync_error?: string | null; twinfield_synced_at?: string | null; updated_at?: string; vat_display?: string | null; vat_number?: string | null; website?: string | null; }; Relationships: []; }; dashboard_ai_conversations: { Row: { created_at: string; id: string; messages: Json; page_id: string | null; title: string | null; updated_at: string; user_id: string; }; Insert: { created_at?: string; id?: string; messages?: Json; page_id?: string | null; title?: string | null; updated_at?: string; user_id: string; }; Update: { created_at?: string; id?: string; messages?: Json; page_id?: string | null; title?: string | null; updated_at?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "dashboard_ai_conversations_page_id_fkey"; columns: ["page_id"]; isOneToOne: false; referencedRelation: "dashboard_pages"; referencedColumns: ["id"]; } ]; }; dashboard_alert_events: { Row: { acknowledged: boolean; block_id: string; created_at: string; id: string; message: string | null; page_id: string; severity: string; threshold: number | null; user_id: string; value: number | null; }; Insert: { acknowledged?: boolean; block_id: string; created_at?: string; id?: string; message?: string | null; page_id: string; severity?: string; threshold?: number | null; user_id: string; value?: number | null; }; Update: { acknowledged?: boolean; block_id?: string; created_at?: string; id?: string; message?: string | null; page_id?: string; severity?: string; threshold?: number | null; user_id?: string; value?: number | null; }; Relationships: [ { foreignKeyName: "dashboard_alert_events_block_id_fkey"; columns: ["block_id"]; isOneToOne: false; referencedRelation: "dashboard_blocks"; referencedColumns: ["id"]; }, { foreignKeyName: "dashboard_alert_events_page_id_fkey"; columns: ["page_id"]; isOneToOne: false; referencedRelation: "dashboard_pages"; referencedColumns: ["id"]; } ]; }; dashboard_block_templates: { Row: { config: Json; created_at: string; description: string | null; id: string; is_public: boolean; name: string; type: string; updated_at: string; user_id: string; }; Insert: { config?: Json; created_at?: string; description?: string | null; id?: string; is_public?: boolean; name: string; type: string; updated_at?: string; user_id: string; }; Update: { config?: Json; created_at?: string; description?: string | null; id?: string; is_public?: boolean; name?: string; type?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; dashboard_blocks: { Row: { config: Json; created_at: string; filters: Json; id: string; layout: Json; page_id: string; permissions: Json; sort_order: number; title: string; type: string; updated_at: string; }; Insert: { config?: Json; created_at?: string; filters?: Json; id?: string; layout?: Json; page_id: string; permissions?: Json; sort_order?: number; title: string; type: string; updated_at?: string; }; Update: { config?: Json; created_at?: string; filters?: Json; id?: string; layout?: Json; page_id?: string; permissions?: Json; sort_order?: number; title?: string; type?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "dashboard_blocks_page_id_fkey"; columns: ["page_id"]; isOneToOne: false; referencedRelation: "dashboard_pages"; referencedColumns: ["id"]; } ]; }; dashboard_critical_alerts: { Row: { alert_key: string; alert_type: string; created_at: string; description: string | null; id: string; metadata: Json | null; priority: string; raised_at: string; related_cart_ids: string[] | null; resolved_at: string | null; title: string; updated_at: string; user_id: string; }; Insert: { alert_key: string; alert_type: string; created_at?: string; description?: string | null; id?: string; metadata?: Json | null; priority?: string; raised_at?: string; related_cart_ids?: string[] | null; resolved_at?: string | null; title: string; updated_at?: string; user_id: string; }; Update: { alert_key?: string; alert_type?: string; created_at?: string; description?: string | null; id?: string; metadata?: Json | null; priority?: string; raised_at?: string; related_cart_ids?: string[] | null; resolved_at?: string | null; title?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; dashboard_daily_reports: { Row: { created_at: string; highlights: Json | null; id: string; page_id: string; summary: string; user_id: string; }; Insert: { created_at?: string; highlights?: Json | null; id?: string; page_id: string; summary: string; user_id: string; }; Update: { created_at?: string; highlights?: Json | null; id?: string; page_id?: string; summary?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "dashboard_daily_reports_page_id_fkey"; columns: ["page_id"]; isOneToOne: false; referencedRelation: "dashboard_pages"; referencedColumns: ["id"]; } ]; }; dashboard_pages: { Row: { created_at: string; icon: string | null; id: string; is_default: boolean; name: string; shared_with: string[]; sort_order: number; updated_at: string; user_id: string; }; Insert: { created_at?: string; icon?: string | null; id?: string; is_default?: boolean; name: string; shared_with?: string[]; sort_order?: number; updated_at?: string; user_id: string; }; Update: { created_at?: string; icon?: string | null; id?: string; is_default?: boolean; name?: string; shared_with?: string[]; sort_order?: number; updated_at?: string; user_id?: string; }; Relationships: []; }; dashboard_saved_queries: { Row: { created_at: string; description: string | null; id: string; name: string; query_spec: Json; updated_at: string; user_id: string; }; Insert: { created_at?: string; description?: string | null; id?: string; name: string; query_spec: Json; updated_at?: string; user_id: string; }; Update: { created_at?: string; description?: string | null; id?: string; name?: string; query_spec?: Json; updated_at?: string; user_id?: string; }; Relationships: []; }; delivery_notes: { Row: { byte_size: number | null; connection_id: string | null; content_type: string; created_at: string; error_message: string | null; fetched_at: string | null; fulfillment_order_id: string | null; http_status: number | null; id: string; label_code: string | null; letter: string | null; load_carrier_index: number | null; load_carrier_type: string | null; order_id: string | null; order_number: string | null; packages: number | null; source: string; status: string; storage_bucket: string; storage_path: string | null; updated_at: string; }; Insert: { byte_size?: number | null; connection_id?: string | null; content_type?: string; created_at?: string; error_message?: string | null; fetched_at?: string | null; fulfillment_order_id?: string | null; http_status?: number | null; id?: string; label_code?: string | null; letter?: string | null; load_carrier_index?: number | null; load_carrier_type?: string | null; order_id?: string | null; order_number?: string | null; packages?: number | null; source?: string; status?: string; storage_bucket?: string; storage_path?: string | null; updated_at?: string; }; Update: { byte_size?: number | null; connection_id?: string | null; content_type?: string; created_at?: string; error_message?: string | null; fetched_at?: string | null; fulfillment_order_id?: string | null; http_status?: number | null; id?: string; label_code?: string | null; letter?: string | null; load_carrier_index?: number | null; load_carrier_type?: string | null; order_id?: string | null; order_number?: string | null; packages?: number | null; source?: string; status?: string; storage_bucket?: string; storage_path?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "delivery_notes_order_id_fkey"; columns: ["order_id"]; isOneToOne: false; referencedRelation: "orders"; referencedColumns: ["id"]; } ]; }; document_bronregels: { Row: { bron: string; created_at: string; documenttype: string; herkomst: string; id: string; layout_id: string | null; updated_at: string; }; Insert: { bron?: string; created_at?: string; documenttype: string; herkomst: string; id?: string; layout_id?: string | null; updated_at?: string; }; Update: { bron?: string; created_at?: string; documenttype?: string; herkomst?: string; id?: string; layout_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "document_bronregels_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; } ]; }; document_formaat_printers: { Row: { created_at: string; documenttype: string; formaat_code: string; id: string; printer_id: string | null; updated_at: string; }; Insert: { created_at?: string; documenttype: string; formaat_code: string; id?: string; printer_id?: string | null; updated_at?: string; }; Update: { created_at?: string; documenttype?: string; formaat_code?: string; id?: string; printer_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "document_formaat_printers_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "printers"; referencedColumns: ["id"]; } ]; }; document_layout_conditions: { Row: { created_at: string; element_key: string; id: string; layout_id: string; operator: string; updated_at: string; veld: string; waarde: string; }; Insert: { created_at?: string; element_key: string; id?: string; layout_id: string; operator?: string; updated_at?: string; veld: string; waarde?: string; }; Update: { created_at?: string; element_key?: string; id?: string; layout_id?: string; operator?: string; updated_at?: string; veld?: string; waarde?: string; }; Relationships: [ { foreignKeyName: "document_layout_conditions_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; } ]; }; document_layout_datasources: { Row: { alias: string; created_at: string; entiteit: string; filter: Json; id: string; layout_id: string; module_id: string; updated_at: string; }; Insert: { alias?: string; created_at?: string; entiteit: string; filter?: Json; id?: string; layout_id: string; module_id: string; updated_at?: string; }; Update: { alias?: string; created_at?: string; entiteit?: string; filter?: Json; id?: string; layout_id?: string; module_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "document_layout_datasources_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; } ]; }; document_layout_elements: { Row: { breedte: number; config: Json; content: string; created_at: string; element_key: string; hoogte: number; id: string; layout_id: string; logo_id: string | null; parent_key: string | null; rotatie: number; stijl: Json; type: string; updated_at: string; veldpad: string | null; verborgen: boolean; vergrendeld: boolean; volgorde: number; x: number; y: number; z_index: number; }; Insert: { breedte?: number; config?: Json; content?: string; created_at?: string; element_key: string; hoogte?: number; id?: string; layout_id: string; logo_id?: string | null; parent_key?: string | null; rotatie?: number; stijl?: Json; type: string; updated_at?: string; veldpad?: string | null; verborgen?: boolean; vergrendeld?: boolean; volgorde?: number; x?: number; y?: number; z_index?: number; }; Update: { breedte?: number; config?: Json; content?: string; created_at?: string; element_key?: string; hoogte?: number; id?: string; layout_id?: string; logo_id?: string | null; parent_key?: string | null; rotatie?: number; stijl?: Json; type?: string; updated_at?: string; veldpad?: string | null; verborgen?: boolean; vergrendeld?: boolean; volgorde?: number; x?: number; y?: number; z_index?: number; }; Relationships: [ { foreignKeyName: "document_layout_elements_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; }, { foreignKeyName: "document_layout_elements_logo_id_fkey"; columns: ["logo_id"]; isOneToOne: false; referencedRelation: "layout_logos"; referencedColumns: ["id"]; } ]; }; document_layout_variables: { Row: { created_at: string; expressie: string; id: string; layout_id: string; naam: string; omschrijving: string; updated_at: string; }; Insert: { created_at?: string; expressie?: string; id?: string; layout_id: string; naam: string; omschrijving?: string; updated_at?: string; }; Update: { created_at?: string; expressie?: string; id?: string; layout_id?: string; naam?: string; omschrijving?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "document_layout_variables_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; } ]; }; document_layout_versions: { Row: { commentaar: string; created_at: string; created_by: string | null; elements: Json; id: string; layout_id: string; page_settings: Json; updated_at: string; versienummer: number; }; Insert: { commentaar?: string; created_at?: string; created_by?: string | null; elements?: Json; id?: string; layout_id: string; page_settings?: Json; updated_at?: string; versienummer: number; }; Update: { commentaar?: string; created_at?: string; created_by?: string | null; elements?: Json; id?: string; layout_id?: string; page_settings?: Json; updated_at?: string; versienummer?: number; }; Relationships: [ { foreignKeyName: "document_layout_versions_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; } ]; }; document_layouts: { Row: { actief: boolean; breedte_mm: number; bron: string; config: Json; created_at: string; created_by: string | null; documenttype: Database["public"]["Enums"]["doc_layout_type"]; hoogte_mm: number; huidige_versie: number; id: string; is_standaard: boolean; marge_boven: number; marge_links: number; marge_onder: number; marge_rechts: number; naam: string; omschrijving: string; orientatie: Database["public"]["Enums"]["doc_orientation"]; page_settings: Json; papierformaat: string; systeem: boolean; thumbnail_url: string | null; updated_at: string; }; Insert: { actief?: boolean; breedte_mm?: number; bron?: string; config?: Json; created_at?: string; created_by?: string | null; documenttype?: Database["public"]["Enums"]["doc_layout_type"]; hoogte_mm?: number; huidige_versie?: number; id?: string; is_standaard?: boolean; marge_boven?: number; marge_links?: number; marge_onder?: number; marge_rechts?: number; naam: string; omschrijving?: string; orientatie?: Database["public"]["Enums"]["doc_orientation"]; page_settings?: Json; papierformaat?: string; systeem?: boolean; thumbnail_url?: string | null; updated_at?: string; }; Update: { actief?: boolean; breedte_mm?: number; bron?: string; config?: Json; created_at?: string; created_by?: string | null; documenttype?: Database["public"]["Enums"]["doc_layout_type"]; hoogte_mm?: number; huidige_versie?: number; id?: string; is_standaard?: boolean; marge_boven?: number; marge_links?: number; marge_onder?: number; marge_rechts?: number; naam?: string; omschrijving?: string; orientatie?: Database["public"]["Enums"]["doc_orientation"]; page_settings?: Json; papierformaat?: string; systeem?: boolean; thumbnail_url?: string | null; updated_at?: string; }; Relationships: []; }; document_printplek_printers: { Row: { created_at: string; documenttype: string; id: string; papierformaat: string | null; print_plek_id: string; printer_id: string | null; updated_at: string; }; Insert: { created_at?: string; documenttype: string; id?: string; papierformaat?: string | null; print_plek_id: string; printer_id?: string | null; updated_at?: string; }; Update: { created_at?: string; documenttype?: string; id?: string; papierformaat?: string | null; print_plek_id?: string; printer_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "document_printplek_printers_print_plek_id_fkey"; columns: ["print_plek_id"]; isOneToOne: false; referencedRelation: "print_plekken"; referencedColumns: ["id"]; }, { foreignKeyName: "document_printplek_printers_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "printers"; referencedColumns: ["id"]; } ]; }; document_werkplek_printers: { Row: { created_at: string; documenttype: string; id: string; papierformaat: string | null; printer_id: string | null; updated_at: string; werkplek: string; }; Insert: { created_at?: string; documenttype: string; id?: string; papierformaat?: string | null; printer_id?: string | null; updated_at?: string; werkplek: string; }; Update: { created_at?: string; documenttype?: string; id?: string; papierformaat?: string | null; printer_id?: string | null; updated_at?: string; werkplek?: string; }; Relationships: [ { foreignKeyName: "document_werkplek_printers_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "printers"; referencedColumns: ["id"]; } ]; }; email_auth_connections: { Row: { access_token_encrypted: string | null; account_email: string | null; client_id_encrypted: string | null; client_secret_encrypted: string | null; created_at: string; created_by: string | null; display_name: string | null; gmail_history_id: string | null; gmail_watch_expires_at: string | null; graph_subscription_expires_at: string | null; graph_subscription_id: string | null; id: string; imap_host: string | null; imap_last_uid: number | null; imap_password_encrypted: string | null; imap_port: number | null; imap_secure: boolean | null; imap_uid_validity: number | null; imap_username: string | null; is_active: boolean; last_error: string | null; last_event_at: string | null; last_verified_at: string | null; oauth_mode: string | null; provider: string; purpose_assignments: Json; realtime_mode: string; refresh_token_encrypted: string | null; scopes: string[] | null; smtp_host: string | null; smtp_password_encrypted: string | null; smtp_port: number | null; smtp_secure: boolean | null; smtp_username: string | null; status: string; token_expires_at: string | null; updated_at: string; watch_scope: string; webhook_last_attempt_at: string | null; webhook_last_error: string | null; webhook_status: string; }; Insert: { access_token_encrypted?: string | null; account_email?: string | null; client_id_encrypted?: string | null; client_secret_encrypted?: string | null; created_at?: string; created_by?: string | null; display_name?: string | null; gmail_history_id?: string | null; gmail_watch_expires_at?: string | null; graph_subscription_expires_at?: string | null; graph_subscription_id?: string | null; id?: string; imap_host?: string | null; imap_last_uid?: number | null; imap_password_encrypted?: string | null; imap_port?: number | null; imap_secure?: boolean | null; imap_uid_validity?: number | null; imap_username?: string | null; is_active?: boolean; last_error?: string | null; last_event_at?: string | null; last_verified_at?: string | null; oauth_mode?: string | null; provider: string; purpose_assignments?: Json; realtime_mode?: string; refresh_token_encrypted?: string | null; scopes?: string[] | null; smtp_host?: string | null; smtp_password_encrypted?: string | null; smtp_port?: number | null; smtp_secure?: boolean | null; smtp_username?: string | null; status?: string; token_expires_at?: string | null; updated_at?: string; watch_scope?: string; webhook_last_attempt_at?: string | null; webhook_last_error?: string | null; webhook_status?: string; }; Update: { access_token_encrypted?: string | null; account_email?: string | null; client_id_encrypted?: string | null; client_secret_encrypted?: string | null; created_at?: string; created_by?: string | null; display_name?: string | null; gmail_history_id?: string | null; gmail_watch_expires_at?: string | null; graph_subscription_expires_at?: string | null; graph_subscription_id?: string | null; id?: string; imap_host?: string | null; imap_last_uid?: number | null; imap_password_encrypted?: string | null; imap_port?: number | null; imap_secure?: boolean | null; imap_uid_validity?: number | null; imap_username?: string | null; is_active?: boolean; last_error?: string | null; last_event_at?: string | null; last_verified_at?: string | null; oauth_mode?: string | null; provider?: string; purpose_assignments?: Json; realtime_mode?: string; refresh_token_encrypted?: string | null; scopes?: string[] | null; smtp_host?: string | null; smtp_password_encrypted?: string | null; smtp_port?: number | null; smtp_secure?: boolean | null; smtp_username?: string | null; status?: string; token_expires_at?: string | null; updated_at?: string; watch_scope?: string; webhook_last_attempt_at?: string | null; webhook_last_error?: string | null; webhook_status?: string; }; Relationships: []; }; email_auth_events: { Row: { connection_id: string; consumed_at: string | null; created_at: string; event_type: string; external_id: string | null; id: string; payload: Json; provider: string; received_at: string; }; Insert: { connection_id: string; consumed_at?: string | null; created_at?: string; event_type: string; external_id?: string | null; id?: string; payload?: Json; provider: string; received_at?: string; }; Update: { connection_id?: string; consumed_at?: string | null; created_at?: string; event_type?: string; external_id?: string | null; id?: string; payload?: Json; provider?: string; received_at?: string; }; Relationships: [ { foreignKeyName: "email_auth_events_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections"; referencedColumns: ["id"]; }, { foreignKeyName: "email_auth_events_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections_safe"; referencedColumns: ["id"]; } ]; }; email_auth_outbox: { Row: { attempts: number; bcc_addresses: string[]; cc_addresses: string[]; connection_id: string | null; created_at: string; created_by: string | null; external_message_id: string | null; headers: Json; html_body: string | null; id: string; last_error: string | null; purpose: string; reply_to: string | null; scheduled_at: string; sent_at: string | null; status: string; subject: string; text_body: string | null; to_addresses: string[]; updated_at: string; }; Insert: { attempts?: number; bcc_addresses?: string[]; cc_addresses?: string[]; connection_id?: string | null; created_at?: string; created_by?: string | null; external_message_id?: string | null; headers?: Json; html_body?: string | null; id?: string; last_error?: string | null; purpose: string; reply_to?: string | null; scheduled_at?: string; sent_at?: string | null; status?: string; subject: string; text_body?: string | null; to_addresses: string[]; updated_at?: string; }; Update: { attempts?: number; bcc_addresses?: string[]; cc_addresses?: string[]; connection_id?: string | null; created_at?: string; created_by?: string | null; external_message_id?: string | null; headers?: Json; html_body?: string | null; id?: string; last_error?: string | null; purpose?: string; reply_to?: string | null; scheduled_at?: string; sent_at?: string | null; status?: string; subject?: string; text_body?: string | null; to_addresses?: string[]; updated_at?: string; }; Relationships: [ { foreignKeyName: "email_auth_outbox_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections"; referencedColumns: ["id"]; }, { foreignKeyName: "email_auth_outbox_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections_safe"; referencedColumns: ["id"]; } ]; }; email_auth_purpose_settings: { Row: { default_cc: string[]; purpose: string; reply_to: string | null; updated_at: string; updated_by: string | null; }; Insert: { default_cc?: string[]; purpose: string; reply_to?: string | null; updated_at?: string; updated_by?: string | null; }; Update: { default_cc?: string[]; purpose?: string; reply_to?: string | null; updated_at?: string; updated_by?: string | null; }; Relationships: []; }; email_auth_token_refresh_log: { Row: { connection_id: string; error_message: string | null; id: string; refreshed_at: string; success: boolean; trigger_source: string; }; Insert: { connection_id: string; error_message?: string | null; id?: string; refreshed_at?: string; success: boolean; trigger_source: string; }; Update: { connection_id?: string; error_message?: string | null; id?: string; refreshed_at?: string; success?: boolean; trigger_source?: string; }; Relationships: [ { foreignKeyName: "email_auth_token_refresh_log_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections"; referencedColumns: ["id"]; }, { foreignKeyName: "email_auth_token_refresh_log_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections_safe"; referencedColumns: ["id"]; } ]; }; email_auth_watch_folders: { Row: { connection_id: string; created_at: string; folder_id: string; folder_name: string | null; gmail_history_id: string | null; graph_subscription_expires_at: string | null; graph_subscription_id: string | null; id: string; imap_last_uid: number | null; imap_uid_validity: number | null; mailbox: string; provider: string; updated_at: string; webhook_last_error: string | null; webhook_status: string | null; }; Insert: { connection_id: string; created_at?: string; folder_id: string; folder_name?: string | null; gmail_history_id?: string | null; graph_subscription_expires_at?: string | null; graph_subscription_id?: string | null; id?: string; imap_last_uid?: number | null; imap_uid_validity?: number | null; mailbox?: string; provider: string; updated_at?: string; webhook_last_error?: string | null; webhook_status?: string | null; }; Update: { connection_id?: string; created_at?: string; folder_id?: string; folder_name?: string | null; gmail_history_id?: string | null; graph_subscription_expires_at?: string | null; graph_subscription_id?: string | null; id?: string; imap_last_uid?: number | null; imap_uid_validity?: number | null; mailbox?: string; provider?: string; updated_at?: string; webhook_last_error?: string | null; webhook_status?: string | null; }; Relationships: [ { foreignKeyName: "email_auth_watch_folders_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections"; referencedColumns: ["id"]; }, { foreignKeyName: "email_auth_watch_folders_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections_safe"; referencedColumns: ["id"]; } ]; }; email_auth_webhook_log: { Row: { body_sample: string | null; connection_id: string | null; created_at: string; error_message: string | null; headers_sample: Json | null; id: string; notification_count: number | null; provider: string | null; source: string | null; status: string; subscription_id: string | null; }; Insert: { body_sample?: string | null; connection_id?: string | null; created_at?: string; error_message?: string | null; headers_sample?: Json | null; id?: string; notification_count?: number | null; provider?: string | null; source?: string | null; status: string; subscription_id?: string | null; }; Update: { body_sample?: string | null; connection_id?: string | null; created_at?: string; error_message?: string | null; headers_sample?: Json | null; id?: string; notification_count?: number | null; provider?: string | null; source?: string | null; status?: string; subscription_id?: string | null; }; Relationships: [ { foreignKeyName: "email_auth_webhook_log_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections"; referencedColumns: ["id"]; }, { foreignKeyName: "email_auth_webhook_log_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections_safe"; referencedColumns: ["id"]; } ]; }; exact_account_analytics_cache: { Row: { account_id: string; account_name: string | null; avg_payment_days: number | null; computed_at: string; connection_id: string; expires_at: string | null; id: string; invoice_count: number | null; last_invoice_date: string | null; last_payment_date: string | null; open_balance: number | null; overdue_balance: number | null; total_revenue: number | null; }; Insert: { account_id: string; account_name?: string | null; avg_payment_days?: number | null; computed_at?: string; connection_id: string; expires_at?: string | null; id?: string; invoice_count?: number | null; last_invoice_date?: string | null; last_payment_date?: string | null; open_balance?: number | null; overdue_balance?: number | null; total_revenue?: number | null; }; Update: { account_id?: string; account_name?: string | null; avg_payment_days?: number | null; computed_at?: string; connection_id?: string; expires_at?: string | null; id?: string; invoice_count?: number | null; last_invoice_date?: string | null; last_payment_date?: string | null; open_balance?: number | null; overdue_balance?: number | null; total_revenue?: number | null; }; Relationships: [ { foreignKeyName: "exact_account_analytics_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; exact_analytics_cache: { Row: { analytics_type: string; avg_payment_days: number | null; computed_at: string; connection_id: string; data_raw: Json | null; expires_at: string | null; id: string; open_count: number | null; overdue_amount: number | null; paid_this_month: number | null; period_key: string; total_invoiced: number | null; total_open: number | null; }; Insert: { analytics_type: string; avg_payment_days?: number | null; computed_at?: string; connection_id: string; data_raw?: Json | null; expires_at?: string | null; id?: string; open_count?: number | null; overdue_amount?: number | null; paid_this_month?: number | null; period_key: string; total_invoiced?: number | null; total_open?: number | null; }; Update: { analytics_type?: string; avg_payment_days?: number | null; computed_at?: string; connection_id?: string; data_raw?: Json | null; expires_at?: string | null; id?: string; open_count?: number | null; overdue_amount?: number | null; paid_this_month?: number | null; period_key?: string; total_invoiced?: number | null; total_open?: number | null; }; Relationships: [ { foreignKeyName: "exact_analytics_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; exact_auth_call_budget: { Row: { account_key: string; day_count: number; day_date: string; division_code: number; environment: string; minute_count: number; minute_window: string; updated_at: string; }; Insert: { account_key?: string; day_count?: number; day_date?: string; division_code?: number; environment: string; minute_count?: number; minute_window?: string; updated_at?: string; }; Update: { account_key?: string; day_count?: number; day_date?: string; division_code?: number; environment?: string; minute_count?: number; minute_window?: string; updated_at?: string; }; Relationships: []; }; exact_auth_customers: { Row: { account_key: string; address_line1: string | null; chamber_of_commerce: string | null; city: string | null; code: string | null; country: string | null; created_at: string; currency: string | null; division_code: number | null; email: string | null; environment: Database["public"]["Enums"]["exact_env"]; exact_id: string; exact_modified: string | null; exact_timestamp: number | null; id: string; is_active: boolean; name: string | null; phone: string | null; postcode: string | null; raw: Json | null; status: string | null; updated_at: string; vat_number: string | null; website: string | null; }; Insert: { account_key?: string; address_line1?: string | null; chamber_of_commerce?: string | null; city?: string | null; code?: string | null; country?: string | null; created_at?: string; currency?: string | null; division_code?: number | null; email?: string | null; environment: Database["public"]["Enums"]["exact_env"]; exact_id: string; exact_modified?: string | null; exact_timestamp?: number | null; id?: string; is_active?: boolean; name?: string | null; phone?: string | null; postcode?: string | null; raw?: Json | null; status?: string | null; updated_at?: string; vat_number?: string | null; website?: string | null; }; Update: { account_key?: string; address_line1?: string | null; chamber_of_commerce?: string | null; city?: string | null; code?: string | null; country?: string | null; created_at?: string; currency?: string | null; division_code?: number | null; email?: string | null; environment?: Database["public"]["Enums"]["exact_env"]; exact_id?: string; exact_modified?: string | null; exact_timestamp?: number | null; id?: string; is_active?: boolean; name?: string | null; phone?: string | null; postcode?: string | null; raw?: Json | null; status?: string | null; updated_at?: string; vat_number?: string | null; website?: string | null; }; Relationships: []; }; exact_auth_divisions: { Row: { account_key: string; company_name: string | null; created_at: string; division_code: number | null; environment: Database["public"]["Enums"]["exact_env"]; id: string; last_synced_at: string | null; updated_at: string; }; Insert: { account_key?: string; company_name?: string | null; created_at?: string; division_code?: number | null; environment: Database["public"]["Enums"]["exact_env"]; id?: string; last_synced_at?: string | null; updated_at?: string; }; Update: { account_key?: string; company_name?: string | null; created_at?: string; division_code?: number | null; environment?: Database["public"]["Enums"]["exact_env"]; id?: string; last_synced_at?: string | null; updated_at?: string; }; Relationships: []; }; exact_auth_invoice_lines: { Row: { account_key: string; amount_excl: number | null; created_at: string; description: string | null; discount: number | null; environment: Database["public"]["Enums"]["exact_env"]; exact_id: string; exact_timestamp: number | null; id: string; invoice_exact_id: string; item_code: string | null; item_exact_id: string | null; line_number: number | null; quantity: number | null; raw: Json | null; unit_price: number | null; updated_at: string; vat_amount: number | null; vat_code: string | null; }; Insert: { account_key?: string; amount_excl?: number | null; created_at?: string; description?: string | null; discount?: number | null; environment: Database["public"]["Enums"]["exact_env"]; exact_id: string; exact_timestamp?: number | null; id?: string; invoice_exact_id: string; item_code?: string | null; item_exact_id?: string | null; line_number?: number | null; quantity?: number | null; raw?: Json | null; unit_price?: number | null; updated_at?: string; vat_amount?: number | null; vat_code?: string | null; }; Update: { account_key?: string; amount_excl?: number | null; created_at?: string; description?: string | null; discount?: number | null; environment?: Database["public"]["Enums"]["exact_env"]; exact_id?: string; exact_timestamp?: number | null; id?: string; invoice_exact_id?: string; item_code?: string | null; item_exact_id?: string | null; line_number?: number | null; quantity?: number | null; raw?: Json | null; unit_price?: number | null; updated_at?: string; vat_amount?: number | null; vat_code?: string | null; }; Relationships: []; }; exact_auth_invoices: { Row: { account_key: string; amount_excl: number | null; amount_incl: number | null; amount_open: number | null; created_at: string; currency: string | null; customer_code: string | null; customer_exact_id: string | null; customer_name: string | null; description: string | null; division_code: number | null; due_date: string | null; environment: Database["public"]["Enums"]["exact_env"]; exact_id: string; exact_modified: string | null; exact_timestamp: number | null; id: string; invoice_date: string | null; invoice_number: string | null; order_number: string | null; paid_at: string | null; payment_status: string; raw: Json | null; receivable_synced_at: string | null; status_code: number | null; updated_at: string; }; Insert: { account_key?: string; amount_excl?: number | null; amount_incl?: number | null; amount_open?: number | null; created_at?: string; currency?: string | null; customer_code?: string | null; customer_exact_id?: string | null; customer_name?: string | null; description?: string | null; division_code?: number | null; due_date?: string | null; environment: Database["public"]["Enums"]["exact_env"]; exact_id: string; exact_modified?: string | null; exact_timestamp?: number | null; id?: string; invoice_date?: string | null; invoice_number?: string | null; order_number?: string | null; paid_at?: string | null; payment_status?: string; raw?: Json | null; receivable_synced_at?: string | null; status_code?: number | null; updated_at?: string; }; Update: { account_key?: string; amount_excl?: number | null; amount_incl?: number | null; amount_open?: number | null; created_at?: string; currency?: string | null; customer_code?: string | null; customer_exact_id?: string | null; customer_name?: string | null; description?: string | null; division_code?: number | null; due_date?: string | null; environment?: Database["public"]["Enums"]["exact_env"]; exact_id?: string; exact_modified?: string | null; exact_timestamp?: number | null; id?: string; invoice_date?: string | null; invoice_number?: string | null; order_number?: string | null; paid_at?: string | null; payment_status?: string; raw?: Json | null; receivable_synced_at?: string | null; status_code?: number | null; updated_at?: string; }; Relationships: []; }; exact_auth_items: { Row: { account_key: string; barcode: string | null; code: string | null; cost_price: number | null; created_at: string; description: string | null; division_code: number | null; environment: Database["public"]["Enums"]["exact_env"]; exact_id: string; exact_modified: string | null; exact_timestamp: number | null; gl_account_code: string | null; id: string; is_active: boolean; is_sales_item: boolean | null; item_type: string | null; raw: Json | null; sales_price: number | null; unit: string | null; updated_at: string; vat_code: string | null; }; Insert: { account_key?: string; barcode?: string | null; code?: string | null; cost_price?: number | null; created_at?: string; description?: string | null; division_code?: number | null; environment: Database["public"]["Enums"]["exact_env"]; exact_id: string; exact_modified?: string | null; exact_timestamp?: number | null; gl_account_code?: string | null; id?: string; is_active?: boolean; is_sales_item?: boolean | null; item_type?: string | null; raw?: Json | null; sales_price?: number | null; unit?: string | null; updated_at?: string; vat_code?: string | null; }; Update: { account_key?: string; barcode?: string | null; code?: string | null; cost_price?: number | null; created_at?: string; description?: string | null; division_code?: number | null; environment?: Database["public"]["Enums"]["exact_env"]; exact_id?: string; exact_modified?: string | null; exact_timestamp?: number | null; gl_account_code?: string | null; id?: string; is_active?: boolean; is_sales_item?: boolean | null; item_type?: string | null; raw?: Json | null; sales_price?: number | null; unit?: string | null; updated_at?: string; vat_code?: string | null; }; Relationships: []; }; exact_auth_sync_log: { Row: { account_key: string; calls_used: number; created_at: string; domain: string; environment: Database["public"]["Enums"]["exact_env"]; error: string | null; finished_at: string | null; id: string; ok: boolean; records: number; started_at: string; }; Insert: { account_key?: string; calls_used?: number; created_at?: string; domain: string; environment: Database["public"]["Enums"]["exact_env"]; error?: string | null; finished_at?: string | null; id?: string; ok?: boolean; records?: number; started_at?: string; }; Update: { account_key?: string; calls_used?: number; created_at?: string; domain?: string; environment?: Database["public"]["Enums"]["exact_env"]; error?: string | null; finished_at?: string | null; id?: string; ok?: boolean; records?: number; started_at?: string; }; Relationships: []; }; exact_auth_sync_state: { Row: { account_key: string; created_at: string; cursor_timestamp: number; division_code: number | null; domain: string; duration_ms: number | null; environment: Database["public"]["Enums"]["exact_env"]; initial_sync_done: boolean; last_error: string | null; last_run_at: string | null; last_success_at: string | null; locked_at: string | null; needs_initial_sync: boolean; record_count: number; updated_at: string; }; Insert: { account_key?: string; created_at?: string; cursor_timestamp?: number; division_code?: number | null; domain: string; duration_ms?: number | null; environment: Database["public"]["Enums"]["exact_env"]; initial_sync_done?: boolean; last_error?: string | null; last_run_at?: string | null; last_success_at?: string | null; locked_at?: string | null; needs_initial_sync?: boolean; record_count?: number; updated_at?: string; }; Update: { account_key?: string; created_at?: string; cursor_timestamp?: number; division_code?: number | null; domain?: string; duration_ms?: number | null; environment?: Database["public"]["Enums"]["exact_env"]; initial_sync_done?: boolean; last_error?: string | null; last_run_at?: string | null; last_success_at?: string | null; locked_at?: string | null; needs_initial_sync?: boolean; record_count?: number; updated_at?: string; }; Relationships: []; }; exact_bulk_operation_items: { Row: { attempts: number; bulk_operation_id: string; created_at: string; error_message: string | null; id: string; invoice_cache_id: string | null; invoice_exact_id: string | null; processed_at: string | null; result_data: Json | null; status: string; }; Insert: { attempts?: number; bulk_operation_id: string; created_at?: string; error_message?: string | null; id?: string; invoice_cache_id?: string | null; invoice_exact_id?: string | null; processed_at?: string | null; result_data?: Json | null; status?: string; }; Update: { attempts?: number; bulk_operation_id?: string; created_at?: string; error_message?: string | null; id?: string; invoice_cache_id?: string | null; invoice_exact_id?: string | null; processed_at?: string | null; result_data?: Json | null; status?: string; }; Relationships: [ { foreignKeyName: "exact_bulk_operation_items_bulk_operation_id_fkey"; columns: ["bulk_operation_id"]; isOneToOne: false; referencedRelation: "exact_bulk_operations"; referencedColumns: ["id"]; }, { foreignKeyName: "exact_bulk_operation_items_invoice_cache_id_fkey"; columns: ["invoice_cache_id"]; isOneToOne: false; referencedRelation: "exact_invoices_cache"; referencedColumns: ["id"]; } ]; }; exact_bulk_operations: { Row: { completed_at: string | null; connection_id: string; created_at: string; created_by: string | null; error_message: string | null; failed_count: number | null; id: string; operation_type: string; processed_count: number | null; result_data: Json | null; started_at: string | null; status: string; total_count: number | null; updated_at: string; }; Insert: { completed_at?: string | null; connection_id: string; created_at?: string; created_by?: string | null; error_message?: string | null; failed_count?: number | null; id?: string; operation_type: string; processed_count?: number | null; result_data?: Json | null; started_at?: string | null; status?: string; total_count?: number | null; updated_at?: string; }; Update: { completed_at?: string | null; connection_id?: string; created_at?: string; created_by?: string | null; error_message?: string | null; failed_count?: number | null; id?: string; operation_type?: string; processed_count?: number | null; result_data?: Json | null; started_at?: string | null; status?: string; total_count?: number | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "exact_bulk_operations_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; exact_connections: { Row: { access_token_encrypted: string; company_name: string | null; connected_at: string; connected_by: string | null; division_code: number | null; environment: Database["public"]["Enums"]["exact_env"]; expires_at: string; id: string; last_error: string | null; last_refreshed_at: string | null; last_tested_at: string | null; refresh_token_encrypted: string; status: string; updated_at: string; }; Insert: { access_token_encrypted: string; company_name?: string | null; connected_at?: string; connected_by?: string | null; division_code?: number | null; environment: Database["public"]["Enums"]["exact_env"]; expires_at: string; id?: string; last_error?: string | null; last_refreshed_at?: string | null; last_tested_at?: string | null; refresh_token_encrypted: string; status?: string; updated_at?: string; }; Update: { access_token_encrypted?: string; company_name?: string | null; connected_at?: string; connected_by?: string | null; division_code?: number | null; environment?: Database["public"]["Enums"]["exact_env"]; expires_at?: string; id?: string; last_error?: string | null; last_refreshed_at?: string | null; last_tested_at?: string | null; refresh_token_encrypted?: string; status?: string; updated_at?: string; }; Relationships: []; }; exact_credentials: { Row: { client_id: string; client_secret_encrypted: string; created_at: string; environment: Database["public"]["Enums"]["exact_env"]; id: string; redirect_uri: string; updated_at: string; }; Insert: { client_id: string; client_secret_encrypted: string; created_at?: string; environment: Database["public"]["Enums"]["exact_env"]; id?: string; redirect_uri?: string; updated_at?: string; }; Update: { client_id?: string; client_secret_encrypted?: string; created_at?: string; environment?: Database["public"]["Enums"]["exact_env"]; id?: string; redirect_uri?: string; updated_at?: string; }; Relationships: []; }; exact_customer_sync_queue: { Row: { attempts: number; connection_id: string; created_at: string; customer_exact_id: string | null; error_message: string | null; id: string; max_attempts: number; operation: string; payload: Json; process_at: string; processed_at: string | null; status: string; updated_at: string; }; Insert: { attempts?: number; connection_id: string; created_at?: string; customer_exact_id?: string | null; error_message?: string | null; id?: string; max_attempts?: number; operation: string; payload?: Json; process_at?: string; processed_at?: string | null; status?: string; updated_at?: string; }; Update: { attempts?: number; connection_id?: string; created_at?: string; customer_exact_id?: string | null; error_message?: string | null; id?: string; max_attempts?: number; operation?: string; payload?: Json; process_at?: string; processed_at?: string | null; status?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "exact_customer_sync_queue_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; exact_customers_cache: { Row: { account_name: string | null; account_number: string | null; address_line1: string | null; address_line2: string | null; balance: number | null; chamber_of_commerce: string | null; city: string | null; classification_description: string | null; connection_id: string; contact_name: string | null; country: string | null; created_at_exact: string | null; credit_line: number | null; currency: string | null; data_raw: Json | null; email: string | null; exact_id: string; expires_at: string | null; fetched_at: string; id: string; is_sales: boolean | null; is_supplier: boolean | null; language: string | null; modified_at_exact: string | null; payment_condition_description: string | null; payment_condition_sales: string | null; phone: string | null; postal_code: string | null; remarks: string | null; search_text: string | null; status: string | null; updated_at: string; vat_number: string | null; website: string | null; }; Insert: { account_name?: string | null; account_number?: string | null; address_line1?: string | null; address_line2?: string | null; balance?: number | null; chamber_of_commerce?: string | null; city?: string | null; classification_description?: string | null; connection_id: string; contact_name?: string | null; country?: string | null; created_at_exact?: string | null; credit_line?: number | null; currency?: string | null; data_raw?: Json | null; email?: string | null; exact_id: string; expires_at?: string | null; fetched_at?: string; id?: string; is_sales?: boolean | null; is_supplier?: boolean | null; language?: string | null; modified_at_exact?: string | null; payment_condition_description?: string | null; payment_condition_sales?: string | null; phone?: string | null; postal_code?: string | null; remarks?: string | null; search_text?: string | null; status?: string | null; updated_at?: string; vat_number?: string | null; website?: string | null; }; Update: { account_name?: string | null; account_number?: string | null; address_line1?: string | null; address_line2?: string | null; balance?: number | null; chamber_of_commerce?: string | null; city?: string | null; classification_description?: string | null; connection_id?: string; contact_name?: string | null; country?: string | null; created_at_exact?: string | null; credit_line?: number | null; currency?: string | null; data_raw?: Json | null; email?: string | null; exact_id?: string; expires_at?: string | null; fetched_at?: string; id?: string; is_sales?: boolean | null; is_supplier?: boolean | null; language?: string | null; modified_at_exact?: string | null; payment_condition_description?: string | null; payment_condition_sales?: string | null; phone?: string | null; postal_code?: string | null; remarks?: string | null; search_text?: string | null; status?: string | null; updated_at?: string; vat_number?: string | null; website?: string | null; }; Relationships: [ { foreignKeyName: "exact_customers_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; exact_invoice_actions: { Row: { action_type: string; connection_id: string; created_at: string; created_by: string | null; error_message: string | null; id: string; invoice_cache_id: string | null; invoice_exact_id: string | null; rate_limit_remaining: number | null; response_data: Json | null; status: string; }; Insert: { action_type: string; connection_id: string; created_at?: string; created_by?: string | null; error_message?: string | null; id?: string; invoice_cache_id?: string | null; invoice_exact_id?: string | null; rate_limit_remaining?: number | null; response_data?: Json | null; status: string; }; Update: { action_type?: string; connection_id?: string; created_at?: string; created_by?: string | null; error_message?: string | null; id?: string; invoice_cache_id?: string | null; invoice_exact_id?: string | null; rate_limit_remaining?: number | null; response_data?: Json | null; status?: string; }; Relationships: [ { foreignKeyName: "exact_invoice_actions_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; }, { foreignKeyName: "exact_invoice_actions_invoice_cache_id_fkey"; columns: ["invoice_cache_id"]; isOneToOne: false; referencedRelation: "exact_invoices_cache"; referencedColumns: ["id"]; } ]; }; exact_invoice_lines_cache: { Row: { connection_id: string; created_at: string; data_raw: Json | null; description: string | null; discount: number | null; exact_line_id: string; gl_account_code: string | null; id: string; invoice_cache_id: string; item_code: string | null; line_total: number | null; quantity: number | null; unit_price: number | null; vat_code: string | null; }; Insert: { connection_id: string; created_at?: string; data_raw?: Json | null; description?: string | null; discount?: number | null; exact_line_id: string; gl_account_code?: string | null; id?: string; invoice_cache_id: string; item_code?: string | null; line_total?: number | null; quantity?: number | null; unit_price?: number | null; vat_code?: string | null; }; Update: { connection_id?: string; created_at?: string; data_raw?: Json | null; description?: string | null; discount?: number | null; exact_line_id?: string; gl_account_code?: string | null; id?: string; invoice_cache_id?: string; item_code?: string | null; line_total?: number | null; quantity?: number | null; unit_price?: number | null; vat_code?: string | null; }; Relationships: [ { foreignKeyName: "exact_invoice_lines_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; }, { foreignKeyName: "exact_invoice_lines_cache_invoice_cache_id_fkey"; columns: ["invoice_cache_id"]; isOneToOne: false; referencedRelation: "exact_invoices_cache"; referencedColumns: ["id"]; } ]; }; exact_invoices_cache: { Row: { account_id: string | null; account_name: string | null; amount_excl_btw: number | null; btw_amount: number | null; connection_id: string; data_raw: Json | null; due_date: string | null; entry_id: string | null; exact_id: string; expires_at: string | null; fetched_at: string; has_pdf: boolean | null; id: string; invoice_date: string | null; invoice_number: string | null; last_reminder_date: string | null; open_amount: number | null; paid_amount: number | null; paid_date: string | null; reminder_count: number | null; search_text: string | null; status: string | null; total_amount: number | null; updated_at: string; }; Insert: { account_id?: string | null; account_name?: string | null; amount_excl_btw?: number | null; btw_amount?: number | null; connection_id: string; data_raw?: Json | null; due_date?: string | null; entry_id?: string | null; exact_id: string; expires_at?: string | null; fetched_at?: string; has_pdf?: boolean | null; id?: string; invoice_date?: string | null; invoice_number?: string | null; last_reminder_date?: string | null; open_amount?: number | null; paid_amount?: number | null; paid_date?: string | null; reminder_count?: number | null; search_text?: string | null; status?: string | null; total_amount?: number | null; updated_at?: string; }; Update: { account_id?: string | null; account_name?: string | null; amount_excl_btw?: number | null; btw_amount?: number | null; connection_id?: string; data_raw?: Json | null; due_date?: string | null; entry_id?: string | null; exact_id?: string; expires_at?: string | null; fetched_at?: string; has_pdf?: boolean | null; id?: string; invoice_date?: string | null; invoice_number?: string | null; last_reminder_date?: string | null; open_amount?: number | null; paid_amount?: number | null; paid_date?: string | null; reminder_count?: number | null; search_text?: string | null; status?: string | null; total_amount?: number | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "exact_invoices_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; exact_operation_logs: { Row: { connection_id: string | null; created_at: string; duration_ms: number | null; entity_id: string | null; entity_type: string | null; error_message: string | null; id: string; operation: string | null; rate_limit_remaining: number | null; request_data: Json | null; response_data: Json | null; status: string | null; }; Insert: { connection_id?: string | null; created_at?: string; duration_ms?: number | null; entity_id?: string | null; entity_type?: string | null; error_message?: string | null; id?: string; operation?: string | null; rate_limit_remaining?: number | null; request_data?: Json | null; response_data?: Json | null; status?: string | null; }; Update: { connection_id?: string | null; created_at?: string; duration_ms?: number | null; entity_id?: string | null; entity_type?: string | null; error_message?: string | null; id?: string; operation?: string | null; rate_limit_remaining?: number | null; request_data?: Json | null; response_data?: Json | null; status?: string | null; }; Relationships: [ { foreignKeyName: "exact_operation_logs_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; exact_push_queue: { Row: { attempts: number; connection_id: string; created_at: string; external_id: string | null; id: string; idempotency_hash: string; last_error: string | null; payload: Json; status: Database["public"]["Enums"]["exact_push_status"]; updated_at: string; }; Insert: { attempts?: number; connection_id: string; created_at?: string; external_id?: string | null; id?: string; idempotency_hash: string; last_error?: string | null; payload: Json; status?: Database["public"]["Enums"]["exact_push_status"]; updated_at?: string; }; Update: { attempts?: number; connection_id?: string; created_at?: string; external_id?: string | null; id?: string; idempotency_hash?: string; last_error?: string | null; payload?: Json; status?: Database["public"]["Enums"]["exact_push_status"]; updated_at?: string; }; Relationships: [ { foreignKeyName: "exact_push_queue_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; exact_refresh_locks: { Row: { environment: Database["public"]["Enums"]["exact_env"]; locked_by: string; locked_until: string; updated_at: string; }; Insert: { environment: Database["public"]["Enums"]["exact_env"]; locked_by: string; locked_until: string; updated_at?: string; }; Update: { environment?: Database["public"]["Enums"]["exact_env"]; locked_by?: string; locked_until?: string; updated_at?: string; }; Relationships: []; }; exact_settings: { Row: { client_id: string | null; client_secret: string | null; connection_status: string; created_at: string; division_id: string | null; id: string; last_sync_at: string | null; redirect_uri: string | null; updated_at: string; }; Insert: { client_id?: string | null; client_secret?: string | null; connection_status?: string; created_at?: string; division_id?: string | null; id?: string; last_sync_at?: string | null; redirect_uri?: string | null; updated_at?: string; }; Update: { client_id?: string | null; client_secret?: string | null; connection_status?: string; created_at?: string; division_id?: string | null; id?: string; last_sync_at?: string | null; redirect_uri?: string | null; updated_at?: string; }; Relationships: []; }; exact_sync_state: { Row: { connection_id: string; last_error: string | null; last_modified_cursor: string | null; last_modified_cursor_customers: string | null; last_modified_cursor_invoices: string | null; last_synced_at: string | null; status: string; updated_at: string; }; Insert: { connection_id: string; last_error?: string | null; last_modified_cursor?: string | null; last_modified_cursor_customers?: string | null; last_modified_cursor_invoices?: string | null; last_synced_at?: string | null; status?: string; updated_at?: string; }; Update: { connection_id?: string; last_error?: string | null; last_modified_cursor?: string | null; last_modified_cursor_customers?: string | null; last_modified_cursor_invoices?: string | null; last_synced_at?: string | null; status?: string; updated_at?: string; }; Relationships: []; }; external_customer_providers: { Row: { color: string | null; created_at: string; icon: string | null; is_enabled: boolean; label: string; last_synced_at: string | null; provider: string; sort_order: number; updated_at: string; }; Insert: { color?: string | null; created_at?: string; icon?: string | null; is_enabled?: boolean; label: string; last_synced_at?: string | null; provider: string; sort_order?: number; updated_at?: string; }; Update: { color?: string | null; created_at?: string; icon?: string | null; is_enabled?: boolean; label?: string; last_synced_at?: string | null; provider?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; external_invoice_providers: { Row: { color: string | null; created_at: string; hmac_secret_name: string | null; icon: string | null; is_enabled: boolean; label: string; last_synced_at: string | null; provider: string; push_endpoint: string | null; sort_order: number; status_endpoint: string | null; sync_endpoint: string | null; updated_at: string; }; Insert: { color?: string | null; created_at?: string; hmac_secret_name?: string | null; icon?: string | null; is_enabled?: boolean; label: string; last_synced_at?: string | null; provider: string; push_endpoint?: string | null; sort_order?: number; status_endpoint?: string | null; sync_endpoint?: string | null; updated_at?: string; }; Update: { color?: string | null; created_at?: string; hmac_secret_name?: string | null; icon?: string | null; is_enabled?: boolean; label?: string; last_synced_at?: string | null; provider?: string; push_endpoint?: string | null; sort_order?: number; status_endpoint?: string | null; sync_endpoint?: string | null; updated_at?: string; }; Relationships: []; }; extra_categories: { Row: { created_at: string; id: string; name: string; sort_order: number; updated_at: string; }; Insert: { created_at?: string; id?: string; name: string; sort_order?: number; updated_at?: string; }; Update: { created_at?: string; id?: string; name?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; extra_pricing_types: { Row: { code: string; created_at: string; id: string; label: string; sort_order: number; updated_at: string; }; Insert: { code: string; created_at?: string; id?: string; label: string; sort_order?: number; updated_at?: string; }; Update: { code?: string; created_at?: string; id?: string; label?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; extras: { Row: { category: string; created_at: string; exact_article_id: string | null; id: string; image_url: string | null; is_active: boolean; name: string; price: number; pricing_type: string; }; Insert: { category: string; created_at?: string; exact_article_id?: string | null; id?: string; image_url?: string | null; is_active?: boolean; name: string; price?: number; pricing_type?: string; }; Update: { category?: string; created_at?: string; exact_article_id?: string | null; id?: string; image_url?: string | null; is_active?: boolean; name?: string; price?: number; pricing_type?: string; }; Relationships: []; }; floricode_connection_settings: { Row: { catalog_key: string | null; catalog_url: string; client_id: string | null; client_secret_ciphertext: string | null; client_secret_last4: string | null; created_at: string; id: number; last_meta: Json | null; last_test_at: string | null; last_test_error: string | null; last_test_ok: boolean | null; last_token_test_at: string | null; last_token_test_error: string | null; last_token_test_ok: boolean | null; updated_at: string; }; Insert: { catalog_key?: string | null; catalog_url?: string; client_id?: string | null; client_secret_ciphertext?: string | null; client_secret_last4?: string | null; created_at?: string; id?: number; last_meta?: Json | null; last_test_at?: string | null; last_test_error?: string | null; last_test_ok?: boolean | null; last_token_test_at?: string | null; last_token_test_error?: string | null; last_token_test_ok?: boolean | null; updated_at?: string; }; Update: { catalog_key?: string | null; catalog_url?: string; client_id?: string | null; client_secret_ciphertext?: string | null; client_secret_last4?: string | null; created_at?: string; id?: number; last_meta?: Json | null; last_test_at?: string | null; last_test_error?: string | null; last_test_ok?: boolean | null; last_token_test_at?: string | null; last_token_test_error?: string | null; last_token_test_ok?: boolean | null; updated_at?: string; }; Relationships: []; }; floricode_records: { Row: { change_date_time: string | null; data: Json; last_synced_at: string; record_id: string; resource: string; }; Insert: { change_date_time?: string | null; data?: Json; last_synced_at?: string; record_id: string; resource: string; }; Update: { change_date_time?: string | null; data?: Json; last_synced_at?: string; record_id?: string; resource?: string; }; Relationships: []; }; floricode_sync_state: { Row: { cursor_skip: number; error_message: string | null; last_change_date_time: string | null; last_sequence_number: number; last_sync_at: string | null; resource: string; status: string; updated_at: string; }; Insert: { cursor_skip?: number; error_message?: string | null; last_change_date_time?: string | null; last_sequence_number?: number; last_sync_at?: string | null; resource: string; status?: string; updated_at?: string; }; Update: { cursor_skip?: number; error_message?: string | null; last_change_date_time?: string | null; last_sequence_number?: number; last_sync_at?: string | null; resource?: string; status?: string; updated_at?: string; }; Relationships: []; }; floriday_additional_services_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_additional_services_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_agreement_calloffs_cache: { Row: { agreement_id: string | null; connection_id: string; data: Json; delivery_date: string | null; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; status: string | null; updated_at: string; }; Insert: { agreement_id?: string | null; connection_id: string; data?: Json; delivery_date?: string | null; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; updated_at?: string; }; Update: { agreement_id?: string | null; connection_id?: string; data?: Json; delivery_date?: string | null; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_agreement_calloffs_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_agreements_cache: { Row: { buyer_organization_id: string | null; connection_id: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; status: string | null; updated_at: string; valid_from: string | null; valid_until: string | null; }; Insert: { buyer_organization_id?: string | null; connection_id: string; data?: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; updated_at?: string; valid_from?: string | null; valid_until?: string | null; }; Update: { buyer_organization_id?: string | null; connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; updated_at?: string; valid_from?: string | null; valid_until?: string | null; }; Relationships: [ { foreignKeyName: "floriday_agreements_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_auction_letters_cache: { Row: { auction_letter_code: string; clock_supply_id: string; connection_id: string; content_type: string; fetched_at: string; id: string; storage_path: string; }; Insert: { auction_letter_code: string; clock_supply_id: string; connection_id: string; content_type?: string; fetched_at?: string; id?: string; storage_path: string; }; Update: { auction_letter_code?: string; clock_supply_id?: string; connection_id?: string; content_type?: string; fetched_at?: string; id?: string; storage_path?: string; }; Relationships: [ { foreignKeyName: "floriday_auction_letters_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_auto_fulfillment_log: { Row: { attempts: number; connection_id: string; created_at: string; error: string | null; fulfillment_order_id: string | null; id: string; last_attempt_at: string | null; reason: string | null; sales_order_id: string; status: string; updated_at: string; }; Insert: { attempts?: number; connection_id: string; created_at?: string; error?: string | null; fulfillment_order_id?: string | null; id?: string; last_attempt_at?: string | null; reason?: string | null; sales_order_id: string; status?: string; updated_at?: string; }; Update: { attempts?: number; connection_id?: string; created_at?: string; error?: string | null; fulfillment_order_id?: string | null; id?: string; last_attempt_at?: string | null; reason?: string | null; sales_order_id?: string; status?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_auto_fulfillment_log_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_base_items_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_base_items_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_blanket_orders_cache: { Row: { connection_id: string; contract_id: string | null; created_at: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; contract_id?: string | null; created_at?: string; data: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; contract_id?: string | null; created_at?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_blanket_orders_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_carriers_cache: { Row: { connection_id: string | null; created_at: string; data: Json; fetched_at: string; gln_code: string | null; id: string; name: string | null; organization_id: string; updated_at: string; }; Insert: { connection_id?: string | null; created_at?: string; data: Json; fetched_at?: string; gln_code?: string | null; id?: string; name?: string | null; organization_id: string; updated_at?: string; }; Update: { connection_id?: string | null; created_at?: string; data?: Json; fetched_at?: string; gln_code?: string | null; id?: string; name?: string | null; organization_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_carriers_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_clock_presales_cache: { Row: { buyer_organization_id: string | null; clock_supply_id: string | null; connection_id: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { buyer_organization_id?: string | null; clock_supply_id?: string | null; connection_id: string; data?: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { buyer_organization_id?: string | null; clock_supply_id?: string | null; connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_clock_presales_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_clock_supplies_cache: { Row: { auction_date: string | null; connection_id: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; status: string | null; trade_item_id: string | null; updated_at: string; }; Insert: { auction_date?: string | null; connection_id: string; data?: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; trade_item_id?: string | null; updated_at?: string; }; Update: { auction_date?: string | null; connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; trade_item_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_clock_supplies_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_code_lists_cache: { Row: { code: string; environment: string; label: string | null; list_name: string; payload: Json | null; updated_at: string; }; Insert: { code: string; environment: string; label?: string | null; list_name: string; payload?: Json | null; updated_at?: string; }; Update: { code?: string; environment?: string; label?: string | null; list_name?: string; payload?: Json | null; updated_at?: string; }; Relationships: []; }; floriday_collections_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_collections_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_commercial_service_types_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_commercial_service_types_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_connections: { Row: { api_key: string; created_at: string; customers_endpoint: string | null; environment: string; gln_code: string | null; id: string; is_active: boolean; label: string; organization_name: string | null; preferred_warehouse_id: string | null; preferred_warehouse_name: string | null; token_expires_at: string | null; updated_at: string; }; Insert: { api_key: string; created_at?: string; customers_endpoint?: string | null; environment: string; gln_code?: string | null; id?: string; is_active?: boolean; label?: string; organization_name?: string | null; preferred_warehouse_id?: string | null; preferred_warehouse_name?: string | null; token_expires_at?: string | null; updated_at?: string; }; Update: { api_key?: string; created_at?: string; customers_endpoint?: string | null; environment?: string; gln_code?: string | null; id?: string; is_active?: boolean; label?: string; organization_name?: string | null; preferred_warehouse_id?: string | null; preferred_warehouse_name?: string | null; token_expires_at?: string | null; updated_at?: string; }; Relationships: []; }; floriday_connections_cache: { Row: { buyer_organization_id: string | null; buyer_organization_name: string | null; connection_id: string; data: Json; floriday_connection_id: string; is_deleted: boolean; sequence_number: number; status: string | null; synced_at: string; }; Insert: { buyer_organization_id?: string | null; buyer_organization_name?: string | null; connection_id: string; data: Json; floriday_connection_id: string; is_deleted?: boolean; sequence_number: number; status?: string | null; synced_at?: string; }; Update: { buyer_organization_id?: string | null; buyer_organization_name?: string | null; connection_id?: string; data?: Json; floriday_connection_id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; synced_at?: string; }; Relationships: [ { foreignKeyName: "floriday_connections_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_continuous_stock_cache: { Row: { connection_id: string; fetched_at: string; number_of_pieces: number; trade_item_id: string; }; Insert: { connection_id: string; fetched_at?: string; number_of_pieces?: number; trade_item_id: string; }; Update: { connection_id?: string; fetched_at?: string; number_of_pieces?: number; trade_item_id?: string; }; Relationships: []; }; floriday_continuous_stock_queue: { Row: { attempts: number; connection_id: string; created_at: string; dead_lettered_at: string | null; desired_available: boolean | null; gateway_attempt_id: string | null; id: string; last_error: string | null; locked_at: string | null; locked_by: string | null; next_attempt_at: string; number_of_pieces: number; product_id: string | null; sent_at: string | null; status: string; stock_mode: string | null; superseded_by: string | null; target_week: number | null; target_year: number | null; trade_item_id: string; updated_at: string; user_id: string; }; Insert: { attempts?: number; connection_id: string; created_at?: string; dead_lettered_at?: string | null; desired_available?: boolean | null; gateway_attempt_id?: string | null; id?: string; last_error?: string | null; locked_at?: string | null; locked_by?: string | null; next_attempt_at?: string; number_of_pieces?: number; product_id?: string | null; sent_at?: string | null; status?: string; stock_mode?: string | null; superseded_by?: string | null; target_week?: number | null; target_year?: number | null; trade_item_id: string; updated_at?: string; user_id: string; }; Update: { attempts?: number; connection_id?: string; created_at?: string; dead_lettered_at?: string | null; desired_available?: boolean | null; gateway_attempt_id?: string | null; id?: string; last_error?: string | null; locked_at?: string | null; locked_by?: string | null; next_attempt_at?: string; number_of_pieces?: number; product_id?: string | null; sent_at?: string | null; status?: string; stock_mode?: string | null; superseded_by?: string | null; target_week?: number | null; target_year?: number | null; trade_item_id?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; floriday_contract_trade_item_groups_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_contract_trade_item_groups_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_contracts_cache: { Row: { connection_id: string; created_at: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; created_at?: string; data: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; created_at?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_contracts_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_customer_sticker_pdfs_cache: { Row: { byte_size: number | null; connection_id: string; content_type: string; created_at: string; fetched_at: string; id: string; sticker_id: string; storage_path: string; }; Insert: { byte_size?: number | null; connection_id: string; content_type?: string; created_at?: string; fetched_at?: string; id?: string; sticker_id: string; storage_path: string; }; Update: { byte_size?: number | null; connection_id?: string; content_type?: string; created_at?: string; fetched_at?: string; id?: string; sticker_id?: string; storage_path?: string; }; Relationships: [ { foreignKeyName: "floriday_customer_sticker_pdfs_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_customer_stickers_cache: { Row: { connection_id: string; created_at: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; quantity: number | null; sales_order_id: string | null; sequence_number: number; status: string | null; trade_item_id: string | null; updated_at: string; }; Insert: { connection_id: string; created_at?: string; data?: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; quantity?: number | null; sales_order_id?: string | null; sequence_number?: number; status?: string | null; trade_item_id?: string | null; updated_at?: string; }; Update: { connection_id?: string; created_at?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; quantity?: number | null; sales_order_id?: string | null; sequence_number?: number; status?: string | null; trade_item_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_customer_stickers_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_customers_cache: { Row: { connection_id: string | null; data: Json; fetched_at: string; gln_code: string | null; is_deleted: boolean; name: string | null; organization_id: string; sequence_number: number | null; }; Insert: { connection_id?: string | null; data?: Json; fetched_at?: string; gln_code?: string | null; is_deleted?: boolean; name?: string | null; organization_id: string; sequence_number?: number | null; }; Update: { connection_id?: string | null; data?: Json; fetched_at?: string; gln_code?: string | null; is_deleted?: boolean; name?: string | null; organization_id?: string; sequence_number?: number | null; }; Relationships: [ { foreignKeyName: "floriday_customers_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_delivery_condition_sets_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_delivery_condition_sets_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_delivery_locations_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; gln_code: string | null; id: string; is_deleted: boolean; name: string | null; organization_id: string | null; updated_at: string; }; Insert: { connection_id: string; data?: Json; fetched_at?: string; floriday_id: string; gln_code?: string | null; id?: string; is_deleted?: boolean; name?: string | null; organization_id?: string | null; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; gln_code?: string | null; id?: string; is_deleted?: boolean; name?: string | null; organization_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_delivery_locations_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_delivery_orders_cache: { Row: { auction_date: string | null; connection_id: string; data: Json; destination_warehouse_id: string | null; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; status: string | null; trade_item_id: string | null; updated_at: string; }; Insert: { auction_date?: string | null; connection_id: string; data?: Json; destination_warehouse_id?: string | null; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; trade_item_id?: string | null; updated_at?: string; }; Update: { auction_date?: string | null; connection_id?: string; data?: Json; destination_warehouse_id?: string | null; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; trade_item_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_delivery_orders_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_fulfillment_orders_cache: { Row: { auction_date: string | null; connection_id: string; data: Json; delivery_order_id: string | null; despatch_warehouse_id: string | null; destination_warehouse_id: string | null; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean | null; latest_delivery_at: string | null; load_carrier_type: string | null; one_label_only: boolean | null; sequence_number: number; status: string | null; }; Insert: { auction_date?: string | null; connection_id: string; data: Json; delivery_order_id?: string | null; despatch_warehouse_id?: string | null; destination_warehouse_id?: string | null; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean | null; latest_delivery_at?: string | null; load_carrier_type?: string | null; one_label_only?: boolean | null; sequence_number?: number; status?: string | null; }; Update: { auction_date?: string | null; connection_id?: string; data?: Json; delivery_order_id?: string | null; despatch_warehouse_id?: string | null; destination_warehouse_id?: string | null; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean | null; latest_delivery_at?: string | null; load_carrier_type?: string | null; one_label_only?: boolean | null; sequence_number?: number; status?: string | null; }; Relationships: [ { foreignKeyName: "floriday_fulfillment_orders_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_inventory_settings: { Row: { buffer_quantity: number; connection_id: string; created_at: string; desired_availability: boolean; desired_quantity: number; fixed_quantity: number | null; floriday_trade_item_id: string | null; id: string; last_confirmed_at: string | null; last_enqueued_at: string | null; last_published_at: string | null; last_sync_error: string | null; manual_quantity: number | null; maximum_quantity: number | null; product_id: string; quantity_control: string; remote_available: boolean | null; remote_checked_at: string | null; remote_quantity: number | null; stock_mode: string; sync_status: string; updated_at: string; updated_by: string | null; user_id: string; }; Insert: { buffer_quantity?: number; connection_id: string; created_at?: string; desired_availability?: boolean; desired_quantity?: number; fixed_quantity?: number | null; floriday_trade_item_id?: string | null; id?: string; last_confirmed_at?: string | null; last_enqueued_at?: string | null; last_published_at?: string | null; last_sync_error?: string | null; manual_quantity?: number | null; maximum_quantity?: number | null; product_id: string; quantity_control?: string; remote_available?: boolean | null; remote_checked_at?: string | null; remote_quantity?: number | null; stock_mode?: string; sync_status?: string; updated_at?: string; updated_by?: string | null; user_id: string; }; Update: { buffer_quantity?: number; connection_id?: string; created_at?: string; desired_availability?: boolean; desired_quantity?: number; fixed_quantity?: number | null; floriday_trade_item_id?: string | null; id?: string; last_confirmed_at?: string | null; last_enqueued_at?: string | null; last_published_at?: string | null; last_sync_error?: string | null; manual_quantity?: number | null; maximum_quantity?: number | null; product_id?: string; quantity_control?: string; remote_available?: boolean | null; remote_checked_at?: string | null; remote_quantity?: number | null; stock_mode?: string; sync_status?: string; updated_at?: string; updated_by?: string | null; user_id?: string; }; Relationships: []; }; floriday_invoices_cache: { Row: { buyer_organization_id: string | null; connection_id: string; currency: string | null; data: Json; fetched_at: string; floriday_id: string; id: string; invoice_date: string | null; invoice_number: string | null; is_deleted: boolean; sequence_number: number; total_amount: number | null; updated_at: string; }; Insert: { buyer_organization_id?: string | null; connection_id: string; currency?: string | null; data?: Json; fetched_at?: string; floriday_id: string; id?: string; invoice_date?: string | null; invoice_number?: string | null; is_deleted?: boolean; sequence_number?: number; total_amount?: number | null; updated_at?: string; }; Update: { buyer_organization_id?: string | null; connection_id?: string; currency?: string | null; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; invoice_date?: string | null; invoice_number?: string | null; is_deleted?: boolean; sequence_number?: number; total_amount?: number | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_invoices_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_logistic_labels_cache: { Row: { byte_size: number | null; connection_id: string; content_type: string; fetched_at: string; fulfillment_order_id: string; id: string; logistic_label_code: string; storage_path: string; }; Insert: { byte_size?: number | null; connection_id: string; content_type?: string; fetched_at?: string; fulfillment_order_id: string; id?: string; logistic_label_code: string; storage_path: string; }; Update: { byte_size?: number | null; connection_id?: string; content_type?: string; fetched_at?: string; fulfillment_order_id?: string; id?: string; logistic_label_code?: string; storage_path?: string; }; Relationships: [ { foreignKeyName: "floriday_logistic_labels_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_network_cache: { Row: { city: string | null; connection_id: string; country: string | null; data: Json; fetched_at: string; gln: string | null; organization_id: string; organization_name: string | null; }; Insert: { city?: string | null; connection_id: string; country?: string | null; data?: Json; fetched_at?: string; gln?: string | null; organization_id: string; organization_name?: string | null; }; Update: { city?: string | null; connection_id?: string; country?: string | null; data?: Json; fetched_at?: string; gln?: string | null; organization_id?: string; organization_name?: string | null; }; Relationships: []; }; floriday_network_sync_state: { Row: { connection_id: string; last_error: string | null; last_sequence_number: number; last_synced_at: string | null; updated_at: string; }; Insert: { connection_id: string; last_error?: string | null; last_sequence_number?: number; last_synced_at?: string | null; updated_at?: string; }; Update: { connection_id?: string; last_error?: string | null; last_sequence_number?: number; last_synced_at?: string | null; updated_at?: string; }; Relationships: []; }; floriday_order_number_map: { Row: { created_at: string; floriday_id: string; order_number: string; }; Insert: { created_at?: string; floriday_id: string; order_number: string; }; Update: { created_at?: string; floriday_id?: string; order_number?: string; }; Relationships: []; }; floriday_packings_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data?: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_packings_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_price_groups_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_price_groups_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_rate_limit_state: { Row: { bucket: string; last_refill_at: string; tokens: number; }; Insert: { bucket: string; last_refill_at?: string; tokens: number; }; Update: { bucket?: string; last_refill_at?: string; tokens?: number; }; Relationships: []; }; floriday_resource_schemas: { Row: { enums: Json; fetched_at: string; resource: string; schema: Json; source_url: string | null; version: string; }; Insert: { enums?: Json; fetched_at?: string; resource: string; schema: Json; source_url?: string | null; version: string; }; Update: { enums?: Json; fetched_at?: string; resource?: string; schema?: Json; source_url?: string | null; version?: string; }; Relationships: []; }; floriday_sales_order_ingest: { Row: { connection_id: string; created_at: string; id: string; impact: Json; order_status: string | null; order_version: number; processed_at: string; sales_order_id: string; }; Insert: { connection_id: string; created_at?: string; id?: string; impact?: Json; order_status?: string | null; order_version?: number; processed_at?: string; sales_order_id: string; }; Update: { connection_id?: string; created_at?: string; id?: string; impact?: Json; order_status?: string | null; order_version?: number; processed_at?: string; sales_order_id?: string; }; Relationships: []; }; floriday_sales_strategies_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_sales_strategies_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_salesorders_cache: { Row: { buyer_organization_id: string | null; connection_id: string; controlled_at: string | null; created_at: string; data: Json; floriday_id: string; is_deleted: boolean; sequence_number: number; status: string | null; updated_at: string; }; Insert: { buyer_organization_id?: string | null; connection_id: string; controlled_at?: string | null; created_at?: string; data: Json; floriday_id: string; is_deleted?: boolean; sequence_number: number; status?: string | null; updated_at?: string; }; Update: { buyer_organization_id?: string | null; connection_id?: string; controlled_at?: string | null; created_at?: string; data?: Json; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_salesorders_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_settings: { Row: { active_environment: string; id: number; updated_at: string; }; Insert: { active_environment?: string; id?: number; updated_at?: string; }; Update: { active_environment?: string; id?: number; updated_at?: string; }; Relationships: []; }; floriday_status_sync_queue: { Row: { attempts: number; created_at: string; error: string | null; floriday_sales_order_id: string; order_id: string; processed_at: string | null; requested_at: string; state: string; target_status: string; updated_at: string; }; Insert: { attempts?: number; created_at?: string; error?: string | null; floriday_sales_order_id: string; order_id: string; processed_at?: string | null; requested_at?: string; state?: string; target_status: string; updated_at?: string; }; Update: { attempts?: number; created_at?: string; error?: string | null; floriday_sales_order_id?: string; order_id?: string; processed_at?: string | null; requested_at?: string; state?: string; target_status?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_status_sync_queue_order_id_fkey"; columns: ["order_id"]; isOneToOne: true; referencedRelation: "orders"; referencedColumns: ["id"]; } ]; }; floriday_sync_cursors: { Row: { connection_id: string; created_at: string; id: string; last_error: string | null; last_sync_at: string | null; resource_type: string; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; created_at?: string; id?: string; last_error?: string | null; last_sync_at?: string | null; resource_type: string; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; created_at?: string; id?: string; last_error?: string | null; last_sync_at?: string | null; resource_type?: string; sequence_number?: number; updated_at?: string; }; Relationships: []; }; floriday_sync_state: { Row: { connection_id: string; entity_type: string; last_error: string | null; last_items_processed: number | null; last_sequence_number: number; last_success_at: string | null; last_synced_at: string | null; updated_at: string; }; Insert: { connection_id: string; entity_type: string; last_error?: string | null; last_items_processed?: number | null; last_sequence_number?: number; last_success_at?: string | null; last_synced_at?: string | null; updated_at?: string; }; Update: { connection_id?: string; entity_type?: string; last_error?: string | null; last_items_processed?: number | null; last_sequence_number?: number; last_success_at?: string | null; last_synced_at?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_sync_state_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_token_refresh_log: { Row: { attempted_at: string; connection_id: string | null; environment: string; error: string | null; expires_at: string | null; id: string; ok: boolean; }; Insert: { attempted_at?: string; connection_id?: string | null; environment: string; error?: string | null; expires_at?: string | null; id?: string; ok: boolean; }; Update: { attempted_at?: string; connection_id?: string | null; environment?: string; error?: string | null; expires_at?: string | null; id?: string; ok?: boolean; }; Relationships: [ { foreignKeyName: "floriday_token_refresh_log_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_trade_item_classifications_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_trade_item_classifications_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_trade_items_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; is_deleted: boolean; sequence_number: number; }; Insert: { connection_id: string; data?: Json; fetched_at?: string; floriday_id: string; is_deleted?: boolean; sequence_number?: number; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; is_deleted?: boolean; sequence_number?: number; }; Relationships: [ { foreignKeyName: "floriday_trade_items_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_trade_settings_customers_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; updated_at: string; }; Insert: { connection_id: string; data: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_trade_settings_customers_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_trips_cache: { Row: { carrier_organization_id: string | null; connection_id: string; data: Json; fetched_at: string; floriday_id: string; id: string; is_deleted: boolean; sequence_number: number; status: string | null; trip_date: string | null; updated_at: string; }; Insert: { carrier_organization_id?: string | null; connection_id: string; data?: Json; fetched_at?: string; floriday_id: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; trip_date?: string | null; updated_at?: string; }; Update: { carrier_organization_id?: string | null; connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; id?: string; is_deleted?: boolean; sequence_number?: number; status?: string | null; trip_date?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_trips_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_vbn_required_characteristics: { Row: { required_codes: string[]; updated_at: string; updated_by: string | null; vbn_code: string; }; Insert: { required_codes?: string[]; updated_at?: string; updated_by?: string | null; vbn_code: string; }; Update: { required_codes?: string[]; updated_at?: string; updated_by?: string | null; vbn_code?: string; }; Relationships: []; }; floriday_warehouses_cache: { Row: { connection_id: string; data: Json; fetched_at: string; floriday_id: string; gln_code: string | null; id: string; is_default: boolean; is_deleted: boolean; name: string | null; updated_at: string; }; Insert: { connection_id: string; data?: Json; fetched_at?: string; floriday_id: string; gln_code?: string | null; id?: string; is_default?: boolean; is_deleted?: boolean; name?: string | null; updated_at?: string; }; Update: { connection_id?: string; data?: Json; fetched_at?: string; floriday_id?: string; gln_code?: string | null; id?: string; is_default?: boolean; is_deleted?: boolean; name?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "floriday_warehouses_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; floriday_write_log: { Row: { action: string; caller: string; connection_id: string | null; created_at: string; error: string | null; floriday_id: string | null; http_status: number | null; id: string; idempotency_key: string | null; module: string | null; ok: boolean; request: Json | null; resource: string; response: Json | null; user_id: string | null; }; Insert: { action: string; caller?: string; connection_id?: string | null; created_at?: string; error?: string | null; floriday_id?: string | null; http_status?: number | null; id?: string; idempotency_key?: string | null; module?: string | null; ok: boolean; request?: Json | null; resource: string; response?: Json | null; user_id?: string | null; }; Update: { action?: string; caller?: string; connection_id?: string | null; created_at?: string; error?: string | null; floriday_id?: string | null; http_status?: number | null; id?: string; idempotency_key?: string | null; module?: string | null; ok?: boolean; request?: Json | null; resource?: string; response?: Json | null; user_id?: string | null; }; Relationships: [ { foreignKeyName: "floriday_write_log_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; flow_role_assignments: { Row: { created_at: string; id: string; role_id: string; user_id: string; }; Insert: { created_at?: string; id?: string; role_id: string; user_id: string; }; Update: { created_at?: string; id?: string; role_id?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "flow_role_assignments_role_id_fkey"; columns: ["role_id"]; isOneToOne: false; referencedRelation: "flow_roles"; referencedColumns: ["id"]; } ]; }; flow_roles: { Row: { created_at: string; description: string | null; id: string; module_access: string[]; name: string; updated_at: string; }; Insert: { created_at?: string; description?: string | null; id?: string; module_access?: string[]; name: string; updated_at?: string; }; Update: { created_at?: string; description?: string | null; id?: string; module_access?: string[]; name?: string; updated_at?: string; }; Relationships: []; }; fust_stock_mutations: { Row: { created_at: string; delta: number; fust_type_id: string; id: string; note: string | null; reason: string; trade_item_key: string | null; user_id: string; }; Insert: { created_at?: string; delta: number; fust_type_id: string; id?: string; note?: string | null; reason?: string; trade_item_key?: string | null; user_id: string; }; Update: { created_at?: string; delta?: number; fust_type_id?: string; id?: string; note?: string | null; reason?: string; trade_item_key?: string | null; user_id?: string; }; Relationships: [ { foreignKeyName: "fust_stock_mutations_fust_type_id_fkey"; columns: ["fust_type_id"]; isOneToOne: false; referencedRelation: "fust_types"; referencedColumns: ["id"]; } ]; }; fust_types: { Row: { connection_id: string | null; created_at: string; custom_package_id: string | null; fust_key: string; height_mm: number | null; id: string; in_use: boolean; length_mm: number | null; minimum_stock: number; name: string; notes: string | null; source: string; stock: number; updated_at: string; used_by_count: number; user_id: string; vbn_code: number | null; width_mm: number | null; }; Insert: { connection_id?: string | null; created_at?: string; custom_package_id?: string | null; fust_key: string; height_mm?: number | null; id?: string; in_use?: boolean; length_mm?: number | null; minimum_stock?: number; name: string; notes?: string | null; source?: string; stock?: number; updated_at?: string; used_by_count?: number; user_id: string; vbn_code?: number | null; width_mm?: number | null; }; Update: { connection_id?: string | null; created_at?: string; custom_package_id?: string | null; fust_key?: string; height_mm?: number | null; id?: string; in_use?: boolean; length_mm?: number | null; minimum_stock?: number; name?: string; notes?: string | null; source?: string; stock?: number; updated_at?: string; used_by_count?: number; user_id?: string; vbn_code?: number | null; width_mm?: number | null; }; Relationships: []; }; imap_accounts: { Row: { created_at: string; email: string | null; host: string; id: string; is_active: boolean; last_test_error: string | null; last_test_ok: boolean | null; last_tested_at: string | null; name: string; password: string | null; password_secret_name: string | null; port: number; updated_at: string; use_tls: boolean; username: string; }; Insert: { created_at?: string; email?: string | null; host: string; id?: string; is_active?: boolean; last_test_error?: string | null; last_test_ok?: boolean | null; last_tested_at?: string | null; name: string; password?: string | null; password_secret_name?: string | null; port?: number; updated_at?: string; use_tls?: boolean; username: string; }; Update: { created_at?: string; email?: string | null; host?: string; id?: string; is_active?: boolean; last_test_error?: string | null; last_test_ok?: boolean | null; last_tested_at?: string | null; name?: string; password?: string | null; password_secret_name?: string | null; port?: number; updated_at?: string; use_tls?: boolean; username?: string; }; Relationships: []; }; imap_profiles: { Row: { account_id: string | null; created_at: string; folder: string; id: string; last_error: string | null; last_polled_at: string | null; last_uid_seen: number; name: string; polling_enabled: boolean; profile_key: string; updated_at: string; }; Insert: { account_id?: string | null; created_at?: string; folder?: string; id?: string; last_error?: string | null; last_polled_at?: string | null; last_uid_seen?: number; name: string; polling_enabled?: boolean; profile_key: string; updated_at?: string; }; Update: { account_id?: string | null; created_at?: string; folder?: string; id?: string; last_error?: string | null; last_polled_at?: string | null; last_uid_seen?: number; name?: string; polling_enabled?: boolean; profile_key?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "imap_profiles_account_id_fkey"; columns: ["account_id"]; isOneToOne: false; referencedRelation: "imap_accounts"; referencedColumns: ["id"]; } ]; }; imap_sync_log: { Row: { account_id: string | null; details: Json | null; error: string | null; finished_at: string | null; id: string; inserted: number; ok: boolean | null; profile_id: string | null; started_at: string; }; Insert: { account_id?: string | null; details?: Json | null; error?: string | null; finished_at?: string | null; id?: string; inserted?: number; ok?: boolean | null; profile_id?: string | null; started_at?: string; }; Update: { account_id?: string | null; details?: Json | null; error?: string | null; finished_at?: string | null; id?: string; inserted?: number; ok?: boolean | null; profile_id?: string | null; started_at?: string; }; Relationships: [ { foreignKeyName: "imap_sync_log_account_id_fkey"; columns: ["account_id"]; isOneToOne: false; referencedRelation: "imap_accounts"; referencedColumns: ["id"]; }, { foreignKeyName: "imap_sync_log_profile_id_fkey"; columns: ["profile_id"]; isOneToOne: false; referencedRelation: "imap_profiles"; referencedColumns: ["id"]; } ]; }; inventory_settings: { Row: { created_at: string; hierarchy_levels: string[]; id: string; updated_at: string; visible_columns: string[]; }; Insert: { created_at?: string; hierarchy_levels?: string[]; id?: string; updated_at?: string; visible_columns?: string[]; }; Update: { created_at?: string; hierarchy_levels?: string[]; id?: string; updated_at?: string; visible_columns?: string[]; }; Relationships: []; }; inventory_stock_snapshots: { Row: { connection_id: string; created_at: string; erp_available_quantity: number; floriday_desired_quantity: number; floriday_remote_quantity: number | null; granularity: string; id: string; snapshot_at: string; user_id: string | null; }; Insert: { connection_id: string; created_at?: string; erp_available_quantity?: number; floriday_desired_quantity?: number; floriday_remote_quantity?: number | null; granularity?: string; id?: string; snapshot_at?: string; user_id?: string | null; }; Update: { connection_id?: string; created_at?: string; erp_available_quantity?: number; floriday_desired_quantity?: number; floriday_remote_quantity?: number | null; granularity?: string; id?: string; snapshot_at?: string; user_id?: string | null; }; Relationships: []; }; invoice_items: { Row: { created_at: string; description: string; id: string; invoice_id: string; kind: string; quantity: number; sort_order: number; source_line_ref: string | null; total_cents: number; unit: string; unit_price_cents: number; }; Insert: { created_at?: string; description?: string; id?: string; invoice_id: string; kind?: string; quantity?: number; sort_order?: number; source_line_ref?: string | null; total_cents?: number; unit?: string; unit_price_cents?: number; }; Update: { created_at?: string; description?: string; id?: string; invoice_id?: string; kind?: string; quantity?: number; sort_order?: number; source_line_ref?: string | null; total_cents?: number; unit?: string; unit_price_cents?: number; }; Relationships: [ { foreignKeyName: "invoice_items_invoice_id_fkey"; columns: ["invoice_id"]; isOneToOne: false; referencedRelation: "invoices"; referencedColumns: ["id"]; }, { foreignKeyName: "invoice_items_invoice_id_fkey"; columns: ["invoice_id"]; isOneToOne: false; referencedRelation: "uren_facturen"; referencedColumns: ["id"]; } ]; }; invoice_post_idempotency: { Row: { administration_code: string; client_request_id: string; completed_at: string | null; created_at: string; error_message: string | null; invoice_number: string | null; status: string; user_id: string; }; Insert: { administration_code?: string; client_request_id: string; completed_at?: string | null; created_at?: string; error_message?: string | null; invoice_number?: string | null; status?: string; user_id: string; }; Update: { administration_code?: string; client_request_id?: string; completed_at?: string | null; created_at?: string; error_message?: string | null; invoice_number?: string | null; status?: string; user_id?: string; }; Relationships: []; }; invoice_push_log: { Row: { connection_id: string | null; created_at: string; created_by: string; customer_id: string | null; id: string; last_error: string | null; last_polled_at: string | null; payload: Json; provider_id: string; queue_id: string | null; status: string; updated_at: string; }; Insert: { connection_id?: string | null; created_at?: string; created_by?: string; customer_id?: string | null; id?: string; last_error?: string | null; last_polled_at?: string | null; payload?: Json; provider_id: string; queue_id?: string | null; status?: string; updated_at?: string; }; Update: { connection_id?: string | null; created_at?: string; created_by?: string; customer_id?: string | null; id?: string; last_error?: string | null; last_polled_at?: string | null; payload?: Json; provider_id?: string; queue_id?: string | null; status?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "invoice_push_log_provider_id_fkey"; columns: ["provider_id"]; isOneToOne: false; referencedRelation: "external_invoice_providers"; referencedColumns: ["provider"]; } ]; }; invoice_run_items: { Row: { booking_id: string | null; company_name: string | null; created_at: string; customer_email: string | null; description: string | null; exact_article_id: string | null; id: string; invoice_run_id: string | null; quantity: number | null; total_excl_vat: number | null; total_incl_vat: number | null; unit_price: number | null; vat_amount: number | null; }; Insert: { booking_id?: string | null; company_name?: string | null; created_at?: string; customer_email?: string | null; description?: string | null; exact_article_id?: string | null; id?: string; invoice_run_id?: string | null; quantity?: number | null; total_excl_vat?: number | null; total_incl_vat?: number | null; unit_price?: number | null; vat_amount?: number | null; }; Update: { booking_id?: string | null; company_name?: string | null; created_at?: string; customer_email?: string | null; description?: string | null; exact_article_id?: string | null; id?: string; invoice_run_id?: string | null; quantity?: number | null; total_excl_vat?: number | null; total_incl_vat?: number | null; unit_price?: number | null; vat_amount?: number | null; }; Relationships: [ { foreignKeyName: "invoice_run_items_booking_id_fkey"; columns: ["booking_id"]; isOneToOne: false; referencedRelation: "bookings"; referencedColumns: ["id"]; }, { foreignKeyName: "invoice_run_items_invoice_run_id_fkey"; columns: ["invoice_run_id"]; isOneToOne: false; referencedRelation: "invoice_runs"; referencedColumns: ["id"]; } ]; }; invoice_runs: { Row: { created_at: string; created_by: string | null; id: string; period_end: string; period_start: string; status: string; total_excl_vat: number | null; total_incl_vat: number | null; vat_amount: number | null; }; Insert: { created_at?: string; created_by?: string | null; id?: string; period_end: string; period_start: string; status?: string; total_excl_vat?: number | null; total_incl_vat?: number | null; vat_amount?: number | null; }; Update: { created_at?: string; created_by?: string | null; id?: string; period_end?: string; period_start?: string; status?: string; total_excl_vat?: number | null; total_incl_vat?: number | null; vat_amount?: number | null; }; Relationships: []; }; invoice_timing_settings: { Row: { anchor: string; business_days_only: boolean; created_at: string; enabled: boolean; id: string; offset_days: number; pickup_anchor: string; pickup_business_days_only: boolean; pickup_offset_days: number; pickup_time_of_day: string; singleton: boolean; time_of_day: string; updated_at: string; }; Insert: { anchor?: string; business_days_only?: boolean; created_at?: string; enabled?: boolean; id?: string; offset_days?: number; pickup_anchor?: string; pickup_business_days_only?: boolean; pickup_offset_days?: number; pickup_time_of_day?: string; singleton?: boolean; time_of_day?: string; updated_at?: string; }; Update: { anchor?: string; business_days_only?: boolean; created_at?: string; enabled?: boolean; id?: string; offset_days?: number; pickup_anchor?: string; pickup_business_days_only?: boolean; pickup_offset_days?: number; pickup_time_of_day?: string; singleton?: boolean; time_of_day?: string; updated_at?: string; }; Relationships: []; }; invoices: { Row: { created_at: string; created_by: string | null; customer_id: string | null; customer_name: string | null; due_date: string | null; id: string; invoice_date: string; invoice_number: string | null; note: string | null; source_number: string | null; source_ref: string | null; source_type: string; status: string; subtotal_cents: number; total_cents: number; updated_at: string; vat_cents: number; vat_rate: number; }; Insert: { created_at?: string; created_by?: string | null; customer_id?: string | null; customer_name?: string | null; due_date?: string | null; id?: string; invoice_date?: string; invoice_number?: string | null; note?: string | null; source_number?: string | null; source_ref?: string | null; source_type?: string; status?: string; subtotal_cents?: number; total_cents?: number; updated_at?: string; vat_cents?: number; vat_rate?: number; }; Update: { created_at?: string; created_by?: string | null; customer_id?: string | null; customer_name?: string | null; due_date?: string | null; id?: string; invoice_date?: string; invoice_number?: string | null; note?: string | null; source_number?: string | null; source_ref?: string | null; source_type?: string; status?: string; subtotal_cents?: number; total_cents?: number; updated_at?: string; vat_cents?: number; vat_rate?: number; }; Relationships: [ { foreignKeyName: "invoices_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "itk_customers"; referencedColumns: ["id"]; } ]; }; itk_contact_persons: { Row: { created_at: string; customer_id: string; email: string | null; id: string; name: string; phone: string | null; role: string | null; updated_at: string; }; Insert: { created_at?: string; customer_id: string; email?: string | null; id?: string; name: string; phone?: string | null; role?: string | null; updated_at?: string; }; Update: { created_at?: string; customer_id?: string; email?: string | null; id?: string; name?: string; phone?: string | null; role?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "itk_contact_persons_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "itk_customers"; referencedColumns: ["id"]; } ]; }; itk_customer_dynamic_values: { Row: { created_at: string; customer_id: string; field_id: string; id: string; updated_at: string; value: string | null; }; Insert: { created_at?: string; customer_id: string; field_id: string; id?: string; updated_at?: string; value?: string | null; }; Update: { created_at?: string; customer_id?: string; field_id?: string; id?: string; updated_at?: string; value?: string | null; }; Relationships: [ { foreignKeyName: "itk_customer_dynamic_values_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "itk_customers"; referencedColumns: ["id"]; }, { foreignKeyName: "itk_customer_dynamic_values_field_id_fkey"; columns: ["field_id"]; isOneToOne: false; referencedRelation: "itk_dynamic_fields"; referencedColumns: ["id"]; } ]; }; itk_customer_notes: { Row: { body: string; created_at: string; created_by: string | null; customer_id: string; id: string; note_type: string; updated_at: string; }; Insert: { body: string; created_at?: string; created_by?: string | null; customer_id: string; id?: string; note_type?: string; updated_at?: string; }; Update: { body?: string; created_at?: string; created_by?: string | null; customer_id?: string; id?: string; note_type?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "itk_customer_notes_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "itk_customers"; referencedColumns: ["id"]; } ]; }; itk_customers: { Row: { billing_city: string | null; billing_postcode: string | null; billing_street: string | null; created_at: string; customer_number: string | null; general_email: string | null; general_phone: string | null; id: string; kvk_number: string | null; legacy_customer_id: string | null; name: string; segment: Database["public"]["Enums"]["itk_customer_segment"]; updated_at: string; vat_number: string | null; }; Insert: { billing_city?: string | null; billing_postcode?: string | null; billing_street?: string | null; created_at?: string; customer_number?: string | null; general_email?: string | null; general_phone?: string | null; id?: string; kvk_number?: string | null; legacy_customer_id?: string | null; name: string; segment?: Database["public"]["Enums"]["itk_customer_segment"]; updated_at?: string; vat_number?: string | null; }; Update: { billing_city?: string | null; billing_postcode?: string | null; billing_street?: string | null; created_at?: string; customer_number?: string | null; general_email?: string | null; general_phone?: string | null; id?: string; kvk_number?: string | null; legacy_customer_id?: string | null; name?: string; segment?: Database["public"]["Enums"]["itk_customer_segment"]; updated_at?: string; vat_number?: string | null; }; Relationships: []; }; itk_dynamic_fields: { Row: { created_at: string; field_name: string; field_type: Database["public"]["Enums"]["itk_dynamic_field_type"]; id: string; options: Json; sort_order: number; updated_at: string; }; Insert: { created_at?: string; field_name: string; field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"]; id?: string; options?: Json; sort_order?: number; updated_at?: string; }; Update: { created_at?: string; field_name?: string; field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"]; id?: string; options?: Json; sort_order?: number; updated_at?: string; }; Relationships: []; }; itk_handover_github_scan: { Row: { gescand_op: string; gevonden: boolean; melding: string | null; module_id: string | null; repo: string; }; Insert: { gescand_op?: string; gevonden?: boolean; melding?: string | null; module_id?: string | null; repo: string; }; Update: { gescand_op?: string; gevonden?: boolean; melding?: string | null; module_id?: string | null; repo?: string; }; Relationships: []; }; itk_handover_module_meta: { Row: { check_aangevraagd_op: string | null; check_nodig: boolean; check_reden: string | null; created_at: string; module_id: string; project_url: string | null; publicatie_url: string | null; updated_at: string; }; Insert: { check_aangevraagd_op?: string | null; check_nodig?: boolean; check_reden?: string | null; created_at?: string; module_id: string; project_url?: string | null; publicatie_url?: string | null; updated_at?: string; }; Update: { check_aangevraagd_op?: string | null; check_nodig?: boolean; check_reden?: string | null; created_at?: string; module_id?: string; project_url?: string | null; publicatie_url?: string | null; updated_at?: string; }; Relationships: []; }; itk_handover_project_modules: { Row: { created_at: string; id: string; module_id: string; project_id: string; updated_at: string; }; Insert: { created_at?: string; id?: string; module_id: string; project_id: string; updated_at?: string; }; Update: { created_at?: string; id?: string; module_id?: string; project_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "itk_handover_project_modules_project_id_fkey"; columns: ["project_id"]; isOneToOne: false; referencedRelation: "itk_handover_projecten"; referencedColumns: ["id"]; } ]; }; itk_handover_projecten: { Row: { created_at: string; id: string; naam: string; omschrijving: string | null; updated_at: string; }; Insert: { created_at?: string; id?: string; naam: string; omschrijving?: string | null; updated_at?: string; }; Update: { created_at?: string; id?: string; naam?: string; omschrijving?: string | null; updated_at?: string; }; Relationships: []; }; itk_handover_rechten: { Row: { created_at: string; id: string; module_id: string; rol: Database["public"]["Enums"]["app_role"] | null; updated_at: string; user_id: string | null; }; Insert: { created_at?: string; id?: string; module_id: string; rol?: Database["public"]["Enums"]["app_role"] | null; updated_at?: string; user_id?: string | null; }; Update: { created_at?: string; id?: string; module_id?: string; rol?: Database["public"]["Enums"]["app_role"] | null; updated_at?: string; user_id?: string | null; }; Relationships: []; }; itk_module_fingerprints: { Row: { created_at: string; gemaakt_op: string; hash: string; id: string; module_id: string; payload: Json; updated_at: string; }; Insert: { created_at?: string; gemaakt_op?: string; hash: string; id?: string; module_id: string; payload?: Json; updated_at?: string; }; Update: { created_at?: string; gemaakt_op?: string; hash?: string; id?: string; module_id?: string; payload?: Json; updated_at?: string; }; Relationships: []; }; itk_module_handovers: { Row: { bevindingen: string | null; bezit_tabellen: string[]; bron_commit: string | null; bron_pad: string | null; bron_repo: string | null; bron_soort: string | null; bron_versie: string | null; conflicten_snapshot: Json; contractfuncties: string[]; created_at: string; eigenaar_module_id: string | null; gepubliceerd_door: string | null; gepubliceerd_op: string; herzieningstermijn_dagen: number; id: string; inhoud_md: string; is_actueel: boolean; is_gearchiveerd: boolean; laatst_gecontroleerd_op: string | null; module_id: string; module_titel: string; ontbrekende_contracten: string[]; samenvatting: string | null; updated_at: string; versie: number; }; Insert: { bevindingen?: string | null; bezit_tabellen?: string[]; bron_commit?: string | null; bron_pad?: string | null; bron_repo?: string | null; bron_soort?: string | null; bron_versie?: string | null; conflicten_snapshot?: Json; contractfuncties?: string[]; created_at?: string; eigenaar_module_id?: string | null; gepubliceerd_door?: string | null; gepubliceerd_op?: string; herzieningstermijn_dagen?: number; id?: string; inhoud_md: string; is_actueel?: boolean; is_gearchiveerd?: boolean; laatst_gecontroleerd_op?: string | null; module_id: string; module_titel: string; ontbrekende_contracten?: string[]; samenvatting?: string | null; updated_at?: string; versie?: number; }; Update: { bevindingen?: string | null; bezit_tabellen?: string[]; bron_commit?: string | null; bron_pad?: string | null; bron_repo?: string | null; bron_soort?: string | null; bron_versie?: string | null; conflicten_snapshot?: Json; contractfuncties?: string[]; created_at?: string; eigenaar_module_id?: string | null; gepubliceerd_door?: string | null; gepubliceerd_op?: string; herzieningstermijn_dagen?: number; id?: string; inhoud_md?: string; is_actueel?: boolean; is_gearchiveerd?: boolean; laatst_gecontroleerd_op?: string | null; module_id?: string; module_titel?: string; ontbrekende_contracten?: string[]; samenvatting?: string | null; updated_at?: string; versie?: number; }; Relationships: []; }; itk_module_instructies: { Row: { created_at: string; eigenaar_module_id: string; gepubliceerd_door: string | null; gepubliceerd_op: string; id: string; inhoud_md: string; is_actueel: boolean; sleutel: string; titel: string; toelichting: string | null; updated_at: string; versie: number; }; Insert: { created_at?: string; eigenaar_module_id?: string; gepubliceerd_door?: string | null; gepubliceerd_op?: string; id?: string; inhoud_md: string; is_actueel?: boolean; sleutel: string; titel: string; toelichting?: string | null; updated_at?: string; versie?: number; }; Update: { created_at?: string; eigenaar_module_id?: string; gepubliceerd_door?: string | null; gepubliceerd_op?: string; id?: string; inhoud_md?: string; is_actueel?: boolean; sleutel?: string; titel?: string; toelichting?: string | null; updated_at?: string; versie?: number; }; Relationships: []; }; itk_module_wijzigingen: { Row: { created_at: string; geconstateerd_op: string; id: string; module_id: string; omschrijving: string; soort: string; updated_at: string; was_na_publicatie: boolean; }; Insert: { created_at?: string; geconstateerd_op?: string; id?: string; module_id: string; omschrijving: string; soort: string; updated_at?: string; was_na_publicatie?: boolean; }; Update: { created_at?: string; geconstateerd_op?: string; id?: string; module_id?: string; omschrijving?: string; soort?: string; updated_at?: string; was_na_publicatie?: boolean; }; Relationships: []; }; itk_offerte_events: { Row: { created_at: string; event_type: string; id: string; metadata: Json; offerte_id: string; omschrijving: string | null; user_id: string | null; }; Insert: { created_at?: string; event_type: string; id?: string; metadata?: Json; offerte_id: string; omschrijving?: string | null; user_id?: string | null; }; Update: { created_at?: string; event_type?: string; id?: string; metadata?: Json; offerte_id?: string; omschrijving?: string | null; user_id?: string | null; }; Relationships: [ { foreignKeyName: "itk_offerte_events_offerte_id_fkey"; columns: ["offerte_id"]; isOneToOne: false; referencedRelation: "itk_offertes"; referencedColumns: ["id"]; } ]; }; itk_offerte_regels: { Row: { created_at: string; id: string; line_total_cents: number; offerte_id: string; omschrijving: string; package_id: string | null; quantity: number; sort_order: number; source: string; unit_price_cents: number; updated_at: string; }; Insert: { created_at?: string; id?: string; line_total_cents?: number; offerte_id: string; omschrijving?: string; package_id?: string | null; quantity?: number; sort_order?: number; source?: string; unit_price_cents?: number; updated_at?: string; }; Update: { created_at?: string; id?: string; line_total_cents?: number; offerte_id?: string; omschrijving?: string; package_id?: string | null; quantity?: number; sort_order?: number; source?: string; unit_price_cents?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "itk_offerte_regels_offerte_id_fkey"; columns: ["offerte_id"]; isOneToOne: false; referencedRelation: "itk_offertes"; referencedColumns: ["id"]; }, { foreignKeyName: "itk_offerte_regels_package_id_fkey"; columns: ["package_id"]; isOneToOne: false; referencedRelation: "werkbon_packages"; referencedColumns: ["id"]; } ]; }; itk_offerte_settings: { Row: { auto_convert_binnen_mandaat: boolean; created_at: string; default_geldigheid_dagen: number; default_vat_rate: number; id: string; singleton: boolean; updated_at: string; }; Insert: { auto_convert_binnen_mandaat?: boolean; created_at?: string; default_geldigheid_dagen?: number; default_vat_rate?: number; id?: string; singleton?: boolean; updated_at?: string; }; Update: { auto_convert_binnen_mandaat?: boolean; created_at?: string; default_geldigheid_dagen?: number; default_vat_rate?: number; id?: string; singleton?: boolean; updated_at?: string; }; Relationships: []; }; itk_offertes: { Row: { ai_generated: boolean; approved_at: string | null; binnen_mandaat: boolean; contact_id: string | null; converted_at: string | null; created_at: string; created_by: string | null; customer_id: string | null; follow_up_werkbon_id: string | null; id: string; jaar: number; mandaat_restant_cents: number; notities: string | null; offerte_number: string | null; omschrijving: string; rejected_at: string | null; sent_at: string | null; source_number: string | null; source_ref: string | null; source_type: string; status: string; subtotal_cents: number; total_cents: number; updated_at: string; valid_until: string | null; vat_cents: number; vat_rate: number; viewed_at: string | null; volgnummer: number | null; werkbon_id: string | null; work_location_id: string | null; }; Insert: { ai_generated?: boolean; approved_at?: string | null; binnen_mandaat?: boolean; contact_id?: string | null; converted_at?: string | null; created_at?: string; created_by?: string | null; customer_id?: string | null; follow_up_werkbon_id?: string | null; id?: string; jaar?: number; mandaat_restant_cents?: number; notities?: string | null; offerte_number?: string | null; omschrijving?: string; rejected_at?: string | null; sent_at?: string | null; source_number?: string | null; source_ref?: string | null; source_type?: string; status?: string; subtotal_cents?: number; total_cents?: number; updated_at?: string; valid_until?: string | null; vat_cents?: number; vat_rate?: number; viewed_at?: string | null; volgnummer?: number | null; werkbon_id?: string | null; work_location_id?: string | null; }; Update: { ai_generated?: boolean; approved_at?: string | null; binnen_mandaat?: boolean; contact_id?: string | null; converted_at?: string | null; created_at?: string; created_by?: string | null; customer_id?: string | null; follow_up_werkbon_id?: string | null; id?: string; jaar?: number; mandaat_restant_cents?: number; notities?: string | null; offerte_number?: string | null; omschrijving?: string; rejected_at?: string | null; sent_at?: string | null; source_number?: string | null; source_ref?: string | null; source_type?: string; status?: string; subtotal_cents?: number; total_cents?: number; updated_at?: string; valid_until?: string | null; vat_cents?: number; vat_rate?: number; viewed_at?: string | null; volgnummer?: number | null; werkbon_id?: string | null; work_location_id?: string | null; }; Relationships: [ { foreignKeyName: "itk_offertes_contact_id_fkey"; columns: ["contact_id"]; isOneToOne: false; referencedRelation: "itk_contact_persons"; referencedColumns: ["id"]; }, { foreignKeyName: "itk_offertes_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "itk_customers"; referencedColumns: ["id"]; }, { foreignKeyName: "itk_offertes_follow_up_werkbon_id_fkey"; columns: ["follow_up_werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "itk_offertes_follow_up_werkbon_id_fkey"; columns: ["follow_up_werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; }, { foreignKeyName: "itk_offertes_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "itk_offertes_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; }, { foreignKeyName: "itk_offertes_work_location_id_fkey"; columns: ["work_location_id"]; isOneToOne: false; referencedRelation: "itk_work_locations"; referencedColumns: ["id"]; } ]; }; itk_work_locations: { Row: { city: string | null; created_at: string; customer_id: string; id: string; instructions: string | null; label: string; latitude: number | null; longitude: number | null; postcode: string | null; street: string | null; updated_at: string; }; Insert: { city?: string | null; created_at?: string; customer_id: string; id?: string; instructions?: string | null; label: string; latitude?: number | null; longitude?: number | null; postcode?: string | null; street?: string | null; updated_at?: string; }; Update: { city?: string | null; created_at?: string; customer_id?: string; id?: string; instructions?: string | null; label?: string; latitude?: number | null; longitude?: number | null; postcode?: string | null; street?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "itk_work_locations_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "itk_customers"; referencedColumns: ["id"]; } ]; }; job_locks: { Row: { created_at: string; lock_key: string; locked_until: string; owner: string | null; updated_at: string; }; Insert: { created_at?: string; lock_key: string; locked_until: string; owner?: string | null; updated_at?: string; }; Update: { created_at?: string; lock_key?: string; locked_until?: string; owner?: string | null; updated_at?: string; }; Relationships: []; }; layout_logos: { Row: { bestand_url: string; bestandsgrootte: number; bestandspad: string | null; bestandstype: string; breedte: number; categorie: string; created_at: string; hash: string | null; hoogte: number; id: string; is_standaard: boolean; naam: string; omschrijving: string; transparant: boolean; updated_at: string; }; Insert: { bestand_url: string; bestandsgrootte?: number; bestandspad?: string | null; bestandstype?: string; breedte?: number; categorie?: string; created_at?: string; hash?: string | null; hoogte?: number; id?: string; is_standaard?: boolean; naam: string; omschrijving?: string; transparant?: boolean; updated_at?: string; }; Update: { bestand_url?: string; bestandsgrootte?: number; bestandspad?: string | null; bestandstype?: string; breedte?: number; categorie?: string; created_at?: string; hash?: string | null; hoogte?: number; id?: string; is_standaard?: boolean; naam?: string; omschrijving?: string; transparant?: boolean; updated_at?: string; }; Relationships: []; }; leave_requests: { Row: { created_at: string; decided_at: string | null; decided_by: string | null; end_date: string; end_time: string | null; hours: number | null; id: string; leave_type: string; monteur_id: string | null; reason: string | null; start_date: string; start_time: string | null; status: string; updated_at: string; user_id: string; }; Insert: { created_at?: string; decided_at?: string | null; decided_by?: string | null; end_date: string; end_time?: string | null; hours?: number | null; id?: string; leave_type?: string; monteur_id?: string | null; reason?: string | null; start_date: string; start_time?: string | null; status?: string; updated_at?: string; user_id: string; }; Update: { created_at?: string; decided_at?: string | null; decided_by?: string | null; end_date?: string; end_time?: string | null; hours?: number | null; id?: string; leave_type?: string; monteur_id?: string | null; reason?: string | null; start_date?: string; start_time?: string | null; status?: string; updated_at?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "leave_requests_monteur_id_fkey"; columns: ["monteur_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; }, { foreignKeyName: "leave_requests_user_id_fkey"; columns: ["user_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; } ]; }; load_carrier_types: { Row: { allow_mixing: boolean; capacity_model: string; code: string; created_at: string; id: string; is_active: boolean; is_default: boolean; layer_length_cm: number; layer_width_cm: number; layers_per_carrier: number; max_boxes: number | null; max_crates_per_layer: number | null; max_customers: number | null; max_height_cm: number | null; max_orders: number | null; max_weight_kg: number | null; name: string; sort_order: number; updated_at: string; }; Insert: { allow_mixing?: boolean; capacity_model?: string; code: string; created_at?: string; id?: string; is_active?: boolean; is_default?: boolean; layer_length_cm?: number; layer_width_cm?: number; layers_per_carrier?: number; max_boxes?: number | null; max_crates_per_layer?: number | null; max_customers?: number | null; max_height_cm?: number | null; max_orders?: number | null; max_weight_kg?: number | null; name: string; sort_order?: number; updated_at?: string; }; Update: { allow_mixing?: boolean; capacity_model?: string; code?: string; created_at?: string; id?: string; is_active?: boolean; is_default?: boolean; layer_length_cm?: number; layer_width_cm?: number; layers_per_carrier?: number; max_boxes?: number | null; max_crates_per_layer?: number | null; max_customers?: number | null; max_height_cm?: number | null; max_orders?: number | null; max_weight_kg?: number | null; name?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; local_customer_agreements: { Row: { base_price: number | null; created_at: string; currency: string; customer_id: string; id: string; min_quantity: number; net_price: number; notes: string | null; product_category_id: string | null; product_id: string | null; updated_at: string; valid_from: string | null; valid_until: string | null; }; Insert: { base_price?: number | null; created_at?: string; currency?: string; customer_id: string; id?: string; min_quantity?: number; net_price: number; notes?: string | null; product_category_id?: string | null; product_id?: string | null; updated_at?: string; valid_from?: string | null; valid_until?: string | null; }; Update: { base_price?: number | null; created_at?: string; currency?: string; customer_id?: string; id?: string; min_quantity?: number; net_price?: number; notes?: string | null; product_category_id?: string | null; product_id?: string | null; updated_at?: string; valid_from?: string | null; valid_until?: string | null; }; Relationships: [ { foreignKeyName: "local_customer_agreements_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; }, { foreignKeyName: "local_customer_agreements_product_category_id_fkey"; columns: ["product_category_id"]; isOneToOne: false; referencedRelation: "product_categories"; referencedColumns: ["id"]; }, { foreignKeyName: "local_customer_agreements_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "local_customer_agreements_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; local_customer_price_groups: { Row: { created_at: string; currency: string; customer_id: string; discount_type: string; discount_value: number; id: string; min_quantity: number; notes: string | null; product_category_id: string | null; product_id: string | null; updated_at: string; valid_from: string | null; valid_until: string | null; }; Insert: { created_at?: string; currency?: string; customer_id: string; discount_type: string; discount_value: number; id?: string; min_quantity?: number; notes?: string | null; product_category_id?: string | null; product_id?: string | null; updated_at?: string; valid_from?: string | null; valid_until?: string | null; }; Update: { created_at?: string; currency?: string; customer_id?: string; discount_type?: string; discount_value?: number; id?: string; min_quantity?: number; notes?: string | null; product_category_id?: string | null; product_id?: string | null; updated_at?: string; valid_from?: string | null; valid_until?: string | null; }; Relationships: [ { foreignKeyName: "local_customer_price_groups_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; }, { foreignKeyName: "local_customer_price_groups_product_category_id_fkey"; columns: ["product_category_id"]; isOneToOne: false; referencedRelation: "product_categories"; referencedColumns: ["id"]; }, { foreignKeyName: "local_customer_price_groups_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "local_customer_price_groups_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; local_customer_sales_strategies: { Row: { created_at: string; currency: string; customer_id: string; discount_type: string; discount_value: number; id: string; min_quantity: number; notes: string | null; product_category_id: string | null; product_id: string | null; updated_at: string; valid_from: string | null; valid_until: string | null; }; Insert: { created_at?: string; currency?: string; customer_id: string; discount_type: string; discount_value: number; id?: string; min_quantity?: number; notes?: string | null; product_category_id?: string | null; product_id?: string | null; updated_at?: string; valid_from?: string | null; valid_until?: string | null; }; Update: { created_at?: string; currency?: string; customer_id?: string; discount_type?: string; discount_value?: number; id?: string; min_quantity?: number; notes?: string | null; product_category_id?: string | null; product_id?: string | null; updated_at?: string; valid_from?: string | null; valid_until?: string | null; }; Relationships: [ { foreignKeyName: "local_customer_sales_strategies_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; }, { foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey"; columns: ["product_category_id"]; isOneToOne: false; referencedRelation: "product_categories"; referencedColumns: ["id"]; }, { foreignKeyName: "local_customer_sales_strategies_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "local_customer_sales_strategies_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; locations: { Row: { created_at: string; id: string; name: string; sort_order: number; updated_at: string; }; Insert: { created_at?: string; id?: string; name: string; sort_order?: number; updated_at?: string; }; Update: { created_at?: string; id?: string; name?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; logistics_capacity_alerts: { Row: { available_minutes: number; carts_short: number; carts_total: number; created_at: string; email_enabled: boolean; email_error: string | null; email_recipients: string[]; email_sent_at: string | null; email_status: string; id: string; moved_carts: Json; notification_enabled: boolean; notification_id: string | null; pickup_label: string | null; pickup_moment_id: string | null; pickup_time: string | null; plan_date: string; required_minutes: number; resolved_at: string | null; shortage_minutes: number; status: string; unplanned_carts: Json; updated_at: string; user_id: string; }; Insert: { available_minutes?: number; carts_short?: number; carts_total?: number; created_at?: string; email_enabled?: boolean; email_error?: string | null; email_recipients?: string[]; email_sent_at?: string | null; email_status?: string; id?: string; moved_carts?: Json; notification_enabled?: boolean; notification_id?: string | null; pickup_label?: string | null; pickup_moment_id?: string | null; pickup_time?: string | null; plan_date: string; required_minutes?: number; resolved_at?: string | null; shortage_minutes?: number; status?: string; unplanned_carts?: Json; updated_at?: string; user_id?: string; }; Update: { available_minutes?: number; carts_short?: number; carts_total?: number; created_at?: string; email_enabled?: boolean; email_error?: string | null; email_recipients?: string[]; email_sent_at?: string | null; email_status?: string; id?: string; moved_carts?: Json; notification_enabled?: boolean; notification_id?: string | null; pickup_label?: string | null; pickup_moment_id?: string | null; pickup_time?: string | null; plan_date?: string; required_minutes?: number; resolved_at?: string | null; shortage_minutes?: number; status?: string; unplanned_carts?: Json; updated_at?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "logistics_capacity_alerts_pickup_moment_id_fkey"; columns: ["pickup_moment_id"]; isOneToOne: false; referencedRelation: "logistics_pickup_moments"; referencedColumns: ["id"]; } ]; }; logistics_capacity_events: { Row: { available_carts: number; created_at: string; id: string; measures: Json; note: string | null; outcome: string; required_carts: number; reserve_minutes: number; shortage_carts: number; status: string; user_id: string; }; Insert: { available_carts?: number; created_at?: string; id?: string; measures?: Json; note?: string | null; outcome?: string; required_carts?: number; reserve_minutes?: number; shortage_carts?: number; status: string; user_id: string; }; Update: { available_carts?: number; created_at?: string; id?: string; measures?: Json; note?: string | null; outcome?: string; required_carts?: number; reserve_minutes?: number; shortage_carts?: number; status?: string; user_id?: string; }; Relationships: []; }; logistics_capacity_settings: { Row: { created_at: string; settings: Json; updated_at: string; user_id: string; }; Insert: { created_at?: string; settings?: Json; updated_at?: string; user_id: string; }; Update: { created_at?: string; settings?: Json; updated_at?: string; user_id?: string; }; Relationships: []; }; logistics_cart_barcode: { Row: { barcode: string; cart_id: string; created_at: string; order_id: string | null; }; Insert: { barcode: string; cart_id: string; created_at?: string; order_id?: string | null; }; Update: { barcode?: string; cart_id?: string; created_at?: string; order_id?: string | null; }; Relationships: []; }; logistics_control_scan: { Row: { approved_at: string | null; attempts: number; barcode: string; cart_id: string; created_at: string; document_url: string | null; error: string | null; error_code: string | null; fulfillment_order_id: string | null; id: string; is_floriday: boolean; locked_until: string | null; order_id: string | null; order_number: string | null; print_job_id: string | null; printed_at: string | null; printer_id: string | null; scanner_id: string | null; status: string; updated_at: string; }; Insert: { approved_at?: string | null; attempts?: number; barcode: string; cart_id: string; created_at?: string; document_url?: string | null; error?: string | null; error_code?: string | null; fulfillment_order_id?: string | null; id?: string; is_floriday?: boolean; locked_until?: string | null; order_id?: string | null; order_number?: string | null; print_job_id?: string | null; printed_at?: string | null; printer_id?: string | null; scanner_id?: string | null; status?: string; updated_at?: string; }; Update: { approved_at?: string | null; attempts?: number; barcode?: string; cart_id?: string; created_at?: string; document_url?: string | null; error?: string | null; error_code?: string | null; fulfillment_order_id?: string | null; id?: string; is_floriday?: boolean; locked_until?: string | null; order_id?: string | null; order_number?: string | null; print_job_id?: string | null; printed_at?: string | null; printer_id?: string | null; scanner_id?: string | null; status?: string; updated_at?: string; }; Relationships: []; }; logistics_decisions: { Row: { created_at: string; explanation: string | null; id: string; input_snapshot: Json; result: Json; slot: string; strategy_id: string | null; subject_id: string; subject_type: string; user_id: string; }; Insert: { created_at?: string; explanation?: string | null; id?: string; input_snapshot?: Json; result?: Json; slot: string; strategy_id?: string | null; subject_id: string; subject_type: string; user_id: string; }; Update: { created_at?: string; explanation?: string | null; id?: string; input_snapshot?: Json; result?: Json; slot?: string; strategy_id?: string | null; subject_id?: string; subject_type?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "logistics_decisions_strategy_id_fkey"; columns: ["strategy_id"]; isOneToOne: false; referencedRelation: "logistics_strategies"; referencedColumns: ["id"]; } ]; }; logistics_delay_alerts: { Row: { approved_by: string | null; created_at: string; current_status: string | null; customer_name: string | null; customer_notified: boolean; customer_template: string | null; email_enabled: boolean; email_error: string | null; email_recipients: string[]; email_sent_at: string | null; email_status: string; expected_delivery_date: string | null; id: string; load_carrier_id: string | null; notification_id: string | null; order_id: string | null; order_ref: string; planned_delivery_date: string | null; priority: number; reason: string | null; reschedule_mode: string; reschedule_status: string; rescheduled_at: string | null; resolved_at: string | null; resolved_by: string | null; status: string; updated_at: string; user_id: string; }; Insert: { approved_by?: string | null; created_at?: string; current_status?: string | null; customer_name?: string | null; customer_notified?: boolean; customer_template?: string | null; email_enabled?: boolean; email_error?: string | null; email_recipients?: string[]; email_sent_at?: string | null; email_status?: string; expected_delivery_date?: string | null; id?: string; load_carrier_id?: string | null; notification_id?: string | null; order_id?: string | null; order_ref: string; planned_delivery_date?: string | null; priority?: number; reason?: string | null; reschedule_mode?: string; reschedule_status?: string; rescheduled_at?: string | null; resolved_at?: string | null; resolved_by?: string | null; status?: string; updated_at?: string; user_id: string; }; Update: { approved_by?: string | null; created_at?: string; current_status?: string | null; customer_name?: string | null; customer_notified?: boolean; customer_template?: string | null; email_enabled?: boolean; email_error?: string | null; email_recipients?: string[]; email_sent_at?: string | null; email_status?: string; expected_delivery_date?: string | null; id?: string; load_carrier_id?: string | null; notification_id?: string | null; order_id?: string | null; order_ref?: string; planned_delivery_date?: string | null; priority?: number; reason?: string | null; reschedule_mode?: string; reschedule_status?: string; rescheduled_at?: string | null; resolved_at?: string | null; resolved_by?: string | null; status?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; logistics_delay_log: { Row: { action: string; alert_id: string | null; created_at: string; detail: string | null; id: string; order_ref: string | null; payload: Json; user_id: string; }; Insert: { action: string; alert_id?: string | null; created_at?: string; detail?: string | null; id?: string; order_ref?: string | null; payload?: Json; user_id: string; }; Update: { action?: string; alert_id?: string | null; created_at?: string; detail?: string | null; id?: string; order_ref?: string | null; payload?: Json; user_id?: string; }; Relationships: [ { foreignKeyName: "logistics_delay_log_alert_id_fkey"; columns: ["alert_id"]; isOneToOne: false; referencedRelation: "logistics_delay_alerts"; referencedColumns: ["id"]; } ]; }; logistics_document_prints: { Row: { created_at: string; document_type: string; environment: string | null; error: string | null; id: string; merged_batch_id: string | null; order_ref: string; printed_at: string | null; status: string; task_id: string | null; trigger: string; updated_at: string; }; Insert: { created_at?: string; document_type: string; environment?: string | null; error?: string | null; id?: string; merged_batch_id?: string | null; order_ref: string; printed_at?: string | null; status?: string; task_id?: string | null; trigger: string; updated_at?: string; }; Update: { created_at?: string; document_type?: string; environment?: string | null; error?: string | null; id?: string; merged_batch_id?: string | null; order_ref?: string; printed_at?: string | null; status?: string; task_id?: string | null; trigger?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "logistics_document_prints_task_id_fkey"; columns: ["task_id"]; isOneToOne: false; referencedRelation: "logistics_tasks"; referencedColumns: ["id"]; } ]; }; logistics_events: { Row: { created_at: string; error: string | null; event_type: string; id: string; idempotency_key: string | null; order_ref: string; payload: Json; plan_run_id: string | null; priority: number; processed_at: string | null; shadow: boolean; source_module: string; status: string; strategy_id: string | null; updated_at: string; user_id: string; }; Insert: { created_at?: string; error?: string | null; event_type?: string; id?: string; idempotency_key?: string | null; order_ref: string; payload?: Json; plan_run_id?: string | null; priority?: number; processed_at?: string | null; shadow?: boolean; source_module: string; status?: string; strategy_id?: string | null; updated_at?: string; user_id?: string; }; Update: { created_at?: string; error?: string | null; event_type?: string; id?: string; idempotency_key?: string | null; order_ref?: string; payload?: Json; plan_run_id?: string | null; priority?: number; processed_at?: string | null; shadow?: boolean; source_module?: string; status?: string; strategy_id?: string | null; updated_at?: string; user_id?: string; }; Relationships: []; }; logistics_floriday_carrier_map: { Row: { carrier_code: string; created_at: string; floriday_code: string; }; Insert: { carrier_code: string; created_at?: string; floriday_code: string; }; Update: { carrier_code?: string; created_at?: string; floriday_code?: string; }; Relationships: []; }; logistics_floriday_pushes: { Row: { attempts: number; created_at: string; first_queued_at: string; fulfillment_order_id: string | null; id: string; last_error: string | null; last_error_at: string | null; last_error_code: string | null; last_gateway_status: number | null; last_queued_at: string | null; last_response: Json | null; last_sent_hash: string | null; locked_by: string | null; locked_until: string | null; next_attempt_at: string; order_ref: string; payload: Json; payload_hash: string | null; revision: number; sent_at: string | null; status: string; updated_at: string; }; Insert: { attempts?: number; created_at?: string; first_queued_at?: string; fulfillment_order_id?: string | null; id?: string; last_error?: string | null; last_error_at?: string | null; last_error_code?: string | null; last_gateway_status?: number | null; last_queued_at?: string | null; last_response?: Json | null; last_sent_hash?: string | null; locked_by?: string | null; locked_until?: string | null; next_attempt_at?: string; order_ref: string; payload?: Json; payload_hash?: string | null; revision?: number; sent_at?: string | null; status?: string; updated_at?: string; }; Update: { attempts?: number; created_at?: string; first_queued_at?: string; fulfillment_order_id?: string | null; id?: string; last_error?: string | null; last_error_at?: string | null; last_error_code?: string | null; last_gateway_status?: number | null; last_queued_at?: string | null; last_response?: Json | null; last_sent_hash?: string | null; locked_by?: string | null; locked_until?: string | null; next_attempt_at?: string; order_ref?: string; payload?: Json; payload_hash?: string | null; revision?: number; sent_at?: string | null; status?: string; updated_at?: string; }; Relationships: []; }; logistics_formulas: { Row: { created_at: string; expression: string; id: string; notes: string | null; slot: string; strategy_id: string; updated_at: string; user_id: string; version: number; }; Insert: { created_at?: string; expression?: string; id?: string; notes?: string | null; slot: string; strategy_id: string; updated_at?: string; user_id: string; version?: number; }; Update: { created_at?: string; expression?: string; id?: string; notes?: string | null; slot?: string; strategy_id?: string; updated_at?: string; user_id?: string; version?: number; }; Relationships: [ { foreignKeyName: "logistics_formulas_strategy_id_fkey"; columns: ["strategy_id"]; isOneToOne: false; referencedRelation: "logistics_strategies"; referencedColumns: ["id"]; } ]; }; logistics_layer_override_log: { Row: { cart_id: string; created_at: string; details: Json; id: string; keg_id: string | null; product_id: string | null; reason: string; }; Insert: { cart_id: string; created_at?: string; details?: Json; id?: string; keg_id?: string | null; product_id?: string | null; reason: string; }; Update: { cart_id?: string; created_at?: string; details?: Json; id?: string; keg_id?: string | null; product_id?: string | null; reason?: string; }; Relationships: []; }; logistics_pickup_moments: { Row: { carrier_ref: string | null; created_at: string; id: string; label: string | null; moment_date: string; pickup_time: string; sequence: number; updated_at: string; user_id: string; }; Insert: { carrier_ref?: string | null; created_at?: string; id?: string; label?: string | null; moment_date: string; pickup_time: string; sequence?: number; updated_at?: string; user_id?: string; }; Update: { carrier_ref?: string | null; created_at?: string; id?: string; label?: string | null; moment_date?: string; pickup_time?: string; sequence?: number; updated_at?: string; user_id?: string; }; Relationships: []; }; logistics_plan_queue: { Row: { attempts: number; claimed_at: string | null; enqueued_at: string; error: string | null; id: string; next_attempt_at: string; order_id: string; reason: string; reason_code: string | null; status: string; updated_at: string; }; Insert: { attempts?: number; claimed_at?: string | null; enqueued_at?: string; error?: string | null; id?: string; next_attempt_at?: string; order_id: string; reason?: string; reason_code?: string | null; status?: string; updated_at?: string; }; Update: { attempts?: number; claimed_at?: string | null; enqueued_at?: string; error?: string | null; id?: string; next_attempt_at?: string; order_id?: string; reason?: string; reason_code?: string | null; status?: string; updated_at?: string; }; Relationships: []; }; logistics_plan_runs: { Row: { created_at: string; error: string | null; id: string; input: Json; order_ref: string; rule_config_id: string | null; rule_version: number | null; settings_hash: string | null; settings_snapshot: Json; source_module: string | null; status: string; strategy_id: string | null; tasks_created: number; tasks_revised: number; trigger: string; updated_at: string; user_id: string; warnings: Json; }; Insert: { created_at?: string; error?: string | null; id?: string; input?: Json; order_ref: string; rule_config_id?: string | null; rule_version?: number | null; settings_hash?: string | null; settings_snapshot?: Json; source_module?: string | null; status?: string; strategy_id?: string | null; tasks_created?: number; tasks_revised?: number; trigger?: string; updated_at?: string; user_id?: string; warnings?: Json; }; Update: { created_at?: string; error?: string | null; id?: string; input?: Json; order_ref?: string; rule_config_id?: string | null; rule_version?: number | null; settings_hash?: string | null; settings_snapshot?: Json; source_module?: string | null; status?: string; strategy_id?: string | null; tasks_created?: number; tasks_revised?: number; trigger?: string; updated_at?: string; user_id?: string; warnings?: Json; }; Relationships: [ { foreignKeyName: "logistics_plan_runs_rule_config_id_fkey"; columns: ["rule_config_id"]; isOneToOne: false; referencedRelation: "logistics_rule_configs"; referencedColumns: ["id"]; }, { foreignKeyName: "logistics_plan_runs_strategy_id_fkey"; columns: ["strategy_id"]; isOneToOne: false; referencedRelation: "logistics_strategies"; referencedColumns: ["id"]; } ]; }; logistics_plan_settings: { Row: { key: string; updated_at: string; value: string; }; Insert: { key: string; updated_at?: string; value: string; }; Update: { key?: string; updated_at?: string; value?: string; }; Relationships: []; }; logistics_rebuffer_state: { Row: { created_at: string; id: boolean; last_checked: number; last_duration_ms: number; last_run_at: string | null; last_updated: number; pending: boolean; requested_at: string | null; updated_at: string; }; Insert: { created_at?: string; id?: boolean; last_checked?: number; last_duration_ms?: number; last_run_at?: string | null; last_updated?: number; pending?: boolean; requested_at?: string | null; updated_at?: string; }; Update: { created_at?: string; id?: boolean; last_checked?: number; last_duration_ms?: number; last_run_at?: string | null; last_updated?: number; pending?: boolean; requested_at?: string | null; updated_at?: string; }; Relationships: []; }; logistics_recalc_jobs: { Row: { carts_created: number; created_at: string; cursor: string | null; errors: Json; failed: number; finished_at: string | null; id: string; last_tick_at: string | null; phase: string; processed: number; skipped_locked: number; started_by: string | null; status: string; steps: Json; strategy_id: string | null; tasks_updated: number; updated_at: string; }; Insert: { carts_created?: number; created_at?: string; cursor?: string | null; errors?: Json; failed?: number; finished_at?: string | null; id?: string; last_tick_at?: string | null; phase?: string; processed?: number; skipped_locked?: number; started_by?: string | null; status?: string; steps?: Json; strategy_id?: string | null; tasks_updated?: number; updated_at?: string; }; Update: { carts_created?: number; created_at?: string; cursor?: string | null; errors?: Json; failed?: number; finished_at?: string | null; id?: string; last_tick_at?: string | null; phase?: string; processed?: number; skipped_locked?: number; started_by?: string | null; status?: string; steps?: Json; strategy_id?: string | null; tasks_updated?: number; updated_at?: string; }; Relationships: []; }; logistics_reschedules: { Row: { created_at: string; created_by: string | null; customer_notified: boolean; delay_alert_id: string | null; delivery_date_kept: boolean; direction: string; id: string; new_delivery_date: string | null; new_pickup_date: string | null; new_pickup_from: string | null; new_pickup_to: string | null; order_id: string | null; order_ref: string; prev_delivery_date: string | null; prev_pickup_date: string | null; prev_pickup_from: string | null; prev_pickup_to: string | null; reason: string | null; source_module: string; updated_at: string; user_id: string | null; }; Insert: { created_at?: string; created_by?: string | null; customer_notified?: boolean; delay_alert_id?: string | null; delivery_date_kept?: boolean; direction: string; id?: string; new_delivery_date?: string | null; new_pickup_date?: string | null; new_pickup_from?: string | null; new_pickup_to?: string | null; order_id?: string | null; order_ref: string; prev_delivery_date?: string | null; prev_pickup_date?: string | null; prev_pickup_from?: string | null; prev_pickup_to?: string | null; reason?: string | null; source_module?: string; updated_at?: string; user_id?: string | null; }; Update: { created_at?: string; created_by?: string | null; customer_notified?: boolean; delay_alert_id?: string | null; delivery_date_kept?: boolean; direction?: string; id?: string; new_delivery_date?: string | null; new_pickup_date?: string | null; new_pickup_from?: string | null; new_pickup_to?: string | null; order_id?: string | null; order_ref?: string; prev_delivery_date?: string | null; prev_pickup_date?: string | null; prev_pickup_from?: string | null; prev_pickup_to?: string | null; reason?: string | null; source_module?: string; updated_at?: string; user_id?: string | null; }; Relationships: []; }; logistics_rule_configs: { Row: { created_at: string; current_version: number; description: string | null; id: string; is_active: boolean; name: string; settings: Json; status: string; strategy_id: string | null; updated_at: string; user_id: string; }; Insert: { created_at?: string; current_version?: number; description?: string | null; id?: string; is_active?: boolean; name: string; settings?: Json; status?: string; strategy_id?: string | null; updated_at?: string; user_id?: string; }; Update: { created_at?: string; current_version?: number; description?: string | null; id?: string; is_active?: boolean; name?: string; settings?: Json; status?: string; strategy_id?: string | null; updated_at?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "logistics_rule_configs_strategy_id_fkey"; columns: ["strategy_id"]; isOneToOne: false; referencedRelation: "logistics_strategies"; referencedColumns: ["id"]; } ]; }; logistics_rule_versions: { Row: { config_id: string; created_at: string; id: string; label: string | null; note: string | null; settings: Json; status: string; user_id: string; version: number; }; Insert: { config_id: string; created_at?: string; id?: string; label?: string | null; note?: string | null; settings?: Json; status?: string; user_id?: string; version: number; }; Update: { config_id?: string; created_at?: string; id?: string; label?: string | null; note?: string | null; settings?: Json; status?: string; user_id?: string; version?: number; }; Relationships: [ { foreignKeyName: "logistics_rule_versions_config_id_fkey"; columns: ["config_id"]; isOneToOne: false; referencedRelation: "logistics_rule_configs"; referencedColumns: ["id"]; } ]; }; logistics_shipping_note_scan: { Row: { barcode: string; cart_id: string; id: string; is_reprint: boolean; order_id: string | null; print_job_id: string | null; scanned_at: string; }; Insert: { barcode: string; cart_id: string; id?: string; is_reprint?: boolean; order_id?: string | null; print_job_id?: string | null; scanned_at?: string; }; Update: { barcode?: string; cart_id?: string; id?: string; is_reprint?: boolean; order_id?: string | null; print_job_id?: string | null; scanned_at?: string; }; Relationships: []; }; logistics_staff_planning: { Row: { created_at: string; end_time: string; id: string; note: string | null; plan_date: string; source_module: string | null; staff_count: number; start_time: string; updated_at: string; user_id: string; }; Insert: { created_at?: string; end_time?: string; id?: string; note?: string | null; plan_date: string; source_module?: string | null; staff_count?: number; start_time?: string; updated_at?: string; user_id?: string; }; Update: { created_at?: string; end_time?: string; id?: string; note?: string | null; plan_date?: string; source_module?: string | null; staff_count?: number; start_time?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; logistics_stock_alerts: { Row: { created_at: string; customer_name: string | null; delivery_date: string | null; email_enabled: boolean; email_error: string | null; email_outbox_id: string | null; email_recipients: string[]; email_sent_at: string | null; email_status: string; id: string; notification_id: string | null; order_id: string | null; order_ref: string; priority: number; resolved_at: string | null; resolved_by: string | null; shortages: Json; status: string; updated_at: string; user_id: string; }; Insert: { created_at?: string; customer_name?: string | null; delivery_date?: string | null; email_enabled?: boolean; email_error?: string | null; email_outbox_id?: string | null; email_recipients?: string[]; email_sent_at?: string | null; email_status?: string; id?: string; notification_id?: string | null; order_id?: string | null; order_ref: string; priority?: number; resolved_at?: string | null; resolved_by?: string | null; shortages?: Json; status?: string; updated_at?: string; user_id: string; }; Update: { created_at?: string; customer_name?: string | null; delivery_date?: string | null; email_enabled?: boolean; email_error?: string | null; email_outbox_id?: string | null; email_recipients?: string[]; email_sent_at?: string | null; email_status?: string; id?: string; notification_id?: string | null; order_id?: string | null; order_ref?: string; priority?: number; resolved_at?: string | null; resolved_by?: string | null; shortages?: Json; status?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; logistics_strategies: { Row: { color: string; created_at: string; description: string | null; id: string; is_active: boolean; name: string; priority: number; updated_at: string; updated_by: string | null; user_id: string; version: number; }; Insert: { color?: string; created_at?: string; description?: string | null; id?: string; is_active?: boolean; name: string; priority?: number; updated_at?: string; updated_by?: string | null; user_id: string; version?: number; }; Update: { color?: string; created_at?: string; description?: string | null; id?: string; is_active?: boolean; name?: string; priority?: number; updated_at?: string; updated_by?: string | null; user_id?: string; version?: number; }; Relationships: []; }; logistics_strategy_schedules: { Row: { condition_expression: string | null; created_at: string; end_date: string | null; id: string; is_enabled: boolean; priority: number; rule_type: string; start_date: string | null; strategy_id: string; updated_at: string; user_id: string; }; Insert: { condition_expression?: string | null; created_at?: string; end_date?: string | null; id?: string; is_enabled?: boolean; priority?: number; rule_type: string; start_date?: string | null; strategy_id: string; updated_at?: string; user_id: string; }; Update: { condition_expression?: string | null; created_at?: string; end_date?: string | null; id?: string; is_enabled?: boolean; priority?: number; rule_type?: string; start_date?: string | null; strategy_id?: string; updated_at?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "logistics_strategy_schedules_strategy_id_fkey"; columns: ["strategy_id"]; isOneToOne: false; referencedRelation: "logistics_strategies"; referencedColumns: ["id"]; } ]; }; logistics_tasks: { Row: { attempt_log: Json; attempts: number; buffer_ref: string | null; claimed_at: string | null; claimed_by: string | null; completed_at: string | null; created_at: string; depends_on: string[]; due_at: string | null; error: string | null; id: string; last_error: string | null; next_attempt_at: string | null; order_ref: string; owner_module: string; payload: Json; plan_run_id: string | null; planned_end: string | null; planned_start: string | null; priority: number; result: Json | null; rule_config_id: string | null; rule_version: number | null; sequence: number; shadow: boolean; started_at: string | null; status: string; strategy_id: string | null; task_type: string; updated_at: string; user_id: string; }; Insert: { attempt_log?: Json; attempts?: number; buffer_ref?: string | null; claimed_at?: string | null; claimed_by?: string | null; completed_at?: string | null; created_at?: string; depends_on?: string[]; due_at?: string | null; error?: string | null; id?: string; last_error?: string | null; next_attempt_at?: string | null; order_ref: string; owner_module: string; payload?: Json; plan_run_id?: string | null; planned_end?: string | null; planned_start?: string | null; priority?: number; result?: Json | null; rule_config_id?: string | null; rule_version?: number | null; sequence?: number; shadow?: boolean; started_at?: string | null; status?: string; strategy_id?: string | null; task_type: string; updated_at?: string; user_id?: string; }; Update: { attempt_log?: Json; attempts?: number; buffer_ref?: string | null; claimed_at?: string | null; claimed_by?: string | null; completed_at?: string | null; created_at?: string; depends_on?: string[]; due_at?: string | null; error?: string | null; id?: string; last_error?: string | null; next_attempt_at?: string | null; order_ref?: string; owner_module?: string; payload?: Json; plan_run_id?: string | null; planned_end?: string | null; planned_start?: string | null; priority?: number; result?: Json | null; rule_config_id?: string | null; rule_version?: number | null; sequence?: number; shadow?: boolean; started_at?: string | null; status?: string; strategy_id?: string | null; task_type?: string; updated_at?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "logistics_tasks_plan_run_id_fkey"; columns: ["plan_run_id"]; isOneToOne: false; referencedRelation: "logistics_plan_runs"; referencedColumns: ["id"]; }, { foreignKeyName: "logistics_tasks_rule_config_id_fkey"; columns: ["rule_config_id"]; isOneToOne: false; referencedRelation: "logistics_rule_configs"; referencedColumns: ["id"]; }, { foreignKeyName: "logistics_tasks_strategy_id_fkey"; columns: ["strategy_id"]; isOneToOne: false; referencedRelation: "logistics_strategies"; referencedColumns: ["id"]; } ]; }; logistics_tick_heartbeat: { Row: { id: boolean; last_tick_at: string; }; Insert: { id?: boolean; last_tick_at?: string; }; Update: { id?: boolean; last_tick_at?: string; }; Relationships: []; }; logistics_variables: { Row: { created_at: string; default_value: string | null; description: string | null; id: string; is_builtin: boolean; key: string; label: string; updated_at: string; user_id: string; value_type: string; }; Insert: { created_at?: string; default_value?: string | null; description?: string | null; id?: string; is_builtin?: boolean; key: string; label: string; updated_at?: string; user_id: string; value_type: string; }; Update: { created_at?: string; default_value?: string | null; description?: string | null; id?: string; is_builtin?: boolean; key?: string; label?: string; updated_at?: string; user_id?: string; value_type?: string; }; Relationships: []; }; mailbox_ai_goal_prompts: { Row: { created_at: string; goal_key: string; id: string; system_prompt: string; updated_at: string; }; Insert: { created_at?: string; goal_key: string; id?: string; system_prompt?: string; updated_at?: string; }; Update: { created_at?: string; goal_key?: string; id?: string; system_prompt?: string; updated_at?: string; }; Relationships: []; }; mailbox_ai_settings: { Row: { active_goal_key: string | null; created_at: string; enabled: boolean; id: string; required_fields: string[]; singleton: boolean; system_prompt: string | null; updated_at: string; }; Insert: { active_goal_key?: string | null; created_at?: string; enabled?: boolean; id?: string; required_fields?: string[]; singleton?: boolean; system_prompt?: string | null; updated_at?: string; }; Update: { active_goal_key?: string | null; created_at?: string; enabled?: boolean; id?: string; required_fields?: string[]; singleton?: boolean; system_prompt?: string | null; updated_at?: string; }; Relationships: []; }; mailbox_ingest_runs: { Row: { connection_id: string | null; error_sample: string | null; errors: number; finished_at: string | null; id: string; inserted: number; processed: number; started_at: string; trigger: string; }; Insert: { connection_id?: string | null; error_sample?: string | null; errors?: number; finished_at?: string | null; id?: string; inserted?: number; processed?: number; started_at?: string; trigger: string; }; Update: { connection_id?: string | null; error_sample?: string | null; errors?: number; finished_at?: string | null; id?: string; inserted?: number; processed?: number; started_at?: string; trigger?: string; }; Relationships: []; }; mailbox_messages: { Row: { attachments: Json; body_html: string | null; body_text: string | null; cc_recipients: Json; connection_id: string | null; created_at: string; error_message: string | null; external_id: string | null; from_email: string | null; from_name: string | null; has_attachments: boolean; id: string; message_id: string | null; profile_id: string | null; raw_size: number | null; received_at: string | null; status: string; subject: string | null; to_recipients: Json; uid: number | null; updated_at: string; }; Insert: { attachments?: Json; body_html?: string | null; body_text?: string | null; cc_recipients?: Json; connection_id?: string | null; created_at?: string; error_message?: string | null; external_id?: string | null; from_email?: string | null; from_name?: string | null; has_attachments?: boolean; id?: string; message_id?: string | null; profile_id?: string | null; raw_size?: number | null; received_at?: string | null; status?: string; subject?: string | null; to_recipients?: Json; uid?: number | null; updated_at?: string; }; Update: { attachments?: Json; body_html?: string | null; body_text?: string | null; cc_recipients?: Json; connection_id?: string | null; created_at?: string; error_message?: string | null; external_id?: string | null; from_email?: string | null; from_name?: string | null; has_attachments?: boolean; id?: string; message_id?: string | null; profile_id?: string | null; raw_size?: number | null; received_at?: string | null; status?: string; subject?: string | null; to_recipients?: Json; uid?: number | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "mailbox_messages_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections"; referencedColumns: ["id"]; }, { foreignKeyName: "mailbox_messages_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "email_auth_connections_safe"; referencedColumns: ["id"]; }, { foreignKeyName: "mailbox_messages_profile_id_fkey"; columns: ["profile_id"]; isOneToOne: false; referencedRelation: "imap_profiles"; referencedColumns: ["id"]; } ]; }; mailbox_order_proposals: { Row: { ai_validation: Json | null; confidence: number | null; created_at: string; created_order_id: string | null; delivery_date: string | null; id: string; matched_customer_id: string | null; message_id: string; notes: string | null; order_number: string | null; parsed_payload: Json | null; reviewed_at: string | null; reviewed_by: string | null; status: string; updated_at: string; }; Insert: { ai_validation?: Json | null; confidence?: number | null; created_at?: string; created_order_id?: string | null; delivery_date?: string | null; id?: string; matched_customer_id?: string | null; message_id: string; notes?: string | null; order_number?: string | null; parsed_payload?: Json | null; reviewed_at?: string | null; reviewed_by?: string | null; status?: string; updated_at?: string; }; Update: { ai_validation?: Json | null; confidence?: number | null; created_at?: string; created_order_id?: string | null; delivery_date?: string | null; id?: string; matched_customer_id?: string | null; message_id?: string; notes?: string | null; order_number?: string | null; parsed_payload?: Json | null; reviewed_at?: string | null; reviewed_by?: string | null; status?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "mailbox_order_proposals_created_order_id_fkey"; columns: ["created_order_id"]; isOneToOne: false; referencedRelation: "orders"; referencedColumns: ["id"]; }, { foreignKeyName: "mailbox_order_proposals_matched_customer_id_fkey"; columns: ["matched_customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; }, { foreignKeyName: "mailbox_order_proposals_message_id_fkey"; columns: ["message_id"]; isOneToOne: false; referencedRelation: "mailbox_messages"; referencedColumns: ["id"]; } ]; }; mailbox_order_template_fields: { Row: { ai_enabled: boolean; ai_hint: string | null; created_at: string; default_value: Json | null; field_type: string; id: string; key: string; label: string; options: Json | null; required: boolean; sort_order: number; source: string; source_table: string | null; updated_at: string; visible: boolean; }; Insert: { ai_enabled?: boolean; ai_hint?: string | null; created_at?: string; default_value?: Json | null; field_type: string; id?: string; key: string; label: string; options?: Json | null; required?: boolean; sort_order?: number; source?: string; source_table?: string | null; updated_at?: string; visible?: boolean; }; Update: { ai_enabled?: boolean; ai_hint?: string | null; created_at?: string; default_value?: Json | null; field_type?: string; id?: string; key?: string; label?: string; options?: Json | null; required?: boolean; sort_order?: number; source?: string; source_table?: string | null; updated_at?: string; visible?: boolean; }; Relationships: []; }; mailbox_proposal_field_values: { Row: { ai_confidence: number | null; ai_filled: boolean; created_at: string; field_key: string; id: string; needs_review: boolean; proposal_id: string; updated_at: string; value: Json | null; }; Insert: { ai_confidence?: number | null; ai_filled?: boolean; created_at?: string; field_key: string; id?: string; needs_review?: boolean; proposal_id: string; updated_at?: string; value?: Json | null; }; Update: { ai_confidence?: number | null; ai_filled?: boolean; created_at?: string; field_key?: string; id?: string; needs_review?: boolean; proposal_id?: string; updated_at?: string; value?: Json | null; }; Relationships: [ { foreignKeyName: "mailbox_proposal_field_values_proposal_id_fkey"; columns: ["proposal_id"]; isOneToOne: false; referencedRelation: "mailbox_order_proposals"; referencedColumns: ["id"]; } ]; }; mailbox_proposal_lines: { Row: { created_at: string; id: string; match_confidence: number | null; plant_type: string | null; product_id: string | null; proposal_id: string; quantity: number | null; raw_product_text: string | null; sort_order: number; unit: string | null; updated_at: string; }; Insert: { created_at?: string; id?: string; match_confidence?: number | null; plant_type?: string | null; product_id?: string | null; proposal_id: string; quantity?: number | null; raw_product_text?: string | null; sort_order?: number; unit?: string | null; updated_at?: string; }; Update: { created_at?: string; id?: string; match_confidence?: number | null; plant_type?: string | null; product_id?: string | null; proposal_id?: string; quantity?: number | null; raw_product_text?: string | null; sort_order?: number; unit?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "mailbox_proposal_lines_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "mailbox_proposal_lines_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; }, { foreignKeyName: "mailbox_proposal_lines_proposal_id_fkey"; columns: ["proposal_id"]; isOneToOne: false; referencedRelation: "mailbox_order_proposals"; referencedColumns: ["id"]; } ]; }; mailbox_settings: { Row: { created_at: string; folder: string; id: string; imap_host: string; imap_port: number; imap_use_tls: boolean; imap_username: string; last_error: string | null; last_polled_at: string | null; last_uid_seen: number; polling_enabled: boolean; singleton: boolean; updated_at: string; }; Insert: { created_at?: string; folder?: string; id?: string; imap_host?: string; imap_port?: number; imap_use_tls?: boolean; imap_username?: string; last_error?: string | null; last_polled_at?: string | null; last_uid_seen?: number; polling_enabled?: boolean; singleton?: boolean; updated_at?: string; }; Update: { created_at?: string; folder?: string; id?: string; imap_host?: string; imap_port?: number; imap_use_tls?: boolean; imap_username?: string; last_error?: string | null; last_polled_at?: string | null; last_uid_seen?: number; polling_enabled?: boolean; singleton?: boolean; updated_at?: string; }; Relationships: []; }; manufacture_product_components: { Row: { component_type: string; created_at: string; id: string; manufacture_product_id: string; product_group_id: string | null; quantity: number; trade_item_id: string | null; unit: string; }; Insert: { component_type: string; created_at?: string; id?: string; manufacture_product_id: string; product_group_id?: string | null; quantity?: number; trade_item_id?: string | null; unit?: string; }; Update: { component_type?: string; created_at?: string; id?: string; manufacture_product_id?: string; product_group_id?: string | null; quantity?: number; trade_item_id?: string | null; unit?: string; }; Relationships: [ { foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey"; columns: ["manufacture_product_id"]; isOneToOne: false; referencedRelation: "manufacture_product_possible_stock_view"; referencedColumns: ["manufacture_product_id"]; }, { foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey"; columns: ["manufacture_product_id"]; isOneToOne: false; referencedRelation: "manufacture_products"; referencedColumns: ["id"]; }, { foreignKeyName: "manufacture_product_components_product_group_id_fkey"; columns: ["product_group_id"]; isOneToOne: false; referencedRelation: "product_groups"; referencedColumns: ["id"]; } ]; }; manufacture_products: { Row: { created_at: string; description: string | null; id: string; is_active: boolean; name: string; produced_stock: number; product_code: string; tenant_id: string; updated_at: string; }; Insert: { created_at?: string; description?: string | null; id?: string; is_active?: boolean; name: string; produced_stock?: number; product_code: string; tenant_id: string; updated_at?: string; }; Update: { created_at?: string; description?: string | null; id?: string; is_active?: boolean; name?: string; produced_stock?: number; product_code?: string; tenant_id?: string; updated_at?: string; }; Relationships: []; }; maps_addresses: { Row: { address_hash: string; created_at: string; error_reason: string | null; formatted_address: string | null; id: string; lat: number | null; lng: number | null; place_id: string | null; raw_address: string; resolved_at: string | null; status: string; updated_at: string; }; Insert: { address_hash: string; created_at?: string; error_reason?: string | null; formatted_address?: string | null; id?: string; lat?: number | null; lng?: number | null; place_id?: string | null; raw_address: string; resolved_at?: string | null; status?: string; updated_at?: string; }; Update: { address_hash?: string; created_at?: string; error_reason?: string | null; formatted_address?: string | null; id?: string; lat?: number | null; lng?: number | null; place_id?: string | null; raw_address?: string; resolved_at?: string | null; status?: string; updated_at?: string; }; Relationships: []; }; maps_job_lease: { Row: { job: string; locked_until: string; updated_at: string; }; Insert: { job: string; locked_until?: string; updated_at?: string; }; Update: { job?: string; locked_until?: string; updated_at?: string; }; Relationships: []; }; maps_request_queue: { Row: { attempts: number; created_at: string; destination_hash: string | null; id: string; kind: string; last_error: string | null; mode: string; origin_hash: string | null; processed_at: string | null; raw_destination: string | null; raw_origin: string | null; requested_by: string | null; status: string; updated_at: string; }; Insert: { attempts?: number; created_at?: string; destination_hash?: string | null; id?: string; kind: string; last_error?: string | null; mode?: string; origin_hash?: string | null; processed_at?: string | null; raw_destination?: string | null; raw_origin?: string | null; requested_by?: string | null; status?: string; updated_at?: string; }; Update: { attempts?: number; created_at?: string; destination_hash?: string | null; id?: string; kind?: string; last_error?: string | null; mode?: string; origin_hash?: string | null; processed_at?: string | null; raw_destination?: string | null; raw_origin?: string | null; requested_by?: string | null; status?: string; updated_at?: string; }; Relationships: []; }; maps_settings: { Row: { allow_estimate_fallback: boolean; cache_ttl_days: number; created_at: string; daily_call_limit: number; id: string; last_error: string | null; last_error_at: string | null; last_success_at: string | null; provider: string; updated_at: string; }; Insert: { allow_estimate_fallback?: boolean; cache_ttl_days?: number; created_at?: string; daily_call_limit?: number; id?: string; last_error?: string | null; last_error_at?: string | null; last_success_at?: string | null; provider?: string; updated_at?: string; }; Update: { allow_estimate_fallback?: boolean; cache_ttl_days?: number; created_at?: string; daily_call_limit?: number; id?: string; last_error?: string | null; last_error_at?: string | null; last_success_at?: string | null; provider?: string; updated_at?: string; }; Relationships: []; }; maps_travel_times: { Row: { created_at: string; destination_id: string; distance_m: number | null; duration_sec: number; expires_at: string; id: string; mode: string; origin_id: string; source: string; updated_at: string; }; Insert: { created_at?: string; destination_id: string; distance_m?: number | null; duration_sec: number; expires_at?: string; id?: string; mode?: string; origin_id: string; source?: string; updated_at?: string; }; Update: { created_at?: string; destination_id?: string; distance_m?: number | null; duration_sec?: number; expires_at?: string; id?: string; mode?: string; origin_id?: string; source?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "maps_travel_times_destination_id_fkey"; columns: ["destination_id"]; isOneToOne: false; referencedRelation: "maps_addresses"; referencedColumns: ["id"]; }, { foreignKeyName: "maps_travel_times_origin_id_fkey"; columns: ["origin_id"]; isOneToOne: false; referencedRelation: "maps_addresses"; referencedColumns: ["id"]; } ]; }; maps_usage_log: { Row: { cache_hits: number; call_type: string; created_at: string; day: string; detail: string | null; elements: number; id: string; outcome: string; }; Insert: { cache_hits?: number; call_type: string; created_at?: string; day?: string; detail?: string | null; elements?: number; id?: string; outcome?: string; }; Update: { cache_hits?: number; call_type?: string; created_at?: string; day?: string; detail?: string | null; elements?: number; id?: string; outcome?: string; }; Relationships: []; }; material_usage: { Row: { created_at: string; id: string; material_name: string; monteur_id: string | null; price_at_time: number; quantity_used: number; updated_at: string; van_inventory_id: string | null; work_order_id: string; }; Insert: { created_at?: string; id?: string; material_name: string; monteur_id?: string | null; price_at_time?: number; quantity_used?: number; updated_at?: string; van_inventory_id?: string | null; work_order_id: string; }; Update: { created_at?: string; id?: string; material_name?: string; monteur_id?: string | null; price_at_time?: number; quantity_used?: number; updated_at?: string; van_inventory_id?: string | null; work_order_id?: string; }; Relationships: [ { foreignKeyName: "material_usage_monteur_id_fkey"; columns: ["monteur_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; }, { foreignKeyName: "material_usage_van_inventory_id_fkey"; columns: ["van_inventory_id"]; isOneToOne: false; referencedRelation: "van_inventories"; referencedColumns: ["id"]; }, { foreignKeyName: "material_usage_work_order_id_fkey"; columns: ["work_order_id"]; isOneToOne: false; referencedRelation: "work_orders"; referencedColumns: ["id"]; } ]; }; medewerker_details: { Row: { color: string | null; created_at: string; hours_fri: number | null; hours_mon: number | null; hours_thu: number | null; hours_tue: number | null; hours_wed: number | null; id: string; is_active: boolean; leave_balance_hours: number; persnr: string | null; phone: string | null; profile_id: string; updated_at: string; }; Insert: { color?: string | null; created_at?: string; hours_fri?: number | null; hours_mon?: number | null; hours_thu?: number | null; hours_tue?: number | null; hours_wed?: number | null; id?: string; is_active?: boolean; leave_balance_hours?: number; persnr?: string | null; phone?: string | null; profile_id: string; updated_at?: string; }; Update: { color?: string | null; created_at?: string; hours_fri?: number | null; hours_mon?: number | null; hours_thu?: number | null; hours_tue?: number | null; hours_wed?: number | null; id?: string; is_active?: boolean; leave_balance_hours?: number; persnr?: string | null; phone?: string | null; profile_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "medewerker_details_profile_id_fkey"; columns: ["profile_id"]; isOneToOne: true; referencedRelation: "profiles"; referencedColumns: ["id"]; } ]; }; module_features: { Row: { created_at: string; feature_id: string; id: string; is_active: boolean; last_seen_at: string; module_id: string; name: string; }; Insert: { created_at?: string; feature_id: string; id?: string; is_active?: boolean; last_seen_at?: string; module_id: string; name: string; }; Update: { created_at?: string; feature_id?: string; id?: string; is_active?: boolean; last_seen_at?: string; module_id?: string; name?: string; }; Relationships: []; }; module_permissions: { Row: { created_at: string; id: string; module_id: string; permission: string; role: Database["public"]["Enums"]["app_role"]; updated_at: string; }; Insert: { created_at?: string; id?: string; module_id: string; permission: string; role: Database["public"]["Enums"]["app_role"]; updated_at?: string; }; Update: { created_at?: string; id?: string; module_id?: string; permission?: string; role?: Database["public"]["Enums"]["app_role"]; updated_at?: string; }; Relationships: []; }; module_registry: { Row: { created_at: string; enforce: boolean; is_active: boolean; last_seen_at: string; missing_count: number; module_id: string; name: string; shell_id: string | null; sort_order: number | null; }; Insert: { created_at?: string; enforce?: boolean; is_active?: boolean; last_seen_at?: string; missing_count?: number; module_id: string; name: string; shell_id?: string | null; sort_order?: number | null; }; Update: { created_at?: string; enforce?: boolean; is_active?: boolean; last_seen_at?: string; missing_count?: number; module_id?: string; name?: string; shell_id?: string | null; sort_order?: number | null; }; Relationships: []; }; module_runtime_config: { Row: { key: string; updated_at: string; value: string; }; Insert: { key: string; updated_at?: string; value: string; }; Update: { key?: string; updated_at?: string; value?: string; }; Relationships: []; }; modules: { Row: { created_at: string; description: string | null; id: string; is_active: boolean; last_seen_at: string | null; module_key: string; module_name: string; updated_at: string; }; Insert: { created_at?: string; description?: string | null; id?: string; is_active?: boolean; last_seen_at?: string | null; module_key: string; module_name: string; updated_at?: string; }; Update: { created_at?: string; description?: string | null; id?: string; is_active?: boolean; last_seen_at?: string | null; module_key?: string; module_name?: string; updated_at?: string; }; Relationships: []; }; nmbrs_component_mapping: { Row: { created_at: string; id: string; source_kind: string; source_value: string | null; updated_at: string; wage_code: string; }; Insert: { created_at?: string; id?: string; source_kind: string; source_value?: string | null; updated_at?: string; wage_code: string; }; Update: { created_at?: string; id?: string; source_kind?: string; source_value?: string | null; updated_at?: string; wage_code?: string; }; Relationships: [ { foreignKeyName: "nmbrs_component_mapping_wage_code_fkey"; columns: ["wage_code"]; isOneToOne: false; referencedRelation: "nmbrs_wage_components"; referencedColumns: ["code"]; } ]; }; nmbrs_employee_mapping: { Row: { active_from: string | null; active_to: string | null; contract_hours_per_week: number | null; created_at: string; hourly_wage: number | null; id: string; monteur_id: string; nmbrs_company_code: string | null; nmbrs_employee_number: string; updated_at: string; }; Insert: { active_from?: string | null; active_to?: string | null; contract_hours_per_week?: number | null; created_at?: string; hourly_wage?: number | null; id?: string; monteur_id: string; nmbrs_company_code?: string | null; nmbrs_employee_number: string; updated_at?: string; }; Update: { active_from?: string | null; active_to?: string | null; contract_hours_per_week?: number | null; created_at?: string; hourly_wage?: number | null; id?: string; monteur_id?: string; nmbrs_company_code?: string | null; nmbrs_employee_number?: string; updated_at?: string; }; Relationships: []; }; nmbrs_export_lines: { Row: { amount: number; created_at: string; entry_date: string; hours: number; id: string; monteur_id: string; nmbrs_employee_number: string | null; notes: string | null; run_id: string; source_kind: string | null; source_ref_id: string | null; updated_at: string; wage_code: string; }; Insert: { amount?: number; created_at?: string; entry_date: string; hours?: number; id?: string; monteur_id: string; nmbrs_employee_number?: string | null; notes?: string | null; run_id: string; source_kind?: string | null; source_ref_id?: string | null; updated_at?: string; wage_code: string; }; Update: { amount?: number; created_at?: string; entry_date?: string; hours?: number; id?: string; monteur_id?: string; nmbrs_employee_number?: string | null; notes?: string | null; run_id?: string; source_kind?: string | null; source_ref_id?: string | null; updated_at?: string; wage_code?: string; }; Relationships: [ { foreignKeyName: "nmbrs_export_lines_run_id_fkey"; columns: ["run_id"]; isOneToOne: false; referencedRelation: "nmbrs_export_runs"; referencedColumns: ["id"]; }, { foreignKeyName: "nmbrs_export_lines_wage_code_fkey"; columns: ["wage_code"]; isOneToOne: false; referencedRelation: "nmbrs_wage_components"; referencedColumns: ["code"]; } ]; }; nmbrs_export_runs: { Row: { created_at: string; file_name: string | null; generated_at: string; generated_by: string | null; id: string; notes: string | null; period_end: string; period_label: string; period_start: string; status: string; total_hours: number; total_lines: number; updated_at: string; }; Insert: { created_at?: string; file_name?: string | null; generated_at?: string; generated_by?: string | null; id?: string; notes?: string | null; period_end: string; period_label: string; period_start: string; status?: string; total_hours?: number; total_lines?: number; updated_at?: string; }; Update: { created_at?: string; file_name?: string | null; generated_at?: string; generated_by?: string | null; id?: string; notes?: string | null; period_end?: string; period_label?: string; period_start?: string; status?: string; total_hours?: number; total_lines?: number; updated_at?: string; }; Relationships: []; }; nmbrs_settings: { Row: { created_at: string; default_company_code: string | null; id: boolean; include_travel: boolean; overtime_threshold_daily: number; overtime_threshold_weekly: number; period_type: string; updated_at: string; updated_by: string | null; week_start_day: number; }; Insert: { created_at?: string; default_company_code?: string | null; id?: boolean; include_travel?: boolean; overtime_threshold_daily?: number; overtime_threshold_weekly?: number; period_type?: string; updated_at?: string; updated_by?: string | null; week_start_day?: number; }; Update: { created_at?: string; default_company_code?: string | null; id?: boolean; include_travel?: boolean; overtime_threshold_daily?: number; overtime_threshold_weekly?: number; period_type?: string; updated_at?: string; updated_by?: string | null; week_start_day?: number; }; Relationships: []; }; nmbrs_wage_components: { Row: { category: string; code: string; created_at: string; id: string; is_active: boolean; label: string; sort_order: number; unit: string; updated_at: string; }; Insert: { category: string; code: string; created_at?: string; id?: string; is_active?: boolean; label: string; sort_order?: number; unit: string; updated_at?: string; }; Update: { category?: string; code?: string; created_at?: string; id?: string; is_active?: boolean; label?: string; sort_order?: number; unit?: string; updated_at?: string; }; Relationships: []; }; notifications: { Row: { created_at: string; id: string; message: string | null; read: boolean; title: string; updated_at: string; user_id: string; }; Insert: { created_at?: string; id?: string; message?: string | null; read?: boolean; title: string; updated_at?: string; user_id: string; }; Update: { created_at?: string; id?: string; message?: string | null; read?: boolean; title?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; offer_campaign_product_tiers: { Row: { campaign_product_id: string; created_at: string; id: string; min_crates: number; price_per_crate: number; sort_order: number; }; Insert: { campaign_product_id: string; created_at?: string; id?: string; min_crates?: number; price_per_crate?: number; sort_order?: number; }; Update: { campaign_product_id?: string; created_at?: string; id?: string; min_crates?: number; price_per_crate?: number; sort_order?: number; }; Relationships: [ { foreignKeyName: "offer_campaign_product_tiers_campaign_product_id_fkey"; columns: ["campaign_product_id"]; isOneToOne: false; referencedRelation: "offer_campaign_products"; referencedColumns: ["id"]; } ]; }; offer_campaign_products: { Row: { available_stock: number; barcode: string | null; belading: string | null; campaign_id: string; crate_price: number | null; created_at: string; description: string | null; discount_price: number; id: string; image_url: string | null; normal_price: number; plants_per_crate: number | null; product_id: string | null; product_name: string; sort_order: number; sticker_available: boolean; sticker_cost: number | null; }; Insert: { available_stock?: number; barcode?: string | null; belading?: string | null; campaign_id: string; crate_price?: number | null; created_at?: string; description?: string | null; discount_price?: number; id?: string; image_url?: string | null; normal_price?: number; plants_per_crate?: number | null; product_id?: string | null; product_name: string; sort_order?: number; sticker_available?: boolean; sticker_cost?: number | null; }; Update: { available_stock?: number; barcode?: string | null; belading?: string | null; campaign_id?: string; crate_price?: number | null; created_at?: string; description?: string | null; discount_price?: number; id?: string; image_url?: string | null; normal_price?: number; plants_per_crate?: number | null; product_id?: string | null; product_name?: string; sort_order?: number; sticker_available?: boolean; sticker_cost?: number | null; }; Relationships: [ { foreignKeyName: "offer_campaign_products_campaign_id_fkey"; columns: ["campaign_id"]; isOneToOne: false; referencedRelation: "offer_campaigns"; referencedColumns: ["id"]; } ]; }; offer_campaigns: { Row: { created_at: string; created_by: string | null; from_email: string; from_name: string; id: string; intro_message: string | null; name: string; scheduled_at: string | null; sent_at: string | null; status: string; subject: string; updated_at: string; }; Insert: { created_at?: string; created_by?: string | null; from_email: string; from_name: string; id?: string; intro_message?: string | null; name: string; scheduled_at?: string | null; sent_at?: string | null; status?: string; subject: string; updated_at?: string; }; Update: { created_at?: string; created_by?: string | null; from_email?: string; from_name?: string; id?: string; intro_message?: string | null; name?: string; scheduled_at?: string | null; sent_at?: string | null; status?: string; subject?: string; updated_at?: string; }; Relationships: []; }; offer_events: { Row: { campaign_id: string; created_at: string; event_type: string; id: string; metadata: Json; recipient_id: string; }; Insert: { campaign_id: string; created_at?: string; event_type: string; id?: string; metadata?: Json; recipient_id: string; }; Update: { campaign_id?: string; created_at?: string; event_type?: string; id?: string; metadata?: Json; recipient_id?: string; }; Relationships: [ { foreignKeyName: "offer_events_campaign_id_fkey"; columns: ["campaign_id"]; isOneToOne: false; referencedRelation: "offer_campaigns"; referencedColumns: ["id"]; }, { foreignKeyName: "offer_events_recipient_id_fkey"; columns: ["recipient_id"]; isOneToOne: false; referencedRelation: "offer_recipients"; referencedColumns: ["id"]; } ]; }; offer_orders: { Row: { campaign_id: string; created_at: string; customer_email: string; customer_id: string | null; customer_name: string; customer_phone: string | null; id: string; items: Json; notes: string | null; order_number: string | null; recipient_id: string; total_amount: number; }; Insert: { campaign_id: string; created_at?: string; customer_email: string; customer_id?: string | null; customer_name: string; customer_phone?: string | null; id?: string; items?: Json; notes?: string | null; order_number?: string | null; recipient_id: string; total_amount?: number; }; Update: { campaign_id?: string; created_at?: string; customer_email?: string; customer_id?: string | null; customer_name?: string; customer_phone?: string | null; id?: string; items?: Json; notes?: string | null; order_number?: string | null; recipient_id?: string; total_amount?: number; }; Relationships: [ { foreignKeyName: "offer_orders_campaign_id_fkey"; columns: ["campaign_id"]; isOneToOne: false; referencedRelation: "offer_campaigns"; referencedColumns: ["id"]; }, { foreignKeyName: "offer_orders_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; }, { foreignKeyName: "offer_orders_recipient_id_fkey"; columns: ["recipient_id"]; isOneToOne: false; referencedRelation: "offer_recipients"; referencedColumns: ["id"]; } ]; }; offer_recipients: { Row: { campaign_id: string; clicked_at: string | null; contact_id: string | null; created_at: string; customer_id: string | null; id: string; link_code: string; opened_at: string | null; ordered_at: string | null; recipient_email: string; recipient_name: string; sent_at: string | null; }; Insert: { campaign_id: string; clicked_at?: string | null; contact_id?: string | null; created_at?: string; customer_id?: string | null; id?: string; link_code?: string; opened_at?: string | null; ordered_at?: string | null; recipient_email: string; recipient_name: string; sent_at?: string | null; }; Update: { campaign_id?: string; clicked_at?: string | null; contact_id?: string | null; created_at?: string; customer_id?: string | null; id?: string; link_code?: string; opened_at?: string | null; ordered_at?: string | null; recipient_email?: string; recipient_name?: string; sent_at?: string | null; }; Relationships: [ { foreignKeyName: "offer_recipients_campaign_id_fkey"; columns: ["campaign_id"]; isOneToOne: false; referencedRelation: "offer_campaigns"; referencedColumns: ["id"]; }, { foreignKeyName: "offer_recipients_contact_id_fkey"; columns: ["contact_id"]; isOneToOne: false; referencedRelation: "customer_contacts"; referencedColumns: ["id"]; }, { foreignKeyName: "offer_recipients_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; } ]; }; offer_settings: { Row: { brand_name: string | null; button_color: string; created_at: string; default_countries: string[]; default_customer_classes: string[]; default_intro: string; default_sticker_cost: number; default_subject: string; discount_display: string; excluded_contact_ids: string[]; excluded_customer_ids: string[]; from_email: string; from_name: string; id: string; logo_url: string | null; primary_color: string; show_customer_classes: boolean; singleton: boolean; tracking_enabled: boolean; updated_at: string; }; Insert: { brand_name?: string | null; button_color?: string; created_at?: string; default_countries?: string[]; default_customer_classes?: string[]; default_intro?: string; default_sticker_cost?: number; default_subject?: string; discount_display?: string; excluded_contact_ids?: string[]; excluded_customer_ids?: string[]; from_email?: string; from_name?: string; id?: string; logo_url?: string | null; primary_color?: string; show_customer_classes?: boolean; singleton?: boolean; tracking_enabled?: boolean; updated_at?: string; }; Update: { brand_name?: string | null; button_color?: string; created_at?: string; default_countries?: string[]; default_customer_classes?: string[]; default_intro?: string; default_sticker_cost?: number; default_subject?: string; discount_display?: string; excluded_contact_ids?: string[]; excluded_customer_ids?: string[]; from_email?: string; from_name?: string; id?: string; logo_url?: string | null; primary_color?: string; show_customer_classes?: boolean; singleton?: boolean; tracking_enabled?: boolean; updated_at?: string; }; Relationships: []; }; order_buffers: { Row: { buffer_key: string; close_at: string | null; closed_at: string | null; created_at: string; customer_id: string | null; grouping_mode: string; id: string; pickup_date: string | null; pickup_location: string | null; plan_locked_at: string | null; updated_at: string; }; Insert: { buffer_key: string; close_at?: string | null; closed_at?: string | null; created_at?: string; customer_id?: string | null; grouping_mode: string; id?: string; pickup_date?: string | null; pickup_location?: string | null; plan_locked_at?: string | null; updated_at?: string; }; Update: { buffer_key?: string; close_at?: string | null; closed_at?: string | null; created_at?: string; customer_id?: string | null; grouping_mode?: string; id?: string; pickup_date?: string | null; pickup_location?: string | null; plan_locked_at?: string | null; updated_at?: string; }; Relationships: []; }; order_cart_items: { Row: { boxes: number | null; cart_id: string; crates: number; crates_in_layer: number | null; crates_per_layer: number; created_at: string; id: string; layer_fraction: number; layer_index: number | null; layer_share_pct: number; layers_per_cart: number; order_item_id: string | null; plants_per_crate: number; product_id: string | null; product_name: string; weight_kg: number | null; }; Insert: { boxes?: number | null; cart_id: string; crates: number; crates_in_layer?: number | null; crates_per_layer?: number; created_at?: string; id?: string; layer_fraction?: number; layer_index?: number | null; layer_share_pct?: number; layers_per_cart?: number; order_item_id?: string | null; plants_per_crate?: number; product_id?: string | null; product_name: string; weight_kg?: number | null; }; Update: { boxes?: number | null; cart_id?: string; crates?: number; crates_in_layer?: number | null; crates_per_layer?: number; created_at?: string; id?: string; layer_fraction?: number; layer_index?: number | null; layer_share_pct?: number; layers_per_cart?: number; order_item_id?: string | null; plants_per_crate?: number; product_id?: string | null; product_name?: string; weight_kg?: number | null; }; Relationships: [ { foreignKeyName: "order_cart_items_cart_id_fkey"; columns: ["cart_id"]; isOneToOne: false; referencedRelation: "order_carts"; referencedColumns: ["id"]; }, { foreignKeyName: "order_cart_items_order_item_id_fkey"; columns: ["order_item_id"]; isOneToOne: false; referencedRelation: "order_items"; referencedColumns: ["id"]; }, { foreignKeyName: "order_cart_items_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "order_cart_items_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; order_cart_layer_positions: { Row: { algorithm_version: number | null; cart_id: string; created_at: string; height: number; id: string; keg_id: string; label: string | null; layer: number; layer_height: number | null; layer_width: number | null; manual_overridden_at: string | null; manual_overridden_by: string | null; manual_override: boolean; order_item_id: string | null; original_layer: number | null; original_x: number | null; original_y: number | null; product_id: string | null; rotation: number; source: string | null; updated_at: string; width: number; x: number; y: number; }; Insert: { algorithm_version?: number | null; cart_id: string; created_at?: string; height: number; id?: string; keg_id: string; label?: string | null; layer: number; layer_height?: number | null; layer_width?: number | null; manual_overridden_at?: string | null; manual_overridden_by?: string | null; manual_override?: boolean; order_item_id?: string | null; original_layer?: number | null; original_x?: number | null; original_y?: number | null; product_id?: string | null; rotation?: number; source?: string | null; updated_at?: string; width: number; x: number; y: number; }; Update: { algorithm_version?: number | null; cart_id?: string; created_at?: string; height?: number; id?: string; keg_id?: string; label?: string | null; layer?: number; layer_height?: number | null; layer_width?: number | null; manual_overridden_at?: string | null; manual_overridden_by?: string | null; manual_override?: boolean; order_item_id?: string | null; original_layer?: number | null; original_x?: number | null; original_y?: number | null; product_id?: string | null; rotation?: number; source?: string | null; updated_at?: string; width?: number; x?: number; y?: number; }; Relationships: [ { foreignKeyName: "order_cart_layer_positions_cart_id_fkey"; columns: ["cart_id"]; isOneToOne: false; referencedRelation: "order_carts"; referencedColumns: ["id"]; } ]; }; order_carts: { Row: { algorithm_version: number; buffer_id: string | null; carrier_type: string; carrier_type_id: string | null; cart_number: number; created_at: string; id: string; is_auto: boolean; is_complete: boolean; layout_method: string | null; max_layers: number | null; moved_at: string | null; moved_from_moment_id: string | null; moved_reason: string | null; notes: string | null; occupancy_pct: number; order_id: string | null; pickup_locked: boolean; pickup_moment_id: string | null; source: string; total_carts: number | null; total_layers_used: number; updated_at: string; weight_kg: number | null; }; Insert: { algorithm_version?: number; buffer_id?: string | null; carrier_type?: string; carrier_type_id?: string | null; cart_number: number; created_at?: string; id?: string; is_auto?: boolean; is_complete?: boolean; layout_method?: string | null; max_layers?: number | null; moved_at?: string | null; moved_from_moment_id?: string | null; moved_reason?: string | null; notes?: string | null; occupancy_pct?: number; order_id?: string | null; pickup_locked?: boolean; pickup_moment_id?: string | null; source?: string; total_carts?: number | null; total_layers_used?: number; updated_at?: string; weight_kg?: number | null; }; Update: { algorithm_version?: number; buffer_id?: string | null; carrier_type?: string; carrier_type_id?: string | null; cart_number?: number; created_at?: string; id?: string; is_auto?: boolean; is_complete?: boolean; layout_method?: string | null; max_layers?: number | null; moved_at?: string | null; moved_from_moment_id?: string | null; moved_reason?: string | null; notes?: string | null; occupancy_pct?: number; order_id?: string | null; pickup_locked?: boolean; pickup_moment_id?: string | null; source?: string; total_carts?: number | null; total_layers_used?: number; updated_at?: string; weight_kg?: number | null; }; Relationships: [ { foreignKeyName: "order_carts_buffer_id_fkey"; columns: ["buffer_id"]; isOneToOne: false; referencedRelation: "order_buffers"; referencedColumns: ["id"]; }, { foreignKeyName: "order_carts_carrier_type_id_fkey"; columns: ["carrier_type_id"]; isOneToOne: false; referencedRelation: "load_carrier_types"; referencedColumns: ["id"]; }, { foreignKeyName: "order_carts_moved_from_moment_id_fkey"; columns: ["moved_from_moment_id"]; isOneToOne: false; referencedRelation: "logistics_pickup_moments"; referencedColumns: ["id"]; }, { foreignKeyName: "order_carts_order_id_fkey"; columns: ["order_id"]; isOneToOne: false; referencedRelation: "orders"; referencedColumns: ["id"]; }, { foreignKeyName: "order_carts_pickup_moment_id_fkey"; columns: ["pickup_moment_id"]; isOneToOne: false; referencedRelation: "logistics_pickup_moments"; referencedColumns: ["id"]; } ]; }; order_field_options: { Row: { created_at: string; field_setting_id: string; id: string; label: string; sort_order: number; }; Insert: { created_at?: string; field_setting_id: string; id?: string; label: string; sort_order?: number; }; Update: { created_at?: string; field_setting_id?: string; id?: string; label?: string; sort_order?: number; }; Relationships: [ { foreignKeyName: "order_field_options_field_setting_id_fkey"; columns: ["field_setting_id"]; isOneToOne: false; referencedRelation: "order_field_settings"; referencedColumns: ["id"]; } ]; }; order_field_settings: { Row: { active: boolean; created_at: string; field_key: string; field_label: string; field_type: string; id: string; is_custom: boolean; sort_order: number; updated_at: string; }; Insert: { active?: boolean; created_at?: string; field_key: string; field_label: string; field_type?: string; id?: string; is_custom?: boolean; sort_order?: number; updated_at?: string; }; Update: { active?: boolean; created_at?: string; field_key?: string; field_label?: string; field_type?: string; id?: string; is_custom?: boolean; sort_order?: number; updated_at?: string; }; Relationships: []; }; order_fust_bookings: { Row: { created_at: string; fust_type_id: string; id: string; order_item_id: string; quantity: number; updated_at: string; }; Insert: { created_at?: string; fust_type_id: string; id?: string; order_item_id: string; quantity?: number; updated_at?: string; }; Update: { created_at?: string; fust_type_id?: string; id?: string; order_item_id?: string; quantity?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "order_fust_bookings_fust_type_id_fkey"; columns: ["fust_type_id"]; isOneToOne: false; referencedRelation: "fust_types"; referencedColumns: ["id"]; } ]; }; order_invoice_links: { Row: { administration_code: string | null; attempts: number; created_at: string; error_message: string | null; id: string; invoice_number: string | null; next_attempt_at: string; order_id: string; processed_at: string | null; status: string; updated_at: string; }; Insert: { administration_code?: string | null; attempts?: number; created_at?: string; error_message?: string | null; id?: string; invoice_number?: string | null; next_attempt_at?: string; order_id: string; processed_at?: string | null; status?: string; updated_at?: string; }; Update: { administration_code?: string | null; attempts?: number; created_at?: string; error_message?: string | null; id?: string; invoice_number?: string | null; next_attempt_at?: string; order_id?: string; processed_at?: string | null; status?: string; updated_at?: string; }; Relationships: []; }; order_items: { Row: { crates_per_layer: number | null; created_at: string; id: string; layers_per_cart: number | null; order_id: string; plants_per_crate: number | null; product_id: string | null; product_name: string; quantity: number; unit: string; unit_price: number | null; }; Insert: { crates_per_layer?: number | null; created_at?: string; id?: string; layers_per_cart?: number | null; order_id: string; plants_per_crate?: number | null; product_id?: string | null; product_name: string; quantity?: number; unit?: string; unit_price?: number | null; }; Update: { crates_per_layer?: number | null; created_at?: string; id?: string; layers_per_cart?: number | null; order_id?: string; plants_per_crate?: number | null; product_id?: string | null; product_name?: string; quantity?: number; unit?: string; unit_price?: number | null; }; Relationships: [ { foreignKeyName: "order_items_order_id_fkey"; columns: ["order_id"]; isOneToOne: false; referencedRelation: "orders"; referencedColumns: ["id"]; }, { foreignKeyName: "order_items_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "order_items_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; order_number_counters: { Row: { last_value: number; updated_at: string; year: number; }; Insert: { last_value?: number; updated_at?: string; year: number; }; Update: { last_value?: number; updated_at?: string; year?: number; }; Relationships: []; }; order_shipment_items: { Row: { created_at: string; id: string; order_item_id: string; product_id: string | null; product_name: string; quantity: number; shipment_id: string; updated_at: string; }; Insert: { created_at?: string; id?: string; order_item_id: string; product_id?: string | null; product_name: string; quantity: number; shipment_id: string; updated_at?: string; }; Update: { created_at?: string; id?: string; order_item_id?: string; product_id?: string | null; product_name?: string; quantity?: number; shipment_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "order_shipment_items_order_item_id_fkey"; columns: ["order_item_id"]; isOneToOne: false; referencedRelation: "order_items"; referencedColumns: ["id"]; }, { foreignKeyName: "order_shipment_items_shipment_id_fkey"; columns: ["shipment_id"]; isOneToOne: false; referencedRelation: "order_shipments"; referencedColumns: ["id"]; } ]; }; order_shipments: { Row: { carrier_id: string | null; created_at: string; delivery_date: string | null; delivery_location_id: string | null; id: string; notes: string | null; order_id: string; shipment_number: number; shipped_at: string | null; status: string; updated_at: string; }; Insert: { carrier_id?: string | null; created_at?: string; delivery_date?: string | null; delivery_location_id?: string | null; id?: string; notes?: string | null; order_id: string; shipment_number: number; shipped_at?: string | null; status?: string; updated_at?: string; }; Update: { carrier_id?: string | null; created_at?: string; delivery_date?: string | null; delivery_location_id?: string | null; id?: string; notes?: string | null; order_id?: string; shipment_number?: number; shipped_at?: string | null; status?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "order_shipments_carrier_id_fkey"; columns: ["carrier_id"]; isOneToOne: false; referencedRelation: "carriers"; referencedColumns: ["id"]; }, { foreignKeyName: "order_shipments_order_id_fkey"; columns: ["order_id"]; isOneToOne: false; referencedRelation: "orders"; referencedColumns: ["id"]; } ]; }; orders: { Row: { buffer_id: string | null; cancel_reason: string | null; cancelled_at: string | null; created_at: string; custom_fields: Json; customer_id: string | null; customer_name: string; deleted_at: string | null; delivery_date: string | null; floriday_sales_order_id: string | null; id: string; invoice_due_at: string | null; is_reservation: boolean; notes: string | null; order_date: string; order_number: string; order_source: string; plan_locked_at: string | null; plan_locked_ref: string | null; status: string; status_changed_at: string; status_origin: string; status_sync_token: string | null; total: string; updated_at: string; }; Insert: { buffer_id?: string | null; cancel_reason?: string | null; cancelled_at?: string | null; created_at?: string; custom_fields?: Json; customer_id?: string | null; customer_name?: string; deleted_at?: string | null; delivery_date?: string | null; floriday_sales_order_id?: string | null; id?: string; invoice_due_at?: string | null; is_reservation?: boolean; notes?: string | null; order_date?: string; order_number: string; order_source?: string; plan_locked_at?: string | null; plan_locked_ref?: string | null; status?: string; status_changed_at?: string; status_origin?: string; status_sync_token?: string | null; total?: string; updated_at?: string; }; Update: { buffer_id?: string | null; cancel_reason?: string | null; cancelled_at?: string | null; created_at?: string; custom_fields?: Json; customer_id?: string | null; customer_name?: string; deleted_at?: string | null; delivery_date?: string | null; floriday_sales_order_id?: string | null; id?: string; invoice_due_at?: string | null; is_reservation?: boolean; notes?: string | null; order_date?: string; order_number?: string; order_source?: string; plan_locked_at?: string | null; plan_locked_ref?: string | null; status?: string; status_changed_at?: string; status_origin?: string; status_sync_token?: string | null; total?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "orders_buffer_id_fkey"; columns: ["buffer_id"]; isOneToOne: false; referencedRelation: "order_buffers"; referencedColumns: ["id"]; }, { foreignKeyName: "orders_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; } ]; }; packages: { Row: { color: string; created_at: string; description: string | null; id: string; is_active: boolean; name: string; sort_order: number; updated_at: string; value: number; }; Insert: { color?: string; created_at?: string; description?: string | null; id?: string; is_active?: boolean; name: string; sort_order?: number; updated_at?: string; value?: number; }; Update: { color?: string; created_at?: string; description?: string | null; id?: string; is_active?: boolean; name?: string; sort_order?: number; updated_at?: string; value?: number; }; Relationships: []; }; pakbon_barcode_inhoud: { Row: { barcode: string; cart_id: string | null; cart_index: number | null; cart_label: string | null; cart_total: number | null; created_at: string; is_herprint: boolean; klant_naam: string | null; klant_nummer: string | null; layout_id: string | null; layout_variant: string | null; order_nummer: string | null; order_ref: string | null; print_job_id: string | null; regels: Json; updated_at: string; }; Insert: { barcode: string; cart_id?: string | null; cart_index?: number | null; cart_label?: string | null; cart_total?: number | null; created_at?: string; is_herprint?: boolean; klant_naam?: string | null; klant_nummer?: string | null; layout_id?: string | null; layout_variant?: string | null; order_nummer?: string | null; order_ref?: string | null; print_job_id?: string | null; regels?: Json; updated_at?: string; }; Update: { barcode?: string; cart_id?: string | null; cart_index?: number | null; cart_label?: string | null; cart_total?: number | null; created_at?: string; is_herprint?: boolean; klant_naam?: string | null; klant_nummer?: string | null; layout_id?: string | null; layout_variant?: string | null; order_nummer?: string | null; order_ref?: string | null; print_job_id?: string | null; regels?: Json; updated_at?: string; }; Relationships: []; }; pakbon_barcode_verzoeken: { Row: { aangevraagd_op: string; barcode: string | null; cart_id: string | null; cart_index: number | null; cart_label: string | null; cart_total: number | null; documentnaam: string | null; geleverd_op: string | null; id: string; is_herprint: boolean; klant_naam: string | null; klant_nummer: string | null; laatst_gevraagd_op: string; layout_id: string | null; layout_variant: string | null; order_nummer: string | null; order_ref: string | null; print_job_id: string; status: string; updated_at: string; }; Insert: { aangevraagd_op?: string; barcode?: string | null; cart_id?: string | null; cart_index?: number | null; cart_label?: string | null; cart_total?: number | null; documentnaam?: string | null; geleverd_op?: string | null; id?: string; is_herprint?: boolean; klant_naam?: string | null; klant_nummer?: string | null; laatst_gevraagd_op?: string; layout_id?: string | null; layout_variant?: string | null; order_nummer?: string | null; order_ref?: string | null; print_job_id: string; status?: string; updated_at?: string; }; Update: { aangevraagd_op?: string; barcode?: string | null; cart_id?: string | null; cart_index?: number | null; cart_label?: string | null; cart_total?: number | null; documentnaam?: string | null; geleverd_op?: string | null; id?: string; is_herprint?: boolean; klant_naam?: string | null; klant_nummer?: string | null; laatst_gevraagd_op?: string; layout_id?: string | null; layout_variant?: string | null; order_nummer?: string | null; order_ref?: string | null; print_job_id?: string; status?: string; updated_at?: string; }; Relationships: []; }; pick_buffer_event_cursor: { Row: { created_at: string; id: boolean; last_event_at: string; updated_at: string; }; Insert: { created_at?: string; id?: boolean; last_event_at?: string; updated_at?: string; }; Update: { created_at?: string; id?: boolean; last_event_at?: string; updated_at?: string; }; Relationships: []; }; pick_countries: { Row: { active: boolean; code: string; created_at: string; flag: string | null; id: string; name: string; sort_order: number; updated_at: string; }; Insert: { active?: boolean; code: string; created_at?: string; flag?: string | null; id?: string; name: string; sort_order?: number; updated_at?: string; }; Update: { active?: boolean; code?: string; created_at?: string; flag?: string | null; id?: string; name?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; pick_document_statuses: { Row: { active: boolean; code: string; color: string | null; created_at: string; id: string; is_open: boolean; is_terminal: boolean; name: string; sort_order: number; updated_at: string; }; Insert: { active?: boolean; code: string; color?: string | null; created_at?: string; id?: string; is_open?: boolean; is_terminal?: boolean; name: string; sort_order?: number; updated_at?: string; }; Update: { active?: boolean; code?: string; color?: string | null; created_at?: string; id?: string; is_open?: boolean; is_terminal?: boolean; name?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; pick_document_types: { Row: { active: boolean; code: string; color: string | null; created_at: string; description: string | null; icon: string | null; id: string; name: string; print_template: string | null; printer_id: string | null; priority: number; report_key: string | null; sort_order: number; updated_at: string; workflow: Json; }; Insert: { active?: boolean; code: string; color?: string | null; created_at?: string; description?: string | null; icon?: string | null; id?: string; name: string; print_template?: string | null; printer_id?: string | null; priority?: number; report_key?: string | null; sort_order?: number; updated_at?: string; workflow?: Json; }; Update: { active?: boolean; code?: string; color?: string | null; created_at?: string; description?: string | null; icon?: string | null; id?: string; name?: string; print_template?: string | null; printer_id?: string | null; priority?: number; report_key?: string | null; sort_order?: number; updated_at?: string; workflow?: Json; }; Relationships: [ { foreignKeyName: "pick_document_types_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "pick_station_printers"; referencedColumns: ["id"]; } ]; }; pick_queue: { Row: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; Insert: { announced_at?: string; assigned_user_id?: string | null; barcode?: string | null; cancelled_at?: string | null; cart_count?: number; completed_at?: string | null; country_code?: string | null; created_at?: string; customer_name?: string | null; delivery_address?: string | null; document_number?: string | null; document_type_id?: string | null; due_at?: string | null; id?: string; is_urgent?: boolean; line_count?: number; order_number?: string | null; order_type?: string | null; payload?: Json; print_count?: number; print_job_id?: string | null; printed_at?: string | null; printed_by?: string | null; printed_cart_ids?: Json; printer_id?: string | null; priority?: number; reference?: string | null; route?: string | null; screen_id?: string | null; station_id?: string | null; status_id?: string | null; updated_at?: string; warnings?: Json; }; Update: { announced_at?: string; assigned_user_id?: string | null; barcode?: string | null; cancelled_at?: string | null; cart_count?: number; completed_at?: string | null; country_code?: string | null; created_at?: string; customer_name?: string | null; delivery_address?: string | null; document_number?: string | null; document_type_id?: string | null; due_at?: string | null; id?: string; is_urgent?: boolean; line_count?: number; order_number?: string | null; order_type?: string | null; payload?: Json; print_count?: number; print_job_id?: string | null; printed_at?: string | null; printed_by?: string | null; printed_cart_ids?: Json; printer_id?: string | null; priority?: number; reference?: string | null; route?: string | null; screen_id?: string | null; station_id?: string | null; status_id?: string | null; updated_at?: string; warnings?: Json; }; Relationships: [ { foreignKeyName: "pick_queue_document_type_id_fkey"; columns: ["document_type_id"]; isOneToOne: false; referencedRelation: "pick_document_types"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_queue_print_job_id_fkey"; columns: ["print_job_id"]; isOneToOne: false; referencedRelation: "print_jobs"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_queue_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "pick_station_printers"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_queue_screen_id_fkey"; columns: ["screen_id"]; isOneToOne: false; referencedRelation: "pick_station_screens"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_queue_station_id_fkey"; columns: ["station_id"]; isOneToOne: false; referencedRelation: "pick_stations"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_queue_status_id_fkey"; columns: ["status_id"]; isOneToOne: false; referencedRelation: "pick_document_statuses"; referencedColumns: ["id"]; } ]; }; pick_queue_locks: { Row: { expires_at: string; id: string; locked_at: string; locked_by: string | null; queue_item_id: string; screen_id: string | null; session_id: string | null; station_id: string | null; }; Insert: { expires_at?: string; id?: string; locked_at?: string; locked_by?: string | null; queue_item_id: string; screen_id?: string | null; session_id?: string | null; station_id?: string | null; }; Update: { expires_at?: string; id?: string; locked_at?: string; locked_by?: string | null; queue_item_id?: string; screen_id?: string | null; session_id?: string | null; station_id?: string | null; }; Relationships: [ { foreignKeyName: "pick_queue_locks_queue_item_id_fkey"; columns: ["queue_item_id"]; isOneToOne: true; referencedRelation: "pick_queue"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_queue_locks_screen_id_fkey"; columns: ["screen_id"]; isOneToOne: false; referencedRelation: "pick_station_screens"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_queue_locks_station_id_fkey"; columns: ["station_id"]; isOneToOne: false; referencedRelation: "pick_stations"; referencedColumns: ["id"]; } ]; }; pick_screen_document_types: { Row: { created_at: string; document_type_id: string; id: string; print_order: number; printer_id: string | null; screen_id: string; }; Insert: { created_at?: string; document_type_id: string; id?: string; print_order?: number; printer_id?: string | null; screen_id: string; }; Update: { created_at?: string; document_type_id?: string; id?: string; print_order?: number; printer_id?: string | null; screen_id?: string; }; Relationships: [ { foreignKeyName: "pick_screen_document_types_document_type_id_fkey"; columns: ["document_type_id"]; isOneToOne: false; referencedRelation: "pick_document_types"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_screen_document_types_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "pick_station_printers"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_screen_document_types_screen_id_fkey"; columns: ["screen_id"]; isOneToOne: false; referencedRelation: "pick_station_screens"; referencedColumns: ["id"]; } ]; }; pick_station_heartbeats: { Row: { browser: string | null; created_at: string; id: string; ip_address: string | null; last_seen_at: string; screen_id: string | null; session_id: string; station_id: string; user_id: string | null; }; Insert: { browser?: string | null; created_at?: string; id?: string; ip_address?: string | null; last_seen_at?: string; screen_id?: string | null; session_id: string; station_id: string; user_id?: string | null; }; Update: { browser?: string | null; created_at?: string; id?: string; ip_address?: string | null; last_seen_at?: string; screen_id?: string | null; session_id?: string; station_id?: string; user_id?: string | null; }; Relationships: [ { foreignKeyName: "pick_station_heartbeats_screen_id_fkey"; columns: ["screen_id"]; isOneToOne: false; referencedRelation: "pick_station_screens"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_station_heartbeats_station_id_fkey"; columns: ["station_id"]; isOneToOne: false; referencedRelation: "pick_stations"; referencedColumns: ["id"]; } ]; }; pick_station_history: { Row: { action: string; changed_by: string | null; created_at: string; entity_id: string; entity_table: string; id: string; new_data: Json | null; old_data: Json | null; }; Insert: { action: string; changed_by?: string | null; created_at?: string; entity_id: string; entity_table: string; id?: string; new_data?: Json | null; old_data?: Json | null; }; Update: { action?: string; changed_by?: string | null; created_at?: string; entity_id?: string; entity_table?: string; id?: string; new_data?: Json | null; old_data?: Json | null; }; Relationships: []; }; pick_station_logs: { Row: { action: string; browser: string | null; created_at: string; detail: Json; duration_ms: number | null; id: string; ip_address: string | null; printer_id: string | null; queue_item_id: string | null; screen_id: string | null; session_id: string | null; station_id: string | null; user_id: string | null; }; Insert: { action: string; browser?: string | null; created_at?: string; detail?: Json; duration_ms?: number | null; id?: string; ip_address?: string | null; printer_id?: string | null; queue_item_id?: string | null; screen_id?: string | null; session_id?: string | null; station_id?: string | null; user_id?: string | null; }; Update: { action?: string; browser?: string | null; created_at?: string; detail?: Json; duration_ms?: number | null; id?: string; ip_address?: string | null; printer_id?: string | null; queue_item_id?: string | null; screen_id?: string | null; session_id?: string | null; station_id?: string | null; user_id?: string | null; }; Relationships: []; }; pick_station_permissions: { Row: { can_break_lock: boolean; can_cancel: boolean; can_print: boolean; can_reprint: boolean; country_code: string | null; created_at: string; id: string; station_id: string | null; task_id: string | null; updated_at: string; urgent_only: boolean; user_id: string; }; Insert: { can_break_lock?: boolean; can_cancel?: boolean; can_print?: boolean; can_reprint?: boolean; country_code?: string | null; created_at?: string; id?: string; station_id?: string | null; task_id?: string | null; updated_at?: string; urgent_only?: boolean; user_id: string; }; Update: { can_break_lock?: boolean; can_cancel?: boolean; can_print?: boolean; can_reprint?: boolean; country_code?: string | null; created_at?: string; id?: string; station_id?: string | null; task_id?: string | null; updated_at?: string; urgent_only?: boolean; user_id?: string; }; Relationships: [ { foreignKeyName: "pick_station_permissions_station_id_fkey"; columns: ["station_id"]; isOneToOne: false; referencedRelation: "pick_stations"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_station_permissions_task_id_fkey"; columns: ["task_id"]; isOneToOne: false; referencedRelation: "pick_station_tasks"; referencedColumns: ["id"]; } ]; }; pick_station_printers: { Row: { active: boolean; code: string | null; config: Json; connection: string | null; created_at: string; id: string; last_seen_at: string | null; location: string | null; name: string; status: string; status_message: string | null; target: string | null; updated_at: string; }; Insert: { active?: boolean; code?: string | null; config?: Json; connection?: string | null; created_at?: string; id?: string; last_seen_at?: string | null; location?: string | null; name: string; status?: string; status_message?: string | null; target?: string | null; updated_at?: string; }; Update: { active?: boolean; code?: string | null; config?: Json; connection?: string | null; created_at?: string; id?: string; last_seen_at?: string | null; location?: string | null; name?: string; status?: string; status_message?: string | null; target?: string | null; updated_at?: string; }; Relationships: []; }; pick_station_screens: { Row: { active: boolean; config: Json; created_at: string; description: string | null; filters: Json; id: string; name: string; printer_id: string | null; screen_type: string; sort_order: number; sort_rules: Json | null; station_id: string; updated_at: string; }; Insert: { active?: boolean; config?: Json; created_at?: string; description?: string | null; filters?: Json; id?: string; name: string; printer_id?: string | null; screen_type?: string; sort_order?: number; sort_rules?: Json | null; station_id: string; updated_at?: string; }; Update: { active?: boolean; config?: Json; created_at?: string; description?: string | null; filters?: Json; id?: string; name?: string; printer_id?: string | null; screen_type?: string; sort_order?: number; sort_rules?: Json | null; station_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "pick_station_screens_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "pick_station_printers"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_station_screens_station_id_fkey"; columns: ["station_id"]; isOneToOne: false; referencedRelation: "pick_stations"; referencedColumns: ["id"]; } ]; }; pick_station_tasks: { Row: { active: boolean; code: string; color: string | null; created_at: string; description: string | null; icon: string | null; id: string; name: string; sort_order: number; updated_at: string; workflow: Json; }; Insert: { active?: boolean; code: string; color?: string | null; created_at?: string; description?: string | null; icon?: string | null; id?: string; name: string; sort_order?: number; updated_at?: string; workflow?: Json; }; Update: { active?: boolean; code?: string; color?: string | null; created_at?: string; description?: string | null; icon?: string | null; id?: string; name?: string; sort_order?: number; updated_at?: string; workflow?: Json; }; Relationships: []; }; pick_station_types: { Row: { active: boolean; code: string; color: string | null; created_at: string; description: string | null; icon: string | null; id: string; name: string; sort_order: number; updated_at: string; }; Insert: { active?: boolean; code: string; color?: string | null; created_at?: string; description?: string | null; icon?: string | null; id?: string; name: string; sort_order?: number; updated_at?: string; }; Update: { active?: boolean; code?: string; color?: string | null; created_at?: string; description?: string | null; icon?: string | null; id?: string; name?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; pick_station_users: { Row: { active: boolean; created_at: string; id: string; station_id: string; user_id: string; }; Insert: { active?: boolean; created_at?: string; id?: string; station_id: string; user_id: string; }; Update: { active?: boolean; created_at?: string; id?: string; station_id?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "pick_station_users_station_id_fkey"; columns: ["station_id"]; isOneToOne: false; referencedRelation: "pick_stations"; referencedColumns: ["id"]; } ]; }; pick_stations: { Row: { active: boolean; allow_multi_screen: boolean; color: string | null; created_at: string; default_printer_id: string | null; department: string | null; description: string | null; icon: string | null; id: string; location: string | null; lock_timeout_seconds: number; name: string; require_country_selection: boolean; slug: string | null; sort_order: number; sort_rules: Json; task_id: string | null; type_id: string | null; updated_at: string; }; Insert: { active?: boolean; allow_multi_screen?: boolean; color?: string | null; created_at?: string; default_printer_id?: string | null; department?: string | null; description?: string | null; icon?: string | null; id?: string; location?: string | null; lock_timeout_seconds?: number; name: string; require_country_selection?: boolean; slug?: string | null; sort_order?: number; sort_rules?: Json; task_id?: string | null; type_id?: string | null; updated_at?: string; }; Update: { active?: boolean; allow_multi_screen?: boolean; color?: string | null; created_at?: string; default_printer_id?: string | null; department?: string | null; description?: string | null; icon?: string | null; id?: string; location?: string | null; lock_timeout_seconds?: number; name?: string; require_country_selection?: boolean; slug?: string | null; sort_order?: number; sort_rules?: Json; task_id?: string | null; type_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "pick_stations_default_printer_id_fkey"; columns: ["default_printer_id"]; isOneToOne: false; referencedRelation: "pick_station_printers"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_stations_task_id_fkey"; columns: ["task_id"]; isOneToOne: false; referencedRelation: "pick_station_tasks"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_stations_type_id_fkey"; columns: ["type_id"]; isOneToOne: false; referencedRelation: "pick_station_types"; referencedColumns: ["id"]; } ]; }; pick_sync_state: { Row: { id: boolean; last_cleanup_at: string | null; last_sync_at: string | null; updated_at: string; }; Insert: { id?: boolean; last_cleanup_at?: string | null; last_sync_at?: string | null; updated_at?: string; }; Update: { id?: boolean; last_cleanup_at?: string | null; last_sync_at?: string | null; updated_at?: string; }; Relationships: []; }; pick_task_document_types: { Row: { created_at: string; document_type_id: string; id: string; task_id: string; }; Insert: { created_at?: string; document_type_id: string; id?: string; task_id: string; }; Update: { created_at?: string; document_type_id?: string; id?: string; task_id?: string; }; Relationships: [ { foreignKeyName: "pick_task_document_types_document_type_id_fkey"; columns: ["document_type_id"]; isOneToOne: false; referencedRelation: "pick_document_types"; referencedColumns: ["id"]; }, { foreignKeyName: "pick_task_document_types_task_id_fkey"; columns: ["task_id"]; isOneToOne: false; referencedRelation: "pick_station_tasks"; referencedColumns: ["id"]; } ]; }; pickstation_print_log: { Row: { customer_name: string | null; documents: string[]; id: string; ip_address: string | null; order_id: string; order_number: string | null; printed_at: string; }; Insert: { customer_name?: string | null; documents?: string[]; id?: string; ip_address?: string | null; order_id: string; order_number?: string | null; printed_at?: string; }; Update: { customer_name?: string | null; documents?: string[]; id?: string; ip_address?: string | null; order_id?: string; order_number?: string | null; printed_at?: string; }; Relationships: []; }; pipeline_settings: { Row: { created_at: string; id: string; key: string; updated_at: string; value: string | null; }; Insert: { created_at?: string; id?: string; key: string; updated_at?: string; value?: string | null; }; Update: { created_at?: string; id?: string; key?: string; updated_at?: string; value?: string | null; }; Relationships: []; }; pipeline_stages: { Row: { automation_type: string; color: string; created_at: string; id: string; is_active: boolean; name: string; sort_order: number; updated_at: string; }; Insert: { automation_type?: string; color?: string; created_at?: string; id?: string; is_active?: boolean; name: string; sort_order?: number; updated_at?: string; }; Update: { automation_type?: string; color?: string; created_at?: string; id?: string; is_active?: boolean; name?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; planning_item_assistants: { Row: { created_at: string; created_by: string | null; monteur_id: string; planning_item_id: string; }; Insert: { created_at?: string; created_by?: string | null; monteur_id: string; planning_item_id: string; }; Update: { created_at?: string; created_by?: string | null; monteur_id?: string; planning_item_id?: string; }; Relationships: [ { foreignKeyName: "planning_item_assistants_planning_item_id_fkey"; columns: ["planning_item_id"]; isOneToOne: false; referencedRelation: "planning_items"; referencedColumns: ["id"]; }, { foreignKeyName: "planning_item_assistants_planning_item_id_fkey"; columns: ["planning_item_id"]; isOneToOne: false; referencedRelation: "planning_overview"; referencedColumns: ["id"]; } ]; }; planning_items: { Row: { assigned_monteur_id: string; created_at: string; created_by: string | null; end_at: string; id: string; notes: string | null; start_at: string; status: Database["public"]["Enums"]["planning_item_status"]; updated_at: string; werkbon_id: string; }; Insert: { assigned_monteur_id: string; created_at?: string; created_by?: string | null; end_at: string; id?: string; notes?: string | null; start_at: string; status?: Database["public"]["Enums"]["planning_item_status"]; updated_at?: string; werkbon_id: string; }; Update: { assigned_monteur_id?: string; created_at?: string; created_by?: string | null; end_at?: string; id?: string; notes?: string | null; start_at?: string; status?: Database["public"]["Enums"]["planning_item_status"]; updated_at?: string; werkbon_id?: string; }; Relationships: [ { foreignKeyName: "planning_items_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "planning_items_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; print_agents: { Row: { actief: boolean; created_at: string; gemelde_printers: Json; id: string; laatst_gezien: string | null; locatie: string; naam: string; pairing_code_hash: string | null; pairing_expires_at: string | null; pairing_used_at: string | null; token_hash: string; updated_at: string; versie: string; }; Insert: { actief?: boolean; created_at?: string; gemelde_printers?: Json; id?: string; laatst_gezien?: string | null; locatie?: string; naam: string; pairing_code_hash?: string | null; pairing_expires_at?: string | null; pairing_used_at?: string | null; token_hash: string; updated_at?: string; versie?: string; }; Update: { actief?: boolean; created_at?: string; gemelde_printers?: Json; id?: string; laatst_gezien?: string | null; locatie?: string; naam?: string; pairing_code_hash?: string | null; pairing_expires_at?: string | null; pairing_used_at?: string | null; token_hash?: string; updated_at?: string; versie?: string; }; Relationships: []; }; print_dedupe_events: { Row: { bestaande_job_id: string | null; created_at: string; detail: string | null; documentnaam: string | null; documenttype: string | null; id: string; idempotentie_sleutel: string; reden: string; }; Insert: { bestaande_job_id?: string | null; created_at?: string; detail?: string | null; documentnaam?: string | null; documenttype?: string | null; id?: string; idempotentie_sleutel: string; reden: string; }; Update: { bestaande_job_id?: string | null; created_at?: string; detail?: string | null; documentnaam?: string | null; documenttype?: string | null; id?: string; idempotentie_sleutel?: string; reden?: string; }; Relationships: []; }; print_job_logs: { Row: { created_at: string; detail: string; gebeurtenis: string; id: string; job_id: string; }; Insert: { created_at?: string; detail?: string; gebeurtenis: string; id?: string; job_id: string; }; Update: { created_at?: string; detail?: string; gebeurtenis?: string; id?: string; job_id?: string; }; Relationships: [ { foreignKeyName: "print_job_logs_job_id_fkey"; columns: ["job_id"]; isOneToOne: false; referencedRelation: "print_jobs"; referencedColumns: ["id"]; } ]; }; print_jobs: { Row: { aflever_pogingen: number; agent_id: string | null; artefact_bytes: number | null; artefact_gereed_op: string | null; artefact_pad: string | null; artefact_sha256: string | null; batch_id: string | null; bron_job_id: string | null; created_at: string; documentnaam: string; documenttype: Database["public"]["Enums"]["doc_layout_type"]; extern_job_id: string | null; fase_gestart_op: string | null; fase_voltooid_op: string | null; foutcode: string | null; foutmelding: string | null; gebruiker_id: string | null; gebruiker_naam: string; gebruikte_bron: string | null; gebruikte_layout_id: string | null; gestart_op: string | null; herkomst: string | null; id: string; idempotentie_sleutel: string | null; is_herprint: boolean; kopieen: number; layout_id: string | null; lokaal_opgeslagen_op: string | null; lokale_pdf_claim_id: string | null; lokale_pdf_claim_tot: string | null; lokale_pdf_fout: string | null; lokale_pdf_print_plek_id: string | null; lokale_pdf_status: string | null; opgepakt_op: string | null; paginas: number; payload: Json; pdf_base64: string | null; pdf_url: string | null; pogingen: number; printer_id: string | null; render_html: string | null; resultaat_pdf_base64: string | null; status: Database["public"]["Enums"]["print_job_status"]; updated_at: string; verwerkingsfase: string; volgende_poging: string | null; voltooid_op: string | null; }; Insert: { aflever_pogingen?: number; agent_id?: string | null; artefact_bytes?: number | null; artefact_gereed_op?: string | null; artefact_pad?: string | null; artefact_sha256?: string | null; batch_id?: string | null; bron_job_id?: string | null; created_at?: string; documentnaam?: string; documenttype?: Database["public"]["Enums"]["doc_layout_type"]; extern_job_id?: string | null; fase_gestart_op?: string | null; fase_voltooid_op?: string | null; foutcode?: string | null; foutmelding?: string | null; gebruiker_id?: string | null; gebruiker_naam?: string; gebruikte_bron?: string | null; gebruikte_layout_id?: string | null; gestart_op?: string | null; herkomst?: string | null; id?: string; idempotentie_sleutel?: string | null; is_herprint?: boolean; kopieen?: number; layout_id?: string | null; lokaal_opgeslagen_op?: string | null; lokale_pdf_claim_id?: string | null; lokale_pdf_claim_tot?: string | null; lokale_pdf_fout?: string | null; lokale_pdf_print_plek_id?: string | null; lokale_pdf_status?: string | null; opgepakt_op?: string | null; paginas?: number; payload?: Json; pdf_base64?: string | null; pdf_url?: string | null; pogingen?: number; printer_id?: string | null; render_html?: string | null; resultaat_pdf_base64?: string | null; status?: Database["public"]["Enums"]["print_job_status"]; updated_at?: string; verwerkingsfase?: string; volgende_poging?: string | null; voltooid_op?: string | null; }; Update: { aflever_pogingen?: number; agent_id?: string | null; artefact_bytes?: number | null; artefact_gereed_op?: string | null; artefact_pad?: string | null; artefact_sha256?: string | null; batch_id?: string | null; bron_job_id?: string | null; created_at?: string; documentnaam?: string; documenttype?: Database["public"]["Enums"]["doc_layout_type"]; extern_job_id?: string | null; fase_gestart_op?: string | null; fase_voltooid_op?: string | null; foutcode?: string | null; foutmelding?: string | null; gebruiker_id?: string | null; gebruiker_naam?: string; gebruikte_bron?: string | null; gebruikte_layout_id?: string | null; gestart_op?: string | null; herkomst?: string | null; id?: string; idempotentie_sleutel?: string | null; is_herprint?: boolean; kopieen?: number; layout_id?: string | null; lokaal_opgeslagen_op?: string | null; lokale_pdf_claim_id?: string | null; lokale_pdf_claim_tot?: string | null; lokale_pdf_fout?: string | null; lokale_pdf_print_plek_id?: string | null; lokale_pdf_status?: string | null; opgepakt_op?: string | null; paginas?: number; payload?: Json; pdf_base64?: string | null; pdf_url?: string | null; pogingen?: number; printer_id?: string | null; render_html?: string | null; resultaat_pdf_base64?: string | null; status?: Database["public"]["Enums"]["print_job_status"]; updated_at?: string; verwerkingsfase?: string; volgende_poging?: string | null; voltooid_op?: string | null; }; Relationships: [ { foreignKeyName: "print_jobs_agent_id_fkey"; columns: ["agent_id"]; isOneToOne: false; referencedRelation: "print_agents"; referencedColumns: ["id"]; }, { foreignKeyName: "print_jobs_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; }, { foreignKeyName: "print_jobs_lokale_pdf_print_plek_id_fkey"; columns: ["lokale_pdf_print_plek_id"]; isOneToOne: false; referencedRelation: "print_plekken"; referencedColumns: ["id"]; }, { foreignKeyName: "print_jobs_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "printers"; referencedColumns: ["id"]; } ]; }; print_plek_computers: { Row: { computer_naam: string; created_at: string; id: string; print_plek_id: string; updated_at: string; }; Insert: { computer_naam: string; created_at?: string; id?: string; print_plek_id: string; updated_at?: string; }; Update: { computer_naam?: string; created_at?: string; id?: string; print_plek_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "print_plek_computers_print_plek_id_fkey"; columns: ["print_plek_id"]; isOneToOne: false; referencedRelation: "print_plekken"; referencedColumns: ["id"]; } ]; }; print_plek_koppelingen: { Row: { bron: string; bron_id: string; created_at: string; id: string; label: string | null; print_plek_id: string; updated_at: string; }; Insert: { bron: string; bron_id: string; created_at?: string; id?: string; label?: string | null; print_plek_id: string; updated_at?: string; }; Update: { bron?: string; bron_id?: string; created_at?: string; id?: string; label?: string | null; print_plek_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "print_plek_koppelingen_print_plek_id_fkey"; columns: ["print_plek_id"]; isOneToOne: false; referencedRelation: "print_plekken"; referencedColumns: ["id"]; } ]; }; print_plekken: { Row: { actief: boolean; created_at: string; id: string; naam: string; omschrijving: string | null; updated_at: string; }; Insert: { actief?: boolean; created_at?: string; id?: string; naam: string; omschrijving?: string | null; updated_at?: string; }; Update: { actief?: boolean; created_at?: string; id?: string; naam?: string; omschrijving?: string | null; updated_at?: string; }; Relationships: []; }; print_preview_events: { Row: { code: string | null; created_at: string; detail: Json; id: string; queue_item_id: string | null; reden: string | null; station_slug: string | null; uitkomst: string; }; Insert: { code?: string | null; created_at?: string; detail?: Json; id?: string; queue_item_id?: string | null; reden?: string | null; station_slug?: string | null; uitkomst?: string; }; Update: { code?: string | null; created_at?: string; detail?: Json; id?: string; queue_item_id?: string | null; reden?: string | null; station_slug?: string | null; uitkomst?: string; }; Relationships: []; }; print_queue_leases: { Row: { created_at: string; houder: string; naam: string; updated_at: string; verloopt_op: string; }; Insert: { created_at?: string; houder: string; naam: string; updated_at?: string; verloopt_op: string; }; Update: { created_at?: string; houder?: string; naam?: string; updated_at?: string; verloopt_op?: string; }; Relationships: []; }; print_queue_runners: { Row: { actief: boolean; basis_url: string; created_at: string; id: string; laatst_gezien: string; laatste_fout: string | null; laatste_request_id: number | null; laatste_wakeup: string | null; mislukte_posts: number; mislukte_wakeups: number; tick_sleutel: string; updated_at: string; }; Insert: { actief?: boolean; basis_url: string; created_at?: string; id?: string; laatst_gezien?: string; laatste_fout?: string | null; laatste_request_id?: number | null; laatste_wakeup?: string | null; mislukte_posts?: number; mislukte_wakeups?: number; tick_sleutel?: string; updated_at?: string; }; Update: { actief?: boolean; basis_url?: string; created_at?: string; id?: string; laatst_gezien?: string; laatste_fout?: string | null; laatste_request_id?: number | null; laatste_wakeup?: string | null; mislukte_posts?: number; mislukte_wakeups?: number; tick_sleutel?: string; updated_at?: string; }; Relationships: []; }; print_queue_settings: { Row: { bewaar_bestanden_dagen: number; bewaar_opdrachten_dagen: number; created_at: string; dubbel_venster_minuten: number; id: string; updated_at: string; }; Insert: { bewaar_bestanden_dagen?: number; bewaar_opdrachten_dagen?: number; created_at?: string; dubbel_venster_minuten?: number; id?: string; updated_at?: string; }; Update: { bewaar_bestanden_dagen?: number; bewaar_opdrachten_dagen?: number; created_at?: string; dubbel_venster_minuten?: number; id?: string; updated_at?: string; }; Relationships: []; }; print_rules: { Row: { actief: boolean; alleen_eerste_keer: boolean; conditie: Json; created_at: string; id: string; kopieen: number; layout_id: string; naam: string; printer_id: string | null; updated_at: string; volgorde: number; }; Insert: { actief?: boolean; alleen_eerste_keer?: boolean; conditie?: Json; created_at?: string; id?: string; kopieen?: number; layout_id: string; naam?: string; printer_id?: string | null; updated_at?: string; volgorde?: number; }; Update: { actief?: boolean; alleen_eerste_keer?: boolean; conditie?: Json; created_at?: string; id?: string; kopieen?: number; layout_id?: string; naam?: string; printer_id?: string | null; updated_at?: string; volgorde?: number; }; Relationships: [ { foreignKeyName: "print_rules_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; }, { foreignKeyName: "print_rules_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "printers"; referencedColumns: ["id"]; } ]; }; printer_mappings: { Row: { created_at: string; id: string; layout_id: string; printer_id: string; prioriteit: number; updated_at: string; }; Insert: { created_at?: string; id?: string; layout_id: string; printer_id: string; prioriteit?: number; updated_at?: string; }; Update: { created_at?: string; id?: string; layout_id?: string; printer_id?: string; prioriteit?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "printer_mappings_layout_id_fkey"; columns: ["layout_id"]; isOneToOne: false; referencedRelation: "document_layouts"; referencedColumns: ["id"]; }, { foreignKeyName: "printer_mappings_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "printers"; referencedColumns: ["id"]; } ]; }; printer_profiles: { Row: { auto_schalen: boolean; created_at: string; duplex: boolean; id: string; is_standaard: boolean; kleur: boolean; kopieen: number; label_gap: number; naam: string; orientatie: Database["public"]["Enums"]["doc_orientation"]; papierlade: string; printer_id: string; resolutie: number; snijden: boolean; updated_at: string; }; Insert: { auto_schalen?: boolean; created_at?: string; duplex?: boolean; id?: string; is_standaard?: boolean; kleur?: boolean; kopieen?: number; label_gap?: number; naam?: string; orientatie?: Database["public"]["Enums"]["doc_orientation"]; papierlade?: string; printer_id: string; resolutie?: number; snijden?: boolean; updated_at?: string; }; Update: { auto_schalen?: boolean; created_at?: string; duplex?: boolean; id?: string; is_standaard?: boolean; kleur?: boolean; kopieen?: number; label_gap?: number; naam?: string; orientatie?: Database["public"]["Enums"]["doc_orientation"]; papierlade?: string; printer_id?: string; resolutie?: number; snijden?: boolean; updated_at?: string; }; Relationships: [ { foreignKeyName: "printer_profiles_printer_id_fkey"; columns: ["printer_id"]; isOneToOne: false; referencedRelation: "printers"; referencedColumns: ["id"]; } ]; }; printers: { Row: { actief: boolean; afdrukmethode: string; agent_id: string | null; created_at: string; driver: string; extern_printer_id: string | null; formaten_bijgewerkt_op: string | null; id: string; ip_adres: string | null; laatst_gezien: string | null; locatie: string; merk: string; naam: string; omschrijving: string; ondersteunde_formaten: Json | null; ondersteunde_laden: Json | null; online: boolean; papierformaat: string; pdf_map: string | null; poort: number | null; soort: Database["public"]["Enums"]["printer_kind"]; systeemnaam: string; updated_at: string; verbinding: Database["public"]["Enums"]["printer_connection"]; }; Insert: { actief?: boolean; afdrukmethode?: string; agent_id?: string | null; created_at?: string; driver?: string; extern_printer_id?: string | null; formaten_bijgewerkt_op?: string | null; id?: string; ip_adres?: string | null; laatst_gezien?: string | null; locatie?: string; merk?: string; naam: string; omschrijving?: string; ondersteunde_formaten?: Json | null; ondersteunde_laden?: Json | null; online?: boolean; papierformaat?: string; pdf_map?: string | null; poort?: number | null; soort?: Database["public"]["Enums"]["printer_kind"]; systeemnaam?: string; updated_at?: string; verbinding?: Database["public"]["Enums"]["printer_connection"]; }; Update: { actief?: boolean; afdrukmethode?: string; agent_id?: string | null; created_at?: string; driver?: string; extern_printer_id?: string | null; formaten_bijgewerkt_op?: string | null; id?: string; ip_adres?: string | null; laatst_gezien?: string | null; locatie?: string; merk?: string; naam?: string; omschrijving?: string; ondersteunde_formaten?: Json | null; ondersteunde_laden?: Json | null; online?: boolean; papierformaat?: string; pdf_map?: string | null; poort?: number | null; soort?: Database["public"]["Enums"]["printer_kind"]; systeemnaam?: string; updated_at?: string; verbinding?: Database["public"]["Enums"]["printer_connection"]; }; Relationships: [ { foreignKeyName: "printers_agent_id_fkey"; columns: ["agent_id"]; isOneToOne: false; referencedRelation: "print_agents"; referencedColumns: ["id"]; } ]; }; product_bom_external_items: { Row: { created_at: string; id: string; name: string; packing_configuration_id: string | null; parent_product_id: string | null; parent_trade_item_floriday_id: string | null; quantity: number; sort_order: number; tenant_id: string; unit: string; updated_at: string; }; Insert: { created_at?: string; id?: string; name: string; packing_configuration_id?: string | null; parent_product_id?: string | null; parent_trade_item_floriday_id?: string | null; quantity?: number; sort_order?: number; tenant_id: string; unit?: string; updated_at?: string; }; Update: { created_at?: string; id?: string; name?: string; packing_configuration_id?: string | null; parent_product_id?: string | null; parent_trade_item_floriday_id?: string | null; quantity?: number; sort_order?: number; tenant_id?: string; unit?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "product_bom_external_items_parent_product_id_fkey"; columns: ["parent_product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "product_bom_external_items_parent_product_id_fkey"; columns: ["parent_product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; product_bom_items: { Row: { component_product_id: string | null; component_trade_item_floriday_id: string | null; created_at: string; id: string; notes: string | null; packing_configuration_id: string | null; parent_product_id: string | null; parent_trade_item_floriday_id: string | null; quantity: number; sort_order: number; tenant_id: string; unit: string; updated_at: string; }; Insert: { component_product_id?: string | null; component_trade_item_floriday_id?: string | null; created_at?: string; id?: string; notes?: string | null; packing_configuration_id?: string | null; parent_product_id?: string | null; parent_trade_item_floriday_id?: string | null; quantity?: number; sort_order?: number; tenant_id: string; unit?: string; updated_at?: string; }; Update: { component_product_id?: string | null; component_trade_item_floriday_id?: string | null; created_at?: string; id?: string; notes?: string | null; packing_configuration_id?: string | null; parent_product_id?: string | null; parent_trade_item_floriday_id?: string | null; quantity?: number; sort_order?: number; tenant_id?: string; unit?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "product_bom_items_component_product_id_fkey"; columns: ["component_product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "product_bom_items_component_product_id_fkey"; columns: ["component_product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; }, { foreignKeyName: "product_bom_items_parent_product_id_fkey"; columns: ["parent_product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "product_bom_items_parent_product_id_fkey"; columns: ["parent_product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; product_categories: { Row: { color: string; created_at: string; icon: string | null; id: string; name: string; slug: string; sort_order: number; updated_at: string; }; Insert: { color?: string; created_at?: string; icon?: string | null; id?: string; name: string; slug: string; sort_order?: number; updated_at?: string; }; Update: { color?: string; created_at?: string; icon?: string | null; id?: string; name?: string; slug?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; product_field_options: { Row: { created_at: string; field_setting_id: string; id: string; label: string; sort_order: number; }; Insert: { created_at?: string; field_setting_id: string; id?: string; label: string; sort_order?: number; }; Update: { created_at?: string; field_setting_id?: string; id?: string; label?: string; sort_order?: number; }; Relationships: [ { foreignKeyName: "product_field_options_field_setting_id_fkey"; columns: ["field_setting_id"]; isOneToOne: false; referencedRelation: "product_field_settings"; referencedColumns: ["id"]; } ]; }; product_field_settings: { Row: { active_per_category: Json; created_at: string; field_key: string; field_label: string; field_type: string; id: string; is_custom: boolean; sort_order: number; updated_at: string; }; Insert: { active_per_category?: Json; created_at?: string; field_key: string; field_label: string; field_type?: string; id?: string; is_custom?: boolean; sort_order?: number; updated_at?: string; }; Update: { active_per_category?: Json; created_at?: string; field_key?: string; field_label?: string; field_type?: string; id?: string; is_custom?: boolean; sort_order?: number; updated_at?: string; }; Relationships: []; }; product_group_items: { Row: { created_at: string; id: string; product_group_id: string; quantity: number; sort_order: number; trade_item_id: string; }; Insert: { created_at?: string; id?: string; product_group_id: string; quantity?: number; sort_order?: number; trade_item_id: string; }; Update: { created_at?: string; id?: string; product_group_id?: string; quantity?: number; sort_order?: number; trade_item_id?: string; }; Relationships: [ { foreignKeyName: "product_group_items_product_group_id_fkey"; columns: ["product_group_id"]; isOneToOne: false; referencedRelation: "product_groups"; referencedColumns: ["id"]; } ]; }; product_groups: { Row: { created_at: string; description: string | null; head_product_id: string | null; head_trade_item_floriday_id: string | null; id: string; is_active: boolean; name: string; tenant_id: string; updated_at: string; }; Insert: { created_at?: string; description?: string | null; head_product_id?: string | null; head_trade_item_floriday_id?: string | null; id?: string; is_active?: boolean; name: string; tenant_id: string; updated_at?: string; }; Update: { created_at?: string; description?: string | null; head_product_id?: string | null; head_trade_item_floriday_id?: string | null; id?: string; is_active?: boolean; name?: string; tenant_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "product_groups_head_product_id_fkey"; columns: ["head_product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "product_groups_head_product_id_fkey"; columns: ["head_product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; product_load_settings: { Row: { created_at: string; id: string; is_package: boolean; label: string | null; layers_per_load_carrier: number | null; load_carrier: string | null; package_id: string | null; package_label: string | null; packages_per_layer: number | null; packing_configuration_id: string; product_id: string | null; tenant_id: string; trade_item_floriday_id: string | null; units_per_package: number | null; updated_at: string; }; Insert: { created_at?: string; id?: string; is_package?: boolean; label?: string | null; layers_per_load_carrier?: number | null; load_carrier?: string | null; package_id?: string | null; package_label?: string | null; packages_per_layer?: number | null; packing_configuration_id?: string; product_id?: string | null; tenant_id: string; trade_item_floriday_id?: string | null; units_per_package?: number | null; updated_at?: string; }; Update: { created_at?: string; id?: string; is_package?: boolean; label?: string | null; layers_per_load_carrier?: number | null; load_carrier?: string | null; package_id?: string | null; package_label?: string | null; packages_per_layer?: number | null; packing_configuration_id?: string; product_id?: string | null; tenant_id?: string; trade_item_floriday_id?: string | null; units_per_package?: number | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "product_load_settings_package_id_fkey"; columns: ["package_id"]; isOneToOne: false; referencedRelation: "packages"; referencedColumns: ["id"]; }, { foreignKeyName: "product_load_settings_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "product_load_settings_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; } ]; }; product_merge_log: { Row: { canonical_product_id: string | null; id: string; merged_at: string; merged_from_id: string; notes: string | null; snapshot: Json; source_table: string; status: string; }; Insert: { canonical_product_id?: string | null; id?: string; merged_at?: string; merged_from_id: string; notes?: string | null; snapshot?: Json; source_table: string; status?: string; }; Update: { canonical_product_id?: string | null; id?: string; merged_at?: string; merged_from_id?: string; notes?: string | null; snapshot?: Json; source_table?: string; status?: string; }; Relationships: []; }; products: { Row: { article_number: string | null; barcode: string | null; batch: string; crates_per_layer: number; created_at: string; custom_fields: Json; floriday_trade_item_id: string | null; fust_type_id: string | null; id: string; image_url: string | null; incoming_quantity: number; is_layer: boolean; layers_per_cart: number; location: string; min_quantity: number; plant_height_cm: number | null; plants_per_crate: number; product: string; product_type: string; purchase_price: number | null; quantity: number; sale_price: number | null; trade_item_key: string | null; unit: string; updated_at: string; weight: string | null; }; Insert: { article_number?: string | null; barcode?: string | null; batch: string; crates_per_layer?: number; created_at?: string; custom_fields?: Json; floriday_trade_item_id?: string | null; fust_type_id?: string | null; id?: string; image_url?: string | null; incoming_quantity?: number; is_layer?: boolean; layers_per_cart?: number; location: string; min_quantity?: number; plant_height_cm?: number | null; plants_per_crate?: number; product: string; product_type?: string; purchase_price?: number | null; quantity?: number; sale_price?: number | null; trade_item_key?: string | null; unit?: string; updated_at?: string; weight?: string | null; }; Update: { article_number?: string | null; barcode?: string | null; batch?: string; crates_per_layer?: number; created_at?: string; custom_fields?: Json; floriday_trade_item_id?: string | null; fust_type_id?: string | null; id?: string; image_url?: string | null; incoming_quantity?: number; is_layer?: boolean; layers_per_cart?: number; location?: string; min_quantity?: number; plant_height_cm?: number | null; plants_per_crate?: number; product?: string; product_type?: string; purchase_price?: number | null; quantity?: number; sale_price?: number | null; trade_item_key?: string | null; unit?: string; updated_at?: string; weight?: string | null; }; Relationships: [ { foreignKeyName: "products_fust_type_id_fkey"; columns: ["fust_type_id"]; isOneToOne: false; referencedRelation: "fust_types"; referencedColumns: ["id"]; } ]; }; profile_modules: { Row: { created_at: string; id: string; module_id: string; profile_id: string; }; Insert: { created_at?: string; id?: string; module_id: string; profile_id: string; }; Update: { created_at?: string; id?: string; module_id?: string; profile_id?: string; }; Relationships: [ { foreignKeyName: "profile_modules_profile_id_fkey"; columns: ["profile_id"]; isOneToOne: false; referencedRelation: "profiles_org"; referencedColumns: ["id"]; } ]; }; profile_roles: { Row: { created_at: string; id: string; profile_id: string; role_id: string; }; Insert: { created_at?: string; id?: string; profile_id: string; role_id: string; }; Update: { created_at?: string; id?: string; profile_id?: string; role_id?: string; }; Relationships: [ { foreignKeyName: "profile_roles_profile_id_fkey"; columns: ["profile_id"]; isOneToOne: false; referencedRelation: "profiles_org"; referencedColumns: ["id"]; }, { foreignKeyName: "profile_roles_role_id_fkey"; columns: ["role_id"]; isOneToOne: false; referencedRelation: "roles"; referencedColumns: ["id"]; } ]; }; profiles: { Row: { address: string | null; avatar_url: string | null; created_at: string; display_name: string | null; email: string | null; id: string; is_superadmin: boolean; notification_preferences: Json; tenant_id: string | null; updated_at: string; }; Insert: { address?: string | null; avatar_url?: string | null; created_at?: string; display_name?: string | null; email?: string | null; id: string; is_superadmin?: boolean; notification_preferences?: Json; tenant_id?: string | null; updated_at?: string; }; Update: { address?: string | null; avatar_url?: string | null; created_at?: string; display_name?: string | null; email?: string | null; id?: string; is_superadmin?: boolean; notification_preferences?: Json; tenant_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "profiles_tenant_id_fkey"; columns: ["tenant_id"]; isOneToOne: false; referencedRelation: "tenants"; referencedColumns: ["id"]; } ]; }; profiles_org: { Row: { created_at: string; id: string; is_default: boolean; name: string; tenant_id: string | null; updated_at: string; }; Insert: { created_at?: string; id?: string; is_default?: boolean; name: string; tenant_id?: string | null; updated_at?: string; }; Update: { created_at?: string; id?: string; is_default?: boolean; name?: string; tenant_id?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "profiles_org_tenant_id_fkey"; columns: ["tenant_id"]; isOneToOne: false; referencedRelation: "tenants"; referencedColumns: ["id"]; } ]; }; projects: { Row: { contact_name: string | null; created_at: string; email: string | null; id: string; name: string; notes: string | null; order_value: number; package_id: string | null; package_name: string | null; phone: string | null; prospect_id: string | null; status: string; updated_at: string; }; Insert: { contact_name?: string | null; created_at?: string; email?: string | null; id?: string; name: string; notes?: string | null; order_value?: number; package_id?: string | null; package_name?: string | null; phone?: string | null; prospect_id?: string | null; status?: string; updated_at?: string; }; Update: { contact_name?: string | null; created_at?: string; email?: string | null; id?: string; name?: string; notes?: string | null; order_value?: number; package_id?: string | null; package_name?: string | null; phone?: string | null; prospect_id?: string | null; status?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "projects_package_id_fkey"; columns: ["package_id"]; isOneToOne: false; referencedRelation: "packages"; referencedColumns: ["id"]; }, { foreignKeyName: "projects_prospect_id_fkey"; columns: ["prospect_id"]; isOneToOne: false; referencedRelation: "prospects"; referencedColumns: ["id"]; } ]; }; prospect_field_settings: { Row: { created_at: string; field_key: string; field_type: string; id: string; label: string; required: boolean; sort_order: number; updated_at: string; visible: boolean; }; Insert: { created_at?: string; field_key: string; field_type?: string; id?: string; label: string; required?: boolean; sort_order?: number; updated_at?: string; visible?: boolean; }; Update: { created_at?: string; field_key?: string; field_type?: string; id?: string; label?: string; required?: boolean; sort_order?: number; updated_at?: string; visible?: boolean; }; Relationships: []; }; prospects: { Row: { address: string | null; company_name: string; contact_name: string | null; created_at: string; email: string | null; id: string; industry: string | null; notes: string | null; order_value: number; package_id: string | null; phone: string | null; source: string | null; stage_id: string | null; status: string; updated_at: string; value_mode: string; website: string | null; }; Insert: { address?: string | null; company_name: string; contact_name?: string | null; created_at?: string; email?: string | null; id?: string; industry?: string | null; notes?: string | null; order_value?: number; package_id?: string | null; phone?: string | null; source?: string | null; stage_id?: string | null; status?: string; updated_at?: string; value_mode?: string; website?: string | null; }; Update: { address?: string | null; company_name?: string; contact_name?: string | null; created_at?: string; email?: string | null; id?: string; industry?: string | null; notes?: string | null; order_value?: number; package_id?: string | null; phone?: string | null; source?: string | null; stage_id?: string | null; status?: string; updated_at?: string; value_mode?: string; website?: string | null; }; Relationships: [ { foreignKeyName: "prospects_package_id_fkey"; columns: ["package_id"]; isOneToOne: false; referencedRelation: "packages"; referencedColumns: ["id"]; }, { foreignKeyName: "prospects_stage_id_fkey"; columns: ["stage_id"]; isOneToOne: false; referencedRelation: "pipeline_stages"; referencedColumns: ["id"]; } ]; }; purchase_order_items: { Row: { created_at: string; id: string; product_id: string | null; product_type: string; purchase_order_id: string; quantity: number; }; Insert: { created_at?: string; id?: string; product_id?: string | null; product_type?: string; purchase_order_id: string; quantity?: number; }; Update: { created_at?: string; id?: string; product_id?: string | null; product_type?: string; purchase_order_id?: string; quantity?: number; }; Relationships: [ { foreignKeyName: "purchase_order_items_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "logistics_product_dimensions"; referencedColumns: ["product_id"]; }, { foreignKeyName: "purchase_order_items_product_id_fkey"; columns: ["product_id"]; isOneToOne: false; referencedRelation: "products"; referencedColumns: ["id"]; }, { foreignKeyName: "purchase_order_items_purchase_order_id_fkey"; columns: ["purchase_order_id"]; isOneToOne: false; referencedRelation: "purchase_orders"; referencedColumns: ["id"]; } ]; }; purchase_orders: { Row: { created_at: string; expected_delivery_date: string; id: string; location_id: string | null; notes: string | null; order_number: string; status: string; supplier_id: string | null; supplier_name: string; updated_at: string; }; Insert: { created_at?: string; expected_delivery_date: string; id?: string; location_id?: string | null; notes?: string | null; order_number: string; status?: string; supplier_id?: string | null; supplier_name?: string; updated_at?: string; }; Update: { created_at?: string; expected_delivery_date?: string; id?: string; location_id?: string | null; notes?: string | null; order_number?: string; status?: string; supplier_id?: string | null; supplier_name?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "purchase_orders_location_id_fkey"; columns: ["location_id"]; isOneToOne: false; referencedRelation: "locations"; referencedColumns: ["id"]; }, { foreignKeyName: "purchase_orders_supplier_id_fkey"; columns: ["supplier_id"]; isOneToOne: false; referencedRelation: "suppliers"; referencedColumns: ["id"]; } ]; }; reception_notifications: { Row: { booking_id: string | null; created_at: string; id: string; is_read: boolean; message: string; recipient_email: string | null; title: string; type: string; }; Insert: { booking_id?: string | null; created_at?: string; id?: string; is_read?: boolean; message: string; recipient_email?: string | null; title: string; type: string; }; Update: { booking_id?: string | null; created_at?: string; id?: string; is_read?: boolean; message?: string; recipient_email?: string | null; title?: string; type?: string; }; Relationships: [ { foreignKeyName: "reception_notifications_booking_id_fkey"; columns: ["booking_id"]; isOneToOne: false; referencedRelation: "bookings"; referencedColumns: ["id"]; } ]; }; role_assignments: { Row: { created_at: string; id: string; role_id: string; user_id: string; }; Insert: { created_at?: string; id?: string; role_id: string; user_id: string; }; Update: { created_at?: string; id?: string; role_id?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "role_assignments_role_id_fkey"; columns: ["role_id"]; isOneToOne: false; referencedRelation: "roles"; referencedColumns: ["id"]; } ]; }; role_permissions: { Row: { can_edit: boolean; can_view: boolean; feature_id: string; id: string; module_id: string; role_id: string; updated_at: string; }; Insert: { can_edit?: boolean; can_view?: boolean; feature_id?: string; id?: string; module_id: string; role_id: string; updated_at?: string; }; Update: { can_edit?: boolean; can_view?: boolean; feature_id?: string; id?: string; module_id?: string; role_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "role_permissions_role_id_fkey"; columns: ["role_id"]; isOneToOne: false; referencedRelation: "roles"; referencedColumns: ["id"]; } ]; }; roles: { Row: { created_at: string; id: string; is_protected: boolean; key: string; name: string; updated_at: string; }; Insert: { created_at?: string; id?: string; is_protected?: boolean; key: string; name: string; updated_at?: string; }; Update: { created_at?: string; id?: string; is_protected?: boolean; key?: string; name?: string; updated_at?: string; }; Relationships: []; }; rooms: { Row: { capacity: number; color_code: string | null; created_at: string; description: string | null; hourly_rate: number; id: string; image_url: string | null; is_active: boolean; name: string; }; Insert: { capacity?: number; color_code?: string | null; created_at?: string; description?: string | null; hourly_rate?: number; id?: string; image_url?: string | null; is_active?: boolean; name: string; }; Update: { capacity?: number; color_code?: string | null; created_at?: string; description?: string | null; hourly_rate?: number; id?: string; image_url?: string | null; is_active?: boolean; name?: string; }; Relationships: []; }; scan_kar_items: { Row: { barcode: string; id: string; kar_id: string; pakbon_id: string; pakbon_item_id: string; product_id: string | null; product_name: string; quantity: number; scanned_at: string; scanned_by: string | null; }; Insert: { barcode: string; id?: string; kar_id: string; pakbon_id: string; pakbon_item_id: string; product_id?: string | null; product_name: string; quantity?: number; scanned_at?: string; scanned_by?: string | null; }; Update: { barcode?: string; id?: string; kar_id?: string; pakbon_id?: string; pakbon_item_id?: string; product_id?: string | null; product_name?: string; quantity?: number; scanned_at?: string; scanned_by?: string | null; }; Relationships: [ { foreignKeyName: "scan_kar_items_kar_id_fkey"; columns: ["kar_id"]; isOneToOne: false; referencedRelation: "scan_karren"; referencedColumns: ["id"]; }, { foreignKeyName: "scan_kar_items_pakbon_id_fkey"; columns: ["pakbon_id"]; isOneToOne: false; referencedRelation: "scan_pakbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "scan_kar_items_pakbon_item_id_fkey"; columns: ["pakbon_item_id"]; isOneToOne: false; referencedRelation: "scan_pakbon_items"; referencedColumns: ["id"]; } ]; }; scan_kar_pakbonnen: { Row: { created_at: string; id: string; kar_id: string; pakbon_id: string; }; Insert: { created_at?: string; id?: string; kar_id: string; pakbon_id: string; }; Update: { created_at?: string; id?: string; kar_id?: string; pakbon_id?: string; }; Relationships: [ { foreignKeyName: "scan_kar_pakbonnen_kar_id_fkey"; columns: ["kar_id"]; isOneToOne: false; referencedRelation: "scan_karren"; referencedColumns: ["id"]; }, { foreignKeyName: "scan_kar_pakbonnen_pakbon_id_fkey"; columns: ["pakbon_id"]; isOneToOne: false; referencedRelation: "scan_pakbonnen"; referencedColumns: ["id"]; } ]; }; scan_kar_sessie_regels: { Row: { barcode: string; cart_id: string | null; created_at: string; id: string; order_id: string | null; order_number: string | null; regels: Json; sessie_id: string; volledig: boolean; }; Insert: { barcode: string; cart_id?: string | null; created_at?: string; id?: string; order_id?: string | null; order_number?: string | null; regels?: Json; sessie_id: string; volledig?: boolean; }; Update: { barcode?: string; cart_id?: string | null; created_at?: string; id?: string; order_id?: string | null; order_number?: string | null; regels?: Json; sessie_id?: string; volledig?: boolean; }; Relationships: [ { foreignKeyName: "scan_kar_sessie_regels_sessie_id_fkey"; columns: ["sessie_id"]; isOneToOne: false; referencedRelation: "scan_kar_sessies"; referencedColumns: ["id"]; } ]; }; scan_kar_sessies: { Row: { afgerond_op: string | null; cart_id: string | null; cart_index: number | null; cart_total: number | null; created_at: string; id: string; klant_naam: string | null; medewerker_naam: string | null; order_id: string | null; order_number: string | null; scanner_id: string | null; status: string; updated_at: string; }; Insert: { afgerond_op?: string | null; cart_id?: string | null; cart_index?: number | null; cart_total?: number | null; created_at?: string; id?: string; klant_naam?: string | null; medewerker_naam?: string | null; order_id?: string | null; order_number?: string | null; scanner_id?: string | null; status?: string; updated_at?: string; }; Update: { afgerond_op?: string | null; cart_id?: string | null; cart_index?: number | null; cart_total?: number | null; created_at?: string; id?: string; klant_naam?: string | null; medewerker_naam?: string | null; order_id?: string | null; order_number?: string | null; scanner_id?: string | null; status?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "scan_kar_sessies_scanner_id_fkey"; columns: ["scanner_id"]; isOneToOne: false; referencedRelation: "scan_scanners"; referencedColumns: ["id"]; } ]; }; scan_karren: { Row: { afgerond_op: string | null; buffer_key: string | null; created_at: string; customer_names: string[]; device_id: string | null; geprint: boolean; geprint_op: string | null; id: string; kar_nummer: string; medewerker_id: string | null; medewerker_naam: string | null; naar_pickstation: boolean; naar_pickstation_op: string | null; order_number: string | null; scanner_id: string | null; scanner_key: string; status: string; totaal_producten: number; updated_at: string; }; Insert: { afgerond_op?: string | null; buffer_key?: string | null; created_at?: string; customer_names?: string[]; device_id?: string | null; geprint?: boolean; geprint_op?: string | null; id?: string; kar_nummer?: string; medewerker_id?: string | null; medewerker_naam?: string | null; naar_pickstation?: boolean; naar_pickstation_op?: string | null; order_number?: string | null; scanner_id?: string | null; scanner_key?: string; status?: string; totaal_producten?: number; updated_at?: string; }; Update: { afgerond_op?: string | null; buffer_key?: string | null; created_at?: string; customer_names?: string[]; device_id?: string | null; geprint?: boolean; geprint_op?: string | null; id?: string; kar_nummer?: string; medewerker_id?: string | null; medewerker_naam?: string | null; naar_pickstation?: boolean; naar_pickstation_op?: string | null; order_number?: string | null; scanner_id?: string | null; scanner_key?: string; status?: string; totaal_producten?: number; updated_at?: string; }; Relationships: []; }; scan_logs: { Row: { code: string; created_at: string; device_id: string | null; id: string; kar_id: string | null; latency_ms: number | null; medewerker_naam: string | null; message: string | null; result: string; retry_count: number; scanner_key: string; session_id: string | null; user_id: string | null; }; Insert: { code: string; created_at?: string; device_id?: string | null; id?: string; kar_id?: string | null; latency_ms?: number | null; medewerker_naam?: string | null; message?: string | null; result: string; retry_count?: number; scanner_key?: string; session_id?: string | null; user_id?: string | null; }; Update: { code?: string; created_at?: string; device_id?: string | null; id?: string; kar_id?: string | null; latency_ms?: number | null; medewerker_naam?: string | null; message?: string | null; result?: string; retry_count?: number; scanner_key?: string; session_id?: string | null; user_id?: string | null; }; Relationships: []; }; scan_pakbon_items: { Row: { barcode: string; created_at: string; id: string; pakbon_id: string; product_id: string | null; product_name: string; quantity: number; scanned_quantity: number; }; Insert: { barcode: string; created_at?: string; id?: string; pakbon_id: string; product_id?: string | null; product_name: string; quantity?: number; scanned_quantity?: number; }; Update: { barcode?: string; created_at?: string; id?: string; pakbon_id?: string; product_id?: string | null; product_name?: string; quantity?: number; scanned_quantity?: number; }; Relationships: [ { foreignKeyName: "scan_pakbon_items_pakbon_id_fkey"; columns: ["pakbon_id"]; isOneToOne: false; referencedRelation: "scan_pakbonnen"; referencedColumns: ["id"]; } ]; }; scan_pakbonnen: { Row: { barcode: string; buffer_key: string | null; created_at: string; customer_name: string; id: string; order_id: string | null; order_number: string; pakbon_nummer: string; printed_at: string; status: string; updated_at: string; vergrendeld_door: string | null; vergrendeld_sessie: string | null; vergrendeld_tot: string | null; }; Insert: { barcode: string; buffer_key?: string | null; created_at?: string; customer_name: string; id?: string; order_id?: string | null; order_number: string; pakbon_nummer: string; printed_at?: string; status?: string; updated_at?: string; vergrendeld_door?: string | null; vergrendeld_sessie?: string | null; vergrendeld_tot?: string | null; }; Update: { barcode?: string; buffer_key?: string | null; created_at?: string; customer_name?: string; id?: string; order_id?: string | null; order_number?: string; pakbon_nummer?: string; printed_at?: string; status?: string; updated_at?: string; vergrendeld_door?: string | null; vergrendeld_sessie?: string | null; vergrendeld_tot?: string | null; }; Relationships: []; }; scan_restpakbonnen: { Row: { barcode: string; bron_barcode: string | null; cart_id: string | null; cart_index: number | null; cart_total: number | null; created_at: string; geprint_op: string | null; id: string; klant_naam: string | null; order_id: string | null; order_number: string | null; print_job_id: string | null; regels: Json; updated_at: string; verwerkt: boolean; }; Insert: { barcode: string; bron_barcode?: string | null; cart_id?: string | null; cart_index?: number | null; cart_total?: number | null; created_at?: string; geprint_op?: string | null; id?: string; klant_naam?: string | null; order_id?: string | null; order_number?: string | null; print_job_id?: string | null; regels?: Json; updated_at?: string; verwerkt?: boolean; }; Update: { barcode?: string; bron_barcode?: string | null; cart_id?: string | null; cart_index?: number | null; cart_total?: number | null; created_at?: string; geprint_op?: string | null; id?: string; klant_naam?: string | null; order_id?: string | null; order_number?: string | null; print_job_id?: string | null; regels?: Json; updated_at?: string; verwerkt?: boolean; }; Relationships: []; }; scan_scanners: { Row: { actief: boolean; created_at: string; id: string; max_producten_per_kar: number | null; naam: string; omschrijving: string | null; pincode: string | null; printer_id: string | null; slug: string; type: string; updated_at: string; vereist_medewerker: boolean; werkplek: string | null; }; Insert: { actief?: boolean; created_at?: string; id?: string; max_producten_per_kar?: number | null; naam: string; omschrijving?: string | null; pincode?: string | null; printer_id?: string | null; slug: string; type?: string; updated_at?: string; vereist_medewerker?: boolean; werkplek?: string | null; }; Update: { actief?: boolean; created_at?: string; id?: string; max_producten_per_kar?: number | null; naam?: string; omschrijving?: string | null; pincode?: string | null; printer_id?: string | null; slug?: string; type?: string; updated_at?: string; vereist_medewerker?: boolean; werkplek?: string | null; }; Relationships: []; }; shell_settings: { Row: { created_at: string; default_path: string | null; shell_id: string; updated_at: string; }; Insert: { created_at?: string; default_path?: string | null; shell_id: string; updated_at?: string; }; Update: { created_at?: string; default_path?: string | null; shell_id?: string; updated_at?: string; }; Relationships: []; }; sick_periods: { Row: { created_at: string; employee_id: string; end_date: string | null; id: string; notes: string | null; start_date: string; updated_at: string; }; Insert: { created_at?: string; employee_id: string; end_date?: string | null; id?: string; notes?: string | null; start_date: string; updated_at?: string; }; Update: { created_at?: string; employee_id?: string; end_date?: string | null; id?: string; notes?: string | null; start_date?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "sick_periods_employee_id_fkey"; columns: ["employee_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; } ]; }; sidebar_config: { Row: { id: string; module_order: string[]; updated_at: string; }; Insert: { id?: string; module_order?: string[]; updated_at?: string; }; Update: { id?: string; module_order?: string[]; updated_at?: string; }; Relationships: []; }; stock_consumption_alerts: { Row: { alert_type: string; created_at: string; id: string; mutation_log_id: string | null; order_id: string | null; order_item_id: string | null; qty: number; reason: string | null; resolved_at: string | null; updated_at: string; }; Insert: { alert_type: string; created_at?: string; id?: string; mutation_log_id?: string | null; order_id?: string | null; order_item_id?: string | null; qty?: number; reason?: string | null; resolved_at?: string | null; updated_at?: string; }; Update: { alert_type?: string; created_at?: string; id?: string; mutation_log_id?: string | null; order_id?: string | null; order_item_id?: string | null; qty?: number; reason?: string | null; resolved_at?: string | null; updated_at?: string; }; Relationships: []; }; stock_import_runs: { Row: { connection_id: string | null; created_at: string; created_rows: number; errors: Json; filename: string | null; id: string; mutations: Json; skipped_rows: number; total_rows: number; updated_rows: number; user_id: string; }; Insert: { connection_id?: string | null; created_at?: string; created_rows?: number; errors?: Json; filename?: string | null; id?: string; mutations?: Json; skipped_rows?: number; total_rows?: number; updated_rows?: number; user_id: string; }; Update: { connection_id?: string | null; created_at?: string; created_rows?: number; errors?: Json; filename?: string | null; id?: string; mutations?: Json; skipped_rows?: number; total_rows?: number; updated_rows?: number; user_id?: string; }; Relationships: []; }; stock_mutation_log: { Row: { connection_id: string | null; created_at: string; created_by: string | null; id: string; mutation_type: string; order_id: string | null; order_item_id: string | null; order_source: string | null; physical_after: number | null; physical_before: number | null; production_batch_id: string | null; qty_delta: number; reason: string | null; reserved_after: number | null; reserved_before: number | null; trade_item_key: string | null; }; Insert: { connection_id?: string | null; created_at?: string; created_by?: string | null; id?: string; mutation_type: string; order_id?: string | null; order_item_id?: string | null; order_source?: string | null; physical_after?: number | null; physical_before?: number | null; production_batch_id?: string | null; qty_delta: number; reason?: string | null; reserved_after?: number | null; reserved_before?: number | null; trade_item_key?: string | null; }; Update: { connection_id?: string | null; created_at?: string; created_by?: string | null; id?: string; mutation_type?: string; order_id?: string | null; order_item_id?: string | null; order_source?: string | null; physical_after?: number | null; physical_before?: number | null; production_batch_id?: string | null; qty_delta?: number; reason?: string | null; reserved_after?: number | null; reserved_before?: number | null; trade_item_key?: string | null; }; Relationships: []; }; supplier_products: { Row: { article_number: string | null; created_at: string; id: string; name: string; notes: string | null; pot_size: string | null; price: number | null; quantity: number | null; supplier_id: string; unit: string; updated_at: string; }; Insert: { article_number?: string | null; created_at?: string; id?: string; name: string; notes?: string | null; pot_size?: string | null; price?: number | null; quantity?: number | null; supplier_id: string; unit?: string; updated_at?: string; }; Update: { article_number?: string | null; created_at?: string; id?: string; name?: string; notes?: string | null; pot_size?: string | null; price?: number | null; quantity?: number | null; supplier_id?: string; unit?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "supplier_products_supplier_id_fkey"; columns: ["supplier_id"]; isOneToOne: false; referencedRelation: "suppliers"; referencedColumns: ["id"]; } ]; }; suppliers: { Row: { address: string | null; column_mappings: Json | null; contact_person: string | null; created_at: string; default_product_type: string; email: string | null; id: string; imported_file_name: string | null; name: string; notes: string | null; phone: string | null; updated_at: string; }; Insert: { address?: string | null; column_mappings?: Json | null; contact_person?: string | null; created_at?: string; default_product_type?: string; email?: string | null; id?: string; imported_file_name?: string | null; name: string; notes?: string | null; phone?: string | null; updated_at?: string; }; Update: { address?: string | null; column_mappings?: Json | null; contact_person?: string | null; created_at?: string; default_product_type?: string; email?: string | null; id?: string; imported_file_name?: string | null; name?: string; notes?: string | null; phone?: string | null; updated_at?: string; }; Relationships: []; }; tba_article_cache: { Row: { article_number: string; created_at: string; fetched_at: string; gtin: string | null; id: string; manufacturer: string | null; omschrijving: string; price_cents: number; raw: Json | null; unit: string | null; updated_at: string; }; Insert: { article_number: string; created_at?: string; fetched_at?: string; gtin?: string | null; id?: string; manufacturer?: string | null; omschrijving: string; price_cents?: number; raw?: Json | null; unit?: string | null; updated_at?: string; }; Update: { article_number?: string; created_at?: string; fetched_at?: string; gtin?: string | null; id?: string; manufacturer?: string | null; omschrijving?: string; price_cents?: number; raw?: Json | null; unit?: string | null; updated_at?: string; }; Relationships: []; }; technician_rates: { Row: { created_at: string; hourly_rate_cents: number; updated_at: string; user_id: string; }; Insert: { created_at?: string; hourly_rate_cents?: number; updated_at?: string; user_id: string; }; Update: { created_at?: string; hourly_rate_cents?: number; updated_at?: string; user_id?: string; }; Relationships: []; }; tenants: { Row: { created_at: string; id: string; name: string; slug: string | null; updated_at: string; }; Insert: { created_at?: string; id?: string; name?: string; slug?: string | null; updated_at?: string; }; Update: { created_at?: string; id?: string; name?: string; slug?: string | null; updated_at?: string; }; Relationships: []; }; time_compensation_entries: { Row: { created_at: string; employee_id: string; entry_date: string; id: string; km: number; meal_allowance: number; notes: string | null; standby_evening: number; standby_weekend: number; tvt_change: number; updated_at: string; }; Insert: { created_at?: string; employee_id: string; entry_date: string; id?: string; km?: number; meal_allowance?: number; notes?: string | null; standby_evening?: number; standby_weekend?: number; tvt_change?: number; updated_at?: string; }; Update: { created_at?: string; employee_id?: string; entry_date?: string; id?: string; km?: number; meal_allowance?: number; notes?: string | null; standby_evening?: number; standby_weekend?: number; tvt_change?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "time_compensation_entries_employee_id_fkey"; columns: ["employee_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; } ]; }; time_entries: { Row: { created_at: string; employee_id: string; entry_date: string; hours: number; id: string; notes: string | null; overtime: number; undertime: number; updated_at: string; }; Insert: { created_at?: string; employee_id: string; entry_date: string; hours?: number; id?: string; notes?: string | null; overtime?: number; undertime?: number; updated_at?: string; }; Update: { created_at?: string; employee_id?: string; entry_date?: string; hours?: number; id?: string; notes?: string | null; overtime?: number; undertime?: number; updated_at?: string; }; Relationships: []; }; time_log_week_approvals: { Row: { approved_at: string | null; approved_by: string | null; created_at: string; employee_id: string; id: string; locked: boolean; notes: string | null; status: string; submitted_at: string | null; updated_at: string; week_start: string; }; Insert: { approved_at?: string | null; approved_by?: string | null; created_at?: string; employee_id: string; id?: string; locked?: boolean; notes?: string | null; status?: string; submitted_at?: string | null; updated_at?: string; week_start: string; }; Update: { approved_at?: string | null; approved_by?: string | null; created_at?: string; employee_id?: string; id?: string; locked?: boolean; notes?: string | null; status?: string; submitted_at?: string | null; updated_at?: string; week_start?: string; }; Relationships: [ { foreignKeyName: "time_log_week_approvals_employee_id_fkey"; columns: ["employee_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; } ]; }; time_logs: { Row: { auto_stop_reason: string | null; auto_stopped: boolean; created_at: string; current_latitude: number | null; current_longitude: number | null; current_position_updated_at: string | null; employee_id: string; end_latitude: number | null; end_longitude: number | null; end_time: string | null; eta_distance_km: number | null; eta_minutes: number | null; eta_updated_at: string | null; hour_category: string | null; id: string; last_reminder_at: string | null; notes: string | null; overtime_hours: number; overtime_type: string | null; regular_hours: number; reminder_count: number; requires_review: boolean; start_latitude: number | null; start_longitude: number | null; start_time: string; travel_cost: number | null; travel_distance_km: number | null; travel_duration_min: number | null; travel_time_minutes: number | null; type: string; updated_at: string; work_order_id: string | null; }; Insert: { auto_stop_reason?: string | null; auto_stopped?: boolean; created_at?: string; current_latitude?: number | null; current_longitude?: number | null; current_position_updated_at?: string | null; employee_id: string; end_latitude?: number | null; end_longitude?: number | null; end_time?: string | null; eta_distance_km?: number | null; eta_minutes?: number | null; eta_updated_at?: string | null; hour_category?: string | null; id?: string; last_reminder_at?: string | null; notes?: string | null; overtime_hours?: number; overtime_type?: string | null; regular_hours?: number; reminder_count?: number; requires_review?: boolean; start_latitude?: number | null; start_longitude?: number | null; start_time?: string; travel_cost?: number | null; travel_distance_km?: number | null; travel_duration_min?: number | null; travel_time_minutes?: number | null; type: string; updated_at?: string; work_order_id?: string | null; }; Update: { auto_stop_reason?: string | null; auto_stopped?: boolean; created_at?: string; current_latitude?: number | null; current_longitude?: number | null; current_position_updated_at?: string | null; employee_id?: string; end_latitude?: number | null; end_longitude?: number | null; end_time?: string | null; eta_distance_km?: number | null; eta_minutes?: number | null; eta_updated_at?: string | null; hour_category?: string | null; id?: string; last_reminder_at?: string | null; notes?: string | null; overtime_hours?: number; overtime_type?: string | null; regular_hours?: number; reminder_count?: number; requires_review?: boolean; start_latitude?: number | null; start_longitude?: number | null; start_time?: string; travel_cost?: number | null; travel_distance_km?: number | null; travel_duration_min?: number | null; travel_time_minutes?: number | null; type?: string; updated_at?: string; work_order_id?: string | null; }; Relationships: [ { foreignKeyName: "time_logs_employee_id_fkey"; columns: ["employee_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; }, { foreignKeyName: "time_logs_work_order_id_fkey"; columns: ["work_order_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "time_logs_work_order_id_fkey"; columns: ["work_order_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; time_off_entries: { Row: { created_at: string; employee_id: string; entry_date: string; hours: number; id: string; notes: string | null; type: string; updated_at: string; }; Insert: { created_at?: string; employee_id: string; entry_date: string; hours?: number; id?: string; notes?: string | null; type: string; updated_at?: string; }; Update: { created_at?: string; employee_id?: string; entry_date?: string; hours?: number; id?: string; notes?: string | null; type?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "time_off_entries_employee_id_fkey"; columns: ["employee_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; } ]; }; trade_item_drafts: { Row: { connection_id: string | null; created_at: string; data: Json; floriday_id: string | null; floriday_link_error: string | null; floriday_link_status: string; id: string; last_floriday_sync_at: string | null; missing_required_fields: string[]; source: string; updated_at: string; user_id: string; }; Insert: { connection_id?: string | null; created_at?: string; data?: Json; floriday_id?: string | null; floriday_link_error?: string | null; floriday_link_status?: string; id?: string; last_floriday_sync_at?: string | null; missing_required_fields?: string[]; source?: string; updated_at?: string; user_id: string; }; Update: { connection_id?: string | null; created_at?: string; data?: Json; floriday_id?: string | null; floriday_link_error?: string | null; floriday_link_status?: string; id?: string; last_floriday_sync_at?: string | null; missing_required_fields?: string[]; source?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; trade_item_prices: { Row: { created_at: string; currency: string; id: string; last_push_error: string | null; last_pushed_at: string | null; price_group_id: string | null; price_per_piece: number; supply_line_id: string | null; trade_item_key: string; updated_at: string; user_id: string; }; Insert: { created_at?: string; currency?: string; id?: string; last_push_error?: string | null; last_pushed_at?: string | null; price_group_id?: string | null; price_per_piece: number; supply_line_id?: string | null; trade_item_key: string; updated_at?: string; user_id: string; }; Update: { created_at?: string; currency?: string; id?: string; last_push_error?: string | null; last_pushed_at?: string | null; price_group_id?: string | null; price_per_piece?: number; supply_line_id?: string | null; trade_item_key?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; trade_item_stock: { Row: { change_source: string; connection_id: string; created_at: string; id: string; incoming_stock: number; minimum_stock: number; notes: string | null; physical_stock: number; reserved_stock: number; trade_item_key: string; updated_at: string; user_id: string; }; Insert: { change_source?: string; connection_id: string; created_at?: string; id?: string; incoming_stock?: number; minimum_stock?: number; notes?: string | null; physical_stock?: number; reserved_stock?: number; trade_item_key: string; updated_at?: string; user_id: string; }; Update: { change_source?: string; connection_id?: string; created_at?: string; id?: string; incoming_stock?: number; minimum_stock?: number; notes?: string | null; physical_stock?: number; reserved_stock?: number; trade_item_key?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; trade_item_supply_lines: { Row: { available_quantity: number | null; connection_id: string; created_at: string; currency: string | null; endpoint_family: string | null; environment: string | null; id: string; last_error: string | null; last_status: number | null; packing_configuration_id: string | null; period_end: string | null; period_start: string | null; price_per_piece: number | null; sales_unit: string | null; supply_line_id: string | null; supply_type: string; trade_item_id: string; updated_at: string; user_id: string; week: number | null; year: number | null; }; Insert: { available_quantity?: number | null; connection_id: string; created_at?: string; currency?: string | null; endpoint_family?: string | null; environment?: string | null; id?: string; last_error?: string | null; last_status?: number | null; packing_configuration_id?: string | null; period_end?: string | null; period_start?: string | null; price_per_piece?: number | null; sales_unit?: string | null; supply_line_id?: string | null; supply_type?: string; trade_item_id: string; updated_at?: string; user_id: string; week?: number | null; year?: number | null; }; Update: { available_quantity?: number | null; connection_id?: string; created_at?: string; currency?: string | null; endpoint_family?: string | null; environment?: string | null; id?: string; last_error?: string | null; last_status?: number | null; packing_configuration_id?: string | null; period_end?: string | null; period_start?: string | null; price_per_piece?: number | null; sales_unit?: string | null; supply_line_id?: string | null; supply_type?: string; trade_item_id?: string; updated_at?: string; user_id?: string; week?: number | null; year?: number | null; }; Relationships: []; }; trade_item_warehouse_preferences: { Row: { connection_id: string; created_at: string; id: string; trade_item_id: string; updated_at: string; warehouse_id: string; warehouse_name: string | null; }; Insert: { connection_id: string; created_at?: string; id?: string; trade_item_id: string; updated_at?: string; warehouse_id: string; warehouse_name?: string | null; }; Update: { connection_id?: string; created_at?: string; id?: string; trade_item_id?: string; updated_at?: string; warehouse_id?: string; warehouse_name?: string | null; }; Relationships: [ { foreignKeyName: "trade_item_warehouse_preferences_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; twinfield_connections: { Row: { account_key: string | null; cluster_uri: string | null; company_code: string | null; company_name: string | null; connected_at: string | null; created_at: string; disconnected_at: string | null; environment: string; id: string; initial_sync_completed_at: string | null; initial_sync_started_at: string | null; is_active: boolean; label: string | null; office_code: string | null; redirect_uri: string | null; superseded_at: string | null; updated_at: string; user_id: string; }; Insert: { account_key?: string | null; cluster_uri?: string | null; company_code?: string | null; company_name?: string | null; connected_at?: string | null; created_at?: string; disconnected_at?: string | null; environment: string; id?: string; initial_sync_completed_at?: string | null; initial_sync_started_at?: string | null; is_active?: boolean; label?: string | null; office_code?: string | null; redirect_uri?: string | null; superseded_at?: string | null; updated_at?: string; user_id: string; }; Update: { account_key?: string | null; cluster_uri?: string | null; company_code?: string | null; company_name?: string | null; connected_at?: string | null; created_at?: string; disconnected_at?: string | null; environment?: string; id?: string; initial_sync_completed_at?: string | null; initial_sync_started_at?: string | null; is_active?: boolean; label?: string | null; office_code?: string | null; redirect_uri?: string | null; superseded_at?: string | null; updated_at?: string; user_id?: string; }; Relationships: []; }; twinfield_cron_auth: { Row: { created_at: string; id: number; secret: string; }; Insert: { created_at?: string; id?: number; secret?: string; }; Update: { created_at?: string; id?: number; secret?: string; }; Relationships: []; }; twinfield_cron_locks: { Row: { created_at: string; heartbeat_at: string; job_name: string; last_error: string | null; last_finished_at: string | null; locked_at: string; run_id: string; updated_at: string; }; Insert: { created_at?: string; heartbeat_at?: string; job_name: string; last_error?: string | null; last_finished_at?: string | null; locked_at?: string; run_id?: string; updated_at?: string; }; Update: { created_at?: string; heartbeat_at?: string; job_name?: string; last_error?: string | null; last_finished_at?: string | null; locked_at?: string; run_id?: string; updated_at?: string; }; Relationships: []; }; twinfield_customers: { Row: { address: string | null; administration_code: string; city: string | null; country: string | null; created_at: string; email: string | null; external_group_key: string | null; id: string; last_synced_at: string | null; name: string; phone: string | null; postal_code: string | null; status: string; sync_error: string | null; sync_status: string; twinfield_code: string | null; updated_at: string; user_id: string; }; Insert: { address?: string | null; administration_code?: string; city?: string | null; country?: string | null; created_at?: string; email?: string | null; external_group_key?: string | null; id?: string; last_synced_at?: string | null; name: string; phone?: string | null; postal_code?: string | null; status?: string; sync_error?: string | null; sync_status?: string; twinfield_code?: string | null; updated_at?: string; user_id: string; }; Update: { address?: string | null; administration_code?: string; city?: string | null; country?: string | null; created_at?: string; email?: string | null; external_group_key?: string | null; id?: string; last_synced_at?: string | null; name?: string; phone?: string | null; postal_code?: string | null; status?: string; sync_error?: string | null; sync_status?: string; twinfield_code?: string | null; updated_at?: string; user_id?: string; }; Relationships: []; }; twinfield_customers_cache: { Row: { connection_id: string; country: string | null; data: Json; email: string | null; fetched_at: string; modified_at: string | null; name: string | null; twinfield_code: string; vat_number: string | null; }; Insert: { connection_id: string; country?: string | null; data?: Json; email?: string | null; fetched_at?: string; modified_at?: string | null; name?: string | null; twinfield_code: string; vat_number?: string | null; }; Update: { connection_id?: string; country?: string | null; data?: Json; email?: string | null; fetched_at?: string; modified_at?: string | null; name?: string | null; twinfield_code?: string; vat_number?: string | null; }; Relationships: [ { foreignKeyName: "twinfield_customers_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "twinfield_connections"; referencedColumns: ["id"]; } ]; }; twinfield_invoice_lines: { Row: { article_code: string | null; created_at: string; description: string | null; gl_account: string | null; id: string; invoice_id: string; line_number: number | null; line_total: number; quantity: number; unit_price: number; user_id: string; vat_code: string | null; vat_rate: number; }; Insert: { article_code?: string | null; created_at?: string; description?: string | null; gl_account?: string | null; id?: string; invoice_id: string; line_number?: number | null; line_total?: number; quantity?: number; unit_price?: number; user_id: string; vat_code?: string | null; vat_rate?: number; }; Update: { article_code?: string | null; created_at?: string; description?: string | null; gl_account?: string | null; id?: string; invoice_id?: string; line_number?: number | null; line_total?: number; quantity?: number; unit_price?: number; user_id?: string; vat_code?: string | null; vat_rate?: number; }; Relationships: [ { foreignKeyName: "twinfield_invoice_lines_invoice_id_fkey"; columns: ["invoice_id"]; isOneToOne: false; referencedRelation: "twinfield_invoices"; referencedColumns: ["id"]; } ]; }; twinfield_invoice_lines_cache_v2: { Row: { article_code: string | null; connection_id: string; data: Json; description: string | null; fetched_at: string; invoice_number: string; line_number: number; line_total: number | null; quantity: number | null; unit_price: number | null; vat_code: string | null; vat_rate: number | null; }; Insert: { article_code?: string | null; connection_id: string; data?: Json; description?: string | null; fetched_at?: string; invoice_number: string; line_number: number; line_total?: number | null; quantity?: number | null; unit_price?: number | null; vat_code?: string | null; vat_rate?: number | null; }; Update: { article_code?: string | null; connection_id?: string; data?: Json; description?: string | null; fetched_at?: string; invoice_number?: string; line_number?: number; line_total?: number | null; quantity?: number | null; unit_price?: number | null; vat_code?: string | null; vat_rate?: number | null; }; Relationships: [ { foreignKeyName: "twinfield_invoice_lines_cache_v2_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "twinfield_connections"; referencedColumns: ["id"]; } ]; }; twinfield_invoice_pdf_cache: { Row: { connection_id: string; created_at: string; fetched_at: string; id: string; invoice_number: string; last_accessed_at: string; object_path: string; office_code: string; size_bytes: number; updated_at: string; }; Insert: { connection_id: string; created_at?: string; fetched_at?: string; id?: string; invoice_number: string; last_accessed_at?: string; object_path: string; office_code: string; size_bytes?: number; updated_at?: string; }; Update: { connection_id?: string; created_at?: string; fetched_at?: string; id?: string; invoice_number?: string; last_accessed_at?: string; object_path?: string; office_code?: string; size_bytes?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "twinfield_invoice_pdf_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "twinfield_connections"; referencedColumns: ["id"]; } ]; }; twinfield_invoice_settings: { Row: { administration_code: string | null; auto_invoice_enabled: boolean; auto_invoice_start_date: string | null; auto_invoice_trigger_statuses: string[]; created_at: string; debtor_gl_account: string; default_credit_invoice_type: string | null; default_gl_account: string; default_invoice_type: string; default_payment_term_days: number; default_vat_code: string; home_country_code: string; invoice_enabled_ao: boolean; invoice_enabled_fo: boolean; invoice_enabled_ho: boolean; invoice_enabled_mo: boolean; needs_review: boolean; payment_gl_account: string; payment_journal_code: string; settings_confirmed_at: string | null; updated_at: string; user_id: string; vat_code_eu_reverse: string | null; vat_code_export: string | null; }; Insert: { administration_code?: string | null; auto_invoice_enabled?: boolean; auto_invoice_start_date?: string | null; auto_invoice_trigger_statuses?: string[]; created_at?: string; debtor_gl_account?: string; default_credit_invoice_type?: string | null; default_gl_account?: string; default_invoice_type?: string; default_payment_term_days?: number; default_vat_code?: string; home_country_code?: string; invoice_enabled_ao?: boolean; invoice_enabled_fo?: boolean; invoice_enabled_ho?: boolean; invoice_enabled_mo?: boolean; needs_review?: boolean; payment_gl_account?: string; payment_journal_code?: string; settings_confirmed_at?: string | null; updated_at?: string; user_id: string; vat_code_eu_reverse?: string | null; vat_code_export?: string | null; }; Update: { administration_code?: string | null; auto_invoice_enabled?: boolean; auto_invoice_start_date?: string | null; auto_invoice_trigger_statuses?: string[]; created_at?: string; debtor_gl_account?: string; default_credit_invoice_type?: string | null; default_gl_account?: string; default_invoice_type?: string; default_payment_term_days?: number; default_vat_code?: string; home_country_code?: string; invoice_enabled_ao?: boolean; invoice_enabled_fo?: boolean; invoice_enabled_ho?: boolean; invoice_enabled_mo?: boolean; needs_review?: boolean; payment_gl_account?: string; payment_journal_code?: string; settings_confirmed_at?: string | null; updated_at?: string; user_id?: string; vat_code_eu_reverse?: string | null; vat_code_export?: string | null; }; Relationships: []; }; twinfield_invoice_sync_logs: { Row: { action_type: string | null; created_at: string; details: Json | null; duration_ms: number | null; id: string; invoice_lines_fetched: number | null; invoices_fetched: number | null; message: string | null; status: string; step: string | null; user_id: string; }; Insert: { action_type?: string | null; created_at?: string; details?: Json | null; duration_ms?: number | null; id?: string; invoice_lines_fetched?: number | null; invoices_fetched?: number | null; message?: string | null; status: string; step?: string | null; user_id: string; }; Update: { action_type?: string | null; created_at?: string; details?: Json | null; duration_ms?: number | null; id?: string; invoice_lines_fetched?: number | null; invoices_fetched?: number | null; message?: string | null; status?: string; step?: string | null; user_id?: string; }; Relationships: []; }; twinfield_invoices: { Row: { administration_code: string | null; created_at: string; currency: string | null; customer_code: string | null; customer_email: string | null; customer_name: string | null; customer_phone: string | null; due_date: string | null; id: string; invoice_date: string | null; last_synced_at: string; local_invoice_number: string | null; outstanding_amount: number; paid_amount: number; payment_date: string | null; raw_payload: Json | null; status: string; subtotal: number; sync_error: string | null; sync_status: string; total: number; twinfield_invoice_number: string; twinfield_transaction_number: string | null; updated_at: string; user_id: string; vat_amount: number; }; Insert: { administration_code?: string | null; created_at?: string; currency?: string | null; customer_code?: string | null; customer_email?: string | null; customer_name?: string | null; customer_phone?: string | null; due_date?: string | null; id?: string; invoice_date?: string | null; last_synced_at?: string; local_invoice_number?: string | null; outstanding_amount?: number; paid_amount?: number; payment_date?: string | null; raw_payload?: Json | null; status?: string; subtotal?: number; sync_error?: string | null; sync_status?: string; total?: number; twinfield_invoice_number: string; twinfield_transaction_number?: string | null; updated_at?: string; user_id: string; vat_amount?: number; }; Update: { administration_code?: string | null; created_at?: string; currency?: string | null; customer_code?: string | null; customer_email?: string | null; customer_name?: string | null; customer_phone?: string | null; due_date?: string | null; id?: string; invoice_date?: string | null; last_synced_at?: string; local_invoice_number?: string | null; outstanding_amount?: number; paid_amount?: number; payment_date?: string | null; raw_payload?: Json | null; status?: string; subtotal?: number; sync_error?: string | null; sync_status?: string; total?: number; twinfield_invoice_number?: string; twinfield_transaction_number?: string | null; updated_at?: string; user_id?: string; vat_amount?: number; }; Relationships: []; }; twinfield_invoices_cache_v2: { Row: { connection_id: string; currency: string | null; customer_code: string | null; data: Json; deleted_at: string | null; due_date: string | null; fetched_at: string; invoice_date: string | null; invoice_number: string; lines_fetched_at: string | null; modified_at: string | null; outstanding_amount: number | null; paid_at: string | null; status: string | null; status_label: string | null; total_excl: number | null; total_incl: number | null; vat_amount: number | null; }; Insert: { connection_id: string; currency?: string | null; customer_code?: string | null; data?: Json; deleted_at?: string | null; due_date?: string | null; fetched_at?: string; invoice_date?: string | null; invoice_number: string; lines_fetched_at?: string | null; modified_at?: string | null; outstanding_amount?: number | null; paid_at?: string | null; status?: string | null; status_label?: string | null; total_excl?: number | null; total_incl?: number | null; vat_amount?: number | null; }; Update: { connection_id?: string; currency?: string | null; customer_code?: string | null; data?: Json; deleted_at?: string | null; due_date?: string | null; fetched_at?: string; invoice_date?: string | null; invoice_number?: string; lines_fetched_at?: string | null; modified_at?: string | null; outstanding_amount?: number | null; paid_at?: string | null; status?: string | null; status_label?: string | null; total_excl?: number | null; total_incl?: number | null; vat_amount?: number | null; }; Relationships: [ { foreignKeyName: "twinfield_invoices_cache_v2_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "twinfield_connections"; referencedColumns: ["id"]; } ]; }; twinfield_ledger_accounts_cache: { Row: { code: string; connection_id: string | null; created_at: string; dim_type: string; fetched_at: string; id: string; is_active: boolean; name: string | null; office_code: string; updated_at: string; }; Insert: { code: string; connection_id?: string | null; created_at?: string; dim_type?: string; fetched_at?: string; id?: string; is_active?: boolean; name?: string | null; office_code: string; updated_at?: string; }; Update: { code?: string; connection_id?: string | null; created_at?: string; dim_type?: string; fetched_at?: string; id?: string; is_active?: boolean; name?: string | null; office_code?: string; updated_at?: string; }; Relationships: []; }; twinfield_push_log: { Row: { created_at: string; customer_id: string | null; id: string; message: string | null; office_code: string | null; ok: boolean; queue_id: string | null; request_xml: string | null; response_raw: string | null; twinfield_code: string | null; }; Insert: { created_at?: string; customer_id?: string | null; id?: string; message?: string | null; office_code?: string | null; ok?: boolean; queue_id?: string | null; request_xml?: string | null; response_raw?: string | null; twinfield_code?: string | null; }; Update: { created_at?: string; customer_id?: string | null; id?: string; message?: string | null; office_code?: string | null; ok?: boolean; queue_id?: string | null; request_xml?: string | null; response_raw?: string | null; twinfield_code?: string | null; }; Relationships: []; }; twinfield_push_queue: { Row: { action: string; attempt_started_at: string | null; attempts: number; connection_id: string | null; created_at: string; customer_id: string | null; external_id: string | null; id: string; idempotency_key: string; last_error: string | null; next_attempt_at: string; office_code: string | null; payload: Json; status: string; updated_at: string; }; Insert: { action?: string; attempt_started_at?: string | null; attempts?: number; connection_id?: string | null; created_at?: string; customer_id?: string | null; external_id?: string | null; id?: string; idempotency_key: string; last_error?: string | null; next_attempt_at?: string; office_code?: string | null; payload: Json; status?: string; updated_at?: string; }; Update: { action?: string; attempt_started_at?: string | null; attempts?: number; connection_id?: string | null; created_at?: string; customer_id?: string | null; external_id?: string | null; id?: string; idempotency_key?: string; last_error?: string | null; next_attempt_at?: string; office_code?: string | null; payload?: Json; status?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "twinfield_push_queue_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "twinfield_connections"; referencedColumns: ["id"]; }, { foreignKeyName: "twinfield_push_queue_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "customers"; referencedColumns: ["id"]; } ]; }; twinfield_request_metrics: { Row: { bucket_hour: string; connection_id: string; error_count: number; rate_limited_count: number; request_count: number; updated_at: string; }; Insert: { bucket_hour: string; connection_id: string; error_count?: number; rate_limited_count?: number; request_count?: number; updated_at?: string; }; Update: { bucket_hour?: string; connection_id?: string; error_count?: number; rate_limited_count?: number; request_count?: number; updated_at?: string; }; Relationships: []; }; twinfield_revoked_accounts: { Row: { account_key: string; last_revoke_error: string | null; revoked_at: string; user_id: string; }; Insert: { account_key: string; last_revoke_error?: string | null; revoked_at?: string; user_id: string; }; Update: { account_key?: string; last_revoke_error?: string | null; revoked_at?: string; user_id?: string; }; Relationships: []; }; twinfield_session_cache: { Row: { cluster: string; created_at: string; expires_at: string; session_id: string; user_id: string; }; Insert: { cluster: string; created_at?: string; expires_at: string; session_id: string; user_id: string; }; Update: { cluster?: string; created_at?: string; expires_at?: string; session_id?: string; user_id?: string; }; Relationships: []; }; twinfield_settings: { Row: { active_environment: string; id: number; updated_at: string; }; Insert: { active_environment?: string; id?: number; updated_at?: string; }; Update: { active_environment?: string; id?: number; updated_at?: string; }; Relationships: []; }; twinfield_sync_state: { Row: { connection_id: string; entity_type: string; last_error: string | null; last_modified_since: string; last_synced_at: string | null; updated_at: string; }; Insert: { connection_id: string; entity_type: string; last_error?: string | null; last_modified_since?: string; last_synced_at?: string | null; updated_at?: string; }; Update: { connection_id?: string; entity_type?: string; last_error?: string | null; last_modified_since?: string; last_synced_at?: string | null; updated_at?: string; }; Relationships: [ { foreignKeyName: "twinfield_sync_state_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "twinfield_connections"; referencedColumns: ["id"]; } ]; }; uren_cao_profiles: { Row: { break_minutes: number | null; contract_hours_per_week: number; created_at: string; daily_threshold_hours: number | null; id: string; include_travel: boolean | null; monteur_id: string; ov02_percentage: number | null; ov03_percentage: number | null; updated_at: string; weekly_threshold_hours: number | null; workday_end: string | null; workday_start: string | null; }; Insert: { break_minutes?: number | null; contract_hours_per_week?: number; created_at?: string; daily_threshold_hours?: number | null; id?: string; include_travel?: boolean | null; monteur_id: string; ov02_percentage?: number | null; ov03_percentage?: number | null; updated_at?: string; weekly_threshold_hours?: number | null; workday_end?: string | null; workday_start?: string | null; }; Update: { break_minutes?: number | null; contract_hours_per_week?: number; created_at?: string; daily_threshold_hours?: number | null; id?: string; include_travel?: boolean | null; monteur_id?: string; ov02_percentage?: number | null; ov03_percentage?: number | null; updated_at?: string; weekly_threshold_hours?: number | null; workday_end?: string | null; workday_start?: string | null; }; Relationships: []; }; uren_entries: { Row: { created_at: string; created_by: string | null; entry_date: string; hours: number; id: string; kind: string; monteur_id: string; note: string | null; source: string; travel_km: number; updated_at: string; werkbon_id: string | null; }; Insert: { created_at?: string; created_by?: string | null; entry_date: string; hours?: number; id?: string; kind?: string; monteur_id: string; note?: string | null; source?: string; travel_km?: number; updated_at?: string; werkbon_id?: string | null; }; Update: { created_at?: string; created_by?: string | null; entry_date?: string; hours?: number; id?: string; kind?: string; monteur_id?: string; note?: string | null; source?: string; travel_km?: number; updated_at?: string; werkbon_id?: string | null; }; Relationships: [ { foreignKeyName: "uren_entries_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "uren_entries_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; uren_exports: { Row: { created_at: string; created_by: string | null; file_name: string | null; id: string; monteur_ids: string[]; period_end: string; period_start: string; row_count: number; }; Insert: { created_at?: string; created_by?: string | null; file_name?: string | null; id?: string; monteur_ids?: string[]; period_end: string; period_start: string; row_count?: number; }; Update: { created_at?: string; created_by?: string | null; file_name?: string | null; id?: string; monteur_ids?: string[]; period_end?: string; period_start?: string; row_count?: number; }; Relationships: []; }; uren_settings: { Row: { break_minutes: number; created_at: string; daily_threshold_hours: number; id: boolean; include_travel: boolean; min_occupancy_monteurs: number; ov02_percentage: number; ov03_percentage: number; updated_at: string; weekly_threshold_hours: number; workday_end: string; workday_start: string; }; Insert: { break_minutes?: number; created_at?: string; daily_threshold_hours?: number; id?: boolean; include_travel?: boolean; min_occupancy_monteurs?: number; ov02_percentage?: number; ov03_percentage?: number; updated_at?: string; weekly_threshold_hours?: number; workday_end?: string; workday_start?: string; }; Update: { break_minutes?: number; created_at?: string; daily_threshold_hours?: number; id?: boolean; include_travel?: boolean; min_occupancy_monteurs?: number; ov02_percentage?: number; ov03_percentage?: number; updated_at?: string; weekly_threshold_hours?: number; workday_end?: string; workday_start?: string; }; Relationships: []; }; uren_tarieven: { Row: { created_at: string; hourly_rate_cents: number; id: string; kind: string; travel_km_rate_cents: number; updated_at: string; }; Insert: { created_at?: string; hourly_rate_cents?: number; id?: string; kind: string; travel_km_rate_cents?: number; updated_at?: string; }; Update: { created_at?: string; hourly_rate_cents?: number; id?: string; kind?: string; travel_km_rate_cents?: number; updated_at?: string; }; Relationships: []; }; uren_team_leden: { Row: { created_at: string; id: string; monteur_id: string; team_id: string; updated_at: string; }; Insert: { created_at?: string; id?: string; monteur_id: string; team_id: string; updated_at?: string; }; Update: { created_at?: string; id?: string; monteur_id?: string; team_id?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "uren_team_leden_team_id_fkey"; columns: ["team_id"]; isOneToOne: false; referencedRelation: "uren_teams"; referencedColumns: ["id"]; } ]; }; uren_teams: { Row: { created_at: string; id: string; is_active: boolean; min_occupancy: number; name: string; updated_at: string; }; Insert: { created_at?: string; id?: string; is_active?: boolean; min_occupancy?: number; name: string; updated_at?: string; }; Update: { created_at?: string; id?: string; is_active?: boolean; min_occupancy?: number; name?: string; updated_at?: string; }; Relationships: []; }; uren_weekstaten: { Row: { approved_at: string | null; approved_by: string | null; created_at: string; id: string; iso_week: number; iso_year: number; monteur_id: string; remark: string | null; status: string; submitted_at: string | null; updated_at: string; }; Insert: { approved_at?: string | null; approved_by?: string | null; created_at?: string; id?: string; iso_week: number; iso_year: number; monteur_id: string; remark?: string | null; status?: string; submitted_at?: string | null; updated_at?: string; }; Update: { approved_at?: string | null; approved_by?: string | null; created_at?: string; id?: string; iso_week?: number; iso_year?: number; monteur_id?: string; remark?: string | null; status?: string; submitted_at?: string | null; updated_at?: string; }; Relationships: []; }; user_module_permissions: { Row: { created_at: string; feature_id: string; id: string; module_id: string; permission: string; updated_at: string; user_id: string; }; Insert: { created_at?: string; feature_id?: string; id?: string; module_id: string; permission: string; updated_at?: string; user_id: string; }; Update: { created_at?: string; feature_id?: string; id?: string; module_id?: string; permission?: string; updated_at?: string; user_id?: string; }; Relationships: []; }; user_roles: { Row: { created_at: string; id: string; role: Database["public"]["Enums"]["app_role"]; user_id: string; }; Insert: { created_at?: string; id?: string; role: Database["public"]["Enums"]["app_role"]; user_id: string; }; Update: { created_at?: string; id?: string; role?: Database["public"]["Enums"]["app_role"]; user_id?: string; }; Relationships: [ { foreignKeyName: "user_roles_user_id_fkey"; columns: ["user_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; } ]; }; van_inventories: { Row: { barcode: string | null; created_at: string; id: string; monteur_id: string | null; price_per_unit: number; product_name: string; quantity_current: number; quantity_min: number; unit: string; updated_at: string; }; Insert: { barcode?: string | null; created_at?: string; id?: string; monteur_id?: string | null; price_per_unit?: number; product_name: string; quantity_current?: number; quantity_min?: number; unit?: string; updated_at?: string; }; Update: { barcode?: string | null; created_at?: string; id?: string; monteur_id?: string | null; price_per_unit?: number; product_name?: string; quantity_current?: number; quantity_min?: number; unit?: string; updated_at?: string; }; Relationships: [ { foreignKeyName: "van_inventories_monteur_id_fkey"; columns: ["monteur_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; } ]; }; voorraad_custom_fields: { Row: { created_at: string; field_key: string; field_label: string; field_type: string; id: string; options: string[]; show_in_columns: boolean; show_in_detail: boolean; show_in_template: boolean; sort_order: number; updated_at: string; }; Insert: { created_at?: string; field_key: string; field_label: string; field_type?: string; id?: string; options?: string[]; show_in_columns?: boolean; show_in_detail?: boolean; show_in_template?: boolean; sort_order?: number; updated_at?: string; }; Update: { created_at?: string; field_key?: string; field_label?: string; field_type?: string; id?: string; options?: string[]; show_in_columns?: boolean; show_in_detail?: boolean; show_in_template?: boolean; sort_order?: number; updated_at?: string; }; Relationships: []; }; voorraad_media_upload_failures: { Row: { action: string; attempt_number: number; caller: string; client_user_id: string | null; content_type: string | null; created_at: string; environment: string; error_message: string | null; filename: string | null; id: string; idempotency_key: string | null; module: string; path: string; reference_id: string | null; request_body_hash: string | null; request_timestamp: number | null; response_content_type: string | null; response_status: number | null; size_bytes: number | null; }; Insert: { action?: string; attempt_number?: number; caller?: string; client_user_id?: string | null; content_type?: string | null; created_at?: string; environment: string; error_message?: string | null; filename?: string | null; id?: string; idempotency_key?: string | null; module?: string; path: string; reference_id?: string | null; request_body_hash?: string | null; request_timestamp?: number | null; response_content_type?: string | null; response_status?: number | null; size_bytes?: number | null; }; Update: { action?: string; attempt_number?: number; caller?: string; client_user_id?: string | null; content_type?: string | null; created_at?: string; environment?: string; error_message?: string | null; filename?: string | null; id?: string; idempotency_key?: string | null; module?: string; path?: string; reference_id?: string | null; request_body_hash?: string | null; request_timestamp?: number | null; response_content_type?: string | null; response_status?: number | null; size_bytes?: number | null; }; Relationships: []; }; voorraad_publish_attempts: { Row: { action: string; connection_id: string | null; created_at: string; error: string | null; gateway_attempt_id: string | null; gateway_status: number | null; id: string; intent: string; ok: boolean; request_summary: Json | null; trade_item_id: string | null; user_id: string; }; Insert: { action: string; connection_id?: string | null; created_at?: string; error?: string | null; gateway_attempt_id?: string | null; gateway_status?: number | null; id?: string; intent: string; ok: boolean; request_summary?: Json | null; trade_item_id?: string | null; user_id: string; }; Update: { action?: string; connection_id?: string | null; created_at?: string; error?: string | null; gateway_attempt_id?: string | null; gateway_status?: number | null; id?: string; intent?: string; ok?: boolean; request_summary?: Json | null; trade_item_id?: string | null; user_id?: string; }; Relationships: []; }; voorraad_publish_jobs: { Row: { connection_id: string | null; created_at: string; environment: string; finished_at: string | null; id: string; intent: string; product_id: string | null; reference_code: string; snapshot: Json; status: string; summary: Json; title: string | null; trade_item_id: string | null; trade_item_key: string | null; updated_at: string; user_id: string; }; Insert: { connection_id?: string | null; created_at?: string; environment?: string; finished_at?: string | null; id?: string; intent?: string; product_id?: string | null; reference_code?: string; snapshot?: Json; status?: string; summary?: Json; title?: string | null; trade_item_id?: string | null; trade_item_key?: string | null; updated_at?: string; user_id: string; }; Update: { connection_id?: string | null; created_at?: string; environment?: string; finished_at?: string | null; id?: string; intent?: string; product_id?: string | null; reference_code?: string; snapshot?: Json; status?: string; summary?: Json; title?: string | null; trade_item_id?: string | null; trade_item_key?: string | null; updated_at?: string; user_id?: string; }; Relationships: []; }; voorraad_publish_learnings: { Row: { created_at: string; field_key: string; hits: number; id: string; label: string | null; last_error: string | null; scope: string; updated_at: string; vbn_code: string; }; Insert: { created_at?: string; field_key: string; hits?: number; id?: string; label?: string | null; last_error?: string | null; scope?: string; updated_at?: string; vbn_code: string; }; Update: { created_at?: string; field_key?: string; hits?: number; id?: string; label?: string | null; last_error?: string | null; scope?: string; updated_at?: string; vbn_code?: string; }; Relationships: []; }; voorraad_publish_steps: { Row: { attempts: number; created_at: string; error_code: string | null; error_detail: string | null; error_message: string | null; finished_at: string | null; id: string; job_id: string; label: string; position: number; result: Json | null; started_at: string | null; status: string; step_key: string; updated_at: string; user_id: string; }; Insert: { attempts?: number; created_at?: string; error_code?: string | null; error_detail?: string | null; error_message?: string | null; finished_at?: string | null; id?: string; job_id: string; label: string; position?: number; result?: Json | null; started_at?: string | null; status?: string; step_key: string; updated_at?: string; user_id: string; }; Update: { attempts?: number; created_at?: string; error_code?: string | null; error_detail?: string | null; error_message?: string | null; finished_at?: string | null; id?: string; job_id?: string; label?: string; position?: number; result?: Json | null; started_at?: string | null; status?: string; step_key?: string; updated_at?: string; user_id?: string; }; Relationships: [ { foreignKeyName: "voorraad_publish_steps_job_id_fkey"; columns: ["job_id"]; isOneToOne: false; referencedRelation: "voorraad_publish_jobs"; referencedColumns: ["id"]; } ]; }; werkbon_export_runs: { Row: { created_at: string; created_by: string | null; filename: string | null; id: string; werkbon_ids: string[]; }; Insert: { created_at?: string; created_by?: string | null; filename?: string | null; id?: string; werkbon_ids?: string[]; }; Update: { created_at?: string; created_by?: string | null; filename?: string | null; id?: string; werkbon_ids?: string[]; }; Relationships: []; }; werkbon_facturatie_controle: { Row: { cao_warnings: string[]; checked_at: string | null; checked_by: string | null; created_at: string; drive_minutes: number; exported_at: string | null; extra_cents: number; hours_total: number; id: string; invoice_id: string | null; invoiced_at: string | null; labour_cents: number; manual_invoice: boolean; materials_cents: number; packages_cents: number; pause_minutes: number; remark: string | null; status: string; total_cents: number; travel_cents: number; updated_at: string; werkbon_id: string; work_minutes: number; }; Insert: { cao_warnings?: string[]; checked_at?: string | null; checked_by?: string | null; created_at?: string; drive_minutes?: number; exported_at?: string | null; extra_cents?: number; hours_total?: number; id?: string; invoice_id?: string | null; invoiced_at?: string | null; labour_cents?: number; manual_invoice?: boolean; materials_cents?: number; packages_cents?: number; pause_minutes?: number; remark?: string | null; status?: string; total_cents?: number; travel_cents?: number; updated_at?: string; werkbon_id: string; work_minutes?: number; }; Update: { cao_warnings?: string[]; checked_at?: string | null; checked_by?: string | null; created_at?: string; drive_minutes?: number; exported_at?: string | null; extra_cents?: number; hours_total?: number; id?: string; invoice_id?: string | null; invoiced_at?: string | null; labour_cents?: number; manual_invoice?: boolean; materials_cents?: number; packages_cents?: number; pause_minutes?: number; remark?: string | null; status?: string; total_cents?: number; travel_cents?: number; updated_at?: string; werkbon_id?: string; work_minutes?: number; }; Relationships: [ { foreignKeyName: "werkbon_facturatie_controle_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: true; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbon_facturatie_controle_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: true; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; werkbon_facturatie_settings: { Row: { break_required_after_minutes: number; callout_fee_cents: number; created_at: string; hourly_rate_cents: number; id: string; max_workday_minutes: number; travel_hourly_rate_cents: number; travel_threshold_minutes: number; updated_at: string; vat_percentage: number; }; Insert: { break_required_after_minutes?: number; callout_fee_cents?: number; created_at?: string; hourly_rate_cents?: number; id?: string; max_workday_minutes?: number; travel_hourly_rate_cents?: number; travel_threshold_minutes?: number; updated_at?: string; vat_percentage?: number; }; Update: { break_required_after_minutes?: number; callout_fee_cents?: number; created_at?: string; hourly_rate_cents?: number; id?: string; max_workday_minutes?: number; travel_hourly_rate_cents?: number; travel_threshold_minutes?: number; updated_at?: string; vat_percentage?: number; }; Relationships: []; }; werkbon_materials: { Row: { article_number: string | null; created_at: string; created_by: string | null; description: string; id: string; quantity: number; source: string; unit: string; unit_price_cents: number; updated_at: string; werkbon_id: string; }; Insert: { article_number?: string | null; created_at?: string; created_by?: string | null; description: string; id?: string; quantity?: number; source?: string; unit?: string; unit_price_cents?: number; updated_at?: string; werkbon_id: string; }; Update: { article_number?: string | null; created_at?: string; created_by?: string | null; description?: string; id?: string; quantity?: number; source?: string; unit?: string; unit_price_cents?: number; updated_at?: string; werkbon_id?: string; }; Relationships: [ { foreignKeyName: "werkbon_materials_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbon_materials_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; werkbon_package_ai_rules: { Row: { active: boolean; case_sensitive: boolean; created_at: string; id: string; package_id: string; priority: number; rule_type: string; updated_at: string; value: string; }; Insert: { active?: boolean; case_sensitive?: boolean; created_at?: string; id?: string; package_id: string; priority?: number; rule_type: string; updated_at?: string; value: string; }; Update: { active?: boolean; case_sensitive?: boolean; created_at?: string; id?: string; package_id?: string; priority?: number; rule_type?: string; updated_at?: string; value?: string; }; Relationships: [ { foreignKeyName: "werkbon_package_ai_rules_package_id_fkey"; columns: ["package_id"]; isOneToOne: false; referencedRelation: "werkbon_packages"; referencedColumns: ["id"]; } ]; }; werkbon_package_categories: { Row: { active: boolean; created_at: string; id: string; kleur: string | null; naam: string; sort_order: number; updated_at: string; }; Insert: { active?: boolean; created_at?: string; id?: string; kleur?: string | null; naam: string; sort_order?: number; updated_at?: string; }; Update: { active?: boolean; created_at?: string; id?: string; kleur?: string | null; naam?: string; sort_order?: number; updated_at?: string; }; Relationships: []; }; werkbon_package_items: { Row: { article_number: string | null; artikel_id: string | null; created_at: string; gtin: string | null; id: string; manufacturer: string | null; omschrijving: string; package_id: string; price_synced_at: string | null; quantity: number; sort_order: number; source: string; sync_status: string; unit: string | null; unit_price_cents: number; updated_at: string; }; Insert: { article_number?: string | null; artikel_id?: string | null; created_at?: string; gtin?: string | null; id?: string; manufacturer?: string | null; omschrijving: string; package_id: string; price_synced_at?: string | null; quantity?: number; sort_order?: number; source?: string; sync_status?: string; unit?: string | null; unit_price_cents?: number; updated_at?: string; }; Update: { article_number?: string | null; artikel_id?: string | null; created_at?: string; gtin?: string | null; id?: string; manufacturer?: string | null; omschrijving?: string; package_id?: string; price_synced_at?: string | null; quantity?: number; sort_order?: number; source?: string; sync_status?: string; unit?: string | null; unit_price_cents?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "werkbon_package_items_artikel_id_fkey"; columns: ["artikel_id"]; isOneToOne: false; referencedRelation: "artikelen_cache"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbon_package_items_package_id_fkey"; columns: ["package_id"]; isOneToOne: false; referencedRelation: "werkbon_packages"; referencedColumns: ["id"]; } ]; }; werkbon_package_lines: { Row: { created_at: string; created_by: string | null; id: string; package_id: string; quantity: number; unit_price_cents_snapshot: number; werkbon_id: string; }; Insert: { created_at?: string; created_by?: string | null; id?: string; package_id: string; quantity?: number; unit_price_cents_snapshot?: number; werkbon_id: string; }; Update: { created_at?: string; created_by?: string | null; id?: string; package_id?: string; quantity?: number; unit_price_cents_snapshot?: number; werkbon_id?: string; }; Relationships: [ { foreignKeyName: "werkbon_package_lines_package_id_fkey"; columns: ["package_id"]; isOneToOne: false; referencedRelation: "werkbon_packages"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbon_package_lines_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbon_package_lines_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; werkbon_packages: { Row: { active: boolean; ai_tags: string[]; category_id: string | null; code: string; created_at: string; default_quantity: number; description: string | null; duration_minutes: number | null; id: string; mandaat_type: string | null; name: string; price_mode: string; sort_order: number; unit_price_cents: number; updated_at: string; }; Insert: { active?: boolean; ai_tags?: string[]; category_id?: string | null; code: string; created_at?: string; default_quantity?: number; description?: string | null; duration_minutes?: number | null; id?: string; mandaat_type?: string | null; name: string; price_mode?: string; sort_order?: number; unit_price_cents?: number; updated_at?: string; }; Update: { active?: boolean; ai_tags?: string[]; category_id?: string | null; code?: string; created_at?: string; default_quantity?: number; description?: string | null; duration_minutes?: number | null; id?: string; mandaat_type?: string | null; name?: string; price_mode?: string; sort_order?: number; unit_price_cents?: number; updated_at?: string; }; Relationships: [ { foreignKeyName: "werkbon_packages_category_id_fkey"; columns: ["category_id"]; isOneToOne: false; referencedRelation: "werkbon_package_categories"; referencedColumns: ["id"]; } ]; }; werkbon_photos: { Row: { created_at: string; id: string; storage_path: string; user_id: string; werkbon_id: string; }; Insert: { created_at?: string; id?: string; storage_path: string; user_id: string; werkbon_id: string; }; Update: { created_at?: string; id?: string; storage_path?: string; user_id?: string; werkbon_id?: string; }; Relationships: [ { foreignKeyName: "werkbon_photos_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbon_photos_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; werkbon_time_logs: { Row: { activity: string; created_at: string; ended_at: string | null; id: string; note: string | null; started_at: string; user_id: string; werkbon_id: string; }; Insert: { activity: string; created_at?: string; ended_at?: string | null; id?: string; note?: string | null; started_at?: string; user_id: string; werkbon_id: string; }; Update: { activity?: string; created_at?: string; ended_at?: string | null; id?: string; note?: string | null; started_at?: string; user_id?: string; werkbon_id?: string; }; Relationships: [ { foreignKeyName: "werkbon_time_logs_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbon_time_logs_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; werkbonnen: { Row: { assigned_user_id: string | null; budget_mandate_cents: number; complaint_description: string | null; created_at: string; created_by: string | null; customer_id: string | null; externe_referentie: string | null; extra_costs_cents: number; first_time_fix: boolean | null; id: string; internal_notes: string | null; needs_detail_review: boolean; parent_werkbon_id: string | null; parsed_payload: Json | null; planning_status: string; project_number: string | null; review_reasons: string[]; room_number: string | null; scheduled_end_time: string | null; scheduled_start_time: string | null; sequence_number: number; signature_accepted_at: string | null; signature_by_user_id: string | null; signature_name: string | null; source_email_meta: Json | null; source_mailbox_message_id: string | null; source_pdf_path: string | null; source_type: string; status: string; technician_id: string | null; technician_notes: string | null; technician_notes_raw: string | null; technician_task_description: string | null; updated_at: string; version: number; work_address: string | null; }; Insert: { assigned_user_id?: string | null; budget_mandate_cents?: number; complaint_description?: string | null; created_at?: string; created_by?: string | null; customer_id?: string | null; externe_referentie?: string | null; extra_costs_cents?: number; first_time_fix?: boolean | null; id?: string; internal_notes?: string | null; needs_detail_review?: boolean; parent_werkbon_id?: string | null; parsed_payload?: Json | null; planning_status?: string; project_number?: string | null; review_reasons?: string[]; room_number?: string | null; scheduled_end_time?: string | null; scheduled_start_time?: string | null; sequence_number: number; signature_accepted_at?: string | null; signature_by_user_id?: string | null; signature_name?: string | null; source_email_meta?: Json | null; source_mailbox_message_id?: string | null; source_pdf_path?: string | null; source_type?: string; status?: string; technician_id?: string | null; technician_notes?: string | null; technician_notes_raw?: string | null; technician_task_description?: string | null; updated_at?: string; version?: number; work_address?: string | null; }; Update: { assigned_user_id?: string | null; budget_mandate_cents?: number; complaint_description?: string | null; created_at?: string; created_by?: string | null; customer_id?: string | null; externe_referentie?: string | null; extra_costs_cents?: number; first_time_fix?: boolean | null; id?: string; internal_notes?: string | null; needs_detail_review?: boolean; parent_werkbon_id?: string | null; parsed_payload?: Json | null; planning_status?: string; project_number?: string | null; review_reasons?: string[]; room_number?: string | null; scheduled_end_time?: string | null; scheduled_start_time?: string | null; sequence_number?: number; signature_accepted_at?: string | null; signature_by_user_id?: string | null; signature_name?: string | null; source_email_meta?: Json | null; source_mailbox_message_id?: string | null; source_pdf_path?: string | null; source_type?: string; status?: string; technician_id?: string | null; technician_notes?: string | null; technician_notes_raw?: string | null; technician_task_description?: string | null; updated_at?: string; version?: number; work_address?: string | null; }; Relationships: [ { foreignKeyName: "werkbonnen_parent_werkbon_id_fkey"; columns: ["parent_werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbonnen_parent_werkbon_id_fkey"; columns: ["parent_werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbonnen_source_mailbox_message_id_fkey"; columns: ["source_mailbox_message_id"]; isOneToOne: false; referencedRelation: "mailbox_messages"; referencedColumns: ["id"]; } ]; }; work_order_monteurs: { Row: { created_at: string; id: string; monteur_id: string; work_order_id: string; }; Insert: { created_at?: string; id?: string; monteur_id: string; work_order_id: string; }; Update: { created_at?: string; id?: string; monteur_id?: string; work_order_id?: string; }; Relationships: [ { foreignKeyName: "work_order_monteurs_monteur_id_fkey"; columns: ["monteur_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; }, { foreignKeyName: "work_order_monteurs_work_order_id_fkey"; columns: ["work_order_id"]; isOneToOne: false; referencedRelation: "work_orders"; referencedColumns: ["id"]; } ]; }; work_order_photos: { Row: { ai_caption: string | null; ai_categorized_at: string | null; ai_labels: Json | null; caption: string | null; created_at: string; id: string; monteur_id: string | null; photo_type: string; storage_path: string; updated_at: string; work_order_id: string; }; Insert: { ai_caption?: string | null; ai_categorized_at?: string | null; ai_labels?: Json | null; caption?: string | null; created_at?: string; id?: string; monteur_id?: string | null; photo_type?: string; storage_path: string; updated_at?: string; work_order_id: string; }; Update: { ai_caption?: string | null; ai_categorized_at?: string | null; ai_labels?: Json | null; caption?: string | null; created_at?: string; id?: string; monteur_id?: string | null; photo_type?: string; storage_path?: string; updated_at?: string; work_order_id?: string; }; Relationships: [ { foreignKeyName: "work_order_photos_monteur_id_fkey"; columns: ["monteur_id"]; isOneToOne: false; referencedRelation: "profiles"; referencedColumns: ["id"]; }, { foreignKeyName: "work_order_photos_work_order_id_fkey"; columns: ["work_order_id"]; isOneToOne: false; referencedRelation: "work_orders"; referencedColumns: ["id"]; } ]; }; work_orders: { Row: { assigned_to: string | null; city: string | null; contact_person: string | null; created_at: string; custom_fields: Json; customer_name: string; description: string; email: string | null; email_source: string | null; estimated_duration_hours: number | null; external_reference: string | null; follow_up_needed: boolean; id: string; mandate: string; mandate_budget: number; mandate_used: number; order_number: string; parent_work_order_id: string | null; pdf_url: string | null; phone: string | null; postal_code: string; priority: string; project_number: string | null; report_validated: boolean; room_number: string; scheduled_date: string | null; scheduled_end_time: string | null; scheduled_start_time: string | null; status: string; total_hours_worked: number | null; total_price: number | null; travel_time_minutes: number | null; updated_at: string; work_address: string; work_report: string | null; }; Insert: { assigned_to?: string | null; city?: string | null; contact_person?: string | null; created_at?: string; custom_fields?: Json; customer_name?: string; description?: string; email?: string | null; email_source?: string | null; estimated_duration_hours?: number | null; external_reference?: string | null; follow_up_needed?: boolean; id?: string; mandate?: string; mandate_budget?: number; mandate_used?: number; order_number?: string; parent_work_order_id?: string | null; pdf_url?: string | null; phone?: string | null; postal_code?: string; priority?: string; project_number?: string | null; report_validated?: boolean; room_number?: string; scheduled_date?: string | null; scheduled_end_time?: string | null; scheduled_start_time?: string | null; status?: string; total_hours_worked?: number | null; total_price?: number | null; travel_time_minutes?: number | null; updated_at?: string; work_address?: string; work_report?: string | null; }; Update: { assigned_to?: string | null; city?: string | null; contact_person?: string | null; created_at?: string; custom_fields?: Json; customer_name?: string; description?: string; email?: string | null; email_source?: string | null; estimated_duration_hours?: number | null; external_reference?: string | null; follow_up_needed?: boolean; id?: string; mandate?: string; mandate_budget?: number; mandate_used?: number; order_number?: string; parent_work_order_id?: string | null; pdf_url?: string | null; phone?: string | null; postal_code?: string; priority?: string; project_number?: string | null; report_validated?: boolean; room_number?: string; scheduled_date?: string | null; scheduled_end_time?: string | null; scheduled_start_time?: string | null; status?: string; total_hours_worked?: number | null; total_price?: number | null; travel_time_minutes?: number | null; updated_at?: string; work_address?: string; work_report?: string | null; }; Relationships: [ { foreignKeyName: "work_orders_parent_work_order_id_fkey"; columns: ["parent_work_order_id"]; isOneToOne: false; referencedRelation: "work_orders"; referencedColumns: ["id"]; } ]; }; }; Views: { email_auth_connections_safe: { Row: { account_email: string | null; created_at: string | null; created_by: string | null; display_name: string | null; graph_subscription_expires_at: string | null; graph_subscription_id: string | null; has_access_token: boolean | null; has_client_id: boolean | null; has_client_secret: boolean | null; has_imap_password: boolean | null; has_refresh_token: boolean | null; has_smtp_password: boolean | null; id: string | null; imap_host: string | null; imap_port: number | null; imap_secure: boolean | null; imap_username: string | null; is_active: boolean | null; last_error: string | null; last_verified_at: string | null; oauth_mode: string | null; provider: string | null; purpose_assignments: Json | null; realtime_mode: string | null; scopes: string[] | null; smtp_host: string | null; smtp_port: number | null; smtp_secure: boolean | null; smtp_username: string | null; status: string | null; token_expires_at: string | null; updated_at: string | null; webhook_last_attempt_at: string | null; webhook_last_error: string | null; webhook_status: string | null; }; Insert: { account_email?: string | null; created_at?: string | null; created_by?: string | null; display_name?: string | null; graph_subscription_expires_at?: string | null; graph_subscription_id?: string | null; has_access_token?: never; has_client_id?: never; has_client_secret?: never; has_imap_password?: never; has_refresh_token?: never; has_smtp_password?: never; id?: string | null; imap_host?: string | null; imap_port?: number | null; imap_secure?: boolean | null; imap_username?: string | null; is_active?: boolean | null; last_error?: string | null; last_verified_at?: string | null; oauth_mode?: string | null; provider?: string | null; purpose_assignments?: Json | null; realtime_mode?: string | null; scopes?: string[] | null; smtp_host?: string | null; smtp_port?: number | null; smtp_secure?: boolean | null; smtp_username?: string | null; status?: string | null; token_expires_at?: string | null; updated_at?: string | null; webhook_last_attempt_at?: string | null; webhook_last_error?: string | null; webhook_status?: string | null; }; Update: { account_email?: string | null; created_at?: string | null; created_by?: string | null; display_name?: string | null; graph_subscription_expires_at?: string | null; graph_subscription_id?: string | null; has_access_token?: never; has_client_id?: never; has_client_secret?: never; has_imap_password?: never; has_refresh_token?: never; has_smtp_password?: never; id?: string | null; imap_host?: string | null; imap_port?: number | null; imap_secure?: boolean | null; imap_username?: string | null; is_active?: boolean | null; last_error?: string | null; last_verified_at?: string | null; oauth_mode?: string | null; provider?: string | null; purpose_assignments?: Json | null; realtime_mode?: string | null; scopes?: string[] | null; smtp_host?: string | null; smtp_port?: number | null; smtp_secure?: boolean | null; smtp_username?: string | null; status?: string | null; token_expires_at?: string | null; updated_at?: string | null; webhook_last_attempt_at?: string | null; webhook_last_error?: string | null; webhook_status?: string | null; }; Relationships: []; }; external_customers_grouped: { Row: { city: string | null; commercial_name: string | null; contact_person: string | null; country: string | null; display_name: string | null; email: string | null; fetched_at: string | null; gln: string | null; group_key: string | null; is_active: boolean | null; is_merged: boolean | null; logo_url: string | null; match_key: string | null; phone: string | null; providers: string[] | null; source_count: number | null; sources: Json | null; vat_number: string | null; website: string | null; }; Relationships: []; }; external_customers_unified: { Row: { city: string | null; commercial_name: string | null; company_name: string | null; connection_id: string | null; contact_person: string | null; country: string | null; email: string | null; external_id: string | null; fetched_at: string | null; gln: string | null; house_number: string | null; is_active: boolean | null; is_deleted: boolean | null; logo_url: string | null; phone: string | null; postal_code: string | null; provider: string | null; raw: Json | null; status: string | null; street: string | null; vat_number: string | null; website: string | null; }; Relationships: []; }; external_invoices_grouped: { Row: { currency: string | null; customer_external_id: string | null; customer_name: string | null; customer_vat: string | null; due_at: string | null; group_key: string | null; invoice_number: string | null; is_merged: boolean | null; issued_at: string | null; modified_at: string | null; open_amount: number | null; paid_at: string | null; providers: string[] | null; source_count: number | null; sources: Json | null; status: string | null; total_excl: number | null; total_incl: number | null; total_vat: number | null; }; Relationships: []; }; external_invoices_unified: { Row: { connection_id: string | null; currency: string | null; customer_external_id: string | null; customer_name: string | null; customer_vat: string | null; due_at: string | null; external_id: string | null; invoice_number: string | null; issued_at: string | null; open_amount: number | null; owner_user_id: string | null; paid_at: string | null; raw: Json | null; source: string | null; status: string | null; synced_at: string | null; total_excl: number | null; total_incl: number | null; total_vat: number | null; }; Relationships: []; }; floriday_customer_discounts: { Row: { base_price: number | null; buyer_organization_id: string | null; currency: string | null; discount_type: string | null; discount_value: number | null; min_quantity: number | null; net_price: number | null; product_group_id: string | null; raw: Json | null; source: string | null; source_id: string | null; trade_item_id: string | null; valid_from: string | null; valid_until: string | null; }; Relationships: []; }; local_customer_discounts: { Row: { base_price: number | null; currency: string | null; customer_id: string | null; discount_type: string | null; discount_value: number | null; min_quantity: number | null; net_price: number | null; product_category_id: string | null; product_id: string | null; product_name: string | null; source: string | null; source_id: string | null; valid_from: string | null; valid_until: string | null; }; Relationships: []; }; logistics_product_dimensions: { Row: { dimension_source: string | null; fust_height_mm: number | null; fust_length_mm: number | null; fust_name: string | null; fust_source: string | null; fust_type_id: string | null; fust_width_mm: number | null; height_source: string | null; missing_reason: string | null; plant_height_cm: number | null; plants_per_crate: number | null; product_id: string | null; product_name: string | null; }; Relationships: []; }; manufacture_product_possible_stock_view: { Row: { component_count: number | null; manufacture_product_id: string | null; possible_stock: number | null; }; Relationships: []; }; planning_overview: { Row: { assigned_monteur_id: string | null; assistants: Json | null; budget_mandate_cents: number | null; created_at: string | null; created_by: string | null; customer_id: string | null; customer_name: string | null; duration_minutes: number | null; end_at: string | null; id: string | null; needs_detail_review: boolean | null; notes: string | null; project_number: string | null; review_reasons: string[] | null; start_at: string | null; status: Database["public"]["Enums"]["planning_item_status"] | null; updated_at: string | null; viewer_role: string | null; werkbon_id: string | null; work_address: string | null; }; Relationships: [ { foreignKeyName: "planning_items_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "planning_items_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; product_group_stock_view: { Row: { item_count: number | null; product_group_id: string | null; total_stock: number | null; }; Relationships: [ { foreignKeyName: "product_group_items_product_group_id_fkey"; columns: ["product_group_id"]; isOneToOne: false; referencedRelation: "product_groups"; referencedColumns: ["id"]; } ]; }; trade_item_stock_view: { Row: { stock: number | null; trade_item_id: string | null; }; Relationships: []; }; uren_facturen: { Row: { created_at: string | null; created_by: string | null; customer_id: string | null; customer_name: string | null; id: string | null; invoice_number: string | null; note: string | null; status: string | null; total_excl_cents: number | null; total_incl_cents: number | null; updated_at: string | null; vat_cents: number | null; vat_percentage: number | null; werkbon_id: string | null; }; Insert: { created_at?: string | null; created_by?: string | null; customer_id?: string | null; customer_name?: string | null; id?: string | null; invoice_number?: string | null; note?: string | null; status?: string | null; total_excl_cents?: number | null; total_incl_cents?: number | null; updated_at?: string | null; vat_cents?: number | null; vat_percentage?: number | null; werkbon_id?: never; }; Update: { created_at?: string | null; created_by?: string | null; customer_id?: string | null; customer_name?: string | null; id?: string | null; invoice_number?: string | null; note?: string | null; status?: string | null; total_excl_cents?: number | null; total_incl_cents?: number | null; updated_at?: string | null; vat_cents?: number | null; vat_percentage?: number | null; werkbon_id?: never; }; Relationships: [ { foreignKeyName: "invoices_customer_id_fkey"; columns: ["customer_id"]; isOneToOne: false; referencedRelation: "itk_customers"; referencedColumns: ["id"]; } ]; }; uren_factuur_regels: { Row: { created_at: string | null; description: string | null; factuur_id: string | null; id: string | null; kind: string | null; quantity: number | null; sort_order: number | null; total_cents: number | null; unit: string | null; unit_price_cents: number | null; }; Insert: { created_at?: string | null; description?: string | null; factuur_id?: string | null; id?: string | null; kind?: string | null; quantity?: number | null; sort_order?: number | null; total_cents?: number | null; unit?: string | null; unit_price_cents?: number | null; }; Update: { created_at?: string | null; description?: string | null; factuur_id?: string | null; id?: string | null; kind?: string | null; quantity?: number | null; sort_order?: number | null; total_cents?: number | null; unit?: string | null; unit_price_cents?: number | null; }; Relationships: [ { foreignKeyName: "invoice_items_invoice_id_fkey"; columns: ["factuur_id"]; isOneToOne: false; referencedRelation: "invoices"; referencedColumns: ["id"]; }, { foreignKeyName: "invoice_items_invoice_id_fkey"; columns: ["factuur_id"]; isOneToOne: false; referencedRelation: "uren_facturen"; referencedColumns: ["id"]; } ]; }; v_external_customers_exact: { Row: { account_number: string | null; city: string | null; coc_number: string | null; company_name: string | null; connection_id: string | null; country: string | null; currency: string | null; email: string | null; external_id: string | null; is_sales: boolean | null; is_supplier: boolean | null; language: string | null; modified_at: string | null; phone: string | null; postal_code: string | null; raw: Json | null; source: string | null; street: string | null; synced_at: string | null; vat_number: string | null; website: string | null; }; Insert: { account_number?: string | null; city?: string | null; coc_number?: string | null; company_name?: string | null; connection_id?: string | null; country?: string | null; currency?: string | null; email?: string | null; external_id?: string | null; is_sales?: boolean | null; is_supplier?: boolean | null; language?: string | null; modified_at?: string | null; phone?: string | null; postal_code?: string | null; raw?: Json | null; source?: never; street?: string | null; synced_at?: string | null; vat_number?: string | null; website?: string | null; }; Update: { account_number?: string | null; city?: string | null; coc_number?: string | null; company_name?: string | null; connection_id?: string | null; country?: string | null; currency?: string | null; email?: string | null; external_id?: string | null; is_sales?: boolean | null; is_supplier?: boolean | null; language?: string | null; modified_at?: string | null; phone?: string | null; postal_code?: string | null; raw?: Json | null; source?: never; street?: string | null; synced_at?: string | null; vat_number?: string | null; website?: string | null; }; Relationships: [ { foreignKeyName: "exact_customers_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; v_external_customers_floriday: { Row: { city: string | null; commercial_name: string | null; company_name: string | null; connection_id: string | null; contact_person: string | null; country: string | null; email: string | null; external_id: string | null; fetched_at: string | null; gln: string | null; house_number: string | null; is_active: boolean | null; is_deleted: boolean | null; logo_url: string | null; phone: string | null; postal_code: string | null; provider: string | null; raw: Json | null; status: string | null; street: string | null; vat_number: string | null; website: string | null; }; Relationships: [ { foreignKeyName: "floriday_customers_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "floriday_connections"; referencedColumns: ["id"]; } ]; }; v_external_customers_local: { Row: { city: string | null; commercial_name: string | null; company_name: string | null; connection_id: string | null; contact_person: string | null; country: string | null; email: string | null; external_id: string | null; fetched_at: string | null; gln: string | null; house_number: string | null; is_active: boolean | null; is_deleted: boolean | null; logo_url: string | null; phone: string | null; postal_code: string | null; provider: string | null; raw: Json | null; status: string | null; street: string | null; vat_number: string | null; website: string | null; }; Insert: { city?: string | null; commercial_name?: string | null; company_name?: string | null; connection_id?: never; contact_person?: string | null; country?: string | null; email?: string | null; external_id?: never; fetched_at?: never; gln?: string | null; house_number?: string | null; is_active?: never; is_deleted?: never; logo_url?: string | null; phone?: string | null; postal_code?: string | null; provider?: never; raw?: never; status?: string | null; street?: string | null; vat_number?: string | null; website?: string | null; }; Update: { city?: string | null; commercial_name?: string | null; company_name?: string | null; connection_id?: never; contact_person?: string | null; country?: string | null; email?: string | null; external_id?: never; fetched_at?: never; gln?: string | null; house_number?: string | null; is_active?: never; is_deleted?: never; logo_url?: string | null; phone?: string | null; postal_code?: string | null; provider?: never; raw?: never; status?: string | null; street?: string | null; vat_number?: string | null; website?: string | null; }; Relationships: []; }; v_external_customers_twinfield: { Row: { city: string | null; commercial_name: string | null; company_name: string | null; connection_id: string | null; contact_person: string | null; country: string | null; email: string | null; external_id: string | null; fetched_at: string | null; gln: string | null; house_number: string | null; is_active: boolean | null; is_deleted: boolean | null; logo_url: string | null; phone: string | null; postal_code: string | null; provider: string | null; raw: Json | null; status: string | null; street: string | null; vat_number: string | null; website: string | null; }; Relationships: [ { foreignKeyName: "twinfield_customers_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "twinfield_connections"; referencedColumns: ["id"]; } ]; }; v_external_invoices_exact: { Row: { connection_id: string | null; currency: string | null; customer_external_id: string | null; customer_name: string | null; customer_vat: string | null; due_at: string | null; external_id: string | null; invoice_number: string | null; issued_at: string | null; open_amount: number | null; paid_at: string | null; raw: Json | null; source: string | null; status: string | null; synced_at: string | null; total_excl: number | null; total_incl: number | null; total_vat: number | null; }; Insert: { connection_id?: string | null; currency?: never; customer_external_id?: string | null; customer_name?: string | null; customer_vat?: never; due_at?: string | null; external_id?: string | null; invoice_number?: string | null; issued_at?: string | null; open_amount?: number | null; paid_at?: string | null; raw?: Json | null; source?: never; status?: string | null; synced_at?: string | null; total_excl?: number | null; total_incl?: number | null; total_vat?: number | null; }; Update: { connection_id?: string | null; currency?: never; customer_external_id?: string | null; customer_name?: string | null; customer_vat?: never; due_at?: string | null; external_id?: string | null; invoice_number?: string | null; issued_at?: string | null; open_amount?: number | null; paid_at?: string | null; raw?: Json | null; source?: never; status?: string | null; synced_at?: string | null; total_excl?: number | null; total_incl?: number | null; total_vat?: number | null; }; Relationships: [ { foreignKeyName: "exact_invoices_cache_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "exact_connections"; referencedColumns: ["id"]; } ]; }; v_external_invoices_twinfield: { Row: { connection_id: string | null; currency: string | null; customer_external_id: string | null; customer_name: string | null; customer_vat: string | null; due_at: string | null; external_id: string | null; invoice_number: string | null; issued_at: string | null; open_amount: number | null; owner_user_id: string | null; paid_at: string | null; raw: Json | null; source: string | null; status: string | null; synced_at: string | null; total_excl: number | null; total_incl: number | null; total_vat: number | null; }; Relationships: [ { foreignKeyName: "twinfield_invoices_cache_v2_connection_id_fkey"; columns: ["connection_id"]; isOneToOne: false; referencedRelation: "twinfield_connections"; referencedColumns: ["id"]; } ]; }; v_werkbon_totalen: { Row: { packages_cents: number | null; packages_minutes: number | null; werkbon_id: string | null; }; Relationships: [ { foreignKeyName: "werkbon_package_lines_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbon_package_lines_werkbon_id_fkey"; columns: ["werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; wo_overview: { Row: { assigned_user_id: string | null; budget_mandate_cents: number | null; created_at: string | null; customer_id: string | null; id: string | null; needs_detail_review: boolean | null; number: string | null; parent_werkbon_id: string | null; planning_status: string | null; scheduled_end_time: string | null; scheduled_start_time: string | null; source_type: string | null; status: string | null; technician_id: string | null; updated_at: string | null; work_address: string | null; }; Insert: { assigned_user_id?: string | null; budget_mandate_cents?: number | null; created_at?: string | null; customer_id?: string | null; id?: string | null; needs_detail_review?: boolean | null; number?: string | null; parent_werkbon_id?: string | null; planning_status?: string | null; scheduled_end_time?: string | null; scheduled_start_time?: string | null; source_type?: string | null; status?: string | null; technician_id?: string | null; updated_at?: string | null; work_address?: string | null; }; Update: { assigned_user_id?: string | null; budget_mandate_cents?: number | null; created_at?: string | null; customer_id?: string | null; id?: string | null; needs_detail_review?: boolean | null; number?: string | null; parent_werkbon_id?: string | null; planning_status?: string | null; scheduled_end_time?: string | null; scheduled_start_time?: string | null; source_type?: string | null; status?: string | null; technician_id?: string | null; updated_at?: string | null; work_address?: string | null; }; Relationships: [ { foreignKeyName: "werkbonnen_parent_werkbon_id_fkey"; columns: ["parent_werkbon_id"]; isOneToOne: false; referencedRelation: "werkbonnen"; referencedColumns: ["id"]; }, { foreignKeyName: "werkbonnen_parent_werkbon_id_fkey"; columns: ["parent_werkbon_id"]; isOneToOne: false; referencedRelation: "wo_overview"; referencedColumns: ["id"]; } ]; }; }; Functions: { _floriday_schedule_job: { Args: { p_apikey: string; p_jobname: string; p_schedule: string; p_timeout_ms: number; p_url: string; }; Returns: number; }; _migrate_rewrite_stock_key: { Args: { _from_key: string; _to_key: string; }; Returns: undefined; }; afh_city_code: { Args: { _city: string; _country: string; }; Returns: string; }; afh_normalize_country: { Args: { _raw: string; }; Returns: string; }; afh_normalize_nl_province: { Args: { _raw: string; }; Returns: string; }; afh_subtract_workdays: { Args: { _date: string; _days: number; }; Returns: string; }; ai_usage_by_module: { Args: { _from: string; _to: string; }; Returns: { calls: number; consumer_module_id: string; cost_usd: number; errors: number; input_tokens: number; output_tokens: number; total_tokens: number; }[]; }; apply_stock_consumption: { Args: { p_order_id: string; p_order_item_id: string; p_qty: number; p_reason: string; p_source: string; p_trade_item_key: string; }; Returns: undefined; }; apply_stock_reservation: { Args: { p_order_id: string; p_order_item_id: string; p_qty: number; p_reason: string; p_source: string; p_trade_item_key: string; }; Returns: undefined; }; approve_mailbox_order_proposal: { Args: { p_custom_fields: Json; p_customer_id: string; p_delivery_date: string; p_field_values?: Json; p_lines: Json; p_notes: string; p_proposal_id: string; p_reviewed_by: string; }; Returns: Json; }; assign_cart_numbers: { Args: { p_carts: Json; }; Returns: { cart_index: number; cart_number: string; day_seq: number; order_id: string; order_source: string; pick_date: string; status: string; }[]; }; assign_floriday_order_numbers: { Args: { p_ids: string[]; }; Returns: { floriday_id: string; order_number: string; }[]; }; autolink_product_to_floriday: { Args: { p_product_id: string; }; Returns: string; }; backfill_open_order_reservations: { Args: never; Returns: { processed_items: number; }[]; }; backfill_order_auto_invoice_queue: { Args: never; Returns: number; }; calculate_floriday_desired_stock: { Args: { p_connection_id: string; p_product_id: string; }; Returns: { desired_availability: boolean; desired_quantity: number; erp_available: number; stock_mode: string; }[]; }; calculate_layer_stock: { Args: { p_product_id: string; }; Returns: number; }; call_exact_route: { Args: { path: string; }; Returns: number; }; can_manage_hours: { Args: never; Returns: boolean; }; check_offer_product_available_stock: { Args: { p_campaign_product_id: string; p_code: string; p_needed_qty?: number; p_product_name?: string; }; Returns: Json; }; check_trade_item_available_stock: { Args: { p_connection_id?: string; p_context?: string; p_needed_qty?: number; p_order_id?: string; p_order_item_id?: string; p_owner_id?: string; p_product_name?: string; p_trade_item_key: string; }; Returns: Json; }; claim_cloud_print_jobs: { Args: { _max?: number; }; Returns: { aflever_pogingen: number; agent_id: string | null; artefact_bytes: number | null; artefact_gereed_op: string | null; artefact_pad: string | null; artefact_sha256: string | null; batch_id: string | null; bron_job_id: string | null; created_at: string; documentnaam: string; documenttype: Database["public"]["Enums"]["doc_layout_type"]; extern_job_id: string | null; fase_gestart_op: string | null; fase_voltooid_op: string | null; foutcode: string | null; foutmelding: string | null; gebruiker_id: string | null; gebruiker_naam: string; gebruikte_bron: string | null; gebruikte_layout_id: string | null; gestart_op: string | null; herkomst: string | null; id: string; idempotentie_sleutel: string | null; is_herprint: boolean; kopieen: number; layout_id: string | null; lokaal_opgeslagen_op: string | null; lokale_pdf_claim_id: string | null; lokale_pdf_claim_tot: string | null; lokale_pdf_fout: string | null; lokale_pdf_print_plek_id: string | null; lokale_pdf_status: string | null; opgepakt_op: string | null; paginas: number; payload: Json; pdf_base64: string | null; pdf_url: string | null; pogingen: number; printer_id: string | null; render_html: string | null; resultaat_pdf_base64: string | null; status: Database["public"]["Enums"]["print_job_status"]; updated_at: string; verwerkingsfase: string; volgende_poging: string | null; voltooid_op: string | null; }[]; SetofOptions: { from: "*"; to: "print_jobs"; isOneToOne: false; isSetofReturn: true; }; }; claim_floriday_stock_queue: { Args: { p_limit?: number; p_worker?: string; }; Returns: { attempts: number; connection_id: string; created_at: string; dead_lettered_at: string | null; desired_available: boolean | null; gateway_attempt_id: string | null; id: string; last_error: string | null; locked_at: string | null; locked_by: string | null; next_attempt_at: string; number_of_pieces: number; product_id: string | null; sent_at: string | null; status: string; stock_mode: string | null; superseded_by: string | null; target_week: number | null; target_year: number | null; trade_item_id: string; updated_at: string; user_id: string; }[]; SetofOptions: { from: "*"; to: "floriday_continuous_stock_queue"; isOneToOne: false; isSetofReturn: true; }; }; claim_local_pdf_jobs: { Args: { _max?: number; _print_plek_id: string; _writer_id: string; }; Returns: { artefact_bytes: number; artefact_pad: string; artefact_sha256: string; documentnaam: string; id: string; lokale_pdf_print_plek_id: string; lokale_pdf_status: string; printer_id: string; resultaat_pdf_base64: string; status: string; }[]; }; claim_logistics_tasks: { Args: { _limit?: number; _owner_module: string; _stale_minutes?: number; _task_type: string; _worker: string; }; Returns: { attempt_log: Json; attempts: number; buffer_ref: string | null; claimed_at: string | null; claimed_by: string | null; completed_at: string | null; created_at: string; depends_on: string[]; due_at: string | null; error: string | null; id: string; last_error: string | null; next_attempt_at: string | null; order_ref: string; owner_module: string; payload: Json; plan_run_id: string | null; planned_end: string | null; planned_start: string | null; priority: number; result: Json | null; rule_config_id: string | null; rule_version: number | null; sequence: number; shadow: boolean; started_at: string | null; status: string; strategy_id: string | null; task_type: string; updated_at: string; user_id: string; }[]; SetofOptions: { from: "*"; to: "logistics_tasks"; isOneToOne: false; isSetofReturn: true; }; }; claim_pdf_print_jobs: { Args: { _max?: number; }; Returns: { aflever_pogingen: number; agent_id: string | null; artefact_bytes: number | null; artefact_gereed_op: string | null; artefact_pad: string | null; artefact_sha256: string | null; batch_id: string | null; bron_job_id: string | null; created_at: string; documentnaam: string; documenttype: Database["public"]["Enums"]["doc_layout_type"]; extern_job_id: string | null; fase_gestart_op: string | null; fase_voltooid_op: string | null; foutcode: string | null; foutmelding: string | null; gebruiker_id: string | null; gebruiker_naam: string; gebruikte_bron: string | null; gebruikte_layout_id: string | null; gestart_op: string | null; herkomst: string | null; id: string; idempotentie_sleutel: string | null; is_herprint: boolean; kopieen: number; layout_id: string | null; lokaal_opgeslagen_op: string | null; lokale_pdf_claim_id: string | null; lokale_pdf_claim_tot: string | null; lokale_pdf_fout: string | null; lokale_pdf_print_plek_id: string | null; lokale_pdf_status: string | null; opgepakt_op: string | null; paginas: number; payload: Json; pdf_base64: string | null; pdf_url: string | null; pogingen: number; printer_id: string | null; render_html: string | null; resultaat_pdf_base64: string | null; status: Database["public"]["Enums"]["print_job_status"]; updated_at: string; verwerkingsfase: string; volgende_poging: string | null; voltooid_op: string | null; }[]; SetofOptions: { from: "*"; to: "print_jobs"; isOneToOne: false; isSetofReturn: true; }; }; claim_print_jobs: { Args: { _agent_id: string; _max?: number; }; Returns: { aflever_pogingen: number; agent_id: string | null; artefact_bytes: number | null; artefact_gereed_op: string | null; artefact_pad: string | null; artefact_sha256: string | null; batch_id: string | null; bron_job_id: string | null; created_at: string; documentnaam: string; documenttype: Database["public"]["Enums"]["doc_layout_type"]; extern_job_id: string | null; fase_gestart_op: string | null; fase_voltooid_op: string | null; foutcode: string | null; foutmelding: string | null; gebruiker_id: string | null; gebruiker_naam: string; gebruikte_bron: string | null; gebruikte_layout_id: string | null; gestart_op: string | null; herkomst: string | null; id: string; idempotentie_sleutel: string | null; is_herprint: boolean; kopieen: number; layout_id: string | null; lokaal_opgeslagen_op: string | null; lokale_pdf_claim_id: string | null; lokale_pdf_claim_tot: string | null; lokale_pdf_fout: string | null; lokale_pdf_print_plek_id: string | null; lokale_pdf_status: string | null; opgepakt_op: string | null; paginas: number; payload: Json; pdf_base64: string | null; pdf_url: string | null; pogingen: number; printer_id: string | null; render_html: string | null; resultaat_pdf_base64: string | null; status: Database["public"]["Enums"]["print_job_status"]; updated_at: string; verwerkingsfase: string; volgende_poging: string | null; voltooid_op: string | null; }[]; SetofOptions: { from: "*"; to: "print_jobs"; isOneToOne: false; isSetofReturn: true; }; }; claim_print_queue_lease: { Args: { _houder: string; _naam: string; _seconden?: number; }; Returns: boolean; }; claim_twinfield_push_batch: { Args: { _customer_id?: string; _limit?: number; }; Returns: { action: string; attempt_started_at: string | null; attempts: number; connection_id: string | null; created_at: string; customer_id: string | null; external_id: string | null; id: string; idempotency_key: string; last_error: string | null; next_attempt_at: string; office_code: string | null; payload: Json; status: string; updated_at: string; }[]; SetofOptions: { from: "*"; to: "twinfield_push_queue"; isOneToOne: false; isSetofReturn: true; }; }; cleanup_floriday_stock_queue: { Args: never; Returns: undefined; }; cleanup_old_bookings: { Args: never; Returns: undefined; }; cleanup_voorraad_module_history: { Args: never; Returns: undefined; }; complete_floriday_stock_queue: { Args: { p_attempt_id?: string; p_error?: string; p_id: string; p_ok: boolean; p_permanent?: boolean; }; Returns: undefined; }; consume_bom_for_production: { Args: { p_connection_id: string; p_parent_id: string; p_parent_key: string; p_parent_kind: string; p_quantity: number; p_user_id: string; }; Returns: Json; } | { Args: { p_batch_id?: string; p_connection_id: string; p_parent_id: string; p_parent_key: string; p_parent_kind: string; p_quantity: number; p_user_id: string; }; Returns: Json; }; consume_floriday_rate_limit: { Args: { p_bucket: string; p_capacity: number; p_cost?: number; p_refill_per_sec: number; }; Returns: { granted: boolean; wait_ms: number; }[]; }; consume_print_agent_pairing: { Args: { _pairing_hash: string; _token_hash: string; }; Returns: { agent_id: string; agent_naam: string; }[]; }; consume_van_inventory: { Args: { p_inventory_id: string; p_quantity: number; }; Returns: { barcode: string | null; created_at: string; id: string; monteur_id: string | null; price_per_unit: number; product_name: string; quantity_current: number; quantity_min: number; unit: string; updated_at: string; }; SetofOptions: { from: "*"; to: "van_inventories"; isOneToOne: true; isSetofReturn: false; }; }; control_get_todays_carts: { Args: never; Returns: { cart_index: number; cart_number: string; cart_number_id: string; cart_seq: number; cart_total: number; order_id: string; order_number: string; order_source: string; pick_date: string; printed_at: string; printed_today: boolean; status: string; }[]; }; control_mark_carts_delivered: { Args: { p_carts: Json; }; Returns: number; }; count_distinct_regulatory_products: { Args: never; Returns: number; }; current_monteur_id: { Args: never; Returns: string; }; custom_access_token_hook: { Args: { event: Json; }; Returns: Json; }; customer_soft_key: { Args: { _email: string; _house: string; _name: string; _postal: string; }; Returns: string; }; dashboard_alert_counts: { Args: never; Returns: Json; }; dashboard_alert_rows: { Args: { check_id: string; row_limit?: number; }; Returns: Json; }; dashboard_list_public_schema: { Args: never; Returns: { column_name: string; data_type: string; table_name: string; }[]; }; delete_samenstelling: { Args: { p_parent_id: string; p_parent_kind: string; }; Returns: Json; }; dispatch_carrier_signups_sql: { Args: { _catchup?: string; }; Returns: Json; }; effective_module_permission: { Args: { _module_id: string; _user_id: string; }; Returns: string; } | { Args: { _feature_id: string; _module_id: string; _user_id: string; }; Returns: string; }; email_auth_decrypt: { Args: { cipher: string; }; Returns: string; }; email_auth_encrypt: { Args: { plain: string; }; Returns: string; }; email_auth_fetch_message: { Args: { _connection_id: string; _external_id: string; }; Returns: Json; }; email_auth_for_purpose: { Args: { _direction: string; _purpose: string; }; Returns: { account_email: string; display_name: string; id: string; last_error: string; last_verified_at: string; needs_reauth: boolean; provider: string; status: string; }[]; }; email_auth_upsert_connection: { Args: { _account_email: string; _created_by: string; _is_active: boolean; _provider: string; _status: string; }; Returns: string; }; employee_day_hours: { Args: { _day: string; _employee_id: string; }; Returns: number; }; enqueue_cart_replan_if_unlocked: { Args: { p_order_id: string; }; Returns: undefined; }; ensure_system_roles: { Args: never; Returns: { action: string; role_key: string; }[]; }; ensure_trade_item_stock_row: { Args: { p_key: string; }; Returns: undefined; }; ensure_user_tenant: { Args: never; Returns: string; }; exact_auth_consume_calls: { Args: { _account_key: string; _calls?: number; _day_limit?: number; _division_code: number; _environment: string; _minute_limit?: number; }; Returns: Json; }; exact_auth_prune_sync_log: { Args: never; Returns: undefined; }; exact_decrypt: { Args: { cipher: string; }; Returns: string; }; exact_encrypt: { Args: { plain: string; }; Returns: string; }; exact_lock_environment: { Args: { _environment: string; }; Returns: undefined; }; exact_release_refresh_lock: { Args: { _environment: Database["public"]["Enums"]["exact_env"]; _locked_by: string; }; Returns: undefined; }; exact_try_acquire_refresh_lock: { Args: { _environment: Database["public"]["Enums"]["exact_env"]; _lease_seconds?: number; _locked_by?: string; }; Returns: boolean; }; find_trade_item_key: { Args: { p_barcode: string; p_name: string; p_product_id: string; }; Returns: string; }; finish_local_pdf_job: { Args: { _fout?: string; _job_id: string; _status: string; _writer_id: string; }; Returns: boolean; }; floriday_adopt_connection: { Args: { p_new: string; p_old: string; }; Returns: Json; }; floriday_autoheal_connections: { Args: never; Returns: Json; }; floriday_capture_stock_snapshot: { Args: never; Returns: number; }; floriday_cleanup_stock_queue_v2: { Args: never; Returns: undefined; }; floriday_compact_stock_snapshots: { Args: never; Returns: undefined; }; floriday_default_owner: { Args: { p_connection_id: string; }; Returns: string; }; floriday_effective_price: { Args: { _buyer_id: string; _on_date?: string; _quantity?: number; _trade_item_id: string; }; Returns: { base_price: number; currency: string; discount_type: string; discount_value: number; net_price: number; source: string; source_id: string; }[]; }; floriday_fill_publish_horizon: { Args: never; Returns: number; }; floriday_ingest_sales_orders: { Args: { p_limit?: number; }; Returns: number; }; floriday_publish_horizon_weeks: { Args: never; Returns: number; }; floriday_recompute_inventory: { Args: { p_connection_id: string; p_force?: boolean; p_product_id: string; }; Returns: undefined; }; floriday_relink_products: { Args: { p_connection_id?: string; }; Returns: Json; }; floriday_requeue_dead_letters: { Args: { p_connection_id?: string; }; Returns: number; }; format_cart_number: { Args: { p_pick_date: string; p_seq: number; }; Returns: string; }; get_active_floriday_connection_public: { Args: never; Returns: { active_environment: string; environment: string; gln_code: string; id: string; label: string; organization_name: string; preferred_warehouse_id: string; preferred_warehouse_name: string; }[]; }; get_active_floriday_context: { Args: never; Returns: { connection_id: string; user_id: string; }[]; }; get_active_twinfield_public: { Args: never; Returns: { active_environment: string; company_code: string; company_name: string; connection_id: string; environment: string; office_code: string; }[]; }; get_floricode_record_counts: { Args: never; Returns: { count: number; resource: string; }[]; }; get_floriday_agreements_active: { Args: { p_on_date?: string; }; Returns: { buyer_organization_id: string; data: Json; floriday_id: string; status: string; valid_from: string; valid_until: string; }[]; }; get_floriday_clock_supplies_window: { Args: { p_from: string; p_to: string; }; Returns: { auction_date: string; data: Json; floriday_id: string; status: string; trade_item_id: string; }[]; }; get_floriday_cron_jobs: { Args: never; Returns: { active: boolean; jobname: string; schedule: string; url: string; }[]; }; get_floriday_delivery_locations: { Args: { p_organization_id: string; }; Returns: { data: Json; floriday_id: string; gln_code: string; name: string; }[]; }; get_floriday_fulfillment_orders_window: { Args: { p_from: string; p_to: string; }; Returns: { auction_date: string; data: Json; delivery_order_id: string; destination_warehouse_id: string; floriday_id: string; status: string; }[]; }; get_floriday_sales_orders_window: { Args: { p_from: string; p_to: string; }; Returns: { buyer_organization_id: string; data: Json; floriday_id: string; status: string; updated_at: string; }[]; }; get_floriday_sync_health: { Args: never; Returns: { entity_type: string; last_error: string; last_items_processed: number; last_sequence_number: number; last_success_at: string; last_synced_at: string; minutes_since_success: number; }[]; }; get_group_allocation_keys: { Args: { p_product_id: string; }; Returns: { k: string; ord: number; }[]; }; get_group_head_key: { Args: { p_group_id: string; }; Returns: string; }; get_inventory_stock_for_key: { Args: { p_key: string; }; Returns: number; }; get_offer_branding: { Args: never; Returns: Json; }; get_offer_by_link_code: { Args: { p_code: string; }; Returns: Json; }; get_offer_delivery_options: { Args: { p_code: string; }; Returns: Json; }; get_offer_recipient_by_code: { Args: { p_code: string; }; Returns: { campaign_id: string; clicked_at: string; customer_id: string; id: string; ordered_at: string; }[]; }; get_or_assign_floriday_order_number: { Args: { p_floriday_id: string; }; Returns: string; }; get_product_group_available_stock: { Args: { p_group_id: string; }; Returns: number; }; get_room_busy_windows: { Args: { p_from: string; p_to: string; }; Returns: { end_time: string; room_id: string; start_time: string; status: string; }[]; }; get_twinfield_cron_jobs: { Args: never; Returns: { active: boolean; jobname: string; schedule: string; url: string; }[]; }; get_user_tenant_id: { Args: never; Returns: string; }; handover_archief_lijst: { Args: never; Returns: Json; }; handover_archiveren: { Args: { _archief?: boolean; _module_id: string; }; Returns: boolean; }; handover_check_afronden: { Args: { _module_id: string; }; Returns: boolean; }; handover_check_markeren: { Args: { _module_ids: string[]; _reden?: string; }; Returns: number; }; handover_fingerprint_maken: { Args: { _module_id?: string; }; Returns: Json; }; handover_get: { Args: { _module_id: string; }; Returns: Json; }; handover_kern_naam: { Args: { _naam: string; }; Returns: string; }; handover_ketenmodel: { Args: never; Returns: Json; }; handover_kruisconflicten: { Args: never; Returns: Json; }; handover_list: { Args: never; Returns: Json; }; handover_mag_schrijven: { Args: { _module_id: string; }; Returns: boolean; }; handover_module_meta_zetten: { Args: { _module_id: string; _project_url?: string; _publicatie_url?: string; }; Returns: boolean; }; handover_norm_naam: { Args: { _naam: string; }; Returns: string; }; handover_publish: { Args: { _bevindingen?: string; _bezit_tabellen?: string[]; _conflicten_snapshot?: Json; _contractfuncties?: string[]; _inhoud_md: string; _module_id: string; _module_titel: string; _ontbrekende_contracten?: string[]; _samenvatting?: string; }; Returns: number; }; handover_publish_uit_github: { Args: { _bezit_tabellen?: string[]; _bron_soort?: string; _commit?: string; _contractfuncties?: string[]; _inhoud_md: string; _module_id: string; _module_titel: string; _ontbrekende_contracten?: string[]; _pad?: string; _repo?: string; _samenvatting?: string; _versie_label?: string; }; Returns: Json; }; handover_publish_via_token: { Args: { _bevindingen?: string; _bezit_tabellen?: string[]; _conflicten_snapshot?: Json; _contractfuncties?: string[]; _inhoud_md: string; _module_id: string; _module_titel: string; _ontbrekende_contracten?: string[]; _samenvatting?: string; _token_hash: string; }; Returns: Json; }; handover_status: { Args: never; Returns: Json; }; handover_synonym_kern: { Args: { _naam: string; }; Returns: string; }; handover_update: { Args: { _bezit_tabellen?: string[]; _contractfuncties?: string[]; _herzieningstermijn_dagen?: number; _inhoud_md?: string; _module_id: string; _module_titel?: string; _samenvatting?: string; _versie: number; }; Returns: boolean; } | { Args: { _bevindingen?: string; _bezit_tabellen?: string[]; _contractfuncties?: string[]; _herzieningstermijn_dagen?: number; _inhoud_md?: string; _module_id: string; _module_titel?: string; _ontbrekende_contracten?: string[]; _samenvatting?: string; _versie: number; }; Returns: boolean; }; handover_versie_verwijderen: { Args: { _module_id: string; _versie: number; }; Returns: boolean; }; handover_versies: { Args: { _module_id: string; }; Returns: Json; }; handover_verwijderen: { Args: { _module_id: string; }; Returns: boolean; }; handover_wijzigingen: { Args: { _module_id?: string; }; Returns: Json; }; has_module_permission: { Args: { _min: string; _module_id: string; _user_id: string; }; Returns: boolean; }; has_role: { Args: { _role: Database["public"]["Enums"]["app_role"]; _user_id: string; }; Returns: boolean; }; has_twinfield_link: { Args: never; Returns: boolean; }; instructie_get: { Args: { _sleutel: string; }; Returns: Json; }; instructie_list: { Args: never; Returns: Json; }; instructie_publish: { Args: { _inhoud_md: string; _sleutel: string; _titel: string; _toelichting?: string; }; Returns: number; }; invoice_create_from_source: { Args: { _payload?: Json; _source_id: string; _source_type: string; }; Returns: Json; }; invoice_get_billable_lines: { Args: { _invoice_id: string; }; Returns: Json; }; invoice_get_for_source: { Args: { _source_id: string; _source_type: string; }; Returns: Json; }; invoice_get_summary: { Args: { _invoice_id: string; }; Returns: Json; }; invoice_list_sources: { Args: { _limit?: number; _source_type?: string; }; Returns: Json; }; invoice_recalc_totals: { Args: { _invoice_id: string; }; Returns: Json; }; is_authenticated: { Args: never; Returns: boolean; }; is_developer: { Args: never; Returns: boolean; }; is_superadmin: { Args: { _user_id: string; }; Returns: boolean; }; is_time_log_week_locked: { Args: { p_employee_id: string; p_start_time: string; }; Returns: boolean; }; is_user_admin: { Args: never; Returns: boolean; }; is_user_admin_or_administratie: { Args: never; Returns: boolean; }; itk_offerte_naar_werkbon: { Args: { _offerte_id: string; }; Returns: string; }; itk_offerte_restant_mandaat: { Args: { _exclude_offerte_id?: string; _werkbon_id: string; }; Returns: number; }; jwt_has_role: { Args: { _role: Database["public"]["Enums"]["app_role"]; }; Returns: boolean; }; list_medewerkers: { Args: never; Returns: { avatar_url: string; color: string; display_name: string; email: string; hours_fri: number; hours_mon: number; hours_thu: number; hours_tue: number; hours_wed: number; id: string; is_active: boolean; leave_balance_hours: number; persnr: string; phone: string; roles: string[]; }[]; }; list_monteur_absences: { Args: { _from: string; _to: string; }; Returns: { absence_date: string; end_time: string; full_day: boolean; kind: string; monteur_id: string; start_time: string; }[]; }; list_monteurs: { Args: never; Returns: { avatar_url: string; display_name: string; email: string; id: string; }[]; }; list_my_planning_items: { Args: { _from: string; _to: string; }; Returns: { assigned_monteur_id: string; end_at: string; id: string; notes: string; role: string; start_at: string; status: Database["public"]["Enums"]["planning_item_status"]; werkbon_id: string; }[]; }; local_effective_price: { Args: { _customer_id: string; _on_date?: string; _product_id: string; _quantity?: number; }; Returns: { currency: string; discount_type: string; discount_value: number; net_price: number; source: string; source_id: string; }[]; }; log_ai_call: { Args: { _consumer_module_id: string; _cost_usd: number; _duration_ms: number; _error_code: string; _error_message: string; _input_tokens: number; _model_slug: string; _output_tokens: number; _provider_slug: string; _status: string; _total_tokens: number; }; Returns: string; }; logistics_active_pick_workdays: { Args: never; Returns: string[]; }; logistics_address_key: { Args: { p_location: string; }; Returns: string; }; logistics_allowed_load_carriers: { Args: { p_strategy_id?: string; p_user_id?: string; }; Returns: Json; }; logistics_apply_buffer_decision: { Args: { p_order_id: string; }; Returns: string; }; logistics_apply_document_layouts: { Args: never; Returns: undefined; }; logistics_apply_order_buffer: { Args: { p_order_id: string; }; Returns: Json; }; logistics_approve_delay_reschedule: { Args: { p_alert_id: string; }; Returns: boolean; }; logistics_backorder_allowed: { Args: { p_strategy_id?: string; }; Returns: boolean; }; logistics_barcode_lookup: { Args: { p_barcode: string; }; Returns: Json; }; logistics_block_reason_code: { Args: { p_details?: Json; p_reason: string; }; Returns: string; }; logistics_blocked_orders: { Args: never; Returns: { attempts: number; blocked_since: string; delivery_date: string; order_id: string; order_ref: string; queue_id: string; reason: string; reason_code: string; }[]; }; logistics_blocked_overview: { Args: never; Returns: Json; }; logistics_buffer_criteria: { Args: { p_settings: Json; }; Returns: string[]; }; logistics_buffer_decision: { Args: { p_order?: Json; p_strategy_id?: string; p_user_id?: string; }; Returns: Json; }; logistics_buffer_detach_late_orders: { Args: { p_buffer?: string; }; Returns: Json; }; logistics_buffer_frozen_order: { Args: { p_order_id: string; }; Returns: boolean; }; logistics_buffer_handled: { Args: { p_buffer: string; }; Returns: boolean; }; logistics_buffer_notify: { Args: { p_event_type: string; p_idempotency_key: string; p_order_ref: string; p_payload: Json; }; Returns: string; }; logistics_buffer_open_key: { Args: { p_base_key: string; }; Returns: string; }; logistics_buffer_simulate: { Args: { p_orders?: Json; p_strategy_id?: string; }; Returns: Json; }; logistics_buffer_value: { Args: { p_criterion: string; p_order: Json; }; Returns: string; }; logistics_cancel_order: { Args: { p_order_ref: string; p_reason?: string; p_user_id?: string; }; Returns: number; }; logistics_cancel_orphan_tasks: { Args: never; Returns: number; }; logistics_capacity_day_check: { Args: { p_from?: string; p_to?: string; }; Returns: Json; }; logistics_capacity_plan_day: { Args: { p_date: string; }; Returns: Json; }; logistics_carrier_minutes: { Args: { p_carrier: string; p_settings: Json; }; Returns: number; }; logistics_cart_barcode_value: { Args: { _cart_id: string; }; Returns: string; }; logistics_cart_handled: { Args: { p_cart_index: number; p_order_id: string; }; Returns: boolean; }; logistics_cart_index: { Args: { p_from?: string; p_to?: string; }; Returns: { cart_id: string; cart_index: number; cart_label: string; cart_number: string; cart_seq: number; cart_total: number; delivery_date: string; is_announced: boolean; is_controlled: boolean; is_printed: boolean; is_shared: boolean; order_number: string; order_source: string; order_uuid: string; pick_date: string; printed_at: string; shifted: boolean; task_status: string; }[]; }; logistics_cart_layout_method: { Args: never; Returns: Json; }; logistics_cart_plan_overview: { Args: { p_days?: number; }; Returns: { cart_total: number; delivery_date: string; order_ref: string; plan_ready: boolean; reason: string; released: boolean; }[]; }; logistics_cart_plan_status: { Args: { p_ref: string; }; Returns: Json; }; logistics_cart_seq: { Args: { p_order_uuid?: string; }; Returns: { cart_id: string; cart_index: number; cart_number: string; cart_seq: number; cart_total: number; order_uuid: string; }[]; }; logistics_cart_slip_plan: { Args: { p_order_id: string; }; Returns: Json; }; logistics_cart_units: { Args: { p_from?: string; p_to?: string; }; Returns: { cart_id: string; cart_index: number; cart_label: string; cart_number: string; cart_seq: number; cart_total: number; delivery_date: string; is_announced: boolean; is_buffer: boolean; is_controlled: boolean; is_printed: boolean; is_shared: boolean; order_number: string; order_source: string; order_uuid: string; pick_date: string; printed_at: string; shifted: boolean; task_status: string; unit_buffer: string; unit_order_count: number; unit_orders: string[]; unit_ref: string; }[]; }; logistics_check_order_allowed: { Args: { p_lines: Json; p_strategy_id?: string; }; Returns: Json; }; logistics_check_order_stock: { Args: { p_event_id: string; }; Returns: string; }; logistics_claim_next_task: { Args: { p_owner_module: string; p_worker?: string; }; Returns: { attempt_log: Json; attempts: number; buffer_ref: string | null; claimed_at: string | null; claimed_by: string | null; completed_at: string | null; created_at: string; depends_on: string[]; due_at: string | null; error: string | null; id: string; last_error: string | null; next_attempt_at: string | null; order_ref: string; owner_module: string; payload: Json; plan_run_id: string | null; planned_end: string | null; planned_start: string | null; priority: number; result: Json | null; rule_config_id: string | null; rule_version: number | null; sequence: number; shadow: boolean; started_at: string | null; status: string; strategy_id: string | null; task_type: string; updated_at: string; user_id: string; }; SetofOptions: { from: "*"; to: "logistics_tasks"; isOneToOne: true; isSetofReturn: false; }; }; logistics_claim_task: { Args: { p_task_id: string; p_worker?: string; }; Returns: { attempt_log: Json; attempts: number; buffer_ref: string | null; claimed_at: string | null; claimed_by: string | null; completed_at: string | null; created_at: string; depends_on: string[]; due_at: string | null; error: string | null; id: string; last_error: string | null; next_attempt_at: string | null; order_ref: string; owner_module: string; payload: Json; plan_run_id: string | null; planned_end: string | null; planned_start: string | null; priority: number; result: Json | null; rule_config_id: string | null; rule_version: number | null; sequence: number; shadow: boolean; started_at: string | null; status: string; strategy_id: string | null; task_type: string; updated_at: string; user_id: string; }; SetofOptions: { from: "*"; to: "logistics_tasks"; isOneToOne: true; isSetofReturn: false; }; }; logistics_complete_task: { Args: { p_result?: Json; p_task_id: string; }; Returns: { attempt_log: Json; attempts: number; buffer_ref: string | null; claimed_at: string | null; claimed_by: string | null; completed_at: string | null; created_at: string; depends_on: string[]; due_at: string | null; error: string | null; id: string; last_error: string | null; next_attempt_at: string | null; order_ref: string; owner_module: string; payload: Json; plan_run_id: string | null; planned_end: string | null; planned_start: string | null; priority: number; result: Json | null; rule_config_id: string | null; rule_version: number | null; sequence: number; shadow: boolean; started_at: string | null; status: string; strategy_id: string | null; task_type: string; updated_at: string; user_id: string; }; SetofOptions: { from: "*"; to: "logistics_tasks"; isOneToOne: true; isSetofReturn: false; }; }; logistics_consistency_check: { Args: never; Returns: { agenda_carts: number; announced_carts: number; control_carts: number; delivery_carts: number; duplicate_carts: number; ok: boolean; orphan_carts: number; orphan_tasks: number; pick_date: string; raw_carts: number; sales_carts: number; station_carts: number; }[]; }; logistics_control_scan_approve: { Args: { p_allow_reprint?: boolean; p_barcode: string; p_printer_id?: string; p_scanner_id?: string; }; Returns: Json; }; logistics_control_scan_claim: { Args: { _lease_seconds?: number; _limit?: number; }; Returns: { approved_at: string | null; attempts: number; barcode: string; cart_id: string; created_at: string; document_url: string | null; error: string | null; error_code: string | null; fulfillment_order_id: string | null; id: string; is_floriday: boolean; locked_until: string | null; order_id: string | null; order_number: string | null; print_job_id: string | null; printed_at: string | null; printer_id: string | null; scanner_id: string | null; status: string; updated_at: string; }[]; SetofOptions: { from: "*"; to: "logistics_control_scan"; isOneToOne: false; isSetofReturn: true; }; }; logistics_control_scan_finish: { Args: { _document_url?: string; _error?: string; _error_code?: string; _fulfillment_order_id?: string; _id: string; _ok: boolean; _print_job_id?: string; _status?: string; }; Returns: Json; }; logistics_control_scan_lookup: { Args: { p_barcode: string; }; Returns: Json; }; logistics_control_scan_overview: { Args: { _date?: string; _scanner_id?: string; }; Returns: Json; }; logistics_control_scan_retry: { Args: { _id: string; }; Returns: Json; }; logistics_control_settings: { Args: never; Returns: Json; }; logistics_delay_customer_email: { Args: { p_customer: string; p_lang: string; p_new_date: string; p_order: string; p_partial?: boolean; }; Returns: { body: string; subject: string; }[]; }; logistics_delivery_agenda: { Args: { p_from?: string; p_to?: string; }; Returns: { announced_count: number; cart_count: number; controlled_count: number; delivery_date: string; order_count: number; orders: Json; plant_count: number; printed_count: number; }[]; }; logistics_document_layout: { Args: { _document_code: string; }; Returns: Json; }; logistics_document_layout_v2: { Args: { _document_code: string; _is_partial?: boolean; }; Returns: Json; }; logistics_document_station: { Args: { _document_code: string; }; Returns: string; }; logistics_document_type_map: { Args: { _document_code: string; }; Returns: Database["public"]["Enums"]["doc_layout_type"][]; }; logistics_emit_event: { Args: { p_event_type: string; p_idempotency_key?: string; p_order_ref: string; p_payload?: Json; p_priority?: number; p_shadow?: boolean; p_source_module: string; p_strategy_id?: string; }; Returns: Json; }; logistics_enqueue_sticker_with_slip: { Args: { _cart_id: string; _is_herprint: boolean; _printer_id: string; _queue_item_id: string; _session_id: string; _slip_job_id: string; }; Returns: string; }; logistics_ensure_cart_barcode: { Args: { _cart_id: string; }; Returns: string; }; logistics_fail_task: { Args: { p_error: string; p_task_id: string; }; Returns: { attempt_log: Json; attempts: number; buffer_ref: string | null; claimed_at: string | null; claimed_by: string | null; completed_at: string | null; created_at: string; depends_on: string[]; due_at: string | null; error: string | null; id: string; last_error: string | null; next_attempt_at: string | null; order_ref: string; owner_module: string; payload: Json; plan_run_id: string | null; planned_end: string | null; planned_start: string | null; priority: number; result: Json | null; rule_config_id: string | null; rule_version: number | null; sequence: number; shadow: boolean; started_at: string | null; status: string; strategy_id: string | null; task_type: string; updated_at: string; user_id: string; }; SetofOptions: { from: "*"; to: "logistics_tasks"; isOneToOne: true; isSetofReturn: false; }; }; logistics_floriday_cart_plan: { Args: { p_order_id: string; }; Returns: { carrier_type: string; idx: number; packages: number; }[]; }; logistics_floriday_claim_pushes: { Args: { _lease_seconds?: number; _limit?: number; _worker?: string; }; Returns: { attempts: number; fulfillment_order_id: string; id: string; last_sent_hash: string; order_ref: string; payload: Json; payload_hash: string; revision: number; }[]; }; logistics_floriday_finish_push: { Args: { _error?: string; _fulfillment_order_id?: string; _id: string; _max_age_hours?: number; _max_attempts?: number; _ok: boolean; _permanent?: boolean; _revision: number; _sent_hash?: string; }; Returns: string; }; logistics_floriday_finish_push_v2: { Args: { _error?: string; _error_code?: string; _fulfillment_order_id?: string; _gateway_status?: number; _id: string; _max_age_hours?: number; _max_attempts?: number; _ok: boolean; _permanent?: boolean; _response?: Json; _revision: number; _sent_hash?: string; }; Returns: string; }; logistics_floriday_finish_push_v3: { Args: { _error?: string; _error_code?: string; _fulfillment_order_id?: string; _gateway_status?: number; _id: string; _max_age_hours?: number; _max_attempts?: number; _outcome: string; _permanent?: boolean; _response?: Json; _revision: number; _sent_hash?: string; _wait_max_age_hours?: number; }; Returns: string; }; logistics_floriday_prune_pushes: { Args: { _days?: number; }; Returns: number; }; logistics_floriday_queue_push: { Args: { _order_ref: string; _payload?: Json; _payload_hash?: string; }; Returns: string; }; logistics_fulfill_barcode_requests: { Args: { p_limit?: number; }; Returns: Json; }; logistics_full_cart_min_layers: { Args: never; Returns: number; }; logistics_full_cart_min_percentage: { Args: never; Returns: number; }; logistics_is_pick_workday: { Args: { p_date: string; }; Returns: boolean; }; logistics_link_order_items: { Args: { p_order?: string; }; Returns: Json; }; logistics_live_carriers: { Args: { p_order_ref: string; }; Returns: Json; }; logistics_live_cart_count: { Args: { p_order_ref: string; }; Returns: number; }; logistics_next_workday_date: { Args: { p_date: string; p_days?: string[]; }; Returns: string; }; logistics_next_workday_not_past: { Args: { p_days: string[]; p_ts: string; }; Returns: string; }; logistics_normalize_product_label: { Args: { p_label: string; }; Returns: string; }; logistics_not_past: { Args: { p_ts: string; }; Returns: string; }; logistics_order_cart_count: { Args: { p_order_ref: string; }; Returns: number; }; logistics_order_handled: { Args: { p_order_uuid: string; }; Returns: boolean; }; logistics_order_is_topick: { Args: { p_order_id: string; p_order_number: string; }; Returns: boolean; }; logistics_order_overview: { Args: { p_from?: string; p_to?: string; }; Returns: { cart_count: number; customer_name: string; delivery_date: string; order_number: string; order_source: string; order_uuid: string; pick_date: string; plant_count: number; printed_at: string; shifted: boolean; status: string; }[]; }; logistics_order_pick_day: { Args: { p_order_ref: string; }; Returns: string; }; logistics_order_released: { Args: { p_order_ref: string; }; Returns: boolean; }; logistics_parse_pickup: { Args: { p_value: string; }; Returns: string; }; logistics_pick_agenda: { Args: { p_from?: string; p_to?: string; }; Returns: { cart_count: number; in_preparation: number; order_count: number; orders: Json; pick_date: string; plant_count: number; ready: number; shifted_count: number; }[]; }; logistics_pick_barcode_enabled: { Args: never; Returns: boolean; }; logistics_pick_email_purpose: { Args: never; Returns: string; }; logistics_pick_mode: { Args: never; Returns: Json; }; logistics_pick_start_estimate: { Args: { p_order: Json; s: Json; }; Returns: string; }; logistics_pick_units: { Args: never; Returns: { is_buffer: boolean; order_number: string; order_uuid: string; unit_buffer: string; unit_order_count: number; unit_orders: string[]; unit_ref: string; }[]; }; logistics_plan_all: { Args: { p_user_id?: string; }; Returns: Json; }; logistics_plan_block: { Args: { p_details?: Json; p_order_ids: string[]; p_reason: string; }; Returns: number; }; logistics_plan_buffer_sql: { Args: { p_buffer_id: string; }; Returns: number; }; logistics_plan_claim: { Args: { p_limit?: number; }; Returns: { attempts: number; id: string; order_id: string; }[]; }; logistics_plan_enqueue: { Args: { p_order_id: string; p_reason?: string; }; Returns: undefined; }; logistics_plan_ensure_event: { Args: { p_order_id: string; }; Returns: boolean; }; logistics_plan_finish: { Args: { p_error?: string; p_id: string; }; Returns: undefined; }; logistics_plan_floriday_order: { Args: { p_buffer_id?: string; p_order_id: string; }; Returns: number; }; logistics_plan_impact_orders: { Args: { p_order_id: string; }; Returns: { buffer_id: string; order_id: string; plan_date: string; }[]; }; logistics_plan_kick: { Args: never; Returns: undefined; }; logistics_plan_prune: { Args: never; Returns: number; }; logistics_plan_release_stale: { Args: never; Returns: number; }; logistics_plan_retry: { Args: { p_order_ids: string[]; }; Returns: number; }; logistics_plan_setting: { Args: { p_default: number; p_key: string; }; Returns: number; }; logistics_prune_buffer_member_queue: { Args: never; Returns: number; }; logistics_prune_handled_pick_queue: { Args: never; Returns: number; }; logistics_queue_capacity_email: { Args: { p_alert_id: string; }; Returns: string; }; logistics_queue_stock_email: { Args: { p_alert_id: string; }; Returns: string; }; logistics_reapply_buffer_decisions: { Args: never; Returns: number; }; logistics_rebuffer_open_orders: { Args: { p_strategy_id?: string; }; Returns: Json; }; logistics_rebuffer_orders: { Args: { p_days?: number; }; Returns: Json; }; logistics_rebuffer_pending: { Args: never; Returns: Json; }; logistics_refresh_pickup_moments: { Args: { p_weeks?: number; }; Returns: Json; }; logistics_report_delay: { Args: { p_expected_date?: string; p_order_id: string; p_reason?: string; }; Returns: string; } | { Args: { p_expected_date?: string; p_force_customer_email?: boolean; p_order_id: string; p_reason?: string; }; Returns: string; }; logistics_rescan_orders: { Args: { p_days?: number; }; Returns: number; }; logistics_reschedule_order: { Args: { p_notify_customer?: boolean; p_order_ref: string; p_pickup_date?: string; p_pickup_from?: string; p_pickup_to?: string; p_reason?: string; p_source_module?: string; p_user_id?: string; }; Returns: Json; }; logistics_reschedule_preview: { Args: { p_order_ref: string; p_pickup_date?: string; p_pickup_from?: string; p_pickup_to?: string; }; Returns: Json; }; logistics_resolve_pick_document: { Args: { _is_herprint: boolean; _queue_item_id: string; _session_id: string; _voorbeeld: boolean; }; Returns: Json; }; logistics_resolve_product_id: { Args: { p_label: string; }; Returns: string; }; logistics_resolve_settings: { Args: { p_config_id: string; p_user_id: string; p_version: number; }; Returns: Json; }; logistics_rule_bool: { Args: { p_default: boolean; p_key: string; p_settings: Json; p_step: string; }; Returns: boolean; }; logistics_rule_num: { Args: { p_default: number; p_key: string; p_settings: Json; p_step: string; }; Returns: number; }; logistics_rule_text: { Args: { p_default: string; p_key: string; p_settings: Json; p_step: string; }; Returns: string; }; logistics_rule_value: { Args: { p_key: string; p_settings: Json; p_step: string; }; Returns: Json; }; logistics_scan_delays: { Args: never; Returns: number; }; logistics_scan_order_stock: { Args: { p_order_id: string; }; Returns: string; }; logistics_scan_resolve: { Args: { p_code: string; }; Returns: Json; }; logistics_schedule_tasks: { Args: never; Returns: number; }; logistics_set_order_priority: { Args: { p_order_ref: string; p_priority: number; p_user_id?: string; }; Returns: number; }; logistics_set_pick_day: { Args: { p_order_ref: string; p_pick_day: string; }; Returns: Json; }; logistics_shift_to_workday: { Args: { p_days: string[]; p_ts: string; }; Returns: string; }; logistics_shipping_note_from_barcode: { Args: { p_allow_reprint?: boolean; p_barcode: string; p_station_id?: string; }; Returns: Json; }; logistics_sticker_follows_slip: { Args: never; Returns: boolean; }; logistics_supersede_stale_tasks: { Args: { p_keep: string[]; p_order_ref: string; p_run_id: string; p_user_id: string; }; Returns: number; }; logistics_sync_pick_queue: { Args: never; Returns: Json; }; logistics_sync_task_carriers: { Args: { p_order_ref?: string; }; Returns: number; }; logistics_task_owner: { Args: { p_task_type: string; }; Returns: string; }; logistics_task_pick_minutes: { Args: { p_payload: Json; p_settings: Json; }; Returns: number; }; logistics_tick_ping: { Args: never; Returns: string; }; logistics_upsert_task: { Args: { p_buffer_ref: string; p_end: string; p_order_ref: string; p_owner: string; p_payload: Json; p_rule_config_id: string; p_rule_version: number; p_run_id: string; p_sequence: number; p_shadow: boolean; p_start: string; p_strategy_id: string; p_task_type: string; p_user_id: string; }; Returns: string; }; logistics_write_buffer_layer_positions: { Args: { p_buffer_id: string; }; Returns: number; }; logistics_write_cart_layer_positions: { Args: { p_cart_id: string; }; Returns: number; }; mark_offer_clicked: { Args: { p_code: string; }; Returns: undefined; }; mark_offer_ordered: { Args: { p_code: string; }; Returns: undefined; }; mark_salesorder_controlled: { Args: { p_controlled: boolean; p_floriday_id: string; }; Returns: undefined; }; mark_shipment_shipped: { Args: { p_shipment_id: string; }; Returns: undefined; }; merge_products: { Args: { _canonical: string; _loser: string; }; Returns: undefined; }; move_cart_layer_position: { Args: { p_id: string; p_layer: number; p_x: number; p_y: number; }; Returns: undefined; }; my_module_permissions: { Args: never; Returns: { feature_id: string; module_id: string; permission: string; }[]; }; next_manufacture_partij: { Args: { _tenant_id: string; }; Returns: string; }; next_order_number: { Args: { p_prefix: string; }; Returns: string; }; next_order_number_for_date: { Args: { p_created_at?: string; p_prefix: string; }; Returns: string; }; next_twinfield_code: { Args: never; Returns: string; }; next_work_order_number: { Args: { p_parent_work_order_id?: string; p_tenant_id: string; }; Returns: string; }; normalize_order_source: { Args: { p_src: string; }; Returns: string; }; normalize_vat: { Args: { v: string; }; Returns: string; }; offer_recipient_matches: { Args: { _campaign_id: string; _customer_id: string; _recipient_id: string; }; Returns: boolean; }; opruim_print_historie: { Args: never; Returns: { ontdaan: number; verwijderd: number; }[]; }; order_departure_proof: { Args: { p_order_id: string; }; Returns: Json; }; order_heeft_bevestigde_karren: { Args: { p_order_id: string; }; Returns: boolean; }; order_number_prefix: { Args: { p_custom_fields?: Json; p_order_source: string; }; Returns: string; }; pakket_suggesties_voor_tekst: { Args: { _tekst: string; }; Returns: { hit_type: string; package_id: string; priority: number; }[]; }; pakket_voor_reistijd: { Args: { _minuten: number; }; Returns: { package_id: string; priority: number; }[]; }; pick_active_printers: { Args: never; Returns: { id: string; locatie: string; naam: string; online: boolean; }[]; }; pick_apply_buffer_events: { Args: never; Returns: Json; }; pick_available_pick_days: { Args: { _max_days?: number; }; Returns: { orders: number; pick_day: string; }[]; }; pick_buffer_order_ids: { Args: { _order_id: string; }; Returns: string[]; }; pick_cart_breakdown: { Args: { _order_id: string; }; Returns: Json; }; pick_claim_document: { Args: { _queue_item_id: string; _screen_id: string; _session_id: string; _station_id: string; _timeout_seconds?: number; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; }; pick_claim_next_document: { Args: { _country_code: string; _pick_day?: string; _screen_id: string; _session_id: string; _station_id: string; _timeout_seconds?: number; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; }; pick_cleanup_maintenance: { Args: { _heartbeat_hours?: number; _log_days?: number; }; Returns: Json; }; pick_complete_print: { Args: { _printer_id: string; _queue_item_id: string; _session_id: string; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; }; pick_complete_print_cart: { Args: { _cart_id: string; _printer_id: string; _queue_item_id: string; _session_id: string; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; }; pick_complete_print_carts: { Args: { _cart_ids: string[]; _queue_item_id: string; _session_id: string; }; Returns: Json; }; pick_current_pick_day: { Args: never; Returns: string; }; pick_day_counts: { Args: { _pick_day?: string; _screen_id?: string; _station_id?: string; }; Returns: Json; }; pick_document_layout_data: { Args: { _layout_id: string; }; Returns: Json; }; pick_enqueue_print_job: { Args: { _is_herprint?: boolean; _printer_id?: string; _queue_item_id: string; _session_id?: string; }; Returns: string; } | { Args: { _cart_id: string; _is_herprint: boolean; _printer_id: string; _queue_item_id: string; _session_id: string; }; Returns: string; }; pick_enqueue_print_job_from_cart: { Args: { _cart_id: string; _is_herprint: boolean; _printer_id: string; _queue_item_id: string; _selected_cart: Json; _session_id: string; }; Returns: string; }; pick_mark_printed: { Args: { _queue_item_id: string; _reden?: string; _session_id: string; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; }; pick_order_context: { Args: { _order_id?: string; _order_number?: string; }; Returns: Json; }; pick_preview_job: { Args: { _queue_item_id: string; _station_slug: string; }; Returns: Json; }; pick_print_job_status: { Args: { _job_id: string; }; Returns: Json; }; pick_print_jobs_status: { Args: { _job_ids: string[]; }; Returns: Json[]; }; pick_print_plekken: { Args: never; Returns: { id: string; naam: string; omschrijving: string; }[]; }; pick_queue_cart_plan: { Args: { _queue_item_id: string; }; Returns: Json; }; pick_reference_data_status: { Args: never; Returns: Json; }; pick_release_expired_locks: { Args: never; Returns: number; }; pick_release_lock: { Args: { _queue_item_id: string; }; Returns: undefined; }; pick_report_missing_cart_plan: { Args: never; Returns: Json; }; pick_reprint_cart: { Args: { _cart_id: string; _queue_item_id: string; _session_id: string; _throttle_seconds?: number; }; Returns: string; }; pick_reprint_document: { Args: { _queue_item_id: string; _session_id: string; _throttle_seconds?: number; }; Returns: string; }; pick_reset_print: { Args: { _queue_item_id: string; _session_id: string; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; } | { Args: { _cart_id?: string; _queue_item_id: string; _session_id: string; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; }; pick_reset_print_job: { Args: { _cart_id: string; _job_id: string; _queue_item_id: string; _session_id: string; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; }; pick_reset_print_jobs: { Args: { _cart_ids: string[]; _job_ids: string[]; _queue_item_id: string; _session_id: string; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; }; pick_restore_to_queue: { Args: { _queue_item_id: string; _session_id: string; }; Returns: { announced_at: string; assigned_user_id: string | null; barcode: string | null; cancelled_at: string | null; cart_count: number; completed_at: string | null; country_code: string | null; created_at: string; customer_name: string | null; delivery_address: string | null; document_number: string | null; document_type_id: string | null; due_at: string | null; id: string; is_urgent: boolean; line_count: number; order_number: string | null; order_type: string | null; payload: Json; print_count: number; print_job_id: string | null; printed_at: string | null; printed_by: string | null; printed_cart_ids: Json; printer_id: string | null; priority: number; reference: string | null; route: string | null; screen_id: string | null; station_id: string | null; status_id: string | null; updated_at: string; warnings: Json; }; SetofOptions: { from: "*"; to: "pick_queue"; isOneToOne: true; isSetofReturn: false; }; }; pick_seed_reference_data: { Args: never; Returns: Json; }; pick_set_station_print_plek: { Args: { _print_plek_id: string; _station_id: string; }; Returns: string; }; pick_station_dashboard: { Args: never; Returns: { active: number; active_sessions: number; avg_wait_seconds: number; done_today: number; station_id: string; station_name: string; waiting: number; }[]; }; pick_station_print_plek: { Args: { _station_id: string; }; Returns: { naam: string; omschrijving: string; print_plek_id: string; }[]; }; pick_station_print_plekken: { Args: never; Returns: { naam: string; omschrijving: string; print_plek_id: string; station_id: string; }[]; }; pick_station_slugify: { Args: { _id: string; _name: string; }; Returns: string; }; pick_sync_pick_day: { Args: { _day: string; }; Returns: Json; }; pick_sync_queue_throttled: { Args: { _min_seconds?: number; }; Returns: Json; }; pickstation_get_orders_raw: { Args: never; Returns: Json; }; pickstation_get_planning_context: { Args: never; Returns: Json; }; pickstation_get_settings: { Args: never; Returns: Json; }; pickstation_log_print: { Args: { p_customer_name: string; p_documents: string[]; p_ip_address: string; p_order_id: string; p_order_number: string; }; Returns: undefined; }; pickstation_resolve_delivery_orders: { Args: { p_sales_order_ids: string[]; }; Returns: { delivery_order_id: string; sales_order_id: string; }[]; }; pickstation_set_cart_status: { Args: { p_cart_index: number; p_order_id: string; p_order_source: string; p_status: string; }; Returns: undefined; }; planning_cancel_item: { Args: { _id: string; }; Returns: undefined; }; planning_list: { Args: { _from: string; _to: string; }; Returns: { assigned_monteur_id: string | null; assistants: Json | null; budget_mandate_cents: number | null; created_at: string | null; created_by: string | null; customer_id: string | null; customer_name: string | null; duration_minutes: number | null; end_at: string | null; id: string | null; needs_detail_review: boolean | null; notes: string | null; project_number: string | null; review_reasons: string[] | null; start_at: string | null; status: Database["public"]["Enums"]["planning_item_status"] | null; updated_at: string | null; viewer_role: string | null; werkbon_id: string | null; work_address: string | null; }[]; SetofOptions: { from: "*"; to: "planning_overview"; isOneToOne: false; isSetofReturn: true; }; }; planning_set_assistants: { Args: { _monteur_ids: string[]; _planning_item_id: string; }; Returns: undefined; }; planning_upsert_item: { Args: { _assigned_monteur_id: string; _end_at: string; _notes?: string; _start_at: string; _werkbon_id: string; }; Returns: { action: string; id: string; }[]; }; print_preview_toestaan: { Args: { _max?: number; _queue_item_id: string; _station_slug: string; _venster_sec?: number; }; Returns: Json; }; print_preview_weiger: { Args: { _code: string; _queue_item_id: string; _reden: string; _station_slug: string; }; Returns: undefined; }; process_logistics_event: { Args: { p_event_id: string; }; Returns: string; }; produce_designed_product: { Args: { p_parent_id: string; p_parent_kind: string; p_quantity: number; }; Returns: Json; }; promote_trade_item_key: { Args: { p_new: string; p_old: string; }; Returns: undefined; }; quote_create_from_source: { Args: { _payload?: Json; _source_id: string; _source_type: string; }; Returns: string; }; quote_get_billable_lines: { Args: { _quotation_id: string; }; Returns: Json; }; quote_get_summary: { Args: { _quotation_id: string; }; Returns: Json; }; quote_list_packages: { Args: never; Returns: Json; }; quote_list_sources: { Args: { _limit?: number; _source_type?: string; }; Returns: Json; }; recompute_all_reserved_stock: { Args: never; Returns: undefined; }; recompute_order_status: { Args: { p_order_id: string; }; Returns: undefined; }; recompute_reserved_for_order: { Args: { p_order_id: string; }; Returns: undefined; }; recompute_reserved_stock: { Args: { p_trade_item_key: string; }; Returns: undefined; }; refresh_external_customers_grouped: { Args: never; Returns: undefined; }; refresh_floricode_derived_code_lists: { Args: never; Returns: { environment: string; list_name: string; row_count: number; }[]; }; refresh_floricode_derived_for_product: { Args: { p_product_code: string; }; Returns: number; }; refresh_floricode_derived_for_products: { Args: { _product_ids: string[]; }; Returns: number; }; release_debtor_lock: { Args: { _group_key: string; _user_id: string; }; Returns: boolean; }; release_job_lock: { Args: { _key: string; }; Returns: undefined; }; release_local_pdf_job: { Args: { _job_id: string; _writer_id: string; }; Returns: boolean; }; release_print_queue_lease: { Args: { _houder: string; _naam: string; }; Returns: boolean; }; release_stale_order_invoice_links: { Args: { _minutes?: number; }; Returns: number; }; reorder_customer_price_groups: { Args: { _ids: string[]; }; Returns: undefined; }; replace_order_carts: { Args: { p_buffer_id: string; p_carts: Json; p_order_id: string; }; Returns: Json; }; reset_cart_layer_positions: { Args: { p_cart_id: string; }; Returns: number; }; reset_floriday_sync_cursor: { Args: { p_connection_id: string; p_entity_type: string; }; Returns: undefined; }; reset_stalled_floriday_stock_queue: { Args: { p_include_failed?: boolean; }; Returns: number; }; resolve_group_allocation: { Args: { _needed: number; _product_group_id: string; }; Returns: { allocated: number; trade_item_id: string; }[]; }; resolve_group_member_stock_key: { Args: { p_trade_item_id: string; }; Returns: string; }; resolve_print_job_printer_id: { Args: { _job: Database["public"]["Tables"]["print_jobs"]["Row"]; }; Returns: string; }; resolve_product_id_for_item: { Args: { p_product_name: string; }; Returns: string; }; resolve_stock_trade_item_key: { Args: { p_product_id: string; }; Returns: string; }; retry_twinfield_push: { Args: { _customer_id: string; }; Returns: number; }; reverse_production: { Args: { p_connection_id?: string; p_parent_key: string; p_quantity: number; p_reason?: string; p_user_id?: string; }; Returns: Json; }; roles_without_enum_mapping: { Args: never; Returns: { assignment_count: number; id: string; key: string; name: string; }[]; }; ruim_print_jobs_op: { Args: { _bewaar_dagen?: number; }; Returns: number; }; run_floriday_continuous_stock_sync: { Args: never; Returns: undefined; }; run_floriday_stock_queue_process: { Args: never; Returns: undefined; }; run_floriday_stock_reconcile: { Args: never; Returns: undefined; }; run_logistics_tasks_dispatch: { Args: never; Returns: undefined; }; run_print_queue_ticks: { Args: never; Returns: number; }; run_twinfield_queue_tick: { Args: never; Returns: undefined; }; scan_cancel_kar: { Args: { p_kar_id: string; }; Returns: Json; }; scan_complete_cart: { Args: { p_allow_reprint?: boolean; p_cart_id: string; p_print?: boolean; p_scanner_id?: string; }; Returns: Json; }; scan_dashboard_stats: { Args: { p_dagen?: number; }; Returns: Json; }; scan_eindcontrole: { Args: { p_barcode: string; p_scanner_id?: string; }; Returns: Json; }; scan_finish_kar: { Args: { p_kar_id: string; }; Returns: Json; }; scan_kar_compleet: { Args: { p_allow_reprint?: boolean; p_sessie_id: string; }; Returns: Json; }; scan_kar_regels: { Args: { p_cart_id: string; }; Returns: Json; }; scan_log_code: { Args: { p_code: string; p_latency_ms?: number; p_message?: string; p_result: string; p_scanner_key?: string; }; Returns: string; }; scan_open_pakbonnen: { Args: { p_dagen?: number; }; Returns: Json; }; scan_pakbon_lookup: { Args: { p_barcode: string; }; Returns: Json; }; scan_pakbon_opnieuw: { Args: { p_barcode: string; p_scanner_id?: string; }; Returns: Json; }; scan_pakbon_toevoegen: { Args: { p_barcode: string; p_medewerker?: string; p_regels?: Json; p_scanner_id: string; }; Returns: Json; }; scan_print_restpakbon: { Args: { p_printer_id?: string; p_restpakbon_id: string; }; Returns: Json; }; scan_print_verzendbrief: { Args: { p_sessie_id: string; }; Returns: Json; }; scan_register_item: { Args: { p_kar_id: string; p_pakbon_item_id: string; p_scanned_by?: string; }; Returns: Json; }; scan_release_expired_locks: { Args: never; Returns: Json; }; scan_remove_item: { Args: { p_kar_item_id: string; }; Returns: Json; }; scan_restpakbon_geprint: { Args: { p_id: string; p_print_job_id?: string; }; Returns: undefined; }; scan_sessie_annuleren: { Args: { p_sessie_id: string; }; Returns: undefined; }; scan_sessie_open: { Args: { p_scanner_id: string; }; Returns: Json; }; scan_start_kar: { Args: { p_medewerker_id?: string; p_medewerker_naam?: string; p_pakbon_ids: string[]; p_scanner_key?: string; }; Returns: Json; } | { Args: { p_medewerker_id?: string; p_medewerker_naam?: string; p_pakbon_ids: string[]; p_scanner_key?: string; p_sessie?: string; }; Returns: Json; }; scan_verzendbrief_regels: { Args: { p_sessie_id: string; }; Returns: Json; }; schedule_floriday_additional_services_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_agreement_calloffs_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_agreements_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_base_items_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_blanket_orders_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_carriers_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_clock_presales_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_clock_supplies_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_collections_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_commercial_service_types_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_connections_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_contract_trade_item_groups_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_contracts_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_customer_organizations_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_customer_stickers_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_delivery_condition_sets_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_delivery_locations_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_delivery_orders_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_fulfillment_orders_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_invoices_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_network_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_packings_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_price_groups_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_reference_data_refresh: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_sales_strategies_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_salesorders_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_stock_queue_process: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_token_refresh: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_trade_item_classifications_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_trade_items_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_trips_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_floriday_warehouses_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; }; schedule_twinfield_customers_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; } | { Args: { p_apikey: string; p_cron_secret?: string; p_url: string; }; Returns: number; }; schedule_twinfield_invoices_sync: { Args: { p_apikey: string; p_url: string; }; Returns: number; } | { Args: { p_apikey: string; p_cron_secret?: string; p_url: string; }; Returns: number; }; schedule_twinfield_push_queue_flush: { Args: { p_apikey: string; p_cron_secret?: string; p_url: string; }; Returns: number; }; schedule_twinfield_token_refresh: { Args: { p_apikey: string; p_url: string; }; Returns: number; } | { Args: { p_apikey: string; p_cron_secret?: string; p_url: string; }; Returns: number; }; self_heal_floriday_links: { Args: never; Returns: number; }; set_planning_status: { Args: { _id: string; _status: Database["public"]["Enums"]["planning_item_status"]; }; Returns: undefined; }; show_limit: { Args: never; Returns: number; }; show_trgm: { Args: { "": string; }; Returns: string[]; }; start_time_log_at: { Args: { p_clicked_at?: string; p_employee_id: string; p_start_lat?: number; p_start_lng?: number; p_type: string; p_work_order_id?: string; }; Returns: Json; }; stop_time_log: { Args: { p_employee_id: string; p_end_lat?: number; p_end_lng?: number; p_end_time: string; }; Returns: Json; }; swap_cart_layer_positions: { Args: { p_a: string; p_b: string; }; Returns: undefined; }; switch_time_log: { Args: { p_employee_id: string; p_start_lat?: number; p_start_lng?: number; p_type: string; p_work_order_id?: string; }; Returns: Json; }; sync_all_layer_stocks: { Args: never; Returns: undefined; }; sync_cached_packing_from_product: { Args: { p_product_id: string; }; Returns: undefined; }; sync_layer_stock: { Args: { p_product_id: string; }; Returns: undefined; }; sync_order_cart_item_packing_from_product: { Args: { p_product_id: string; }; Returns: undefined; }; sync_order_item_fusten: { Args: { _order_item_id: string; }; Returns: undefined; }; sync_product_group_belading: { Args: { _group_id: string; }; Returns: undefined; }; sync_product_packing_from_floriday_cache: { Args: { p_floriday_id: string; }; Returns: undefined; }; sync_sick_time_off: { Args: { _period_id: string; }; Returns: number; }; trade_item_stock_duplicates: { Args: never; Returns: { keys: string[]; product_id: string; product_name: string; row_count: number; }[]; }; try_acquire_job_lock: { Args: { _key: string; _owner?: string; _seconds?: number; }; Returns: boolean; }; try_debtor_lock: { Args: { _group_key: string; _user_id: string; }; Returns: boolean; }; twinfield_cron_lock_acquire: { Args: { _job_name: string; _stale_seconds?: number; }; Returns: boolean; }; twinfield_cron_lock_release: { Args: { _error?: string; _job_name: string; }; Returns: undefined; }; twinfield_deactivate_connection: { Args: { p_connection_id: string; p_user_id: string; }; Returns: Json; }; twinfield_handle_administration_change: { Args: { _administration_code: string; _user_id: string; }; Returns: undefined; }; twinfield_prune_push_queue: { Args: never; Returns: number; }; twinfield_register_cron: { Args: { apikey?: string; base_url: string; }; Returns: Json; }; twinfield_upsert_connection_by_account_key: { Args: { p_account_key: string; p_cluster_uri?: string; p_company_code?: string; p_company_name?: string; p_environment: string; p_office_code?: string; p_reset_sync?: boolean; p_status?: string; p_user_id: string; }; Returns: Json; }; upsert_auto_fulfillment_log: { Args: { p_connection_id: string; p_error?: string; p_fulfillment_order_id?: string; p_reason?: string; p_sales_order_id: string; p_status: string; }; Returns: undefined; }; uren_is_beheerder: { Args: never; Returns: boolean; }; uren_my_monteur_id: { Args: never; Returns: string; }; wake_print_queue: { Args: { _min_interval_ms?: number; }; Returns: number; }; werkbon_totalen: { Args: { _werkbon_id: string; }; Returns: { materials_cents: number; packages_cents: number; packages_minutes: number; total_cents: number; total_minutes: number; }[]; }; wo_create_from_source: { Args: { _payload?: Json; _source_id: string; _source_type: string; }; Returns: string; }; wo_get_billable_lines: { Args: { _work_order_id: string; }; Returns: Json; }; wo_get_summary: { Args: { _work_order_id: string; }; Returns: Json; }; wo_set_status: { Args: { _reason?: string; _status: string; _work_order_id: string; }; Returns: Json; }; }; Enums: { ai_import_status: "nieuw" | "verwerken" | "bevestigen" | "klaar" | "mislukt"; app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "superadmin"; doc_layout_type: "pakbon" | "factuur" | "offerte" | "orderbevestiging" | "etiket" | "verzendlabel" | "productlabel" | "barcode_label" | "magazijnlijst" | "controlelijst" | "transportdocument" | "vrij" | "sticker" | "productiebon" | "veilingbon" | "afleverbrief" | "veilingbrief"; doc_orientation: "portrait" | "landscape"; exact_env: "staging" | "live"; exact_push_status: "pending" | "sent" | "error"; itk_customer_segment: "Business" | "Private"; itk_dynamic_field_type: "text" | "select" | "date" | "checkbox"; planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd" | "concept" | "vrijgegeven"; print_job_status: "wachtend" | "bezig" | "voltooid" | "mislukt" | "geannuleerd"; printer_connection: "ipp" | "raw9100" | "printnode" | "cups" | "usb" | "windows" | "airprint" | "cloud"; printer_kind: "labelprinter" | "laserprinter" | "inkjet" | "thermal" | "kantoorprinter" | "overig"; quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd"; }; CompositeTypes: { [_ in never]: never; }; }; }; type DatabaseWithoutInternals = Omit; type DefaultSchema = DatabaseWithoutInternals[Extract]; export type Tables = DefaultSchemaTableNameOrOptions extends { schema: keyof DatabaseWithoutInternals; } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends { Row: infer R; } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends { Row: infer R; } ? R : never : never; export type TablesInsert = DefaultSchemaTableNameOrOptions extends { schema: keyof DatabaseWithoutInternals; } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends { Insert: infer I; } ? I : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends { Insert: infer I; } ? I : never : never; export type TablesUpdate = DefaultSchemaTableNameOrOptions extends { schema: keyof DatabaseWithoutInternals; } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends { Update: infer U; } ? U : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends { Update: infer U; } ? U : never : never; export type Enums = DefaultSchemaEnumNameOrOptions extends { schema: keyof DatabaseWithoutInternals; } ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] : never; export type CompositeTypes = PublicCompositeTypeNameOrOptions extends { schema: keyof DatabaseWithoutInternals; } ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never; export declare const Constants: { readonly public: { readonly Enums: { readonly ai_import_status: readonly ["nieuw", "verwerken", "bevestigen", "klaar", "mislukt"]; readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin", "manager", "warehouse", "sales", "developer", "receptie", "superadmin"]; readonly doc_layout_type: readonly ["pakbon", "factuur", "offerte", "orderbevestiging", "etiket", "verzendlabel", "productlabel", "barcode_label", "magazijnlijst", "controlelijst", "transportdocument", "vrij", "sticker", "productiebon", "veilingbon", "afleverbrief", "veilingbrief"]; readonly doc_orientation: readonly ["portrait", "landscape"]; readonly exact_env: readonly ["staging", "live"]; readonly exact_push_status: readonly ["pending", "sent", "error"]; readonly itk_customer_segment: readonly ["Business", "Private"]; readonly itk_dynamic_field_type: readonly ["text", "select", "date", "checkbox"]; readonly planning_item_status: readonly ["gepland", "bezig", "afgerond", "geannuleerd", "concept", "vrijgegeven"]; readonly print_job_status: readonly ["wachtend", "bezig", "voltooid", "mislukt", "geannuleerd"]; readonly printer_connection: readonly ["ipp", "raw9100", "printnode", "cups", "usb", "windows", "airprint", "cloud"]; readonly printer_kind: readonly ["labelprinter", "laserprinter", "inkjet", "thermal", "kantoorprinter", "overig"]; readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"]; }; }; }; export {}; //# sourceMappingURL=types.d.ts.map