export type Json =
  | string
  | number
  | boolean
  | null
  | { [key: string]: Json | undefined }
  | Json[]

export type Database = {
  // Allows to automatically instantiate createClient with right options
  // instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
  __InternalSupabase: {
    PostgrestVersion: "14.5"
  }
  public: {
    Tables: {
      address_geocodes: {
        Row: {
          address: string
          address_key: string
          created_at: string
          display_name: string | null
          id: string
          lat: number | null
          lng: number | null
          not_found: boolean
          source: string | null
          updated_at: string
        }
        Insert: {
          address: string
          address_key: string
          created_at?: string
          display_name?: string | null
          id?: string
          lat?: number | null
          lng?: number | null
          not_found?: boolean
          source?: string | null
          updated_at?: string
        }
        Update: {
          address?: string
          address_key?: string
          created_at?: string
          display_name?: string | null
          id?: string
          lat?: number | null
          lng?: number | null
          not_found?: boolean
          source?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      admin_payments: {
        Row: {
          amount: number
          association_id: string
          created_at: string
          created_by: string | null
          description: string | null
          id: string
          owner_id: string | null
          payment_date: string | null
          payment_method: string | null
          reference_number: string | null
          status: string
          updated_at: string
          zoho_payment_id: string | null
        }
        Insert: {
          amount?: number
          association_id: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          owner_id?: string | null
          payment_date?: string | null
          payment_method?: string | null
          reference_number?: string | null
          status?: string
          updated_at?: string
          zoho_payment_id?: string | null
        }
        Update: {
          amount?: number
          association_id?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          owner_id?: string | null
          payment_date?: string | null
          payment_method?: string | null
          reference_number?: string | null
          status?: string
          updated_at?: string
          zoho_payment_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "admin_payments_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "admin_payments_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
        ]
      }
      amenities: {
        Row: {
          amenity_type: string
          association_id: string
          booking_config: Json | null
          cover_image_url: string | null
          created_at: string
          description: string | null
          form_fields: Json | null
          id: string
          is_active: boolean
          map_config: Json | null
          name: string
          show_on_homeowner_portal: boolean
          show_on_public_page: boolean
          signable_documents: Json
          sort_order: number | null
          updated_at: string
          visible_to_roles: Json
        }
        Insert: {
          amenity_type?: string
          association_id: string
          booking_config?: Json | null
          cover_image_url?: string | null
          created_at?: string
          description?: string | null
          form_fields?: Json | null
          id?: string
          is_active?: boolean
          map_config?: Json | null
          name: string
          show_on_homeowner_portal?: boolean
          show_on_public_page?: boolean
          signable_documents?: Json
          sort_order?: number | null
          updated_at?: string
          visible_to_roles?: Json
        }
        Update: {
          amenity_type?: string
          association_id?: string
          booking_config?: Json | null
          cover_image_url?: string | null
          created_at?: string
          description?: string | null
          form_fields?: Json | null
          id?: string
          is_active?: boolean
          map_config?: Json | null
          name?: string
          show_on_homeowner_portal?: boolean
          show_on_public_page?: boolean
          signable_documents?: Json
          sort_order?: number | null
          updated_at?: string
          visible_to_roles?: Json
        }
        Relationships: [
          {
            foreignKeyName: "amenities_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      amenity_bookings: {
        Row: {
          amenity_id: string
          association_id: string
          booking_date: string
          booking_type: string
          created_at: string
          created_by: string | null
          end_time: string | null
          event_description: string | null
          event_title: string | null
          form_data: Json
          guest_email: string | null
          guest_name: string
          guest_phone: string | null
          id: string
          is_public_event: boolean
          location: string | null
          notes: string | null
          payment_amount_cents: number
          payment_link_url: string | null
          payment_paid_at: string | null
          payment_status: string
          signed_documents: Json
          start_time: string | null
          status: string
          title: string | null
          updated_at: string
        }
        Insert: {
          amenity_id: string
          association_id: string
          booking_date: string
          booking_type?: string
          created_at?: string
          created_by?: string | null
          end_time?: string | null
          event_description?: string | null
          event_title?: string | null
          form_data?: Json
          guest_email?: string | null
          guest_name: string
          guest_phone?: string | null
          id?: string
          is_public_event?: boolean
          location?: string | null
          notes?: string | null
          payment_amount_cents?: number
          payment_link_url?: string | null
          payment_paid_at?: string | null
          payment_status?: string
          signed_documents?: Json
          start_time?: string | null
          status?: string
          title?: string | null
          updated_at?: string
        }
        Update: {
          amenity_id?: string
          association_id?: string
          booking_date?: string
          booking_type?: string
          created_at?: string
          created_by?: string | null
          end_time?: string | null
          event_description?: string | null
          event_title?: string | null
          form_data?: Json
          guest_email?: string | null
          guest_name?: string
          guest_phone?: string | null
          id?: string
          is_public_event?: boolean
          location?: string | null
          notes?: string | null
          payment_amount_cents?: number
          payment_link_url?: string | null
          payment_paid_at?: string | null
          payment_status?: string
          signed_documents?: Json
          start_time?: string | null
          status?: string
          title?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "amenity_bookings_amenity_id_fkey"
            columns: ["amenity_id"]
            isOneToOne: false
            referencedRelation: "amenities"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "amenity_bookings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      amenity_form_submissions: {
        Row: {
          amenity_id: string
          association_id: string
          created_at: string
          form_data: Json
          id: string
          submitter_email: string | null
          submitter_name: string | null
        }
        Insert: {
          amenity_id: string
          association_id: string
          created_at?: string
          form_data?: Json
          id?: string
          submitter_email?: string | null
          submitter_name?: string | null
        }
        Update: {
          amenity_id?: string
          association_id?: string
          created_at?: string
          form_data?: Json
          id?: string
          submitter_email?: string | null
          submitter_name?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "amenity_form_submissions_amenity_id_fkey"
            columns: ["amenity_id"]
            isOneToOne: false
            referencedRelation: "amenities"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "amenity_form_submissions_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      announcements: {
        Row: {
          association_id: string | null
          content: string
          created_at: string
          created_by: string | null
          expires_at: string | null
          id: string
          pinned: boolean
          status: string
          title: string
          updated_at: string
          visibility: string
        }
        Insert: {
          association_id?: string | null
          content: string
          created_at?: string
          created_by?: string | null
          expires_at?: string | null
          id?: string
          pinned?: boolean
          status?: string
          title: string
          updated_at?: string
          visibility?: string
        }
        Update: {
          association_id?: string | null
          content?: string
          created_at?: string
          created_by?: string | null
          expires_at?: string | null
          id?: string
          pinned?: boolean
          status?: string
          title?: string
          updated_at?: string
          visibility?: string
        }
        Relationships: [
          {
            foreignKeyName: "announcements_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      annual_meetings: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          id: string
          meeting_date: string | null
          meeting_location: string | null
          meeting_time: string | null
          notes: string | null
          quorum_needed: number
          quorum_percent: number
          total_units: number
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          id?: string
          meeting_date?: string | null
          meeting_location?: string | null
          meeting_time?: string | null
          notes?: string | null
          quorum_needed?: number
          quorum_percent?: number
          total_units?: number
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          id?: string
          meeting_date?: string | null
          meeting_location?: string | null
          meeting_time?: string | null
          notes?: string | null
          quorum_needed?: number
          quorum_percent?: number
          total_units?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "annual_meetings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      arc_application_comments: {
        Row: {
          application_id: string
          comment: string
          created_at: string
          id: string
          updated_at: string
          user_id: string | null
        }
        Insert: {
          application_id: string
          comment: string
          created_at?: string
          id?: string
          updated_at?: string
          user_id?: string | null
        }
        Update: {
          application_id?: string
          comment?: string
          created_at?: string
          id?: string
          updated_at?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "arc_application_comments_application_id_fkey"
            columns: ["application_id"]
            isOneToOne: false
            referencedRelation: "arc_applications"
            referencedColumns: ["id"]
          },
        ]
      }
      arc_application_votes: {
        Row: {
          application_id: string
          created_at: string
          id: string
          user_id: string
          vote: string
        }
        Insert: {
          application_id: string
          created_at?: string
          id?: string
          user_id: string
          vote: string
        }
        Update: {
          application_id?: string
          created_at?: string
          id?: string
          user_id?: string
          vote?: string
        }
        Relationships: [
          {
            foreignKeyName: "arc_application_votes_application_id_fkey"
            columns: ["application_id"]
            isOneToOne: false
            referencedRelation: "arc_applications"
            referencedColumns: ["id"]
          },
        ]
      }
      arc_applications: {
        Row: {
          association_id: string
          buildium_arc_request_id: string | null
          created_at: string
          decision_notes: string | null
          description: string | null
          id: string
          owner_id: string | null
          project_type: string | null
          review_date: string | null
          status: string | null
          submitted_date: string | null
          title: string
          unit_id: string | null
          updated_at: string
        }
        Insert: {
          association_id: string
          buildium_arc_request_id?: string | null
          created_at?: string
          decision_notes?: string | null
          description?: string | null
          id?: string
          owner_id?: string | null
          project_type?: string | null
          review_date?: string | null
          status?: string | null
          submitted_date?: string | null
          title: string
          unit_id?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string
          buildium_arc_request_id?: string | null
          created_at?: string
          decision_notes?: string | null
          description?: string | null
          id?: string
          owner_id?: string | null
          project_type?: string | null
          review_date?: string | null
          status?: string | null
          submitted_date?: string | null
          title?: string
          unit_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "arc_applications_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "arc_applications_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "arc_applications_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      arc_committee_members: {
        Row: {
          association_id: string
          committee_id: string | null
          created_at: string
          created_by: string | null
          email: string | null
          end_date: string | null
          id: string
          is_active: boolean
          name: string
          notes: string | null
          role: string | null
          start_date: string | null
          updated_at: string
          user_id: string | null
        }
        Insert: {
          association_id: string
          committee_id?: string | null
          created_at?: string
          created_by?: string | null
          email?: string | null
          end_date?: string | null
          id?: string
          is_active?: boolean
          name: string
          notes?: string | null
          role?: string | null
          start_date?: string | null
          updated_at?: string
          user_id?: string | null
        }
        Update: {
          association_id?: string
          committee_id?: string | null
          created_at?: string
          created_by?: string | null
          email?: string | null
          end_date?: string | null
          id?: string
          is_active?: boolean
          name?: string
          notes?: string | null
          role?: string | null
          start_date?: string | null
          updated_at?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "arc_committee_members_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "arc_committee_members_committee_id_fkey"
            columns: ["committee_id"]
            isOneToOne: false
            referencedRelation: "committees"
            referencedColumns: ["id"]
          },
        ]
      }
      arc_inbound_emails: {
        Row: {
          ai_description: string | null
          ai_project_type: string | null
          ai_property_address: string | null
          ai_raw: Json | null
          ai_title: string | null
          arc_application_id: string | null
          assigned_at: string | null
          assigned_by: string | null
          association_id: string | null
          attachment_urls: Json
          body_html: string | null
          body_text: string | null
          created_at: string
          from_email: string | null
          from_name: string | null
          id: string
          status: string
          subject: string | null
          to_email: string | null
          updated_at: string
        }
        Insert: {
          ai_description?: string | null
          ai_project_type?: string | null
          ai_property_address?: string | null
          ai_raw?: Json | null
          ai_title?: string | null
          arc_application_id?: string | null
          assigned_at?: string | null
          assigned_by?: string | null
          association_id?: string | null
          attachment_urls?: Json
          body_html?: string | null
          body_text?: string | null
          created_at?: string
          from_email?: string | null
          from_name?: string | null
          id?: string
          status?: string
          subject?: string | null
          to_email?: string | null
          updated_at?: string
        }
        Update: {
          ai_description?: string | null
          ai_project_type?: string | null
          ai_property_address?: string | null
          ai_raw?: Json | null
          ai_title?: string | null
          arc_application_id?: string | null
          assigned_at?: string | null
          assigned_by?: string | null
          association_id?: string | null
          attachment_urls?: Json
          body_html?: string | null
          body_text?: string | null
          created_at?: string
          from_email?: string | null
          from_name?: string | null
          id?: string
          status?: string
          subject?: string | null
          to_email?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "arc_inbound_emails_arc_application_id_fkey"
            columns: ["arc_application_id"]
            isOneToOne: false
            referencedRelation: "arc_applications"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "arc_inbound_emails_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      association_custom_fields: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          field_label: string
          field_value: string | null
          id: string
          sort_order: number
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          field_label: string
          field_value?: string | null
          id?: string
          sort_order?: number
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          field_label?: string
          field_value?: string | null
          id?: string
          sort_order?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "association_custom_fields_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      association_directory_entries: {
        Row: {
          address: string | null
          association_id: string
          category: string
          company: string | null
          created_at: string
          created_by: string | null
          display_name: string
          email: string | null
          id: string
          is_owner_opt_in: boolean
          is_published: boolean
          notes: string | null
          owner_id: string | null
          phone: string | null
          title: string | null
          updated_at: string
        }
        Insert: {
          address?: string | null
          association_id: string
          category?: string
          company?: string | null
          created_at?: string
          created_by?: string | null
          display_name: string
          email?: string | null
          id?: string
          is_owner_opt_in?: boolean
          is_published?: boolean
          notes?: string | null
          owner_id?: string | null
          phone?: string | null
          title?: string | null
          updated_at?: string
        }
        Update: {
          address?: string | null
          association_id?: string
          category?: string
          company?: string | null
          created_at?: string
          created_by?: string | null
          display_name?: string
          email?: string | null
          id?: string
          is_owner_opt_in?: boolean
          is_published?: boolean
          notes?: string | null
          owner_id?: string | null
          phone?: string | null
          title?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "association_directory_entries_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "association_directory_entries_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
        ]
      }
      association_faqs: {
        Row: {
          answer: string | null
          association_id: string
          created_at: string
          id: string
          question: string
          sort_order: number | null
          updated_at: string
        }
        Insert: {
          answer?: string | null
          association_id: string
          created_at?: string
          id?: string
          question: string
          sort_order?: number | null
          updated_at?: string
        }
        Update: {
          answer?: string | null
          association_id?: string
          created_at?: string
          id?: string
          question?: string
          sort_order?: number | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "association_faqs_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      association_fee_rules: {
        Row: {
          assessment_day: number | null
          assessment_frequency: string | null
          association_id: string
          auto_apply_day: number
          auto_apply_enabled: boolean
          auto_apply_schedule: string
          auto_post_enabled: boolean
          billing_start_date: string | null
          created_at: string
          default_assessment_amount: number | null
          id: string
          interest_apply_to: string
          interest_compound: string
          interest_enabled: boolean
          interest_grace_days: number
          interest_rate: number
          last_run_date: string | null
          late_fee_amount: number
          late_fee_enabled: boolean
          late_fee_max: number | null
          late_fee_recurring: boolean
          late_fee_trigger_days: number
          late_fee_type: string
          next_run_date: string | null
          push_to_zoho: boolean
          updated_at: string
        }
        Insert: {
          assessment_day?: number | null
          assessment_frequency?: string | null
          association_id: string
          auto_apply_day?: number
          auto_apply_enabled?: boolean
          auto_apply_schedule?: string
          auto_post_enabled?: boolean
          billing_start_date?: string | null
          created_at?: string
          default_assessment_amount?: number | null
          id?: string
          interest_apply_to?: string
          interest_compound?: string
          interest_enabled?: boolean
          interest_grace_days?: number
          interest_rate?: number
          last_run_date?: string | null
          late_fee_amount?: number
          late_fee_enabled?: boolean
          late_fee_max?: number | null
          late_fee_recurring?: boolean
          late_fee_trigger_days?: number
          late_fee_type?: string
          next_run_date?: string | null
          push_to_zoho?: boolean
          updated_at?: string
        }
        Update: {
          assessment_day?: number | null
          assessment_frequency?: string | null
          association_id?: string
          auto_apply_day?: number
          auto_apply_enabled?: boolean
          auto_apply_schedule?: string
          auto_post_enabled?: boolean
          billing_start_date?: string | null
          created_at?: string
          default_assessment_amount?: number | null
          id?: string
          interest_apply_to?: string
          interest_compound?: string
          interest_enabled?: boolean
          interest_grace_days?: number
          interest_rate?: number
          last_run_date?: string | null
          late_fee_amount?: number
          late_fee_enabled?: boolean
          late_fee_max?: number | null
          late_fee_recurring?: boolean
          late_fee_trigger_days?: number
          late_fee_type?: string
          next_run_date?: string | null
          push_to_zoho?: boolean
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "association_fee_rules_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: true
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      association_hidden_homeowner_folders: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          folder_path: string
          id: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          folder_path: string
          id?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          folder_path?: string
          id?: string
        }
        Relationships: [
          {
            foreignKeyName: "association_hidden_homeowner_folders_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      association_public_pages: {
        Row: {
          accent_color: string | null
          association_id: string
          bg_color: string | null
          body_blocks: Json
          booking_config: Json | null
          cover_image_url: string | null
          created_at: string
          custom_links: Json | null
          font_family: string | null
          footer_bg_color: string | null
          footer_text_color: string | null
          heading_color: string | null
          heading_font_family: string | null
          hero_images: Json | null
          id: string
          is_published: boolean
          logo_width: number | null
          modules_enabled: Json
          page_title: string | null
          section_bg_color: string | null
          seo_description: string | null
          sidebar_blocks: Json
          sidebar_enabled: boolean
          sidebar_title: string | null
          slug: string
          text_color: string | null
          updated_at: string
          welcome_message: string | null
        }
        Insert: {
          accent_color?: string | null
          association_id: string
          bg_color?: string | null
          body_blocks?: Json
          booking_config?: Json | null
          cover_image_url?: string | null
          created_at?: string
          custom_links?: Json | null
          font_family?: string | null
          footer_bg_color?: string | null
          footer_text_color?: string | null
          heading_color?: string | null
          heading_font_family?: string | null
          hero_images?: Json | null
          id?: string
          is_published?: boolean
          logo_width?: number | null
          modules_enabled?: Json
          page_title?: string | null
          section_bg_color?: string | null
          seo_description?: string | null
          sidebar_blocks?: Json
          sidebar_enabled?: boolean
          sidebar_title?: string | null
          slug: string
          text_color?: string | null
          updated_at?: string
          welcome_message?: string | null
        }
        Update: {
          accent_color?: string | null
          association_id?: string
          bg_color?: string | null
          body_blocks?: Json
          booking_config?: Json | null
          cover_image_url?: string | null
          created_at?: string
          custom_links?: Json | null
          font_family?: string | null
          footer_bg_color?: string | null
          footer_text_color?: string | null
          heading_color?: string | null
          heading_font_family?: string | null
          hero_images?: Json | null
          id?: string
          is_published?: boolean
          logo_width?: number | null
          modules_enabled?: Json
          page_title?: string | null
          section_bg_color?: string | null
          seo_description?: string | null
          sidebar_blocks?: Json
          sidebar_enabled?: boolean
          sidebar_title?: string | null
          slug?: string
          text_color?: string | null
          updated_at?: string
          welcome_message?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "association_public_pages_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: true
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      associations: {
        Row: {
          address: string | null
          attorney_email: string | null
          attorney_firm: string | null
          attorney_name: string | null
          attorney_phone: string | null
          care_of_address: string | null
          city: string | null
          contact_email: string | null
          cpa_email: string | null
          cpa_firm: string | null
          cpa_name: string | null
          cpa_phone: string | null
          created_at: string
          email: string | null
          fiscal_year_start: number | null
          id: string
          insurance_expiration: string | null
          insurance_provider: string | null
          logo_url: string | null
          mailing_address: string | null
          management_fee: number | null
          name: string
          phone: string | null
          state: string | null
          status: string
          updated_at: string
          website: string | null
          zip: string | null
          zoho_contact_id: string | null
          zoho_organization_id: string | null
        }
        Insert: {
          address?: string | null
          attorney_email?: string | null
          attorney_firm?: string | null
          attorney_name?: string | null
          attorney_phone?: string | null
          care_of_address?: string | null
          city?: string | null
          contact_email?: string | null
          cpa_email?: string | null
          cpa_firm?: string | null
          cpa_name?: string | null
          cpa_phone?: string | null
          created_at?: string
          email?: string | null
          fiscal_year_start?: number | null
          id?: string
          insurance_expiration?: string | null
          insurance_provider?: string | null
          logo_url?: string | null
          mailing_address?: string | null
          management_fee?: number | null
          name: string
          phone?: string | null
          state?: string | null
          status?: string
          updated_at?: string
          website?: string | null
          zip?: string | null
          zoho_contact_id?: string | null
          zoho_organization_id?: string | null
        }
        Update: {
          address?: string | null
          attorney_email?: string | null
          attorney_firm?: string | null
          attorney_name?: string | null
          attorney_phone?: string | null
          care_of_address?: string | null
          city?: string | null
          contact_email?: string | null
          cpa_email?: string | null
          cpa_firm?: string | null
          cpa_name?: string | null
          cpa_phone?: string | null
          created_at?: string
          email?: string | null
          fiscal_year_start?: number | null
          id?: string
          insurance_expiration?: string | null
          insurance_provider?: string | null
          logo_url?: string | null
          mailing_address?: string | null
          management_fee?: number | null
          name?: string
          phone?: string | null
          state?: string | null
          status?: string
          updated_at?: string
          website?: string | null
          zip?: string | null
          zoho_contact_id?: string | null
          zoho_organization_id?: string | null
        }
        Relationships: []
      }
      autopay_enrollments: {
        Row: {
          association_id: string
          created_at: string
          enrolled_by: string | null
          id: string
          is_active: boolean
          owner_id: string | null
          payment_method_type: string
          stripe_customer_id: string
          stripe_payment_method_id: string
          unit_id: string | null
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          enrolled_by?: string | null
          id?: string
          is_active?: boolean
          owner_id?: string | null
          payment_method_type?: string
          stripe_customer_id: string
          stripe_payment_method_id: string
          unit_id?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          enrolled_by?: string | null
          id?: string
          is_active?: boolean
          owner_id?: string | null
          payment_method_type?: string
          stripe_customer_id?: string
          stripe_payment_method_id?: string
          unit_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "autopay_enrollments_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "autopay_enrollments_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "autopay_enrollments_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      bank_accounts: {
        Row: {
          account_category: string
          account_name: string
          account_number: string | null
          account_type: string | null
          association_id: string
          bank_name: string | null
          created_at: string
          current_balance: number | null
          id: string
          next_check_number: number
          routing_number: string | null
          status: string
          updated_at: string
        }
        Insert: {
          account_category?: string
          account_name: string
          account_number?: string | null
          account_type?: string | null
          association_id: string
          bank_name?: string | null
          created_at?: string
          current_balance?: number | null
          id?: string
          next_check_number?: number
          routing_number?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          account_category?: string
          account_name?: string
          account_number?: string | null
          account_type?: string | null
          association_id?: string
          bank_name?: string | null
          created_at?: string
          current_balance?: number | null
          id?: string
          next_check_number?: number
          routing_number?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "bank_accounts_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      bank_reconciliations: {
        Row: {
          association_id: string
          bank_account_id: string
          cleared_balance: number
          closing_balance: number
          created_at: string
          difference: number
          id: string
          opening_balance: number
          reconciled_at: string | null
          reconciled_by: string | null
          statement_date: string
          status: string
          updated_at: string
        }
        Insert: {
          association_id: string
          bank_account_id: string
          cleared_balance?: number
          closing_balance?: number
          created_at?: string
          difference?: number
          id?: string
          opening_balance?: number
          reconciled_at?: string | null
          reconciled_by?: string | null
          statement_date: string
          status?: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          bank_account_id?: string
          cleared_balance?: number
          closing_balance?: number
          created_at?: string
          difference?: number
          id?: string
          opening_balance?: number
          reconciled_at?: string | null
          reconciled_by?: string | null
          statement_date?: string
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "bank_reconciliations_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bank_reconciliations_bank_account_id_fkey"
            columns: ["bank_account_id"]
            isOneToOne: false
            referencedRelation: "bank_accounts"
            referencedColumns: ["id"]
          },
        ]
      }
      bank_transactions: {
        Row: {
          association_id: string
          bank_account_id: string
          cleared_date: string | null
          created_at: string
          created_by: string | null
          credit: number
          date: string
          debit: number
          description: string | null
          id: string
          is_cleared: boolean
          reconciliation_id: string | null
          reference_number: string | null
          related_entity_id: string | null
          related_entity_type: string | null
          transaction_type: string
          updated_at: string
        }
        Insert: {
          association_id: string
          bank_account_id: string
          cleared_date?: string | null
          created_at?: string
          created_by?: string | null
          credit?: number
          date?: string
          debit?: number
          description?: string | null
          id?: string
          is_cleared?: boolean
          reconciliation_id?: string | null
          reference_number?: string | null
          related_entity_id?: string | null
          related_entity_type?: string | null
          transaction_type?: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          bank_account_id?: string
          cleared_date?: string | null
          created_at?: string
          created_by?: string | null
          credit?: number
          date?: string
          debit?: number
          description?: string | null
          id?: string
          is_cleared?: boolean
          reconciliation_id?: string | null
          reference_number?: string | null
          related_entity_id?: string | null
          related_entity_type?: string | null
          transaction_type?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "bank_transactions_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bank_transactions_bank_account_id_fkey"
            columns: ["bank_account_id"]
            isOneToOne: false
            referencedRelation: "bank_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bank_transactions_reconciliation_id_fkey"
            columns: ["reconciliation_id"]
            isOneToOne: false
            referencedRelation: "bank_reconciliations"
            referencedColumns: ["id"]
          },
        ]
      }
      bank_transfers: {
        Row: {
          amount: number
          association_id: string
          created_at: string
          created_by: string | null
          description: string | null
          from_bank_account_id: string
          from_transaction_id: string | null
          id: string
          to_bank_account_id: string
          to_transaction_id: string | null
          transfer_date: string
          updated_at: string
        }
        Insert: {
          amount: number
          association_id: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          from_bank_account_id: string
          from_transaction_id?: string | null
          id?: string
          to_bank_account_id: string
          to_transaction_id?: string | null
          transfer_date?: string
          updated_at?: string
        }
        Update: {
          amount?: number
          association_id?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          from_bank_account_id?: string
          from_transaction_id?: string | null
          id?: string
          to_bank_account_id?: string
          to_transaction_id?: string | null
          transfer_date?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "bank_transfers_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bank_transfers_from_bank_account_id_fkey"
            columns: ["from_bank_account_id"]
            isOneToOne: false
            referencedRelation: "bank_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bank_transfers_from_transaction_id_fkey"
            columns: ["from_transaction_id"]
            isOneToOne: false
            referencedRelation: "bank_transactions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bank_transfers_to_bank_account_id_fkey"
            columns: ["to_bank_account_id"]
            isOneToOne: false
            referencedRelation: "bank_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bank_transfers_to_transaction_id_fkey"
            columns: ["to_transaction_id"]
            isOneToOne: false
            referencedRelation: "bank_transactions"
            referencedColumns: ["id"]
          },
        ]
      }
      bids_quotes: {
        Row: {
          amount: number
          association_id: string
          created_at: string
          created_by: string | null
          description: string | null
          expiry_date: string | null
          id: string
          project_id: string | null
          received_date: string | null
          status: string
          updated_at: string
          vendor_name: string
        }
        Insert: {
          amount?: number
          association_id: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          expiry_date?: string | null
          id?: string
          project_id?: string | null
          received_date?: string | null
          status?: string
          updated_at?: string
          vendor_name: string
        }
        Update: {
          amount?: number
          association_id?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          expiry_date?: string | null
          id?: string
          project_id?: string | null
          received_date?: string | null
          status?: string
          updated_at?: string
          vendor_name?: string
        }
        Relationships: [
          {
            foreignKeyName: "bids_quotes_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bids_quotes_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
        ]
      }
      bill_approval_email_tokens: {
        Row: {
          acted_at: string | null
          action: string | null
          bill_id: string
          board_member_id: string
          created_at: string
          email: string
          id: string
          member_name: string | null
          notes: string | null
          sent_at: string | null
          token: string
        }
        Insert: {
          acted_at?: string | null
          action?: string | null
          bill_id: string
          board_member_id: string
          created_at?: string
          email: string
          id?: string
          member_name?: string | null
          notes?: string | null
          sent_at?: string | null
          token?: string
        }
        Update: {
          acted_at?: string | null
          action?: string | null
          bill_id?: string
          board_member_id?: string
          created_at?: string
          email?: string
          id?: string
          member_name?: string | null
          notes?: string | null
          sent_at?: string | null
          token?: string
        }
        Relationships: [
          {
            foreignKeyName: "bill_approval_email_tokens_bill_id_fkey"
            columns: ["bill_id"]
            isOneToOne: false
            referencedRelation: "bills"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bill_approval_email_tokens_board_member_id_fkey"
            columns: ["board_member_id"]
            isOneToOne: false
            referencedRelation: "board_members"
            referencedColumns: ["id"]
          },
        ]
      }
      bill_approval_rule_thresholds: {
        Row: {
          created_at: string
          id: string
          max_amount: number | null
          min_amount: number
          required_approvals: number
          rule_id: string
        }
        Insert: {
          created_at?: string
          id?: string
          max_amount?: number | null
          min_amount?: number
          required_approvals: number
          rule_id: string
        }
        Update: {
          created_at?: string
          id?: string
          max_amount?: number | null
          min_amount?: number
          required_approvals?: number
          rule_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "bill_approval_rule_thresholds_rule_id_fkey"
            columns: ["rule_id"]
            isOneToOne: false
            referencedRelation: "bill_approval_rules"
            referencedColumns: ["id"]
          },
        ]
      }
      bill_approval_rule_vendor_exceptions: {
        Row: {
          created_at: string
          id: string
          required_approvals: number
          rule_id: string
          vendor_name: string
        }
        Insert: {
          created_at?: string
          id?: string
          required_approvals: number
          rule_id: string
          vendor_name: string
        }
        Update: {
          created_at?: string
          id?: string
          required_approvals?: number
          rule_id?: string
          vendor_name?: string
        }
        Relationships: [
          {
            foreignKeyName: "bill_approval_rule_vendor_exceptions_rule_id_fkey"
            columns: ["rule_id"]
            isOneToOne: false
            referencedRelation: "bill_approval_rules"
            referencedColumns: ["id"]
          },
        ]
      }
      bill_approval_rules: {
        Row: {
          association_id: string
          created_at: string
          enabled: boolean
          id: string
          required_approvals: number
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          enabled?: boolean
          id?: string
          required_approvals?: number
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          enabled?: boolean
          id?: string
          required_approvals?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "bill_approval_rules_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: true
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      bill_approvals: {
        Row: {
          amount: number
          approved_by: string | null
          approved_date: string | null
          association_id: string
          bill_id: string | null
          created_at: string
          created_by: string | null
          id: string
          invoice_id: string | null
          notes: string | null
          status: string
          updated_at: string
          vendor_name: string
        }
        Insert: {
          amount?: number
          approved_by?: string | null
          approved_date?: string | null
          association_id: string
          bill_id?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          invoice_id?: string | null
          notes?: string | null
          status?: string
          updated_at?: string
          vendor_name: string
        }
        Update: {
          amount?: number
          approved_by?: string | null
          approved_date?: string | null
          association_id?: string
          bill_id?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          invoice_id?: string | null
          notes?: string | null
          status?: string
          updated_at?: string
          vendor_name?: string
        }
        Relationships: [
          {
            foreignKeyName: "bill_approvals_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bill_approvals_bill_id_fkey"
            columns: ["bill_id"]
            isOneToOne: false
            referencedRelation: "bills"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bill_approvals_invoice_id_fkey"
            columns: ["invoice_id"]
            isOneToOne: false
            referencedRelation: "invoices"
            referencedColumns: ["id"]
          },
        ]
      }
      bill_comments: {
        Row: {
          bill_id: string
          comment: string
          created_at: string
          id: string
          user_id: string
          user_name: string
        }
        Insert: {
          bill_id: string
          comment: string
          created_at?: string
          id?: string
          user_id: string
          user_name?: string
        }
        Update: {
          bill_id?: string
          comment?: string
          created_at?: string
          id?: string
          user_id?: string
          user_name?: string
        }
        Relationships: [
          {
            foreignKeyName: "bill_comments_bill_id_fkey"
            columns: ["bill_id"]
            isOneToOne: false
            referencedRelation: "bills"
            referencedColumns: ["id"]
          },
        ]
      }
      billable_expenses: {
        Row: {
          address: string | null
          amount: number
          association_id: string
          billable_type: string | null
          category: string | null
          created_at: string
          created_by: string | null
          credit_reason: string | null
          date: string
          description: string | null
          id: string
          is_credit: boolean
          is_recurring: boolean
          quantity: number | null
          receipt_url: string | null
          recurring_day: number | null
          recurring_end_date: string | null
          recurring_next_date: string | null
          recurring_parent_id: string | null
          status: string
          unit_price: number | null
          updated_at: string
          vendor_name: string | null
        }
        Insert: {
          address?: string | null
          amount?: number
          association_id: string
          billable_type?: string | null
          category?: string | null
          created_at?: string
          created_by?: string | null
          credit_reason?: string | null
          date?: string
          description?: string | null
          id?: string
          is_credit?: boolean
          is_recurring?: boolean
          quantity?: number | null
          receipt_url?: string | null
          recurring_day?: number | null
          recurring_end_date?: string | null
          recurring_next_date?: string | null
          recurring_parent_id?: string | null
          status?: string
          unit_price?: number | null
          updated_at?: string
          vendor_name?: string | null
        }
        Update: {
          address?: string | null
          amount?: number
          association_id?: string
          billable_type?: string | null
          category?: string | null
          created_at?: string
          created_by?: string | null
          credit_reason?: string | null
          date?: string
          description?: string | null
          id?: string
          is_credit?: boolean
          is_recurring?: boolean
          quantity?: number | null
          receipt_url?: string | null
          recurring_day?: number | null
          recurring_end_date?: string | null
          recurring_next_date?: string | null
          recurring_parent_id?: string | null
          status?: string
          unit_price?: number | null
          updated_at?: string
          vendor_name?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "billable_expenses_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "billable_expenses_recurring_parent_id_fkey"
            columns: ["recurring_parent_id"]
            isOneToOne: false
            referencedRelation: "billable_expenses"
            referencedColumns: ["id"]
          },
        ]
      }
      bills: {
        Row: {
          amount: number
          amount_paid: number
          approved_by: string | null
          approved_date: string | null
          association_id: string
          attachment_url: string | null
          bill_date: string
          buildium_bill_id: string | null
          check_id: string | null
          created_at: string
          created_by: string | null
          description: string | null
          due_date: string | null
          expense_account_id: string | null
          id: string
          invoice_number: string | null
          notes: string | null
          paid_date: string | null
          payment_method: string | null
          source_invoice_id: string | null
          status: string
          updated_at: string
          vendor_id: string | null
          zoho_bill_id: string | null
          zoho_payment_id: string | null
        }
        Insert: {
          amount?: number
          amount_paid?: number
          approved_by?: string | null
          approved_date?: string | null
          association_id: string
          attachment_url?: string | null
          bill_date?: string
          buildium_bill_id?: string | null
          check_id?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          expense_account_id?: string | null
          id?: string
          invoice_number?: string | null
          notes?: string | null
          paid_date?: string | null
          payment_method?: string | null
          source_invoice_id?: string | null
          status?: string
          updated_at?: string
          vendor_id?: string | null
          zoho_bill_id?: string | null
          zoho_payment_id?: string | null
        }
        Update: {
          amount?: number
          amount_paid?: number
          approved_by?: string | null
          approved_date?: string | null
          association_id?: string
          attachment_url?: string | null
          bill_date?: string
          buildium_bill_id?: string | null
          check_id?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          expense_account_id?: string | null
          id?: string
          invoice_number?: string | null
          notes?: string | null
          paid_date?: string | null
          payment_method?: string | null
          source_invoice_id?: string | null
          status?: string
          updated_at?: string
          vendor_id?: string | null
          zoho_bill_id?: string | null
          zoho_payment_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "bills_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bills_check_id_fkey"
            columns: ["check_id"]
            isOneToOne: false
            referencedRelation: "checks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bills_expense_account_id_fkey"
            columns: ["expense_account_id"]
            isOneToOne: false
            referencedRelation: "chart_of_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bills_source_invoice_id_fkey"
            columns: ["source_invoice_id"]
            isOneToOne: false
            referencedRelation: "invoices"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bills_vendor_id_fkey"
            columns: ["vendor_id"]
            isOneToOne: false
            referencedRelation: "vendors"
            referencedColumns: ["id"]
          },
        ]
      }
      blocked_dates: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          end_date: string
          id: string
          reason: string | null
          start_date: string
          title: string
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          end_date: string
          id?: string
          reason?: string | null
          start_date: string
          title: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          end_date?: string
          id?: string
          reason?: string | null
          start_date?: string
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "blocked_dates_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      board_members: {
        Row: {
          approval_authority: boolean
          association_id: string
          created_at: string
          id: string
          member_email: string | null
          member_name: string
          phone: string | null
          role: string | null
          updated_at: string
          user_id: string | null
        }
        Insert: {
          approval_authority?: boolean
          association_id: string
          created_at?: string
          id?: string
          member_email?: string | null
          member_name: string
          phone?: string | null
          role?: string | null
          updated_at?: string
          user_id?: string | null
        }
        Update: {
          approval_authority?: boolean
          association_id?: string
          created_at?: string
          id?: string
          member_email?: string | null
          member_name?: string
          phone?: string | null
          role?: string | null
          updated_at?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "board_members_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      board_resources: {
        Row: {
          association_id: string
          category: string
          created_at: string
          description: string | null
          file_url: string | null
          id: string
          is_active: boolean
          resource_type: string
          sort_order: number | null
          title: string
          updated_at: string
          url: string | null
        }
        Insert: {
          association_id: string
          category?: string
          created_at?: string
          description?: string | null
          file_url?: string | null
          id?: string
          is_active?: boolean
          resource_type?: string
          sort_order?: number | null
          title: string
          updated_at?: string
          url?: string | null
        }
        Update: {
          association_id?: string
          category?: string
          created_at?: string
          description?: string | null
          file_url?: string | null
          id?: string
          is_active?: boolean
          resource_type?: string
          sort_order?: number | null
          title?: string
          updated_at?: string
          url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "board_resources_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      board_vote_email_tokens: {
        Row: {
          board_member_id: string
          board_vote_id: string
          created_at: string
          email: string
          id: string
          member_name: string | null
          sent_at: string | null
          token: string
          vote_option: string | null
          voted_at: string | null
        }
        Insert: {
          board_member_id: string
          board_vote_id: string
          created_at?: string
          email: string
          id?: string
          member_name?: string | null
          sent_at?: string | null
          token?: string
          vote_option?: string | null
          voted_at?: string | null
        }
        Update: {
          board_member_id?: string
          board_vote_id?: string
          created_at?: string
          email?: string
          id?: string
          member_name?: string | null
          sent_at?: string | null
          token?: string
          vote_option?: string | null
          voted_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "board_vote_email_tokens_board_member_id_fkey"
            columns: ["board_member_id"]
            isOneToOne: false
            referencedRelation: "board_members"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "board_vote_email_tokens_board_vote_id_fkey"
            columns: ["board_vote_id"]
            isOneToOne: false
            referencedRelation: "board_votes"
            referencedColumns: ["id"]
          },
        ]
      }
      board_vote_responses: {
        Row: {
          board_member_id: string | null
          board_vote_id: string
          created_at: string
          id: string
          recorded_by: string | null
          updated_at: string
          user_id: string | null
          vote_option: string
        }
        Insert: {
          board_member_id?: string | null
          board_vote_id: string
          created_at?: string
          id?: string
          recorded_by?: string | null
          updated_at?: string
          user_id?: string | null
          vote_option: string
        }
        Update: {
          board_member_id?: string | null
          board_vote_id?: string
          created_at?: string
          id?: string
          recorded_by?: string | null
          updated_at?: string
          user_id?: string | null
          vote_option?: string
        }
        Relationships: [
          {
            foreignKeyName: "board_vote_responses_board_member_id_fkey"
            columns: ["board_member_id"]
            isOneToOne: false
            referencedRelation: "board_members"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "board_vote_responses_board_vote_id_fkey"
            columns: ["board_vote_id"]
            isOneToOne: false
            referencedRelation: "board_votes"
            referencedColumns: ["id"]
          },
        ]
      }
      board_votes: {
        Row: {
          association_id: string
          attachments: Json | null
          created_at: string
          created_by: string | null
          description: string | null
          id: string
          status: string
          title: string
          updated_at: string
          vote_options: string[] | null
        }
        Insert: {
          association_id: string
          attachments?: Json | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          status?: string
          title: string
          updated_at?: string
          vote_options?: string[] | null
        }
        Update: {
          association_id?: string
          attachments?: Json | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          status?: string
          title?: string
          updated_at?: string
          vote_options?: string[] | null
        }
        Relationships: [
          {
            foreignKeyName: "board_votes_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      budgets: {
        Row: {
          account_type: string
          actual_amount: number
          association_id: string
          budgeted_amount: number | null
          category: string
          created_at: string
          fiscal_year: number
          gl_account_id: string | null
          id: string
          is_parent: boolean
          notes: string | null
          parent_id: string | null
          updated_at: string
        }
        Insert: {
          account_type?: string
          actual_amount?: number
          association_id: string
          budgeted_amount?: number | null
          category: string
          created_at?: string
          fiscal_year: number
          gl_account_id?: string | null
          id?: string
          is_parent?: boolean
          notes?: string | null
          parent_id?: string | null
          updated_at?: string
        }
        Update: {
          account_type?: string
          actual_amount?: number
          association_id?: string
          budgeted_amount?: number | null
          category?: string
          created_at?: string
          fiscal_year?: number
          gl_account_id?: string | null
          id?: string
          is_parent?: boolean
          notes?: string | null
          parent_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "budgets_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "budgets_gl_account_id_fkey"
            columns: ["gl_account_id"]
            isOneToOne: false
            referencedRelation: "chart_of_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "budgets_parent_id_fkey"
            columns: ["parent_id"]
            isOneToOne: false
            referencedRelation: "budgets"
            referencedColumns: ["id"]
          },
        ]
      }
      buildium_gl_mappings: {
        Row: {
          amount_max: number | null
          amount_min: number | null
          association_id: string
          buildium_gl_account_id: string
          buildium_gl_account_name: string | null
          charge_type: string
          created_at: string
          custom_description: string | null
          id: string
          unit_id: string | null
          updated_at: string
        }
        Insert: {
          amount_max?: number | null
          amount_min?: number | null
          association_id: string
          buildium_gl_account_id: string
          buildium_gl_account_name?: string | null
          charge_type: string
          created_at?: string
          custom_description?: string | null
          id?: string
          unit_id?: string | null
          updated_at?: string
        }
        Update: {
          amount_max?: number | null
          amount_min?: number | null
          association_id?: string
          buildium_gl_account_id?: string
          buildium_gl_account_name?: string | null
          charge_type?: string
          created_at?: string
          custom_description?: string | null
          id?: string
          unit_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "buildium_gl_mappings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "buildium_gl_mappings_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      buildium_import_staging: {
        Row: {
          action: string
          applied_at: string | null
          apply_error: string | null
          association_id: string | null
          batch_id: string
          created_at: string
          created_by: string | null
          diff: Json | null
          external_id: string | null
          id: string
          kind: string
          match_id: string | null
          payload: Json
          reviewed_at: string | null
          reviewed_by: string | null
          status: string
          summary: string | null
          updated_at: string
        }
        Insert: {
          action?: string
          applied_at?: string | null
          apply_error?: string | null
          association_id?: string | null
          batch_id: string
          created_at?: string
          created_by?: string | null
          diff?: Json | null
          external_id?: string | null
          id?: string
          kind: string
          match_id?: string | null
          payload: Json
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string
          summary?: string | null
          updated_at?: string
        }
        Update: {
          action?: string
          applied_at?: string | null
          apply_error?: string | null
          association_id?: string | null
          batch_id?: string
          created_at?: string
          created_by?: string | null
          diff?: Json | null
          external_id?: string | null
          id?: string
          kind?: string
          match_id?: string | null
          payload?: Json
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string
          summary?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      bundle_expenses: {
        Row: {
          added_at: string
          bundle_id: string
          expense_id: string
          fee_schedule_id: string | null
          id: string
        }
        Insert: {
          added_at?: string
          bundle_id: string
          expense_id: string
          fee_schedule_id?: string | null
          id?: string
        }
        Update: {
          added_at?: string
          bundle_id?: string
          expense_id?: string
          fee_schedule_id?: string | null
          id?: string
        }
        Relationships: [
          {
            foreignKeyName: "bundle_expenses_bundle_id_fkey"
            columns: ["bundle_id"]
            isOneToOne: false
            referencedRelation: "expense_bundles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bundle_expenses_expense_id_fkey"
            columns: ["expense_id"]
            isOneToOne: false
            referencedRelation: "billable_expenses"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bundle_expenses_fee_schedule_id_fkey"
            columns: ["fee_schedule_id"]
            isOneToOne: false
            referencedRelation: "fee_schedules"
            referencedColumns: ["id"]
          },
        ]
      }
      calendar_events: {
        Row: {
          all_day: boolean | null
          association_id: string
          attachment_name: string | null
          attachment_url: string | null
          created_at: string
          created_by: string | null
          description: string | null
          end_date: string | null
          event_type: string | null
          id: string
          is_blocked: boolean
          location: string | null
          start_date: string
          title: string
          updated_at: string
          visibility: string[]
        }
        Insert: {
          all_day?: boolean | null
          association_id: string
          attachment_name?: string | null
          attachment_url?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          end_date?: string | null
          event_type?: string | null
          id?: string
          is_blocked?: boolean
          location?: string | null
          start_date: string
          title: string
          updated_at?: string
          visibility?: string[]
        }
        Update: {
          all_day?: boolean | null
          association_id?: string
          attachment_name?: string | null
          attachment_url?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          end_date?: string | null
          event_type?: string | null
          id?: string
          is_blocked?: boolean
          location?: string | null
          start_date?: string
          title?: string
          updated_at?: string
          visibility?: string[]
        }
        Relationships: [
          {
            foreignKeyName: "calendar_events_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      call_logs: {
        Row: {
          association_id: string
          call_type: string | null
          caller_name: string
          caller_phone: string | null
          created_at: string
          follow_up_date: string | null
          follow_up_required: boolean | null
          id: string
          notes: string | null
          subject: string | null
          taken_by: string | null
          updated_at: string
        }
        Insert: {
          association_id: string
          call_type?: string | null
          caller_name: string
          caller_phone?: string | null
          created_at?: string
          follow_up_date?: string | null
          follow_up_required?: boolean | null
          id?: string
          notes?: string | null
          subject?: string | null
          taken_by?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string
          call_type?: string | null
          caller_name?: string
          caller_phone?: string | null
          created_at?: string
          follow_up_date?: string | null
          follow_up_required?: boolean | null
          id?: string
          notes?: string | null
          subject?: string | null
          taken_by?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "call_logs_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      chart_of_accounts: {
        Row: {
          account_name: string
          account_number: string
          account_type: string
          accounting_system: string
          association_id: string | null
          association_ids: string[] | null
          created_at: string
          description: string | null
          id: string
          is_active: boolean
          parent_account_id: string | null
          updated_at: string
        }
        Insert: {
          account_name: string
          account_number: string
          account_type?: string
          accounting_system?: string
          association_id?: string | null
          association_ids?: string[] | null
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean
          parent_account_id?: string | null
          updated_at?: string
        }
        Update: {
          account_name?: string
          account_number?: string
          account_type?: string
          accounting_system?: string
          association_id?: string | null
          association_ids?: string[] | null
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean
          parent_account_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "chart_of_accounts_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "chart_of_accounts_parent_account_id_fkey"
            columns: ["parent_account_id"]
            isOneToOne: false
            referencedRelation: "chart_of_accounts"
            referencedColumns: ["id"]
          },
        ]
      }
      check_layouts: {
        Row: {
          association_id: string
          check_position: string
          created_at: string
          field_positions: Json
          font_family: string
          footer_text: string | null
          id: string
          logo_url: string | null
          memo_prefix: string | null
          offset_x: number
          offset_y: number
          payer_address: string | null
          payer_name: string | null
          show_field_labels: boolean
          show_logo: boolean
          show_payer_block: boolean
          show_signature_line: boolean
          signature_image_url: string | null
          signature_label: string | null
          updated_at: string
        }
        Insert: {
          association_id: string
          check_position?: string
          created_at?: string
          field_positions?: Json
          font_family?: string
          footer_text?: string | null
          id?: string
          logo_url?: string | null
          memo_prefix?: string | null
          offset_x?: number
          offset_y?: number
          payer_address?: string | null
          payer_name?: string | null
          show_field_labels?: boolean
          show_logo?: boolean
          show_payer_block?: boolean
          show_signature_line?: boolean
          signature_image_url?: string | null
          signature_label?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string
          check_position?: string
          created_at?: string
          field_positions?: Json
          font_family?: string
          footer_text?: string | null
          id?: string
          logo_url?: string | null
          memo_prefix?: string | null
          offset_x?: number
          offset_y?: number
          payer_address?: string | null
          payer_name?: string | null
          show_field_labels?: boolean
          show_logo?: boolean
          show_payer_block?: boolean
          show_signature_line?: boolean
          signature_image_url?: string | null
          signature_label?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "check_layouts_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: true
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      checklists: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          description: string | null
          id: string
          items: Json | null
          status: string
          title: string
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          items?: Json | null
          status?: string
          title: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          items?: Json | null
          status?: string
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "checklists_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      checks: {
        Row: {
          amount: number
          association_id: string
          bank_account_id: string | null
          check_date: string | null
          check_number: string | null
          created_at: string
          created_by: string | null
          id: string
          memo: string | null
          payee: string
          printed: boolean | null
          status: string
          updated_at: string
        }
        Insert: {
          amount?: number
          association_id: string
          bank_account_id?: string | null
          check_date?: string | null
          check_number?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          memo?: string | null
          payee: string
          printed?: boolean | null
          status?: string
          updated_at?: string
        }
        Update: {
          amount?: number
          association_id?: string
          bank_account_id?: string | null
          check_date?: string | null
          check_number?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          memo?: string | null
          payee?: string
          printed?: boolean | null
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "checks_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "checks_bank_account_id_fkey"
            columns: ["bank_account_id"]
            isOneToOne: false
            referencedRelation: "bank_accounts"
            referencedColumns: ["id"]
          },
        ]
      }
      client_invoice_items: {
        Row: {
          amount: number
          billable_expense_id: string | null
          category: string | null
          created_at: string
          date: string | null
          description: string | null
          id: string
          invoice_id: string
          is_credit: boolean
          quantity: number
          unit_price: number
        }
        Insert: {
          amount?: number
          billable_expense_id?: string | null
          category?: string | null
          created_at?: string
          date?: string | null
          description?: string | null
          id?: string
          invoice_id: string
          is_credit?: boolean
          quantity?: number
          unit_price?: number
        }
        Update: {
          amount?: number
          billable_expense_id?: string | null
          category?: string | null
          created_at?: string
          date?: string | null
          description?: string | null
          id?: string
          invoice_id?: string
          is_credit?: boolean
          quantity?: number
          unit_price?: number
        }
        Relationships: [
          {
            foreignKeyName: "client_invoice_items_billable_expense_id_fkey"
            columns: ["billable_expense_id"]
            isOneToOne: false
            referencedRelation: "billable_expenses"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "client_invoice_items_invoice_id_fkey"
            columns: ["invoice_id"]
            isOneToOne: false
            referencedRelation: "client_invoices"
            referencedColumns: ["id"]
          },
        ]
      }
      client_invoices: {
        Row: {
          amount: number
          association_id: string
          created_at: string
          created_by: string | null
          credits: number
          due_date: string | null
          id: string
          invoice_number: string
          issue_date: string
          notes: string | null
          paid_date: string | null
          qbo_invoice_id: string | null
          qbo_sync_error: string | null
          qbo_sync_status: string
          qbo_synced_at: string | null
          source: string
          status: string
          total: number
          updated_at: string
          zoho_invoice_id: string | null
          zoho_sync_error: string | null
          zoho_sync_status: string
        }
        Insert: {
          amount?: number
          association_id: string
          created_at?: string
          created_by?: string | null
          credits?: number
          due_date?: string | null
          id?: string
          invoice_number: string
          issue_date?: string
          notes?: string | null
          paid_date?: string | null
          qbo_invoice_id?: string | null
          qbo_sync_error?: string | null
          qbo_sync_status?: string
          qbo_synced_at?: string | null
          source?: string
          status?: string
          total?: number
          updated_at?: string
          zoho_invoice_id?: string | null
          zoho_sync_error?: string | null
          zoho_sync_status?: string
        }
        Update: {
          amount?: number
          association_id?: string
          created_at?: string
          created_by?: string | null
          credits?: number
          due_date?: string | null
          id?: string
          invoice_number?: string
          issue_date?: string
          notes?: string | null
          paid_date?: string | null
          qbo_invoice_id?: string | null
          qbo_sync_error?: string | null
          qbo_sync_status?: string
          qbo_synced_at?: string | null
          source?: string
          status?: string
          total?: number
          updated_at?: string
          zoho_invoice_id?: string | null
          zoho_sync_error?: string | null
          zoho_sync_status?: string
        }
        Relationships: [
          {
            foreignKeyName: "client_invoices_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      client_requests: {
        Row: {
          assigned_to: string | null
          association_id: string
          attachments: Json
          created_at: string
          description: string | null
          id: string
          priority: string | null
          request_type: string | null
          requester_email: string | null
          requester_name: string | null
          status: string
          title: string
          updated_at: string
        }
        Insert: {
          assigned_to?: string | null
          association_id: string
          attachments?: Json
          created_at?: string
          description?: string | null
          id?: string
          priority?: string | null
          request_type?: string | null
          requester_email?: string | null
          requester_name?: string | null
          status?: string
          title: string
          updated_at?: string
        }
        Update: {
          assigned_to?: string | null
          association_id?: string
          attachments?: Json
          created_at?: string
          description?: string | null
          id?: string
          priority?: string | null
          request_type?: string | null
          requester_email?: string | null
          requester_name?: string | null
          status?: string
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "client_requests_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      collaborative_documents: {
        Row: {
          association_id: string
          content: string | null
          created_at: string
          created_by: string
          id: string
          locked_at: string | null
          locked_by: string | null
          title: string
          updated_at: string
        }
        Insert: {
          association_id: string
          content?: string | null
          created_at?: string
          created_by: string
          id?: string
          locked_at?: string | null
          locked_by?: string | null
          title: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          content?: string | null
          created_at?: string
          created_by?: string
          id?: string
          locked_at?: string | null
          locked_by?: string | null
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "collaborative_documents_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      collections: {
        Row: {
          amount_owed: number
          association_id: string
          created_at: string
          created_by: string | null
          id: string
          last_notice_date: string | null
          notes: string | null
          owner_id: string | null
          status: string
          unit_id: string | null
          updated_at: string
        }
        Insert: {
          amount_owed?: number
          association_id: string
          created_at?: string
          created_by?: string | null
          id?: string
          last_notice_date?: string | null
          notes?: string | null
          owner_id?: string | null
          status?: string
          unit_id?: string | null
          updated_at?: string
        }
        Update: {
          amount_owed?: number
          association_id?: string
          created_at?: string
          created_by?: string | null
          id?: string
          last_notice_date?: string | null
          notes?: string | null
          owner_id?: string | null
          status?: string
          unit_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "collections_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "collections_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "collections_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      committees: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          description: string | null
          id: string
          is_active: boolean
          name: string
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          is_active?: boolean
          name: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          is_active?: boolean
          name?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "committees_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      company_bank_accounts: {
        Row: {
          account_category: string | null
          account_name: string
          account_number: string | null
          account_type: string | null
          bank_name: string | null
          created_at: string
          current_balance: number | null
          id: string
          next_check_number: number
          routing_number: string | null
          status: string
          updated_at: string
        }
        Insert: {
          account_category?: string | null
          account_name: string
          account_number?: string | null
          account_type?: string | null
          bank_name?: string | null
          created_at?: string
          current_balance?: number | null
          id?: string
          next_check_number?: number
          routing_number?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          account_category?: string | null
          account_name?: string
          account_number?: string | null
          account_type?: string | null
          bank_name?: string | null
          created_at?: string
          current_balance?: number | null
          id?: string
          next_check_number?: number
          routing_number?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: []
      }
      company_bank_transactions: {
        Row: {
          category: string | null
          check_id: string | null
          cleared_date: string | null
          company_bank_account_id: string | null
          created_at: string
          created_by: string | null
          credit: number
          date: string
          debit: number
          description: string | null
          id: string
          is_cleared: boolean
          qbo_id: string | null
          qbo_sync_status: string | null
          reference_number: string | null
          transaction_type: string
          updated_at: string
        }
        Insert: {
          category?: string | null
          check_id?: string | null
          cleared_date?: string | null
          company_bank_account_id?: string | null
          created_at?: string
          created_by?: string | null
          credit?: number
          date?: string
          debit?: number
          description?: string | null
          id?: string
          is_cleared?: boolean
          qbo_id?: string | null
          qbo_sync_status?: string | null
          reference_number?: string | null
          transaction_type?: string
          updated_at?: string
        }
        Update: {
          category?: string | null
          check_id?: string | null
          cleared_date?: string | null
          company_bank_account_id?: string | null
          created_at?: string
          created_by?: string | null
          credit?: number
          date?: string
          debit?: number
          description?: string | null
          id?: string
          is_cleared?: boolean
          qbo_id?: string | null
          qbo_sync_status?: string | null
          reference_number?: string | null
          transaction_type?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "company_bank_transactions_check_id_fkey"
            columns: ["check_id"]
            isOneToOne: false
            referencedRelation: "company_checks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "company_bank_transactions_company_bank_account_id_fkey"
            columns: ["company_bank_account_id"]
            isOneToOne: false
            referencedRelation: "company_bank_accounts"
            referencedColumns: ["id"]
          },
        ]
      }
      company_check_layouts: {
        Row: {
          check_position: string
          created_at: string
          field_positions: Json
          font_family: string
          footer_text: string | null
          id: string
          logo_url: string | null
          memo_prefix: string | null
          offset_x: number
          offset_y: number
          payer_address: string | null
          payer_name: string | null
          show_field_labels: boolean
          show_logo: boolean
          show_payer_block: boolean
          show_signature_line: boolean
          signature_image_url: string | null
          signature_label: string | null
          updated_at: string
        }
        Insert: {
          check_position?: string
          created_at?: string
          field_positions?: Json
          font_family?: string
          footer_text?: string | null
          id?: string
          logo_url?: string | null
          memo_prefix?: string | null
          offset_x?: number
          offset_y?: number
          payer_address?: string | null
          payer_name?: string | null
          show_field_labels?: boolean
          show_logo?: boolean
          show_payer_block?: boolean
          show_signature_line?: boolean
          signature_image_url?: string | null
          signature_label?: string | null
          updated_at?: string
        }
        Update: {
          check_position?: string
          created_at?: string
          field_positions?: Json
          font_family?: string
          footer_text?: string | null
          id?: string
          logo_url?: string | null
          memo_prefix?: string | null
          offset_x?: number
          offset_y?: number
          payer_address?: string | null
          payer_name?: string | null
          show_field_labels?: boolean
          show_logo?: boolean
          show_payer_block?: boolean
          show_signature_line?: boolean
          signature_image_url?: string | null
          signature_label?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      company_checks: {
        Row: {
          amount: number
          check_date: string | null
          check_number: string | null
          company_bank_account_id: string | null
          created_at: string
          created_by: string | null
          id: string
          memo: string | null
          payee: string
          payee_address: string | null
          printed: boolean
          status: string
          updated_at: string
        }
        Insert: {
          amount?: number
          check_date?: string | null
          check_number?: string | null
          company_bank_account_id?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          memo?: string | null
          payee: string
          payee_address?: string | null
          printed?: boolean
          status?: string
          updated_at?: string
        }
        Update: {
          amount?: number
          check_date?: string | null
          check_number?: string | null
          company_bank_account_id?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          memo?: string | null
          payee?: string
          payee_address?: string | null
          printed?: boolean
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "company_checks_company_bank_account_id_fkey"
            columns: ["company_bank_account_id"]
            isOneToOne: false
            referencedRelation: "company_bank_accounts"
            referencedColumns: ["id"]
          },
        ]
      }
      company_settings: {
        Row: {
          company_name: string | null
          created_at: string
          id: string
          key: string
          updated_at: string
          value: string | null
          zoho_organization_id: string | null
        }
        Insert: {
          company_name?: string | null
          created_at?: string
          id?: string
          key: string
          updated_at?: string
          value?: string | null
          zoho_organization_id?: string | null
        }
        Update: {
          company_name?: string | null
          created_at?: string
          id?: string
          key?: string
          updated_at?: string
          value?: string | null
          zoho_organization_id?: string | null
        }
        Relationships: []
      }
      compliance_checklists: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          fiscal_year: number
          id: string
          items: Json
          status: string
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          fiscal_year: number
          id?: string
          items?: Json
          status?: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          fiscal_year?: number
          id?: string
          items?: Json
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "compliance_checklists_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      custom_ledgers: {
        Row: {
          association_id: string | null
          created_at: string
          created_by: string | null
          id: string
          name: string
          owner_id: string | null
          rows: Json | null
          settings: Json | null
          updated_at: string
        }
        Insert: {
          association_id?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          name: string
          owner_id?: string | null
          rows?: Json | null
          settings?: Json | null
          updated_at?: string
        }
        Update: {
          association_id?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          name?: string
          owner_id?: string | null
          rows?: Json | null
          settings?: Json | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "custom_ledgers_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "custom_ledgers_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
        ]
      }
      custom_variables: {
        Row: {
          association_id: string
          category: string | null
          created_at: string
          created_by: string | null
          default_value: string | null
          description: string | null
          display_label: string
          id: string
          updated_at: string
          variable_name: string
        }
        Insert: {
          association_id: string
          category?: string | null
          created_at?: string
          created_by?: string | null
          default_value?: string | null
          description?: string | null
          display_label: string
          id?: string
          updated_at?: string
          variable_name: string
        }
        Update: {
          association_id?: string
          category?: string | null
          created_at?: string
          created_by?: string | null
          default_value?: string | null
          description?: string | null
          display_label?: string
          id?: string
          updated_at?: string
          variable_name?: string
        }
        Relationships: [
          {
            foreignKeyName: "custom_variables_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      deposit_batch_items: {
        Row: {
          amount: number
          created_at: string
          deposit_batch_id: string
          description: string | null
          id: string
          owner_ledger_entry_id: string | null
        }
        Insert: {
          amount?: number
          created_at?: string
          deposit_batch_id: string
          description?: string | null
          id?: string
          owner_ledger_entry_id?: string | null
        }
        Update: {
          amount?: number
          created_at?: string
          deposit_batch_id?: string
          description?: string | null
          id?: string
          owner_ledger_entry_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "deposit_batch_items_deposit_batch_id_fkey"
            columns: ["deposit_batch_id"]
            isOneToOne: false
            referencedRelation: "deposit_batches"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "deposit_batch_items_owner_ledger_entry_id_fkey"
            columns: ["owner_ledger_entry_id"]
            isOneToOne: false
            referencedRelation: "owner_ledger_entries"
            referencedColumns: ["id"]
          },
        ]
      }
      deposit_batches: {
        Row: {
          association_id: string
          bank_account_id: string
          bank_transaction_id: string | null
          created_at: string
          created_by: string | null
          deposit_date: string
          id: string
          memo: string | null
          status: string
          total_amount: number
          updated_at: string
        }
        Insert: {
          association_id: string
          bank_account_id: string
          bank_transaction_id?: string | null
          created_at?: string
          created_by?: string | null
          deposit_date?: string
          id?: string
          memo?: string | null
          status?: string
          total_amount?: number
          updated_at?: string
        }
        Update: {
          association_id?: string
          bank_account_id?: string
          bank_transaction_id?: string | null
          created_at?: string
          created_by?: string | null
          deposit_date?: string
          id?: string
          memo?: string | null
          status?: string
          total_amount?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "deposit_batches_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "deposit_batches_bank_account_id_fkey"
            columns: ["bank_account_id"]
            isOneToOne: false
            referencedRelation: "bank_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "deposit_batches_bank_transaction_id_fkey"
            columns: ["bank_transaction_id"]
            isOneToOne: false
            referencedRelation: "bank_transactions"
            referencedColumns: ["id"]
          },
        ]
      }
      direct_messages: {
        Row: {
          created_at: string
          id: string
          message: string
          read_at: string | null
          recipient_id: string
          sender_id: string
        }
        Insert: {
          created_at?: string
          id?: string
          message: string
          read_at?: string | null
          recipient_id: string
          sender_id: string
        }
        Update: {
          created_at?: string
          id?: string
          message?: string
          read_at?: string | null
          recipient_id?: string
          sender_id?: string
        }
        Relationships: []
      }
      document_edit_history: {
        Row: {
          change_summary: string | null
          content_snapshot: string | null
          created_at: string
          document_id: string
          id: string
          user_color: string
          user_id: string
          user_name: string
        }
        Insert: {
          change_summary?: string | null
          content_snapshot?: string | null
          created_at?: string
          document_id: string
          id?: string
          user_color?: string
          user_id: string
          user_name: string
        }
        Update: {
          change_summary?: string | null
          content_snapshot?: string | null
          created_at?: string
          document_id?: string
          id?: string
          user_color?: string
          user_id?: string
          user_name?: string
        }
        Relationships: [
          {
            foreignKeyName: "document_edit_history_document_id_fkey"
            columns: ["document_id"]
            isOneToOne: false
            referencedRelation: "collaborative_documents"
            referencedColumns: ["id"]
          },
        ]
      }
      document_validation_proofs: {
        Row: {
          association_id: string | null
          created_at: string
          document_title: string | null
          document_type: string
          file_url: string | null
          generated_at: string
          generated_by: string | null
          id: string
          metadata: Json | null
          verification_hash: string
        }
        Insert: {
          association_id?: string | null
          created_at?: string
          document_title?: string | null
          document_type: string
          file_url?: string | null
          generated_at?: string
          generated_by?: string | null
          id?: string
          metadata?: Json | null
          verification_hash: string
        }
        Update: {
          association_id?: string | null
          created_at?: string
          document_title?: string | null
          document_type?: string
          file_url?: string | null
          generated_at?: string
          generated_by?: string | null
          id?: string
          metadata?: Json | null
          verification_hash?: string
        }
        Relationships: [
          {
            foreignKeyName: "document_validation_proofs_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      documents: {
        Row: {
          ai_summary: string | null
          association_id: string | null
          category: string | null
          created_at: string
          file_name: string | null
          file_size: number | null
          file_url: string | null
          id: string
          is_public: boolean
          title: string
          updated_at: string
          uploaded_by: string | null
          visibility: string[]
        }
        Insert: {
          ai_summary?: string | null
          association_id?: string | null
          category?: string | null
          created_at?: string
          file_name?: string | null
          file_size?: number | null
          file_url?: string | null
          id?: string
          is_public?: boolean
          title: string
          updated_at?: string
          uploaded_by?: string | null
          visibility?: string[]
        }
        Update: {
          ai_summary?: string | null
          association_id?: string | null
          category?: string | null
          created_at?: string
          file_name?: string | null
          file_size?: number | null
          file_url?: string | null
          id?: string
          is_public?: boolean
          title?: string
          updated_at?: string
          uploaded_by?: string | null
          visibility?: string[]
        }
        Relationships: [
          {
            foreignKeyName: "documents_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      docusign_envelopes: {
        Row: {
          association_id: string
          completed_at: string | null
          created_at: string
          document_name: string
          document_url: string | null
          envelope_id: string | null
          id: string
          metadata: Json | null
          recipients: Json
          sent_at: string | null
          sent_by: string | null
          status: string
          updated_at: string
        }
        Insert: {
          association_id: string
          completed_at?: string | null
          created_at?: string
          document_name: string
          document_url?: string | null
          envelope_id?: string | null
          id?: string
          metadata?: Json | null
          recipients?: Json
          sent_at?: string | null
          sent_by?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          completed_at?: string | null
          created_at?: string
          document_name?: string
          document_url?: string | null
          envelope_id?: string | null
          id?: string
          metadata?: Json | null
          recipients?: Json
          sent_at?: string | null
          sent_by?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "docusign_envelopes_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      election_audit_log: {
        Row: {
          action: string
          created_at: string
          election_id: string
          id: string
          ip_address: string | null
          voter_description: string
        }
        Insert: {
          action?: string
          created_at?: string
          election_id: string
          id?: string
          ip_address?: string | null
          voter_description: string
        }
        Update: {
          action?: string
          created_at?: string
          election_id?: string
          id?: string
          ip_address?: string | null
          voter_description?: string
        }
        Relationships: [
          {
            foreignKeyName: "election_audit_log_election_id_fkey"
            columns: ["election_id"]
            isOneToOne: false
            referencedRelation: "elections"
            referencedColumns: ["id"]
          },
        ]
      }
      election_ballots: {
        Row: {
          candidate_id: string | null
          created_at: string
          election_id: string
          id: string
          position_id: string
          vote_token: string
        }
        Insert: {
          candidate_id?: string | null
          created_at?: string
          election_id: string
          id?: string
          position_id: string
          vote_token: string
        }
        Update: {
          candidate_id?: string | null
          created_at?: string
          election_id?: string
          id?: string
          position_id?: string
          vote_token?: string
        }
        Relationships: [
          {
            foreignKeyName: "election_ballots_candidate_id_fkey"
            columns: ["candidate_id"]
            isOneToOne: false
            referencedRelation: "election_candidates"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "election_ballots_election_id_fkey"
            columns: ["election_id"]
            isOneToOne: false
            referencedRelation: "elections"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "election_ballots_position_id_fkey"
            columns: ["position_id"]
            isOneToOne: false
            referencedRelation: "election_positions"
            referencedColumns: ["id"]
          },
        ]
      }
      election_candidates: {
        Row: {
          bio: string | null
          candidate_name: string
          created_at: string
          id: string
          position_id: string
          sort_order: number
        }
        Insert: {
          bio?: string | null
          candidate_name: string
          created_at?: string
          id?: string
          position_id: string
          sort_order?: number
        }
        Update: {
          bio?: string | null
          candidate_name?: string
          created_at?: string
          id?: string
          position_id?: string
          sort_order?: number
        }
        Relationships: [
          {
            foreignKeyName: "election_candidates_position_id_fkey"
            columns: ["position_id"]
            isOneToOne: false
            referencedRelation: "election_positions"
            referencedColumns: ["id"]
          },
        ]
      }
      election_eligible_voters: {
        Row: {
          access_code: string | null
          consent_date: string | null
          created_at: string
          election_id: string
          has_consent: boolean
          has_voted: boolean
          id: string
          owner_id: string
          unit_id: string | null
          vote_token: string | null
          voted_at: string | null
        }
        Insert: {
          access_code?: string | null
          consent_date?: string | null
          created_at?: string
          election_id: string
          has_consent?: boolean
          has_voted?: boolean
          id?: string
          owner_id: string
          unit_id?: string | null
          vote_token?: string | null
          voted_at?: string | null
        }
        Update: {
          access_code?: string | null
          consent_date?: string | null
          created_at?: string
          election_id?: string
          has_consent?: boolean
          has_voted?: boolean
          id?: string
          owner_id?: string
          unit_id?: string | null
          vote_token?: string | null
          voted_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "election_eligible_voters_election_id_fkey"
            columns: ["election_id"]
            isOneToOne: false
            referencedRelation: "elections"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "election_eligible_voters_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "election_eligible_voters_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      election_positions: {
        Row: {
          created_at: string
          election_id: string
          id: string
          seats_available: number
          sort_order: number
          title: string
        }
        Insert: {
          created_at?: string
          election_id: string
          id?: string
          seats_available?: number
          sort_order?: number
          title: string
        }
        Update: {
          created_at?: string
          election_id?: string
          id?: string
          seats_available?: number
          sort_order?: number
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "election_positions_election_id_fkey"
            columns: ["election_id"]
            isOneToOne: false
            referencedRelation: "elections"
            referencedColumns: ["id"]
          },
        ]
      }
      elections: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          description: string | null
          election_type: string
          id: string
          in_person_count: number
          proxies_count: number
          quorum_required: number
          results_locked: boolean
          status: string
          title: string
          updated_at: string
          voting_end: string | null
          voting_start: string | null
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          election_type?: string
          id?: string
          in_person_count?: number
          proxies_count?: number
          quorum_required?: number
          results_locked?: boolean
          status?: string
          title: string
          updated_at?: string
          voting_end?: string | null
          voting_start?: string | null
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          election_type?: string
          id?: string
          in_person_count?: number
          proxies_count?: number
          quorum_required?: number
          results_locked?: boolean
          status?: string
          title?: string
          updated_at?: string
          voting_end?: string | null
          voting_start?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "elections_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      email_history: {
        Row: {
          body_text: string | null
          created_at: string
          email_headers: Json | null
          feature_type: string | null
          id: string
          proof_url: string | null
          recipient_email: string | null
          sender_email: string | null
          sent_at: string | null
          status: string | null
          subject: string | null
          user_id: string
        }
        Insert: {
          body_text?: string | null
          created_at?: string
          email_headers?: Json | null
          feature_type?: string | null
          id?: string
          proof_url?: string | null
          recipient_email?: string | null
          sender_email?: string | null
          sent_at?: string | null
          status?: string | null
          subject?: string | null
          user_id: string
        }
        Update: {
          body_text?: string | null
          created_at?: string
          email_headers?: Json | null
          feature_type?: string | null
          id?: string
          proof_url?: string | null
          recipient_email?: string | null
          sender_email?: string | null
          sent_at?: string | null
          status?: string | null
          subject?: string | null
          user_id?: string
        }
        Relationships: []
      }
      email_inbox_configs: {
        Row: {
          created_at: string
          display_name: string
          email_address: string
          id: string
          imap_host: string
          imap_password: string
          imap_port: number
          imap_username: string
          is_active: boolean
          updated_at: string
          use_tls: boolean
          user_id: string
        }
        Insert: {
          created_at?: string
          display_name: string
          email_address: string
          id?: string
          imap_host: string
          imap_password: string
          imap_port?: number
          imap_username: string
          is_active?: boolean
          updated_at?: string
          use_tls?: boolean
          user_id: string
        }
        Update: {
          created_at?: string
          display_name?: string
          email_address?: string
          id?: string
          imap_host?: string
          imap_password?: string
          imap_port?: number
          imap_username?: string
          is_active?: boolean
          updated_at?: string
          use_tls?: boolean
          user_id?: string
        }
        Relationships: []
      }
      email_routing_rules: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          email_address: string
          id: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          email_address: string
          id?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          email_address?: string
          id?: string
        }
        Relationships: [
          {
            foreignKeyName: "email_routing_rules_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      email_send_log: {
        Row: {
          created_at: string
          error_message: string | null
          id: string
          message_id: string | null
          metadata: Json | null
          recipient_email: string
          status: string
          template_name: string
        }
        Insert: {
          created_at?: string
          error_message?: string | null
          id?: string
          message_id?: string | null
          metadata?: Json | null
          recipient_email: string
          status: string
          template_name: string
        }
        Update: {
          created_at?: string
          error_message?: string | null
          id?: string
          message_id?: string | null
          metadata?: Json | null
          recipient_email?: string
          status?: string
          template_name?: string
        }
        Relationships: []
      }
      email_send_state: {
        Row: {
          auth_email_ttl_minutes: number
          batch_size: number
          id: number
          retry_after_until: string | null
          send_delay_ms: number
          transactional_email_ttl_minutes: number
          updated_at: string
        }
        Insert: {
          auth_email_ttl_minutes?: number
          batch_size?: number
          id?: number
          retry_after_until?: string | null
          send_delay_ms?: number
          transactional_email_ttl_minutes?: number
          updated_at?: string
        }
        Update: {
          auth_email_ttl_minutes?: number
          batch_size?: number
          id?: number
          retry_after_until?: string | null
          send_delay_ms?: number
          transactional_email_ttl_minutes?: number
          updated_at?: string
        }
        Relationships: []
      }
      email_senders: {
        Row: {
          created_at: string
          email_address: string
          id: string
          is_active: boolean | null
          is_default: boolean | null
          sender_name: string
          signature_html: string | null
          smtp_host: string | null
          smtp_password: string | null
          smtp_port: number | null
          smtp_username: string | null
          updated_at: string
          use_ssl: boolean | null
          use_tls: boolean | null
          user_id: string
          verified: boolean | null
        }
        Insert: {
          created_at?: string
          email_address: string
          id?: string
          is_active?: boolean | null
          is_default?: boolean | null
          sender_name: string
          signature_html?: string | null
          smtp_host?: string | null
          smtp_password?: string | null
          smtp_port?: number | null
          smtp_username?: string | null
          updated_at?: string
          use_ssl?: boolean | null
          use_tls?: boolean | null
          user_id: string
          verified?: boolean | null
        }
        Update: {
          created_at?: string
          email_address?: string
          id?: string
          is_active?: boolean | null
          is_default?: boolean | null
          sender_name?: string
          signature_html?: string | null
          smtp_host?: string | null
          smtp_password?: string | null
          smtp_port?: number | null
          smtp_username?: string | null
          updated_at?: string
          use_ssl?: boolean | null
          use_tls?: boolean | null
          user_id?: string
          verified?: boolean | null
        }
        Relationships: []
      }
      email_server_settings: {
        Row: {
          association_id: string
          created_at: string
          id: string
          imap_host: string | null
          imap_port: number | null
          is_configured: boolean | null
          pop3_host: string | null
          pop3_port: number | null
          smtp_host: string | null
          smtp_password: string | null
          smtp_port: number | null
          smtp_username: string | null
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          id?: string
          imap_host?: string | null
          imap_port?: number | null
          is_configured?: boolean | null
          pop3_host?: string | null
          pop3_port?: number | null
          smtp_host?: string | null
          smtp_password?: string | null
          smtp_port?: number | null
          smtp_username?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          id?: string
          imap_host?: string | null
          imap_port?: number | null
          is_configured?: boolean | null
          pop3_host?: string | null
          pop3_port?: number | null
          smtp_host?: string | null
          smtp_password?: string | null
          smtp_port?: number | null
          smtp_username?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "email_server_settings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: true
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      email_templates: {
        Row: {
          body_html: string | null
          created_at: string
          created_by: string | null
          description: string | null
          id: string
          name: string
          subject: string | null
          thumbnail_url: string | null
          updated_at: string
        }
        Insert: {
          body_html?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          name: string
          subject?: string | null
          thumbnail_url?: string | null
          updated_at?: string
        }
        Update: {
          body_html?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          name?: string
          subject?: string | null
          thumbnail_url?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      email_unsubscribe_tokens: {
        Row: {
          created_at: string
          email: string
          id: string
          token: string
          used_at: string | null
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
          token: string
          used_at?: string | null
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
          token?: string
          used_at?: string | null
        }
        Relationships: []
      }
      entity_comments: {
        Row: {
          comment: string
          created_at: string
          entity_id: string
          entity_type: string
          id: string
          updated_at: string
          user_id: string
        }
        Insert: {
          comment: string
          created_at?: string
          entity_id: string
          entity_type: string
          id?: string
          updated_at?: string
          user_id: string
        }
        Update: {
          comment?: string
          created_at?: string
          entity_id?: string
          entity_type?: string
          id?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: []
      }
      entity_votes: {
        Row: {
          created_at: string
          entity_id: string
          entity_type: string
          id: string
          recorded_by: string | null
          user_id: string | null
          vote: string
          voter_name: string | null
        }
        Insert: {
          created_at?: string
          entity_id: string
          entity_type: string
          id?: string
          recorded_by?: string | null
          user_id?: string | null
          vote: string
          voter_name?: string | null
        }
        Update: {
          created_at?: string
          entity_id?: string
          entity_type?: string
          id?: string
          recorded_by?: string | null
          user_id?: string | null
          vote?: string
          voter_name?: string | null
        }
        Relationships: []
      }
      estoppels: {
        Row: {
          address: string | null
          association_id: string
          completed_date: string | null
          created_at: string
          created_by: string | null
          fee: number | null
          id: string
          notes: string | null
          requested_date: string | null
          requestor_email: string | null
          requestor_name: string | null
          status: string
          unit_id: string | null
          updated_at: string
        }
        Insert: {
          address?: string | null
          association_id: string
          completed_date?: string | null
          created_at?: string
          created_by?: string | null
          fee?: number | null
          id?: string
          notes?: string | null
          requested_date?: string | null
          requestor_email?: string | null
          requestor_name?: string | null
          status?: string
          unit_id?: string | null
          updated_at?: string
        }
        Update: {
          address?: string | null
          association_id?: string
          completed_date?: string | null
          created_at?: string
          created_by?: string | null
          fee?: number | null
          id?: string
          notes?: string | null
          requested_date?: string | null
          requestor_email?: string | null
          requestor_name?: string | null
          status?: string
          unit_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "estoppels_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "estoppels_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      expense_bundles: {
        Row: {
          client_id: string
          created_at: string
          created_by: string | null
          description: string | null
          id: string
          name: string
          updated_at: string
        }
        Insert: {
          client_id: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          name: string
          updated_at?: string
        }
        Update: {
          client_id?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          id?: string
          name?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "expense_bundles_client_id_fkey"
            columns: ["client_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      expense_categories: {
        Row: {
          color: string | null
          created_at: string
          description: string | null
          id: string
          is_active: boolean
          name: string
          sort_order: number | null
          updated_at: string
        }
        Insert: {
          color?: string | null
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean
          name: string
          sort_order?: number | null
          updated_at?: string
        }
        Update: {
          color?: string | null
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean
          name?: string
          sort_order?: number | null
          updated_at?: string
        }
        Relationships: []
      }
      expense_subcategories: {
        Row: {
          category_id: string
          created_at: string
          description: string | null
          id: string
          is_active: boolean
          name: string
          sort_order: number | null
          updated_at: string
        }
        Insert: {
          category_id: string
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean
          name: string
          sort_order?: number | null
          updated_at?: string
        }
        Update: {
          category_id?: string
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean
          name?: string
          sort_order?: number | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "expense_subcategories_category_id_fkey"
            columns: ["category_id"]
            isOneToOne: false
            referencedRelation: "expense_categories"
            referencedColumns: ["id"]
          },
        ]
      }
      fee_schedule_subcategories: {
        Row: {
          created_at: string | null
          id: string
          is_custom: boolean | null
          name: string
        }
        Insert: {
          created_at?: string | null
          id?: string
          is_custom?: boolean | null
          name: string
        }
        Update: {
          created_at?: string | null
          id?: string
          is_custom?: boolean | null
          name?: string
        }
        Relationships: []
      }
      fee_schedules: {
        Row: {
          account: string | null
          category: string | null
          created_at: string | null
          description: string
          fee: number
          id: string
          subcategory: string | null
          updated_at: string | null
        }
        Insert: {
          account?: string | null
          category?: string | null
          created_at?: string | null
          description: string
          fee?: number
          id?: string
          subcategory?: string | null
          updated_at?: string | null
        }
        Update: {
          account?: string | null
          category?: string | null
          created_at?: string | null
          description?: string
          fee?: number
          id?: string
          subcategory?: string | null
          updated_at?: string | null
        }
        Relationships: []
      }
      form_inbox: {
        Row: {
          association_id: string | null
          created_at: string
          id: string
          reviewed_at: string | null
          reviewed_by: string | null
          source_id: string
          source_type: string
          status: string
          submitter_email: string | null
          submitter_name: string | null
          summary: string | null
          title: string
          updated_at: string
        }
        Insert: {
          association_id?: string | null
          created_at?: string
          id?: string
          reviewed_at?: string | null
          reviewed_by?: string | null
          source_id: string
          source_type: string
          status?: string
          submitter_email?: string | null
          submitter_name?: string | null
          summary?: string | null
          title: string
          updated_at?: string
        }
        Update: {
          association_id?: string | null
          created_at?: string
          id?: string
          reviewed_at?: string | null
          reviewed_by?: string | null
          source_id?: string
          source_type?: string
          status?: string
          submitter_email?: string | null
          submitter_name?: string | null
          summary?: string | null
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "form_inbox_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      forte_account_mappings: {
        Row: {
          api_access_id: string
          api_secure_key: string | null
          association_id: string | null
          created_at: string
          created_by: string | null
          environment: string
          id: string
          is_active: boolean
          label: string | null
          location_id: string
          organization_id: string
          pass_processing_fee: boolean
          processing_fee_fixed_cents: number
          processing_fee_percent: number
          updated_at: string
        }
        Insert: {
          api_access_id: string
          api_secure_key?: string | null
          association_id?: string | null
          created_at?: string
          created_by?: string | null
          environment?: string
          id?: string
          is_active?: boolean
          label?: string | null
          location_id: string
          organization_id: string
          pass_processing_fee?: boolean
          processing_fee_fixed_cents?: number
          processing_fee_percent?: number
          updated_at?: string
        }
        Update: {
          api_access_id?: string
          api_secure_key?: string | null
          association_id?: string | null
          created_at?: string
          created_by?: string | null
          environment?: string
          id?: string
          is_active?: boolean
          label?: string | null
          location_id?: string
          organization_id?: string
          pass_processing_fee?: boolean
          processing_fee_fixed_cents?: number
          processing_fee_percent?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "forte_account_mappings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      google_drive_tokens: {
        Row: {
          access_token: string
          created_at: string
          id: string
          refresh_token: string
          token_expires_at: string
          updated_at: string
          user_id: string
        }
        Insert: {
          access_token: string
          created_at?: string
          id?: string
          refresh_token: string
          token_expires_at: string
          updated_at?: string
          user_id: string
        }
        Update: {
          access_token?: string
          created_at?: string
          id?: string
          refresh_token?: string
          token_expires_at?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: []
      }
      homeowner_requests: {
        Row: {
          assigned_to: string | null
          association_id: string
          category: string | null
          created_at: string
          description: string | null
          id: string
          owner_id: string | null
          priority: string | null
          status: string
          title: string
          updated_at: string
        }
        Insert: {
          assigned_to?: string | null
          association_id: string
          category?: string | null
          created_at?: string
          description?: string | null
          id?: string
          owner_id?: string | null
          priority?: string | null
          status?: string
          title: string
          updated_at?: string
        }
        Update: {
          assigned_to?: string | null
          association_id?: string
          category?: string | null
          created_at?: string
          description?: string | null
          id?: string
          owner_id?: string | null
          priority?: string | null
          status?: string
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "homeowner_requests_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "homeowner_requests_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
        ]
      }
      in_app_notifications: {
        Row: {
          created_at: string
          id: string
          is_read: boolean
          link: string | null
          message: string | null
          related_item_id: string | null
          related_item_type: string | null
          title: string
          type: string
          user_id: string
        }
        Insert: {
          created_at?: string
          id?: string
          is_read?: boolean
          link?: string | null
          message?: string | null
          related_item_id?: string | null
          related_item_type?: string | null
          title: string
          type?: string
          user_id: string
        }
        Update: {
          created_at?: string
          id?: string
          is_read?: boolean
          link?: string | null
          message?: string | null
          related_item_id?: string | null
          related_item_type?: string | null
          title?: string
          type?: string
          user_id?: string
        }
        Relationships: []
      }
      inbound_bill_emails: {
        Row: {
          association_id: string | null
          attachment_filename: string | null
          attachment_storage_path: string | null
          attachment_url: string | null
          bill_id: string | null
          body_text: string | null
          created_at: string
          error_message: string | null
          from_email: string | null
          from_name: string | null
          id: string
          parsed_data: Json | null
          processed_at: string | null
          processed_by: string | null
          raw_payload: Json | null
          status: string
          subject: string | null
          to_email: string | null
          updated_at: string
        }
        Insert: {
          association_id?: string | null
          attachment_filename?: string | null
          attachment_storage_path?: string | null
          attachment_url?: string | null
          bill_id?: string | null
          body_text?: string | null
          created_at?: string
          error_message?: string | null
          from_email?: string | null
          from_name?: string | null
          id?: string
          parsed_data?: Json | null
          processed_at?: string | null
          processed_by?: string | null
          raw_payload?: Json | null
          status?: string
          subject?: string | null
          to_email?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string | null
          attachment_filename?: string | null
          attachment_storage_path?: string | null
          attachment_url?: string | null
          bill_id?: string | null
          body_text?: string | null
          created_at?: string
          error_message?: string | null
          from_email?: string | null
          from_name?: string | null
          id?: string
          parsed_data?: Json | null
          processed_at?: string | null
          processed_by?: string | null
          raw_payload?: Json | null
          status?: string
          subject?: string | null
          to_email?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "inbound_bill_emails_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "inbound_bill_emails_bill_id_fkey"
            columns: ["bill_id"]
            isOneToOne: false
            referencedRelation: "bills"
            referencedColumns: ["id"]
          },
        ]
      }
      inspections: {
        Row: {
          association_id: string
          completed_date: string | null
          created_at: string
          created_by: string | null
          id: string
          inspection_type: string | null
          inspector: string | null
          notes: string | null
          scheduled_date: string | null
          status: string
          title: string
          unit_id: string | null
          updated_at: string
        }
        Insert: {
          association_id: string
          completed_date?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          inspection_type?: string | null
          inspector?: string | null
          notes?: string | null
          scheduled_date?: string | null
          status?: string
          title: string
          unit_id?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string
          completed_date?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          inspection_type?: string | null
          inspector?: string | null
          notes?: string | null
          scheduled_date?: string | null
          status?: string
          title?: string
          unit_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "inspections_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "inspections_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      invoices: {
        Row: {
          amount: number
          association_id: string
          category: string | null
          created_at: string
          created_by: string | null
          description: string | null
          due_date: string | null
          id: string
          invoice_number: string | null
          issue_date: string | null
          line_items: Json
          next_generation_date: string | null
          paid_date: string | null
          parent_invoice_id: string | null
          rate: number
          raw_pdf_url: string | null
          recurrence_end_date: string | null
          recurrence_frequency: string | null
          status: string
          updated_at: string
          vendor_name: string
        }
        Insert: {
          amount?: number
          association_id: string
          category?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          invoice_number?: string | null
          issue_date?: string | null
          line_items?: Json
          next_generation_date?: string | null
          paid_date?: string | null
          parent_invoice_id?: string | null
          rate?: number
          raw_pdf_url?: string | null
          recurrence_end_date?: string | null
          recurrence_frequency?: string | null
          status?: string
          updated_at?: string
          vendor_name: string
        }
        Update: {
          amount?: number
          association_id?: string
          category?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          invoice_number?: string | null
          issue_date?: string | null
          line_items?: Json
          next_generation_date?: string | null
          paid_date?: string | null
          parent_invoice_id?: string | null
          rate?: number
          raw_pdf_url?: string | null
          recurrence_end_date?: string | null
          recurrence_frequency?: string | null
          status?: string
          updated_at?: string
          vendor_name?: string
        }
        Relationships: [
          {
            foreignKeyName: "invoices_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "invoices_parent_invoice_id_fkey"
            columns: ["parent_invoice_id"]
            isOneToOne: false
            referencedRelation: "invoices"
            referencedColumns: ["id"]
          },
        ]
      }
      journal_entries: {
        Row: {
          amount: number
          association_id: string
          chart_of_account_id: string | null
          created_at: string
          created_by: string | null
          date: string
          description: string | null
          id: string
          type: string
          updated_at: string
        }
        Insert: {
          amount?: number
          association_id: string
          chart_of_account_id?: string | null
          created_at?: string
          created_by?: string | null
          date?: string
          description?: string | null
          id?: string
          type?: string
          updated_at?: string
        }
        Update: {
          amount?: number
          association_id?: string
          chart_of_account_id?: string | null
          created_at?: string
          created_by?: string | null
          date?: string
          description?: string | null
          id?: string
          type?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "journal_entries_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "journal_entries_chart_of_account_id_fkey"
            columns: ["chart_of_account_id"]
            isOneToOne: false
            referencedRelation: "chart_of_accounts"
            referencedColumns: ["id"]
          },
        ]
      }
      legal_association_assignments: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          id: string
          user_id: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          id?: string
          user_id: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "legal_association_assignments_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      legal_matters: {
        Row: {
          amount_due: number | null
          association_id: string
          attorney: string | null
          case_number: string | null
          case_type: string | null
          category: string | null
          closed_date: string | null
          collection_id: string | null
          created_at: string
          created_by: string | null
          current_stage: string | null
          description: string | null
          has_payment_plan: boolean
          id: string
          is_bankruptcy: boolean
          judge: string | null
          official_case_name: string | null
          opened_date: string | null
          opposing_counsel: string | null
          status: string
          title: string
          unit_id: string | null
          updated_at: string
        }
        Insert: {
          amount_due?: number | null
          association_id: string
          attorney?: string | null
          case_number?: string | null
          case_type?: string | null
          category?: string | null
          closed_date?: string | null
          collection_id?: string | null
          created_at?: string
          created_by?: string | null
          current_stage?: string | null
          description?: string | null
          has_payment_plan?: boolean
          id?: string
          is_bankruptcy?: boolean
          judge?: string | null
          official_case_name?: string | null
          opened_date?: string | null
          opposing_counsel?: string | null
          status?: string
          title: string
          unit_id?: string | null
          updated_at?: string
        }
        Update: {
          amount_due?: number | null
          association_id?: string
          attorney?: string | null
          case_number?: string | null
          case_type?: string | null
          category?: string | null
          closed_date?: string | null
          collection_id?: string | null
          created_at?: string
          created_by?: string | null
          current_stage?: string | null
          description?: string | null
          has_payment_plan?: boolean
          id?: string
          is_bankruptcy?: boolean
          judge?: string | null
          official_case_name?: string | null
          opened_date?: string | null
          opposing_counsel?: string | null
          status?: string
          title?: string
          unit_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "legal_matters_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "legal_matters_collection_id_fkey"
            columns: ["collection_id"]
            isOneToOne: false
            referencedRelation: "collections"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "legal_matters_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      mailchimp_configs: {
        Row: {
          api_key: string
          association_id: string
          audience_id: string | null
          audience_name: string | null
          created_at: string
          created_by: string | null
          id: string
          last_sync_at: string | null
          last_sync_count: number | null
          last_sync_error: string | null
          last_sync_status: string | null
          server_prefix: string
          updated_at: string
        }
        Insert: {
          api_key: string
          association_id: string
          audience_id?: string | null
          audience_name?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          last_sync_at?: string | null
          last_sync_count?: number | null
          last_sync_error?: string | null
          last_sync_status?: string | null
          server_prefix: string
          updated_at?: string
        }
        Update: {
          api_key?: string
          association_id?: string
          audience_id?: string | null
          audience_name?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          last_sync_at?: string | null
          last_sync_count?: number | null
          last_sync_error?: string | null
          last_sync_status?: string | null
          server_prefix?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "mailchimp_configs_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: true
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      master_board_assignments: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          id: string
          user_id: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          id?: string
          user_id: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "master_board_assignments_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      migration_field_mappings: {
        Row: {
          created_at: string
          created_by: string | null
          description: string | null
          destination_field: string | null
          destination_table: string | null
          destination_value: string | null
          id: string
          is_active: boolean
          mapping_type: string
          source_field: string | null
          source_table: string | null
          source_value: string | null
          updated_at: string
        }
        Insert: {
          created_at?: string
          created_by?: string | null
          description?: string | null
          destination_field?: string | null
          destination_table?: string | null
          destination_value?: string | null
          id?: string
          is_active?: boolean
          mapping_type: string
          source_field?: string | null
          source_table?: string | null
          source_value?: string | null
          updated_at?: string
        }
        Update: {
          created_at?: string
          created_by?: string | null
          description?: string | null
          destination_field?: string | null
          destination_table?: string | null
          destination_value?: string | null
          id?: string
          is_active?: boolean
          mapping_type?: string
          source_field?: string | null
          source_table?: string | null
          source_value?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      notify_board_templates: {
        Row: {
          attachments: Json | null
          body: string | null
          created_at: string
          created_by: string | null
          id: string
          name: string
          subject: string | null
          updated_at: string
        }
        Insert: {
          attachments?: Json | null
          body?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          name: string
          subject?: string | null
          updated_at?: string
        }
        Update: {
          attachments?: Json | null
          body?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          name?: string
          subject?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      owner_ledger_entries: {
        Row: {
          association_id: string
          bill_to_association: boolean
          created_at: string
          created_by: string | null
          credit: number
          date: string
          debit: number
          description: string | null
          gl_account_id: string | null
          id: string
          is_archived: boolean
          owner_id: string
          reference_id: string | null
          reference_type: string | null
          transaction_type: string
          unit_id: string | null
          updated_at: string
          zoho_invoice_id: string | null
        }
        Insert: {
          association_id: string
          bill_to_association?: boolean
          created_at?: string
          created_by?: string | null
          credit?: number
          date?: string
          debit?: number
          description?: string | null
          gl_account_id?: string | null
          id?: string
          is_archived?: boolean
          owner_id: string
          reference_id?: string | null
          reference_type?: string | null
          transaction_type: string
          unit_id?: string | null
          updated_at?: string
          zoho_invoice_id?: string | null
        }
        Update: {
          association_id?: string
          bill_to_association?: boolean
          created_at?: string
          created_by?: string | null
          credit?: number
          date?: string
          debit?: number
          description?: string | null
          gl_account_id?: string | null
          id?: string
          is_archived?: boolean
          owner_id?: string
          reference_id?: string | null
          reference_type?: string | null
          transaction_type?: string
          unit_id?: string | null
          updated_at?: string
          zoho_invoice_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "owner_ledger_entries_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "owner_ledger_entries_gl_account_id_fkey"
            columns: ["gl_account_id"]
            isOneToOne: false
            referencedRelation: "chart_of_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "owner_ledger_entries_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "owner_ledger_entries_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      owner_notification_proofs: {
        Row: {
          association_id: string | null
          attachments: Json | null
          body: string | null
          client_id: string | null
          created_at: string
          created_by: string | null
          delivery_status: string | null
          id: string
          owners_notified: Json | null
          proof_url: string | null
          subject: string | null
          validation_id: string | null
        }
        Insert: {
          association_id?: string | null
          attachments?: Json | null
          body?: string | null
          client_id?: string | null
          created_at?: string
          created_by?: string | null
          delivery_status?: string | null
          id?: string
          owners_notified?: Json | null
          proof_url?: string | null
          subject?: string | null
          validation_id?: string | null
        }
        Update: {
          association_id?: string | null
          attachments?: Json | null
          body?: string | null
          client_id?: string | null
          created_at?: string
          created_by?: string | null
          delivery_status?: string | null
          id?: string
          owners_notified?: Json | null
          proof_url?: string | null
          subject?: string | null
          validation_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "owner_notification_proofs_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      owner_notification_templates: {
        Row: {
          body: string | null
          created_at: string
          created_by: string | null
          id: string
          name: string
          subject: string | null
          updated_at: string
        }
        Insert: {
          body?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          name: string
          subject?: string | null
          updated_at?: string
        }
        Update: {
          body?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          name?: string
          subject?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      owner_registration_requests: {
        Row: {
          account_number: string | null
          association_id: string | null
          created_at: string
          created_user_id: string | null
          email: string
          id: string
          last_name: string
          notes: string | null
          owner_id: string | null
          reviewed_at: string | null
          reviewed_by: string | null
          status: string
          unit_id: string | null
          unit_identifier: string | null
          updated_at: string
        }
        Insert: {
          account_number?: string | null
          association_id?: string | null
          created_at?: string
          created_user_id?: string | null
          email: string
          id?: string
          last_name: string
          notes?: string | null
          owner_id?: string | null
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string
          unit_id?: string | null
          unit_identifier?: string | null
          updated_at?: string
        }
        Update: {
          account_number?: string | null
          association_id?: string | null
          created_at?: string
          created_user_id?: string | null
          email?: string
          id?: string
          last_name?: string
          notes?: string | null
          owner_id?: string | null
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string
          unit_id?: string | null
          unit_identifier?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "owner_registration_requests_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "owner_registration_requests_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "owner_registration_requests_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      owner_update_tags: {
        Row: {
          association_id: string
          color: string
          created_at: string | null
          id: string
          name: string
        }
        Insert: {
          association_id: string
          color?: string
          created_at?: string | null
          id?: string
          name: string
        }
        Update: {
          association_id?: string
          color?: string
          created_at?: string | null
          id?: string
          name?: string
        }
        Relationships: [
          {
            foreignKeyName: "owner_update_tags_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      owner_updates: {
        Row: {
          association_id: string
          attachments: Json | null
          collection_ids: Json | null
          content: string | null
          created_at: string
          created_by: string | null
          id: string
          posted_at: string | null
          tags: Json | null
          title: string
          unit_id: string | null
          updated_at: string
          violation_ids: Json | null
          visibility: string | null
        }
        Insert: {
          association_id: string
          attachments?: Json | null
          collection_ids?: Json | null
          content?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          posted_at?: string | null
          tags?: Json | null
          title: string
          unit_id?: string | null
          updated_at?: string
          violation_ids?: Json | null
          visibility?: string | null
        }
        Update: {
          association_id?: string
          attachments?: Json | null
          collection_ids?: Json | null
          content?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          posted_at?: string | null
          tags?: Json | null
          title?: string
          unit_id?: string | null
          updated_at?: string
          violation_ids?: Json | null
          visibility?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "owner_updates_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "owner_updates_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      owners: {
        Row: {
          account_number: string | null
          alternate_address_1: string | null
          alternate_address_2: string | null
          association_id: string
          balance: number | null
          buildium_owner_id: string | null
          business_name: string | null
          created_at: string
          delinquency_stage: string | null
          designations: string[]
          display_order: number | null
          electronic_consent: boolean | null
          email: string | null
          exclude_from_signin: boolean | null
          first_name: string
          id: string
          interest_opt_in: boolean | null
          is_designated_voter: boolean
          is_primary: boolean | null
          is_tenant: boolean | null
          last_name: string
          mailing_address: string | null
          management_company: string | null
          management_contact_email: string | null
          management_contact_name: string | null
          management_contact_phone: string | null
          management_contact_title: string | null
          move_in_date: string | null
          move_out_date: string | null
          owner_type: string
          phone: string | null
          property_address: string | null
          show_proxy_text: boolean | null
          status: string
          street_address: string | null
          unit_id: string | null
          updated_at: string
          user_id: string | null
          zoho_contact_id: string | null
        }
        Insert: {
          account_number?: string | null
          alternate_address_1?: string | null
          alternate_address_2?: string | null
          association_id: string
          balance?: number | null
          buildium_owner_id?: string | null
          business_name?: string | null
          created_at?: string
          delinquency_stage?: string | null
          designations?: string[]
          display_order?: number | null
          electronic_consent?: boolean | null
          email?: string | null
          exclude_from_signin?: boolean | null
          first_name: string
          id?: string
          interest_opt_in?: boolean | null
          is_designated_voter?: boolean
          is_primary?: boolean | null
          is_tenant?: boolean | null
          last_name: string
          mailing_address?: string | null
          management_company?: string | null
          management_contact_email?: string | null
          management_contact_name?: string | null
          management_contact_phone?: string | null
          management_contact_title?: string | null
          move_in_date?: string | null
          move_out_date?: string | null
          owner_type?: string
          phone?: string | null
          property_address?: string | null
          show_proxy_text?: boolean | null
          status?: string
          street_address?: string | null
          unit_id?: string | null
          updated_at?: string
          user_id?: string | null
          zoho_contact_id?: string | null
        }
        Update: {
          account_number?: string | null
          alternate_address_1?: string | null
          alternate_address_2?: string | null
          association_id?: string
          balance?: number | null
          buildium_owner_id?: string | null
          business_name?: string | null
          created_at?: string
          delinquency_stage?: string | null
          designations?: string[]
          display_order?: number | null
          electronic_consent?: boolean | null
          email?: string | null
          exclude_from_signin?: boolean | null
          first_name?: string
          id?: string
          interest_opt_in?: boolean | null
          is_designated_voter?: boolean
          is_primary?: boolean | null
          is_tenant?: boolean | null
          last_name?: string
          mailing_address?: string | null
          management_company?: string | null
          management_contact_email?: string | null
          management_contact_name?: string | null
          management_contact_phone?: string | null
          management_contact_title?: string | null
          move_in_date?: string | null
          move_out_date?: string | null
          owner_type?: string
          phone?: string | null
          property_address?: string | null
          show_proxy_text?: boolean | null
          status?: string
          street_address?: string | null
          unit_id?: string | null
          updated_at?: string
          user_id?: string | null
          zoho_contact_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "owners_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "owners_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      parking_records: {
        Row: {
          address: string | null
          association_id: string
          citation: string | null
          created_at: string
          description: string | null
          id: string
          photo_url: string | null
          recorded_at: string
          recorded_by: string | null
          status: string
          title: string
          updated_at: string
          vehicle_make: string | null
          vehicle_model: string | null
          vehicle_plate: string | null
          warning_level: string
        }
        Insert: {
          address?: string | null
          association_id: string
          citation?: string | null
          created_at?: string
          description?: string | null
          id?: string
          photo_url?: string | null
          recorded_at?: string
          recorded_by?: string | null
          status?: string
          title?: string
          updated_at?: string
          vehicle_make?: string | null
          vehicle_model?: string | null
          vehicle_plate?: string | null
          warning_level?: string
        }
        Update: {
          address?: string | null
          association_id?: string
          citation?: string | null
          created_at?: string
          description?: string | null
          id?: string
          photo_url?: string | null
          recorded_at?: string
          recorded_by?: string | null
          status?: string
          title?: string
          updated_at?: string
          vehicle_make?: string | null
          vehicle_model?: string | null
          vehicle_plate?: string | null
          warning_level?: string
        }
        Relationships: [
          {
            foreignKeyName: "parking_records_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      payables: {
        Row: {
          amount: number
          association_id: string
          completed_at: string | null
          created_at: string
          created_by: string | null
          description: string | null
          due_date: string | null
          id: string
          invoice_id: string | null
          status: string
          target_month: string | null
          updated_at: string
          vendor_name: string
        }
        Insert: {
          amount?: number
          association_id: string
          completed_at?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          invoice_id?: string | null
          status?: string
          target_month?: string | null
          updated_at?: string
          vendor_name: string
        }
        Update: {
          amount?: number
          association_id?: string
          completed_at?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          invoice_id?: string | null
          status?: string
          target_month?: string | null
          updated_at?: string
          vendor_name?: string
        }
        Relationships: [
          {
            foreignKeyName: "payables_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "payables_invoice_id_fkey"
            columns: ["invoice_id"]
            isOneToOne: false
            referencedRelation: "invoices"
            referencedColumns: ["id"]
          },
        ]
      }
      payment_plan_installments: {
        Row: {
          amount_due: number
          amount_paid: number
          created_at: string
          due_date: string
          id: string
          installment_number: number
          notes: string | null
          paid_date: string | null
          payment_plan_id: string
          status: string
          updated_at: string
        }
        Insert: {
          amount_due?: number
          amount_paid?: number
          created_at?: string
          due_date: string
          id?: string
          installment_number: number
          notes?: string | null
          paid_date?: string | null
          payment_plan_id: string
          status?: string
          updated_at?: string
        }
        Update: {
          amount_due?: number
          amount_paid?: number
          created_at?: string
          due_date?: string
          id?: string
          installment_number?: number
          notes?: string | null
          paid_date?: string | null
          payment_plan_id?: string
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "payment_plan_installments_payment_plan_id_fkey"
            columns: ["payment_plan_id"]
            isOneToOne: false
            referencedRelation: "payment_plans"
            referencedColumns: ["id"]
          },
        ]
      }
      payment_plans: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          end_date: string | null
          id: string
          monthly_payment: number
          notes: string | null
          owner_id: string | null
          start_date: string | null
          status: string
          total_amount: number
          unit_id: string | null
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          end_date?: string | null
          id?: string
          monthly_payment?: number
          notes?: string | null
          owner_id?: string | null
          start_date?: string | null
          status?: string
          total_amount?: number
          unit_id?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          end_date?: string | null
          id?: string
          monthly_payment?: number
          notes?: string | null
          owner_id?: string | null
          start_date?: string | null
          status?: string
          total_amount?: number
          unit_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "payment_plans_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "payment_plans_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "payment_plans_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      pdf_form_templates: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          description: string | null
          fields: Json
          id: string
          name: string
          page_settings: Json
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          fields?: Json
          id?: string
          name: string
          page_settings?: Json
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          fields?: Json
          id?: string
          name?: string
          page_settings?: Json
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "pdf_form_templates_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      portal_function_visibility: {
        Row: {
          association_id: string | null
          created_at: string
          created_by: string | null
          enabled: boolean
          function_key: string
          id: string
          owner_user_id: string | null
          portal: string
          updated_at: string
        }
        Insert: {
          association_id?: string | null
          created_at?: string
          created_by?: string | null
          enabled?: boolean
          function_key: string
          id?: string
          owner_user_id?: string | null
          portal: string
          updated_at?: string
        }
        Update: {
          association_id?: string | null
          created_at?: string
          created_by?: string | null
          enabled?: boolean
          function_key?: string
          id?: string
          owner_user_id?: string | null
          portal?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "portal_function_visibility_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      profiles: {
        Row: {
          avatar_url: string | null
          bio: string | null
          created_at: string
          email: string | null
          emergency_contact_name: string | null
          emergency_contact_phone: string | null
          full_name: string | null
          id: string
          is_blocked: boolean
          mailing_city: string | null
          mailing_state: string | null
          mailing_street: string | null
          mailing_zip: string | null
          notification_preferences: Json
          phone: string | null
          preferred_language: string | null
          preferred_notification_email: string | null
          primary_association_id: string | null
          primary_owner_id: string | null
          updated_at: string
          user_id: string
          username: string | null
        }
        Insert: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string
          email?: string | null
          emergency_contact_name?: string | null
          emergency_contact_phone?: string | null
          full_name?: string | null
          id?: string
          is_blocked?: boolean
          mailing_city?: string | null
          mailing_state?: string | null
          mailing_street?: string | null
          mailing_zip?: string | null
          notification_preferences?: Json
          phone?: string | null
          preferred_language?: string | null
          preferred_notification_email?: string | null
          primary_association_id?: string | null
          primary_owner_id?: string | null
          updated_at?: string
          user_id: string
          username?: string | null
        }
        Update: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string
          email?: string | null
          emergency_contact_name?: string | null
          emergency_contact_phone?: string | null
          full_name?: string | null
          id?: string
          is_blocked?: boolean
          mailing_city?: string | null
          mailing_state?: string | null
          mailing_street?: string | null
          mailing_zip?: string | null
          notification_preferences?: Json
          phone?: string | null
          preferred_language?: string | null
          preferred_notification_email?: string | null
          primary_association_id?: string | null
          primary_owner_id?: string | null
          updated_at?: string
          user_id?: string
          username?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "profiles_primary_association_id_fkey"
            columns: ["primary_association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "profiles_primary_owner_id_fkey"
            columns: ["primary_owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
        ]
      }
      project_comments: {
        Row: {
          content: string
          created_at: string
          id: string
          project_id: string
          updated_at: string
          user_id: string
        }
        Insert: {
          content: string
          created_at?: string
          id?: string
          project_id: string
          updated_at?: string
          user_id: string
        }
        Update: {
          content?: string
          created_at?: string
          id?: string
          project_id?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "project_comments_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
        ]
      }
      project_files: {
        Row: {
          created_at: string
          file_name: string
          file_size: number | null
          file_url: string
          id: string
          mime_type: string | null
          project_id: string
          user_id: string
        }
        Insert: {
          created_at?: string
          file_name: string
          file_size?: number | null
          file_url: string
          id?: string
          mime_type?: string | null
          project_id: string
          user_id: string
        }
        Update: {
          created_at?: string
          file_name?: string
          file_size?: number | null
          file_url?: string
          id?: string
          mime_type?: string | null
          project_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "project_files_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
        ]
      }
      projects: {
        Row: {
          assigned_to: string | null
          association_id: string
          budget: number | null
          created_at: string
          created_by: string | null
          description: string | null
          due_date: string | null
          id: string
          priority: string | null
          start_date: string | null
          status: string
          title: string
          updated_at: string
        }
        Insert: {
          assigned_to?: string | null
          association_id: string
          budget?: number | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          priority?: string | null
          start_date?: string | null
          status?: string
          title: string
          updated_at?: string
        }
        Update: {
          assigned_to?: string | null
          association_id?: string
          budget?: number | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          priority?: string | null
          start_date?: string | null
          status?: string
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "projects_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      public_form_submission_reports: {
        Row: {
          association_id: string
          created_at: string
          generated_at: string
          id: string
          report_data: Json | null
          status: string
          submission_id: string
          template_id: string
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          generated_at?: string
          id?: string
          report_data?: Json | null
          status?: string
          submission_id: string
          template_id: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          generated_at?: string
          id?: string
          report_data?: Json | null
          status?: string
          submission_id?: string
          template_id?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "public_form_submission_reports_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "public_form_submission_reports_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "public_form_submissions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "public_form_submission_reports_template_id_fkey"
            columns: ["template_id"]
            isOneToOne: false
            referencedRelation: "public_form_templates"
            referencedColumns: ["id"]
          },
        ]
      }
      public_form_submissions: {
        Row: {
          association_id: string
          attachments: Json | null
          created_at: string | null
          form_data: Json
          id: string
          status: string | null
          submitter_email: string | null
          submitter_name: string | null
          template_id: string
          updated_at: string | null
        }
        Insert: {
          association_id: string
          attachments?: Json | null
          created_at?: string | null
          form_data?: Json
          id?: string
          status?: string | null
          submitter_email?: string | null
          submitter_name?: string | null
          template_id: string
          updated_at?: string | null
        }
        Update: {
          association_id?: string
          attachments?: Json | null
          created_at?: string | null
          form_data?: Json
          id?: string
          status?: string | null
          submitter_email?: string | null
          submitter_name?: string | null
          template_id?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "public_form_submissions_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "public_form_submissions_template_id_fkey"
            columns: ["template_id"]
            isOneToOne: false
            referencedRelation: "public_form_templates"
            referencedColumns: ["id"]
          },
        ]
      }
      public_form_templates: {
        Row: {
          allow_attachments: boolean | null
          association_id: string
          body_blocks: Json
          created_at: string | null
          created_by: string | null
          description: string | null
          fields: Json
          id: string
          is_published: boolean | null
          report_styling: Json | null
          require_auth: boolean | null
          settings: Json | null
          sidebar_blocks: Json
          sidebar_enabled: boolean
          sidebar_title: string | null
          slug: string | null
          title: string
          updated_at: string | null
        }
        Insert: {
          allow_attachments?: boolean | null
          association_id: string
          body_blocks?: Json
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          fields?: Json
          id?: string
          is_published?: boolean | null
          report_styling?: Json | null
          require_auth?: boolean | null
          settings?: Json | null
          sidebar_blocks?: Json
          sidebar_enabled?: boolean
          sidebar_title?: string | null
          slug?: string | null
          title: string
          updated_at?: string | null
        }
        Update: {
          allow_attachments?: boolean | null
          association_id?: string
          body_blocks?: Json
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          fields?: Json
          id?: string
          is_published?: boolean | null
          report_styling?: Json | null
          require_auth?: boolean | null
          settings?: Json | null
          sidebar_blocks?: Json
          sidebar_enabled?: boolean
          sidebar_title?: string | null
          slug?: string | null
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "public_form_templates_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      qbo_sync_log: {
        Row: {
          created_at: string
          direction: string
          entity_id: string | null
          entity_type: string
          error_message: string | null
          id: string
          payload: Json | null
          qbo_id: string | null
          status: string
          sync_type: string
        }
        Insert: {
          created_at?: string
          direction?: string
          entity_id?: string | null
          entity_type: string
          error_message?: string | null
          id?: string
          payload?: Json | null
          qbo_id?: string | null
          status?: string
          sync_type: string
        }
        Update: {
          created_at?: string
          direction?: string
          entity_id?: string | null
          entity_type?: string
          error_message?: string | null
          id?: string
          payload?: Json | null
          qbo_id?: string | null
          status?: string
          sync_type?: string
        }
        Relationships: []
      }
      reminders: {
        Row: {
          assigned_to: string | null
          created_at: string
          created_by: string
          description: string | null
          due_date: string
          id: string
          last_notified_at: string | null
          status: string
          title: string
          updated_at: string
        }
        Insert: {
          assigned_to?: string | null
          created_at?: string
          created_by: string
          description?: string | null
          due_date: string
          id?: string
          last_notified_at?: string | null
          status?: string
          title: string
          updated_at?: string
        }
        Update: {
          assigned_to?: string | null
          created_at?: string
          created_by?: string
          description?: string | null
          due_date?: string
          id?: string
          last_notified_at?: string | null
          status?: string
          title?: string
          updated_at?: string
        }
        Relationships: []
      }
      role_permissions: {
        Row: {
          can_create: boolean
          can_delete: boolean
          can_edit: boolean
          can_read: boolean
          created_at: string
          feature_area: string
          id: string
          role: string
          updated_at: string
        }
        Insert: {
          can_create?: boolean
          can_delete?: boolean
          can_edit?: boolean
          can_read?: boolean
          created_at?: string
          feature_area: string
          id?: string
          role: string
          updated_at?: string
        }
        Update: {
          can_create?: boolean
          can_delete?: boolean
          can_edit?: boolean
          can_read?: boolean
          created_at?: string
          feature_area?: string
          id?: string
          role?: string
          updated_at?: string
        }
        Relationships: []
      }
      rv_boat_lot_rentals: {
        Row: {
          association_id: string
          created_at: string
          end_date: string | null
          id: string
          is_owner: boolean
          lot_id: string
          monthly_rate: number | null
          notes: string | null
          owner_id: string | null
          renter_email: string | null
          renter_name: string
          renter_phone: string | null
          start_date: string
          status: string
          unit_id: string | null
          updated_at: string
          user_id: string | null
          vehicle_description: string | null
        }
        Insert: {
          association_id: string
          created_at?: string
          end_date?: string | null
          id?: string
          is_owner?: boolean
          lot_id: string
          monthly_rate?: number | null
          notes?: string | null
          owner_id?: string | null
          renter_email?: string | null
          renter_name: string
          renter_phone?: string | null
          start_date?: string
          status?: string
          unit_id?: string | null
          updated_at?: string
          user_id?: string | null
          vehicle_description?: string | null
        }
        Update: {
          association_id?: string
          created_at?: string
          end_date?: string | null
          id?: string
          is_owner?: boolean
          lot_id?: string
          monthly_rate?: number | null
          notes?: string | null
          owner_id?: string | null
          renter_email?: string | null
          renter_name?: string
          renter_phone?: string | null
          start_date?: string
          status?: string
          unit_id?: string | null
          updated_at?: string
          user_id?: string | null
          vehicle_description?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "rv_boat_lot_rentals_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rv_boat_lot_rentals_lot_id_fkey"
            columns: ["lot_id"]
            isOneToOne: false
            referencedRelation: "rv_boat_lots"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rv_boat_lot_rentals_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rv_boat_lot_rentals_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      rv_boat_lot_waitlist: {
        Row: {
          association_id: string
          created_at: string
          fulfilled_at: string | null
          fulfilled_by: string | null
          fulfilled_lot_number: string | null
          id: string
          joined_at: string
          notes: string | null
          owner_id: string | null
          position: number
          requested_lot_type: string | null
          requester_email: string | null
          requester_name: string
          requester_phone: string | null
          source: string
          status: string
          unit_address: string | null
          unit_id: string | null
          updated_at: string
          vehicle_description: string | null
        }
        Insert: {
          association_id: string
          created_at?: string
          fulfilled_at?: string | null
          fulfilled_by?: string | null
          fulfilled_lot_number?: string | null
          id?: string
          joined_at?: string
          notes?: string | null
          owner_id?: string | null
          position: number
          requested_lot_type?: string | null
          requester_email?: string | null
          requester_name: string
          requester_phone?: string | null
          source?: string
          status?: string
          unit_address?: string | null
          unit_id?: string | null
          updated_at?: string
          vehicle_description?: string | null
        }
        Update: {
          association_id?: string
          created_at?: string
          fulfilled_at?: string | null
          fulfilled_by?: string | null
          fulfilled_lot_number?: string | null
          id?: string
          joined_at?: string
          notes?: string | null
          owner_id?: string | null
          position?: number
          requested_lot_type?: string | null
          requester_email?: string | null
          requester_name?: string
          requester_phone?: string | null
          source?: string
          status?: string
          unit_address?: string | null
          unit_id?: string | null
          updated_at?: string
          vehicle_description?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "rv_boat_lot_waitlist_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rv_boat_lot_waitlist_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rv_boat_lot_waitlist_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      rv_boat_lots: {
        Row: {
          association_id: string
          created_at: string
          id: string
          lot_number: string
          lot_type: string
          monthly_rate: number | null
          notes: string | null
          size: string | null
          status: string
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          id?: string
          lot_number: string
          lot_type?: string
          monthly_rate?: number | null
          notes?: string | null
          size?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          id?: string
          lot_number?: string
          lot_type?: string
          monthly_rate?: number | null
          notes?: string | null
          size?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "rv_boat_lots_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      rv_intent_to_vacate: {
        Row: {
          acknowledged_at: string | null
          acknowledged_by_user_id: string | null
          association_id: string
          created_at: string
          id: string
          lot_id: string | null
          notes: string | null
          owner_id: string | null
          rental_id: string
          status: string
          submitted_by_user_id: string | null
          updated_at: string
          vacate_date: string
        }
        Insert: {
          acknowledged_at?: string | null
          acknowledged_by_user_id?: string | null
          association_id: string
          created_at?: string
          id?: string
          lot_id?: string | null
          notes?: string | null
          owner_id?: string | null
          rental_id: string
          status?: string
          submitted_by_user_id?: string | null
          updated_at?: string
          vacate_date: string
        }
        Update: {
          acknowledged_at?: string | null
          acknowledged_by_user_id?: string | null
          association_id?: string
          created_at?: string
          id?: string
          lot_id?: string | null
          notes?: string | null
          owner_id?: string | null
          rental_id?: string
          status?: string
          submitted_by_user_id?: string | null
          updated_at?: string
          vacate_date?: string
        }
        Relationships: [
          {
            foreignKeyName: "rv_intent_to_vacate_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rv_intent_to_vacate_lot_id_fkey"
            columns: ["lot_id"]
            isOneToOne: false
            referencedRelation: "rv_boat_lots"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rv_intent_to_vacate_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rv_intent_to_vacate_rental_id_fkey"
            columns: ["rental_id"]
            isOneToOne: false
            referencedRelation: "rv_boat_lot_rentals"
            referencedColumns: ["id"]
          },
        ]
      }
      saved_form_templates: {
        Row: {
          association_id: string | null
          created_at: string
          form_data: Json
          form_type: string
          id: string
          name: string
          updated_at: string
          user_id: string
        }
        Insert: {
          association_id?: string | null
          created_at?: string
          form_data?: Json
          form_type: string
          id?: string
          name: string
          updated_at?: string
          user_id: string
        }
        Update: {
          association_id?: string | null
          created_at?: string
          form_data?: Json
          form_type?: string
          id?: string
          name?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "saved_form_templates_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      saved_letters: {
        Row: {
          association_id: string | null
          body_html: string | null
          certified_mail: string | null
          created_at: string
          created_by: string | null
          id: string
          manual_recipients: Json | null
          name: string
          recipients: Json | null
          subject: string | null
          updated_at: string
        }
        Insert: {
          association_id?: string | null
          body_html?: string | null
          certified_mail?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          manual_recipients?: Json | null
          name?: string
          recipients?: Json | null
          subject?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string | null
          body_html?: string | null
          certified_mail?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          manual_recipients?: Json | null
          name?: string
          recipients?: Json | null
          subject?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "saved_letters_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      shared_drive_files: {
        Row: {
          association_ids: string[] | null
          created_at: string
          drive_file_id: string
          drive_file_name: string
          drive_icon_link: string | null
          drive_mime_type: string | null
          drive_web_view_link: string | null
          id: string
          is_folder: boolean
          parent_shared_id: string | null
          shared_by: string | null
          updated_at: string
          visibility: string[]
        }
        Insert: {
          association_ids?: string[] | null
          created_at?: string
          drive_file_id: string
          drive_file_name: string
          drive_icon_link?: string | null
          drive_mime_type?: string | null
          drive_web_view_link?: string | null
          id?: string
          is_folder?: boolean
          parent_shared_id?: string | null
          shared_by?: string | null
          updated_at?: string
          visibility?: string[]
        }
        Update: {
          association_ids?: string[] | null
          created_at?: string
          drive_file_id?: string
          drive_file_name?: string
          drive_icon_link?: string | null
          drive_mime_type?: string | null
          drive_web_view_link?: string | null
          id?: string
          is_folder?: boolean
          parent_shared_id?: string | null
          shared_by?: string | null
          updated_at?: string
          visibility?: string[]
        }
        Relationships: [
          {
            foreignKeyName: "shared_drive_files_parent_shared_id_fkey"
            columns: ["parent_shared_id"]
            isOneToOne: false
            referencedRelation: "shared_drive_files"
            referencedColumns: ["id"]
          },
        ]
      }
      shared_links: {
        Row: {
          access_code: string
          created_at: string
          created_by: string | null
          document_id: string | null
          expires_at: string | null
          folder_name: string | null
          id: string
          is_public: boolean
          share_token: string
          share_type: string
          updated_at: string
        }
        Insert: {
          access_code: string
          created_at?: string
          created_by?: string | null
          document_id?: string | null
          expires_at?: string | null
          folder_name?: string | null
          id?: string
          is_public?: boolean
          share_token?: string
          share_type?: string
          updated_at?: string
        }
        Update: {
          access_code?: string
          created_at?: string
          created_by?: string | null
          document_id?: string | null
          expires_at?: string | null
          folder_name?: string | null
          id?: string
          is_public?: boolean
          share_token?: string
          share_type?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "shared_links_document_id_fkey"
            columns: ["document_id"]
            isOneToOne: false
            referencedRelation: "documents"
            referencedColumns: ["id"]
          },
        ]
      }
      signature_envelopes: {
        Row: {
          association_id: string | null
          completed_at: string | null
          created_at: string
          created_by: string | null
          document_name: string
          document_url: string
          email_body: string | null
          email_subject: string | null
          id: string
          sent_at: string | null
          signed_document_url: string | null
          status: string
          updated_at: string
          voided_at: string | null
          voided_by: string | null
          voided_reason: string | null
        }
        Insert: {
          association_id?: string | null
          completed_at?: string | null
          created_at?: string
          created_by?: string | null
          document_name: string
          document_url: string
          email_body?: string | null
          email_subject?: string | null
          id?: string
          sent_at?: string | null
          signed_document_url?: string | null
          status?: string
          updated_at?: string
          voided_at?: string | null
          voided_by?: string | null
          voided_reason?: string | null
        }
        Update: {
          association_id?: string | null
          completed_at?: string | null
          created_at?: string
          created_by?: string | null
          document_name?: string
          document_url?: string
          email_body?: string | null
          email_subject?: string | null
          id?: string
          sent_at?: string | null
          signed_document_url?: string | null
          status?: string
          updated_at?: string
          voided_at?: string | null
          voided_by?: string | null
          voided_reason?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "signature_envelopes_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      signature_events: {
        Row: {
          created_at: string
          details: Json | null
          envelope_id: string
          event_type: string
          id: string
          ip_address: string | null
          recipient_id: string | null
          user_agent: string | null
        }
        Insert: {
          created_at?: string
          details?: Json | null
          envelope_id: string
          event_type: string
          id?: string
          ip_address?: string | null
          recipient_id?: string | null
          user_agent?: string | null
        }
        Update: {
          created_at?: string
          details?: Json | null
          envelope_id?: string
          event_type?: string
          id?: string
          ip_address?: string | null
          recipient_id?: string | null
          user_agent?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "signature_events_envelope_id_fkey"
            columns: ["envelope_id"]
            isOneToOne: false
            referencedRelation: "signature_envelopes"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "signature_events_recipient_id_fkey"
            columns: ["recipient_id"]
            isOneToOne: false
            referencedRelation: "signature_recipients"
            referencedColumns: ["id"]
          },
        ]
      }
      signature_fields: {
        Row: {
          created_at: string
          envelope_id: string
          field_type: string
          height_ratio: number
          id: string
          page_number: number
          recipient_id: string
          required: boolean
          width_ratio: number
          x_ratio: number
          y_ratio: number
        }
        Insert: {
          created_at?: string
          envelope_id: string
          field_type: string
          height_ratio?: number
          id?: string
          page_number?: number
          recipient_id: string
          required?: boolean
          width_ratio?: number
          x_ratio: number
          y_ratio: number
        }
        Update: {
          created_at?: string
          envelope_id?: string
          field_type?: string
          height_ratio?: number
          id?: string
          page_number?: number
          recipient_id?: string
          required?: boolean
          width_ratio?: number
          x_ratio?: number
          y_ratio?: number
        }
        Relationships: [
          {
            foreignKeyName: "signature_fields_envelope_id_fkey"
            columns: ["envelope_id"]
            isOneToOne: false
            referencedRelation: "signature_envelopes"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "signature_fields_recipient_id_fkey"
            columns: ["recipient_id"]
            isOneToOne: false
            referencedRelation: "signature_recipients"
            referencedColumns: ["id"]
          },
        ]
      }
      signature_recipients: {
        Row: {
          created_at: string
          email: string
          envelope_id: string
          id: string
          name: string
          signature_data_url: string | null
          signature_method: string | null
          signed_at: string | null
          signed_ip: string | null
          signed_user_agent: string | null
          signing_order: number
          signing_token: string
          status: string
          user_id: string | null
        }
        Insert: {
          created_at?: string
          email: string
          envelope_id: string
          id?: string
          name: string
          signature_data_url?: string | null
          signature_method?: string | null
          signed_at?: string | null
          signed_ip?: string | null
          signed_user_agent?: string | null
          signing_order?: number
          signing_token?: string
          status?: string
          user_id?: string | null
        }
        Update: {
          created_at?: string
          email?: string
          envelope_id?: string
          id?: string
          name?: string
          signature_data_url?: string | null
          signature_method?: string | null
          signed_at?: string | null
          signed_ip?: string | null
          signed_user_agent?: string | null
          signing_order?: number
          signing_token?: string
          status?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "signature_recipients_envelope_id_fkey"
            columns: ["envelope_id"]
            isOneToOne: false
            referencedRelation: "signature_envelopes"
            referencedColumns: ["id"]
          },
        ]
      }
      signup_codes: {
        Row: {
          association_id: string | null
          code: string
          created_at: string
          created_by: string | null
          expires_at: string | null
          id: string
          note: string | null
          owner_id: string | null
          redeemed_at: string | null
          redeemed_by_user_id: string | null
          redeemed_email: string | null
          rental_id: string | null
          role: Database["public"]["Enums"]["app_role"]
          updated_at: string
        }
        Insert: {
          association_id?: string | null
          code: string
          created_at?: string
          created_by?: string | null
          expires_at?: string | null
          id?: string
          note?: string | null
          owner_id?: string | null
          redeemed_at?: string | null
          redeemed_by_user_id?: string | null
          redeemed_email?: string | null
          rental_id?: string | null
          role?: Database["public"]["Enums"]["app_role"]
          updated_at?: string
        }
        Update: {
          association_id?: string | null
          code?: string
          created_at?: string
          created_by?: string | null
          expires_at?: string | null
          id?: string
          note?: string | null
          owner_id?: string | null
          redeemed_at?: string | null
          redeemed_by_user_id?: string | null
          redeemed_email?: string | null
          rental_id?: string | null
          role?: Database["public"]["Enums"]["app_role"]
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "signup_codes_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "signup_codes_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "signup_codes_rental_id_fkey"
            columns: ["rental_id"]
            isOneToOne: false
            referencedRelation: "rv_boat_lot_rentals"
            referencedColumns: ["id"]
          },
        ]
      }
      status_update_comments: {
        Row: {
          content: string
          created_at: string
          id: string
          status_update_id: string
          user_id: string
        }
        Insert: {
          content: string
          created_at?: string
          id?: string
          status_update_id: string
          user_id: string
        }
        Update: {
          content?: string
          created_at?: string
          id?: string
          status_update_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "status_update_comments_status_update_id_fkey"
            columns: ["status_update_id"]
            isOneToOne: false
            referencedRelation: "status_updates"
            referencedColumns: ["id"]
          },
        ]
      }
      status_update_votes: {
        Row: {
          created_at: string
          id: string
          status_update_id: string
          user_id: string
          vote: string
        }
        Insert: {
          created_at?: string
          id?: string
          status_update_id: string
          user_id: string
          vote: string
        }
        Update: {
          created_at?: string
          id?: string
          status_update_id?: string
          user_id?: string
          vote?: string
        }
        Relationships: [
          {
            foreignKeyName: "status_update_votes_status_update_id_fkey"
            columns: ["status_update_id"]
            isOneToOne: false
            referencedRelation: "status_updates"
            referencedColumns: ["id"]
          },
        ]
      }
      status_updates: {
        Row: {
          association_id: string
          content: string | null
          created_at: string
          created_by: string | null
          id: string
          image_urls: Json | null
          requested_action: string | null
          status: string
          title: string
          updated_at: string
          voting_enabled: boolean | null
        }
        Insert: {
          association_id: string
          content?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          image_urls?: Json | null
          requested_action?: string | null
          status?: string
          title: string
          updated_at?: string
          voting_enabled?: boolean | null
        }
        Update: {
          association_id?: string
          content?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          image_urls?: Json | null
          requested_action?: string | null
          status?: string
          title?: string
          updated_at?: string
          voting_enabled?: boolean | null
        }
        Relationships: [
          {
            foreignKeyName: "status_updates_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "status_updates_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
        ]
      }
      stripe_account_mappings: {
        Row: {
          association_id: string | null
          created_at: string
          created_by: string | null
          id: string
          is_active: boolean
          label: string | null
          pass_processing_fee: boolean
          processing_fee_fixed_cents: number
          processing_fee_percent: number
          stripe_account_id: string
          stripe_public_key: string
          stripe_secret_key: string | null
          updated_at: string
        }
        Insert: {
          association_id?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          is_active?: boolean
          label?: string | null
          pass_processing_fee?: boolean
          processing_fee_fixed_cents?: number
          processing_fee_percent?: number
          stripe_account_id: string
          stripe_public_key: string
          stripe_secret_key?: string | null
          updated_at?: string
        }
        Update: {
          association_id?: string | null
          created_at?: string
          created_by?: string | null
          id?: string
          is_active?: boolean
          label?: string | null
          pass_processing_fee?: boolean
          processing_fee_fixed_cents?: number
          processing_fee_percent?: number
          stripe_account_id?: string
          stripe_public_key?: string
          stripe_secret_key?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "stripe_account_mappings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      stripe_payments: {
        Row: {
          amount_cents: number
          association_id: string
          created_at: string
          description: string | null
          fee_cents: number
          id: string
          owner_id: string | null
          payment_method_type: string
          status: string
          stripe_payment_intent_id: string | null
          total_cents: number
          unit_id: string | null
          updated_at: string
        }
        Insert: {
          amount_cents: number
          association_id: string
          created_at?: string
          description?: string | null
          fee_cents?: number
          id?: string
          owner_id?: string | null
          payment_method_type?: string
          status?: string
          stripe_payment_intent_id?: string | null
          total_cents: number
          unit_id?: string | null
          updated_at?: string
        }
        Update: {
          amount_cents?: number
          association_id?: string
          created_at?: string
          description?: string | null
          fee_cents?: number
          id?: string
          owner_id?: string | null
          payment_method_type?: string
          status?: string
          stripe_payment_intent_id?: string | null
          total_cents?: number
          unit_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "stripe_payments_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "stripe_payments_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "stripe_payments_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      support_chat_messages: {
        Row: {
          chat_id: string
          content: string
          created_at: string
          escalated: boolean
          id: string
          role: string
        }
        Insert: {
          chat_id: string
          content: string
          created_at?: string
          escalated?: boolean
          id?: string
          role?: string
        }
        Update: {
          chat_id?: string
          content?: string
          created_at?: string
          escalated?: boolean
          id?: string
          role?: string
        }
        Relationships: [
          {
            foreignKeyName: "support_chat_messages_chat_id_fkey"
            columns: ["chat_id"]
            isOneToOne: false
            referencedRelation: "support_chats"
            referencedColumns: ["id"]
          },
        ]
      }
      support_chats: {
        Row: {
          association_id: string | null
          created_at: string
          id: string
          status: string
          updated_at: string
          user_id: string
        }
        Insert: {
          association_id?: string | null
          created_at?: string
          id?: string
          status?: string
          updated_at?: string
          user_id: string
        }
        Update: {
          association_id?: string | null
          created_at?: string
          id?: string
          status?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "support_chats_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      suppressed_emails: {
        Row: {
          created_at: string
          email: string
          id: string
          metadata: Json | null
          reason: string
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
          metadata?: Json | null
          reason: string
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
          metadata?: Json | null
          reason?: string
        }
        Relationships: []
      }
      tasks: {
        Row: {
          assigned_to: string | null
          association_id: string
          client_id: string | null
          client_specific: boolean | null
          completed_at: string | null
          created_at: string
          created_by: string | null
          days_until_due: number | null
          description: string | null
          due_date: string | null
          id: string
          parent_task_id: string | null
          priority: string | null
          project_id: string | null
          property_id: string | null
          recurring: boolean | null
          recurring_interval: string | null
          recurring_next_date: string | null
          status: string
          task_sequence: number | null
          template_id: string | null
          title: string
          updated_at: string
        }
        Insert: {
          assigned_to?: string | null
          association_id: string
          client_id?: string | null
          client_specific?: boolean | null
          completed_at?: string | null
          created_at?: string
          created_by?: string | null
          days_until_due?: number | null
          description?: string | null
          due_date?: string | null
          id?: string
          parent_task_id?: string | null
          priority?: string | null
          project_id?: string | null
          property_id?: string | null
          recurring?: boolean | null
          recurring_interval?: string | null
          recurring_next_date?: string | null
          status?: string
          task_sequence?: number | null
          template_id?: string | null
          title: string
          updated_at?: string
        }
        Update: {
          assigned_to?: string | null
          association_id?: string
          client_id?: string | null
          client_specific?: boolean | null
          completed_at?: string | null
          created_at?: string
          created_by?: string | null
          days_until_due?: number | null
          description?: string | null
          due_date?: string | null
          id?: string
          parent_task_id?: string | null
          priority?: string | null
          project_id?: string | null
          property_id?: string | null
          recurring?: boolean | null
          recurring_interval?: string | null
          recurring_next_date?: string | null
          status?: string
          task_sequence?: number | null
          template_id?: string | null
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "tasks_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "tasks_client_id_fkey"
            columns: ["client_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "tasks_parent_task_id_fkey"
            columns: ["parent_task_id"]
            isOneToOne: false
            referencedRelation: "tasks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "tasks_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "tasks_template_id_fkey"
            columns: ["template_id"]
            isOneToOne: false
            referencedRelation: "workflow_templates"
            referencedColumns: ["id"]
          },
        ]
      }
      tenant_info_requests: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          custom_message: string | null
          expires_at: string
          id: string
          owner_id: string
          sent_at: string
          sent_to_email: string | null
          submitted_at: string | null
          token: string
          unit_id: string | null
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          custom_message?: string | null
          expires_at?: string
          id?: string
          owner_id: string
          sent_at?: string
          sent_to_email?: string | null
          submitted_at?: string | null
          token?: string
          unit_id?: string | null
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          custom_message?: string | null
          expires_at?: string
          id?: string
          owner_id?: string
          sent_at?: string
          sent_to_email?: string | null
          submitted_at?: string | null
          token?: string
          unit_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "tenant_info_requests_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "tenant_info_requests_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      tenant_info_submissions: {
        Row: {
          association_id: string
          email: string | null
          emergency_contact_name: string | null
          emergency_contact_phone: string | null
          id: string
          lease_document_url: string | null
          lease_end: string | null
          lease_length_months: number | null
          lease_start: string | null
          notes: string | null
          occupants: Json | null
          owner_id: string
          pets: Json | null
          phone: string | null
          request_id: string
          submitted_at: string
          tenant_first_name: string
          tenant_last_name: string
          unit_id: string | null
          vehicles: Json | null
        }
        Insert: {
          association_id: string
          email?: string | null
          emergency_contact_name?: string | null
          emergency_contact_phone?: string | null
          id?: string
          lease_document_url?: string | null
          lease_end?: string | null
          lease_length_months?: number | null
          lease_start?: string | null
          notes?: string | null
          occupants?: Json | null
          owner_id: string
          pets?: Json | null
          phone?: string | null
          request_id: string
          submitted_at?: string
          tenant_first_name: string
          tenant_last_name: string
          unit_id?: string | null
          vehicles?: Json | null
        }
        Update: {
          association_id?: string
          email?: string | null
          emergency_contact_name?: string | null
          emergency_contact_phone?: string | null
          id?: string
          lease_document_url?: string | null
          lease_end?: string | null
          lease_length_months?: number | null
          lease_start?: string | null
          notes?: string | null
          occupants?: Json | null
          owner_id?: string
          pets?: Json | null
          phone?: string | null
          request_id?: string
          submitted_at?: string
          tenant_first_name?: string
          tenant_last_name?: string
          unit_id?: string | null
          vehicles?: Json | null
        }
        Relationships: [
          {
            foreignKeyName: "tenant_info_submissions_request_id_fkey"
            columns: ["request_id"]
            isOneToOne: false
            referencedRelation: "tenant_info_requests"
            referencedColumns: ["id"]
          },
        ]
      }
      time_entries: {
        Row: {
          association_id: string | null
          created_at: string
          description: string | null
          duration_seconds: number | null
          end_time: string | null
          id: string
          is_running: boolean
          start_time: string
          updated_at: string
          user_id: string
        }
        Insert: {
          association_id?: string | null
          created_at?: string
          description?: string | null
          duration_seconds?: number | null
          end_time?: string | null
          id?: string
          is_running?: boolean
          start_time?: string
          updated_at?: string
          user_id: string
        }
        Update: {
          association_id?: string | null
          created_at?: string
          description?: string | null
          duration_seconds?: number | null
          end_time?: string | null
          id?: string
          is_running?: boolean
          start_time?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "time_entries_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      unit_documents: {
        Row: {
          association_id: string
          category: string | null
          created_at: string
          file_name: string | null
          file_size: number | null
          file_url: string | null
          id: string
          title: string
          unit_id: string
          updated_at: string
          uploaded_by: string | null
        }
        Insert: {
          association_id: string
          category?: string | null
          created_at?: string
          file_name?: string | null
          file_size?: number | null
          file_url?: string | null
          id?: string
          title: string
          unit_id: string
          updated_at?: string
          uploaded_by?: string | null
        }
        Update: {
          association_id?: string
          category?: string | null
          created_at?: string
          file_name?: string | null
          file_size?: number | null
          file_url?: string | null
          id?: string
          title?: string
          unit_id?: string
          updated_at?: string
          uploaded_by?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "unit_documents_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "unit_documents_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      unit_fee_exclusions: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          fee_type: Database["public"]["Enums"]["fee_exclusion_type"]
          id: string
          mode: Database["public"]["Enums"]["fee_exclusion_mode"]
          override_amount: number | null
          override_percent: number | null
          reason: string | null
          unit_id: string
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          fee_type: Database["public"]["Enums"]["fee_exclusion_type"]
          id?: string
          mode: Database["public"]["Enums"]["fee_exclusion_mode"]
          override_amount?: number | null
          override_percent?: number | null
          reason?: string | null
          unit_id: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          fee_type?: Database["public"]["Enums"]["fee_exclusion_type"]
          id?: string
          mode?: Database["public"]["Enums"]["fee_exclusion_mode"]
          override_amount?: number | null
          override_percent?: number | null
          reason?: string | null
          unit_id?: string
          updated_at?: string
        }
        Relationships: []
      }
      unit_general_info: {
        Row: {
          amenities: string | null
          created_at: string
          id: string
          restrictions: string | null
          unit_id: string
          updated_at: string
          utilities: string | null
        }
        Insert: {
          amenities?: string | null
          created_at?: string
          id?: string
          restrictions?: string | null
          unit_id: string
          updated_at?: string
          utilities?: string | null
        }
        Update: {
          amenities?: string | null
          created_at?: string
          id?: string
          restrictions?: string | null
          unit_id?: string
          updated_at?: string
          utilities?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "unit_general_info_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      unit_occupants: {
        Row: {
          created_at: string
          email: string | null
          id: string
          name: string
          phone: string | null
          relationship: string | null
          unit_id: string
          updated_at: string
        }
        Insert: {
          created_at?: string
          email?: string | null
          id?: string
          name: string
          phone?: string | null
          relationship?: string | null
          unit_id: string
          updated_at?: string
        }
        Update: {
          created_at?: string
          email?: string | null
          id?: string
          name?: string
          phone?: string | null
          relationship?: string | null
          unit_id?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "unit_occupants_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      unit_parking: {
        Row: {
          created_at: string
          id: string
          notes: string | null
          spaces: string | null
          spots: string | null
          type: string | null
          unit_id: string
          updated_at: string
        }
        Insert: {
          created_at?: string
          id?: string
          notes?: string | null
          spaces?: string | null
          spots?: string | null
          type?: string | null
          unit_id: string
          updated_at?: string
        }
        Update: {
          created_at?: string
          id?: string
          notes?: string | null
          spaces?: string | null
          spots?: string | null
          type?: string | null
          unit_id?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "unit_parking_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      unit_pets: {
        Row: {
          breed: string | null
          created_at: string
          id: string
          name: string | null
          notes: string | null
          type: string | null
          unit_id: string
          updated_at: string
          weight: string | null
        }
        Insert: {
          breed?: string | null
          created_at?: string
          id?: string
          name?: string | null
          notes?: string | null
          type?: string | null
          unit_id: string
          updated_at?: string
          weight?: string | null
        }
        Update: {
          breed?: string | null
          created_at?: string
          id?: string
          name?: string | null
          notes?: string | null
          type?: string | null
          unit_id?: string
          updated_at?: string
          weight?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "unit_pets_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      unit_tenants: {
        Row: {
          created_at: string
          email: string | null
          id: string
          lease_end: string | null
          lease_start: string | null
          name: string
          phone: string | null
          status: string | null
          unit_id: string
          updated_at: string
        }
        Insert: {
          created_at?: string
          email?: string | null
          id?: string
          lease_end?: string | null
          lease_start?: string | null
          name: string
          phone?: string | null
          status?: string | null
          unit_id: string
          updated_at?: string
        }
        Update: {
          created_at?: string
          email?: string | null
          id?: string
          lease_end?: string | null
          lease_start?: string | null
          name?: string
          phone?: string | null
          status?: string | null
          unit_id?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "unit_tenants_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      unit_timeline_events: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          description: string | null
          event_tag: string[] | null
          event_type: string
          id: string
          metadata: Json | null
          related_entity_id: string | null
          related_entity_type: string | null
          title: string
          unit_id: string
          updated_at: string
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          event_tag?: string[] | null
          event_type?: string
          id?: string
          metadata?: Json | null
          related_entity_id?: string | null
          related_entity_type?: string | null
          title: string
          unit_id: string
          updated_at?: string
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          event_tag?: string[] | null
          event_type?: string
          id?: string
          metadata?: Json | null
          related_entity_id?: string | null
          related_entity_type?: string | null
          title?: string
          unit_id?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "unit_timeline_events_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "unit_timeline_events_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      units: {
        Row: {
          account_number: string | null
          address: string | null
          assessment_account_id: string | null
          assessment_amount_one: number | null
          assessment_amount_two: number | null
          association_id: string
          bathrooms: number | null
          bedrooms: number | null
          buildium_unit_id: string | null
          city: string | null
          created_at: string
          id: string
          image_url: string | null
          is_rental: boolean
          lot: string | null
          monthly_assessment: number | null
          parcel_id: string | null
          sqft: number | null
          state: string | null
          status: string | null
          status_tags: string[]
          unit_number: string
          updated_at: string
          zip: string | null
          zoho_customer_number: string | null
        }
        Insert: {
          account_number?: string | null
          address?: string | null
          assessment_account_id?: string | null
          assessment_amount_one?: number | null
          assessment_amount_two?: number | null
          association_id: string
          bathrooms?: number | null
          bedrooms?: number | null
          buildium_unit_id?: string | null
          city?: string | null
          created_at?: string
          id?: string
          image_url?: string | null
          is_rental?: boolean
          lot?: string | null
          monthly_assessment?: number | null
          parcel_id?: string | null
          sqft?: number | null
          state?: string | null
          status?: string | null
          status_tags?: string[]
          unit_number: string
          updated_at?: string
          zip?: string | null
          zoho_customer_number?: string | null
        }
        Update: {
          account_number?: string | null
          address?: string | null
          assessment_account_id?: string | null
          assessment_amount_one?: number | null
          assessment_amount_two?: number | null
          association_id?: string
          bathrooms?: number | null
          bedrooms?: number | null
          buildium_unit_id?: string | null
          city?: string | null
          created_at?: string
          id?: string
          image_url?: string | null
          is_rental?: boolean
          lot?: string | null
          monthly_assessment?: number | null
          parcel_id?: string | null
          sqft?: number | null
          state?: string | null
          status?: string | null
          status_tags?: string[]
          unit_number?: string
          updated_at?: string
          zip?: string | null
          zoho_customer_number?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "units_assessment_account_id_fkey"
            columns: ["assessment_account_id"]
            isOneToOne: false
            referencedRelation: "chart_of_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "units_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      user_dashboard_layouts: {
        Row: {
          cards: Json
          created_at: string
          id: string
          layout: Json
          updated_at: string
          user_id: string
        }
        Insert: {
          cards?: Json
          created_at?: string
          id?: string
          layout?: Json
          updated_at?: string
          user_id: string
        }
        Update: {
          cards?: Json
          created_at?: string
          id?: string
          layout?: Json
          updated_at?: string
          user_id?: string
        }
        Relationships: []
      }
      user_roles: {
        Row: {
          id: string
          role: Database["public"]["Enums"]["app_role"]
          user_id: string
        }
        Insert: {
          id?: string
          role: Database["public"]["Enums"]["app_role"]
          user_id: string
        }
        Update: {
          id?: string
          role?: Database["public"]["Enums"]["app_role"]
          user_id?: string
        }
        Relationships: []
      }
      vendor_coa_mappings: {
        Row: {
          association_id: string
          chart_of_accounts_id: string
          created_at: string
          id: string
          notes: string | null
          updated_at: string
          vendor_id: string
        }
        Insert: {
          association_id: string
          chart_of_accounts_id: string
          created_at?: string
          id?: string
          notes?: string | null
          updated_at?: string
          vendor_id: string
        }
        Update: {
          association_id?: string
          chart_of_accounts_id?: string
          created_at?: string
          id?: string
          notes?: string | null
          updated_at?: string
          vendor_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "vendor_coa_mappings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "vendor_coa_mappings_chart_of_accounts_id_fkey"
            columns: ["chart_of_accounts_id"]
            isOneToOne: false
            referencedRelation: "chart_of_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "vendor_coa_mappings_vendor_id_fkey"
            columns: ["vendor_id"]
            isOneToOne: false
            referencedRelation: "vendors"
            referencedColumns: ["id"]
          },
        ]
      }
      vendor_email_mappings: {
        Row: {
          association_id: string
          created_at: string
          created_by: string | null
          email: string
          id: string
          notes: string | null
          updated_at: string
          vendor_id: string | null
          vendor_name: string | null
        }
        Insert: {
          association_id: string
          created_at?: string
          created_by?: string | null
          email: string
          id?: string
          notes?: string | null
          updated_at?: string
          vendor_id?: string | null
          vendor_name?: string | null
        }
        Update: {
          association_id?: string
          created_at?: string
          created_by?: string | null
          email?: string
          id?: string
          notes?: string | null
          updated_at?: string
          vendor_id?: string | null
          vendor_name?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "vendor_email_mappings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "vendor_email_mappings_vendor_id_fkey"
            columns: ["vendor_id"]
            isOneToOne: false
            referencedRelation: "vendors"
            referencedColumns: ["id"]
          },
        ]
      }
      vendor_insurance_requests: {
        Row: {
          created_at: string
          created_by: string | null
          expires_at: string
          id: string
          sent_at: string
          sent_to_email: string | null
          submitted_at: string | null
          token: string
          vendor_id: string
        }
        Insert: {
          created_at?: string
          created_by?: string | null
          expires_at?: string
          id?: string
          sent_at?: string
          sent_to_email?: string | null
          submitted_at?: string | null
          token?: string
          vendor_id: string
        }
        Update: {
          created_at?: string
          created_by?: string | null
          expires_at?: string
          id?: string
          sent_at?: string
          sent_to_email?: string | null
          submitted_at?: string | null
          token?: string
          vendor_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "vendor_insurance_requests_vendor_id_fkey"
            columns: ["vendor_id"]
            isOneToOne: false
            referencedRelation: "vendors"
            referencedColumns: ["id"]
          },
        ]
      }
      vendor_profile_requests: {
        Row: {
          created_at: string
          created_by: string | null
          expires_at: string
          id: string
          sent_at: string
          sent_to_email: string | null
          submitted_at: string | null
          token: string
          vendor_id: string
        }
        Insert: {
          created_at?: string
          created_by?: string | null
          expires_at?: string
          id?: string
          sent_at?: string
          sent_to_email?: string | null
          submitted_at?: string | null
          token?: string
          vendor_id: string
        }
        Update: {
          created_at?: string
          created_by?: string | null
          expires_at?: string
          id?: string
          sent_at?: string
          sent_to_email?: string | null
          submitted_at?: string | null
          token?: string
          vendor_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "vendor_profile_requests_vendor_id_fkey"
            columns: ["vendor_id"]
            isOneToOne: false
            referencedRelation: "vendors"
            referencedColumns: ["id"]
          },
        ]
      }
      vendors: {
        Row: {
          ach_account_holder_enc: string | null
          ach_account_last4: string | null
          ach_account_number_enc: string | null
          ach_account_type: string | null
          ach_bank_name_enc: string | null
          ach_routing_number_enc: string | null
          address: string | null
          association_id: string
          association_ids: string[]
          buildium_vendor_id: string | null
          contact_name: string | null
          contract_end_date: string | null
          created_at: string
          default_expense_account_id: string | null
          email: string | null
          id: string
          insurance_carrier: string | null
          insurance_document_url: string | null
          insurance_expiration_date: string | null
          insurance_policy_number: string | null
          is_1099_eligible: boolean
          is_active: boolean
          name: string
          notes: string | null
          payment_terms: string | null
          phone: string | null
          profile_last_submitted_at: string | null
          remittance_address: string | null
          tax_id: string | null
          updated_at: string
          w9_document_url: string | null
          zoho_contact_id: string | null
        }
        Insert: {
          ach_account_holder_enc?: string | null
          ach_account_last4?: string | null
          ach_account_number_enc?: string | null
          ach_account_type?: string | null
          ach_bank_name_enc?: string | null
          ach_routing_number_enc?: string | null
          address?: string | null
          association_id: string
          association_ids?: string[]
          buildium_vendor_id?: string | null
          contact_name?: string | null
          contract_end_date?: string | null
          created_at?: string
          default_expense_account_id?: string | null
          email?: string | null
          id?: string
          insurance_carrier?: string | null
          insurance_document_url?: string | null
          insurance_expiration_date?: string | null
          insurance_policy_number?: string | null
          is_1099_eligible?: boolean
          is_active?: boolean
          name: string
          notes?: string | null
          payment_terms?: string | null
          phone?: string | null
          profile_last_submitted_at?: string | null
          remittance_address?: string | null
          tax_id?: string | null
          updated_at?: string
          w9_document_url?: string | null
          zoho_contact_id?: string | null
        }
        Update: {
          ach_account_holder_enc?: string | null
          ach_account_last4?: string | null
          ach_account_number_enc?: string | null
          ach_account_type?: string | null
          ach_bank_name_enc?: string | null
          ach_routing_number_enc?: string | null
          address?: string | null
          association_id?: string
          association_ids?: string[]
          buildium_vendor_id?: string | null
          contact_name?: string | null
          contract_end_date?: string | null
          created_at?: string
          default_expense_account_id?: string | null
          email?: string | null
          id?: string
          insurance_carrier?: string | null
          insurance_document_url?: string | null
          insurance_expiration_date?: string | null
          insurance_policy_number?: string | null
          is_1099_eligible?: boolean
          is_active?: boolean
          name?: string
          notes?: string | null
          payment_terms?: string | null
          phone?: string | null
          profile_last_submitted_at?: string | null
          remittance_address?: string | null
          tax_id?: string | null
          updated_at?: string
          w9_document_url?: string | null
          zoho_contact_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "vendors_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "vendors_default_expense_account_id_fkey"
            columns: ["default_expense_account_id"]
            isOneToOne: false
            referencedRelation: "chart_of_accounts"
            referencedColumns: ["id"]
          },
        ]
      }
      violation_responses: {
        Row: {
          created_at: string
          date_corrected: string | null
          id: string
          photo_urls: Json | null
          respondent_email: string | null
          respondent_name: string | null
          respondent_phone: string | null
          response_text: string | null
          status: string
          updated_at: string
          violation_id: string
        }
        Insert: {
          created_at?: string
          date_corrected?: string | null
          id?: string
          photo_urls?: Json | null
          respondent_email?: string | null
          respondent_name?: string | null
          respondent_phone?: string | null
          response_text?: string | null
          status?: string
          updated_at?: string
          violation_id: string
        }
        Update: {
          created_at?: string
          date_corrected?: string | null
          id?: string
          photo_urls?: Json | null
          respondent_email?: string | null
          respondent_name?: string | null
          respondent_phone?: string | null
          response_text?: string | null
          status?: string
          updated_at?: string
          violation_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "violation_responses_violation_id_fkey"
            columns: ["violation_id"]
            isOneToOne: false
            referencedRelation: "violations"
            referencedColumns: ["id"]
          },
        ]
      }
      violation_types: {
        Row: {
          article_section: string | null
          association_id: string
          category: string
          citation: string | null
          created_at: string | null
          description: string | null
          id: string
          requested_action: string | null
          updated_at: string | null
        }
        Insert: {
          article_section?: string | null
          association_id: string
          category: string
          citation?: string | null
          created_at?: string | null
          description?: string | null
          id?: string
          requested_action?: string | null
          updated_at?: string | null
        }
        Update: {
          article_section?: string | null
          association_id?: string
          category?: string
          citation?: string | null
          created_at?: string | null
          description?: string | null
          id?: string
          requested_action?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "violation_types_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      violations: {
        Row: {
          address: string | null
          assigned_to: string | null
          association_id: string
          category: string | null
          created_at: string
          created_by: string | null
          description: string | null
          due_date: string | null
          id: string
          notes: string | null
          notice_history: Json | null
          notice_level: string | null
          owner_id: string | null
          photo_url: string | null
          photo_urls: Json | null
          priority: string | null
          property_id: string | null
          resolved_date: string | null
          stage: string | null
          status: string | null
          tags: string[]
          timeline_entries: Json | null
          title: string
          unit_id: string | null
          updated_at: string
          violation_date: string | null
          violation_type: string | null
        }
        Insert: {
          address?: string | null
          assigned_to?: string | null
          association_id: string
          category?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          notes?: string | null
          notice_history?: Json | null
          notice_level?: string | null
          owner_id?: string | null
          photo_url?: string | null
          photo_urls?: Json | null
          priority?: string | null
          property_id?: string | null
          resolved_date?: string | null
          stage?: string | null
          status?: string | null
          tags?: string[]
          timeline_entries?: Json | null
          title: string
          unit_id?: string | null
          updated_at?: string
          violation_date?: string | null
          violation_type?: string | null
        }
        Update: {
          address?: string | null
          assigned_to?: string | null
          association_id?: string
          category?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          notes?: string | null
          notice_history?: Json | null
          notice_level?: string | null
          owner_id?: string | null
          photo_url?: string | null
          photo_urls?: Json | null
          priority?: string | null
          property_id?: string | null
          resolved_date?: string | null
          stage?: string | null
          status?: string | null
          tags?: string[]
          timeline_entries?: Json | null
          title?: string
          unit_id?: string | null
          updated_at?: string
          violation_date?: string | null
          violation_type?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "violations_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "violations_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "violations_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      workflow_template_tasks: {
        Row: {
          assigned_to: string | null
          created_at: string | null
          days_until_due: number | null
          id: string
          priority: string | null
          task_description: string | null
          task_name: string
          task_sequence: number | null
          template_id: string
        }
        Insert: {
          assigned_to?: string | null
          created_at?: string | null
          days_until_due?: number | null
          id?: string
          priority?: string | null
          task_description?: string | null
          task_name: string
          task_sequence?: number | null
          template_id: string
        }
        Update: {
          assigned_to?: string | null
          created_at?: string | null
          days_until_due?: number | null
          id?: string
          priority?: string | null
          task_description?: string | null
          task_name?: string
          task_sequence?: number | null
          template_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "workflow_template_tasks_template_id_fkey"
            columns: ["template_id"]
            isOneToOne: false
            referencedRelation: "workflow_templates"
            referencedColumns: ["id"]
          },
        ]
      }
      workflow_templates: {
        Row: {
          client_id: string | null
          created_at: string | null
          created_by: string | null
          description: string | null
          id: string
          name: string
          updated_at: string | null
        }
        Insert: {
          client_id?: string | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          id?: string
          name: string
          updated_at?: string | null
        }
        Update: {
          client_id?: string | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          id?: string
          name?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "workflow_templates_client_id_fkey"
            columns: ["client_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      zoho_account_mappings: {
        Row: {
          association_id: string
          chart_of_account_id: string
          created_at: string
          id: string
          updated_at: string
          zoho_account_id: string
          zoho_account_name: string | null
        }
        Insert: {
          association_id: string
          chart_of_account_id: string
          created_at?: string
          id?: string
          updated_at?: string
          zoho_account_id: string
          zoho_account_name?: string | null
        }
        Update: {
          association_id?: string
          chart_of_account_id?: string
          created_at?: string
          id?: string
          updated_at?: string
          zoho_account_id?: string
          zoho_account_name?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "zoho_account_mappings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "zoho_account_mappings_chart_of_account_id_fkey"
            columns: ["chart_of_account_id"]
            isOneToOne: false
            referencedRelation: "chart_of_accounts"
            referencedColumns: ["id"]
          },
        ]
      }
      zoho_customer_mappings: {
        Row: {
          association_id: string
          created_at: string
          id: string
          owner_id: string | null
          unit_id: string | null
          updated_at: string
          zoho_customer_id: string
          zoho_customer_name: string | null
        }
        Insert: {
          association_id: string
          created_at?: string
          id?: string
          owner_id?: string | null
          unit_id?: string | null
          updated_at?: string
          zoho_customer_id: string
          zoho_customer_name?: string | null
        }
        Update: {
          association_id?: string
          created_at?: string
          id?: string
          owner_id?: string | null
          unit_id?: string | null
          updated_at?: string
          zoho_customer_id?: string
          zoho_customer_name?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "zoho_customer_mappings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "zoho_customer_mappings_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "owners"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "zoho_customer_mappings_unit_id_fkey"
            columns: ["unit_id"]
            isOneToOne: false
            referencedRelation: "units"
            referencedColumns: ["id"]
          },
        ]
      }
      zoho_reporting_tag_mappings: {
        Row: {
          association_id: string
          created_at: string
          id: string
          updated_at: string
          zoho_option_name: string | null
          zoho_tag_id: string
          zoho_tag_name: string | null
          zoho_tag_option_id: string
        }
        Insert: {
          association_id: string
          created_at?: string
          id?: string
          updated_at?: string
          zoho_option_name?: string | null
          zoho_tag_id: string
          zoho_tag_name?: string | null
          zoho_tag_option_id: string
        }
        Update: {
          association_id?: string
          created_at?: string
          id?: string
          updated_at?: string
          zoho_option_name?: string | null
          zoho_tag_id?: string
          zoho_tag_name?: string | null
          zoho_tag_option_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "zoho_reporting_tag_mappings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      zoho_sync_log: {
        Row: {
          association_id: string
          created_at: string
          details: Json | null
          direction: string
          error_message: string | null
          id: string
          record_count: number | null
          status: string
          sync_type: string
        }
        Insert: {
          association_id: string
          created_at?: string
          details?: Json | null
          direction?: string
          error_message?: string | null
          id?: string
          record_count?: number | null
          status?: string
          sync_type: string
        }
        Update: {
          association_id?: string
          created_at?: string
          details?: Json | null
          direction?: string
          error_message?: string | null
          id?: string
          record_count?: number | null
          status?: string
          sync_type?: string
        }
        Relationships: [
          {
            foreignKeyName: "zoho_sync_log_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: false
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
      zoho_sync_settings: {
        Row: {
          association_id: string
          auto_sync_enabled: boolean
          created_at: string
          id: string
          sync_bills: boolean
          sync_contacts: boolean
          sync_invoices: boolean
          sync_journal_entries: boolean
          sync_payments: boolean
          updated_at: string
        }
        Insert: {
          association_id: string
          auto_sync_enabled?: boolean
          created_at?: string
          id?: string
          sync_bills?: boolean
          sync_contacts?: boolean
          sync_invoices?: boolean
          sync_journal_entries?: boolean
          sync_payments?: boolean
          updated_at?: string
        }
        Update: {
          association_id?: string
          auto_sync_enabled?: boolean
          created_at?: string
          id?: string
          sync_bills?: boolean
          sync_contacts?: boolean
          sync_invoices?: boolean
          sync_journal_entries?: boolean
          sync_payments?: boolean
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "zoho_sync_settings_association_id_fkey"
            columns: ["association_id"]
            isOneToOne: true
            referencedRelation: "associations"
            referencedColumns: ["id"]
          },
        ]
      }
    }
    Views: {
      budget_actuals_monthly: {
        Row: {
          account_type: string | null
          amount: number | null
          association_id: string | null
          category_name: string | null
          gl_account_id: string | null
          period_month: string | null
        }
        Relationships: []
      }
    }
    Functions: {
      _get_vendor_ach_key: { Args: never; Returns: string }
      calculate_legal_matter_ledger_amount: {
        Args: { p_legal_matter_id: string }
        Returns: number
      }
      can_comment_on_entity: {
        Args: { _entity_id: string; _entity_type: string; _user_id: string }
        Returns: boolean
      }
      can_comment_on_status_update: {
        Args: { _status_update_id: string; _user_id: string }
        Returns: boolean
      }
      can_view_portal_function:
        | {
            Args: { _function_key: string; _portal: string; _user_id?: string }
            Returns: boolean
          }
        | {
            Args: {
              _association_id?: string
              _function_key: string
              _portal: string
              _user_id?: string
            }
            Returns: boolean
          }
      delete_email: {
        Args: { message_id: number; queue_name: string }
        Returns: boolean
      }
      enqueue_email: {
        Args: { payload: Json; queue_name: string }
        Returns: number
      }
      get_association_accounting_system: {
        Args: { _association_id: string }
        Returns: string
      }
      get_association_payment_gateways: {
        Args: { p_association_id: string }
        Returns: Json
      }
      get_cross_association_blocked_dates: {
        Args: { _association_ids: string[] }
        Returns: {
          all_day: boolean
          end_date: string
          id: string
          start_date: string
        }[]
      }
      get_legal_association_ids: {
        Args: { _user_id?: string }
        Returns: string[]
      }
      get_maintenance_status: { Args: never; Returns: Json }
      get_master_board_association_ids: {
        Args: { _user_id?: string }
        Returns: string[]
      }
      get_message_staff_profiles: {
        Args: { _current_user_id?: string }
        Returns: {
          avatar_url: string
          full_name: string
          user_id: string
        }[]
      }
      get_public_amenity_booked_dates: {
        Args: { p_amenity_id: string }
        Returns: {
          booking_date: string
          end_time: string
          event_title: string
          is_public_event: boolean
          start_time: string
          status: string
        }[]
      }
      get_public_booking_confirmation: {
        Args: { p_booking_id: string }
        Returns: {
          amenity_name: string
          association_name: string
          association_slug: string
          booking_date: string
          end_time: string
          guest_email: string
          guest_name: string
          id: string
          start_time: string
          status: string
          title: string
        }[]
      }
      get_required_approvals_for_bill: {
        Args: { p_bill_id: string }
        Returns: number
      }
      get_rv_owner_association_ids: {
        Args: { _user_id?: string }
        Returns: string[]
      }
      get_rv_owner_owner_ids: { Args: { _user_id?: string }; Returns: string[] }
      get_rv_renter_association_ids: {
        Args: { _user_id?: string }
        Returns: string[]
      }
      get_rv_renter_owner_ids: {
        Args: { _user_id?: string }
        Returns: string[]
      }
      get_user_association_ids: { Args: never; Returns: string[] }
      get_vendor_ach_details: {
        Args: { p_vendor_id: string }
        Returns: {
          account_holder: string
          account_last4: string
          account_number: string
          account_type: string
          bank_name: string
          routing_number: string
        }[]
      }
      has_feature_permission: {
        Args: { _action: string; _feature_area: string; _user_id: string }
        Returns: boolean
      }
      has_role: {
        Args: {
          _role: Database["public"]["Enums"]["app_role"]
          _user_id: string
        }
        Returns: boolean
      }
      insert_notification: {
        Args: {
          p_link?: string
          p_message?: string
          p_related_item_id?: string
          p_related_item_type?: string
          p_title: string
          p_type: string
          p_user_id: string
        }
        Returns: string
      }
      is_arc_application_locked: {
        Args: { _application_id: string }
        Returns: boolean
      }
      is_arc_committee_member_of_association: {
        Args: { _association_id: string; _user_id: string }
        Returns: boolean
      }
      is_board_member_of_association: {
        Args: { _association_id: string; _user_id: string }
        Returns: boolean
      }
      is_collection_legal_matter: {
        Args: {
          p_case_type: string
          p_category: string
          p_collection_id: string
        }
        Returns: boolean
      }
      is_master_board_member_of_association: {
        Args: { _association_id: string; _user_id: string }
        Returns: boolean
      }
      legal_user_assigned_to_association: {
        Args: { _association_id: string; _user_id: string }
        Returns: boolean
      }
      lookup_bill_approval_by_token: {
        Args: { p_token: string }
        Returns: {
          acted_at: string
          action: string
          amount: number
          association_name: string
          attachment_url: string
          bill_date: string
          bill_id: string
          bill_status: string
          description: string
          due_date: string
          invoice_number: string
          member_email: string
          member_name: string
          vendor_name: string
        }[]
      }
      lookup_board_vote_by_token: {
        Args: { p_token: string }
        Returns: {
          association_name: string
          board_vote_id: string
          email: string
          member_name: string
          token_id: string
          vote_description: string
          vote_option: string
          vote_options: string[]
          vote_status: string
          vote_title: string
          voted_at: string
        }[]
      }
      lookup_email_by_username: { Args: { _username: string }; Returns: string }
      lookup_signup_code: {
        Args: { p_code: string }
        Returns: {
          association_id: string
          association_name: string
          expires_at: string
          id: string
          owner_email: string
          owner_first_name: string
          owner_id: string
          owner_last_name: string
          redeemed_at: string
          rental_id: string
          rental_renter_name: string
          role: Database["public"]["Enums"]["app_role"]
        }[]
      }
      lookup_tenant_info_request: {
        Args: { p_token: string }
        Returns: {
          association_id: string
          association_name: string
          custom_message: string
          expires_at: string
          owner_id: string
          owner_name: string
          property_address: string
          request_id: string
          submitted_at: string
          unit_id: string
        }[]
      }
      lookup_vendor_insurance_request: {
        Args: { p_token: string }
        Returns: {
          expires_at: string
          request_id: string
          submitted_at: string
          vendor_email: string
          vendor_id: string
          vendor_name: string
        }[]
      }
      lookup_vendor_profile_request: {
        Args: { p_token: string }
        Returns: {
          expires_at: string
          request_id: string
          submitted_at: string
          vendor_email: string
          vendor_id: string
          vendor_name: string
        }[]
      }
      lookup_violation_for_response: {
        Args: { p_violation_id: string }
        Returns: {
          address: string
          association_id: string
          category: string
          created_at: string
          description: string
          due_date: string
          id: string
          notice_level: string
          owner_id: string
          photo_url: string
          photo_urls: Json
          priority: string
          stage: string
          status: string
          title: string
          unit_id: string
          violation_date: string
          violation_type: string
        }[]
      }
      lookup_voter_by_access_code: {
        Args: { p_access_code: string; p_election_id: string }
        Returns: {
          vote_token: string
        }[]
      }
      lookup_voter_by_token: {
        Args: { p_vote_token: string }
        Returns: {
          access_code: string
          consent_date: string
          created_at: string
          election_id: string
          has_consent: boolean
          has_voted: boolean
          id: string
          owner_id: string
          unit_id: string
          vote_token: string
          voted_at: string
        }[]
      }
      mark_voter_as_voted: {
        Args: { p_vote_token: string }
        Returns: undefined
      }
      move_to_dlq: {
        Args: {
          dlq_name: string
          message_id: number
          payload: Json
          source_queue: string
        }
        Returns: number
      }
      read_email_batch: {
        Args: { batch_size: number; queue_name: string; vt: number }
        Returns: {
          message: Json
          msg_id: number
          read_ct: number
        }[]
      }
      realtime_topic_authorized: { Args: { _topic: string }; Returns: boolean }
      record_bill_approval_by_token: {
        Args: { p_action: string; p_notes?: string; p_token: string }
        Returns: Json
      }
      record_board_vote_by_token: {
        Args: { p_option: string; p_token: string }
        Returns: Json
      }
      refresh_committee_member_active_status: {
        Args: never
        Returns: undefined
      }
      submit_tenant_info: {
        Args: {
          p_email?: string
          p_emergency_contact_name?: string
          p_emergency_contact_phone?: string
          p_lease_document_url?: string
          p_lease_end?: string
          p_lease_length_months?: number
          p_lease_start?: string
          p_notes?: string
          p_occupants?: Json
          p_pets?: Json
          p_phone?: string
          p_tenant_first_name: string
          p_tenant_last_name: string
          p_token: string
          p_vehicles?: Json
        }
        Returns: boolean
      }
      submit_vendor_insurance: {
        Args: {
          p_carrier: string
          p_document_url?: string
          p_expiration_date: string
          p_policy_number: string
          p_token: string
        }
        Returns: boolean
      }
      submit_vendor_profile: {
        Args: {
          p_ach_account_holder?: string
          p_ach_account_number?: string
          p_ach_account_type?: string
          p_ach_bank_name?: string
          p_ach_routing_number?: string
          p_insurance_carrier?: string
          p_insurance_document_url?: string
          p_insurance_expiration_date?: string
          p_insurance_policy_number?: string
          p_is_1099_eligible: boolean
          p_remittance_address: string
          p_tax_id: string
          p_token: string
          p_w9_document_url?: string
        }
        Returns: boolean
      }
      sync_collection_legal_matter_amounts_for_owner_unit: {
        Args: { p_owner_id?: string; p_unit_id?: string }
        Returns: undefined
      }
      user_belongs_to_association: {
        Args: { _association_id: string; _user_id: string }
        Returns: boolean
      }
      verify_board_invoice_insert_policy: {
        Args: { _association_id: string; _user_id: string }
        Returns: Json
      }
    }
    Enums: {
      app_role:
        | "admin"
        | "manager"
        | "homeowner"
        | "staff"
        | "employee"
        | "board_member"
        | "arc_member"
        | "fining_member"
        | "legal"
        | "master_board_member"
        | "rv_renter"
        | "rv_owner"
        | "rv_boat_lot"
        | "management"
        | "association_management"
      fee_exclusion_mode: "waive" | "override_amount" | "override_percent"
      fee_exclusion_type: "late_fee" | "interest"
    }
    CompositeTypes: {
      [_ in never]: never
    }
  }
}

type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">

type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]

export type Tables<
  DefaultSchemaTableNameOrOptions extends
    | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
    | { schema: keyof DatabaseWithoutInternals },
  TableName extends DefaultSchemaTableNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
        DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])
    : never = never,
> = 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
    | keyof DefaultSchema["Tables"]
    | { schema: keyof DatabaseWithoutInternals },
  TableName extends DefaultSchemaTableNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
    : never = never,
> = 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
    | keyof DefaultSchema["Tables"]
    | { schema: keyof DatabaseWithoutInternals },
  TableName extends DefaultSchemaTableNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
    : never = never,
> = 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
    | keyof DefaultSchema["Enums"]
    | { schema: keyof DatabaseWithoutInternals },
  EnumName extends DefaultSchemaEnumNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"]
    : never = never,
> = DefaultSchemaEnumNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName]
  : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
    ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions]
    : never

export type CompositeTypes<
  PublicCompositeTypeNameOrOptions extends
    | keyof DefaultSchema["CompositeTypes"]
    | { schema: keyof DatabaseWithoutInternals },
  CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
    : never = never,
> = PublicCompositeTypeNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
  : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"]
    ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
    : never

export const Constants = {
  public: {
    Enums: {
      app_role: [
        "admin",
        "manager",
        "homeowner",
        "staff",
        "employee",
        "board_member",
        "arc_member",
        "fining_member",
        "legal",
        "master_board_member",
        "rv_renter",
        "rv_owner",
        "rv_boat_lot",
        "management",
        "association_management",
      ],
      fee_exclusion_mode: ["waive", "override_amount", "override_percent"],
      fee_exclusion_type: ["late_fee", "interest"],
    },
  },
} as const
