diff --git a/src/integrations/supabase/types.ts b/src/integrations/supabase/types.ts deleted file mode 100644 index 3921972..0000000 --- a/src/integrations/supabase/types.ts +++ /dev/null @@ -1,7383 +0,0 @@ -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(URL, KEY) - __InternalSupabase: { - PostgrestVersion: "14.5" - } - graphql_public: { - Tables: { - [_ in never]: never - } - Views: { - [_ in never]: never - } - Functions: { - graphql: { - Args: { - extensions?: Json - operationName?: string - query?: string - variables?: Json - } - Returns: Json - } - } - Enums: { - [_ in never]: never - } - CompositeTypes: { - [_ in never]: never - } - } - public: { - Tables: { - applicant_documents: { - Row: { - applicant_id: string - created_at: string - document_type: string | null - file_path: string - id: string - title: string | null - uploaded_by: string | null - } - Insert: { - applicant_id: string - created_at?: string - document_type?: string | null - file_path: string - id?: string - title?: string | null - uploaded_by?: string | null - } - Update: { - applicant_id?: string - created_at?: string - document_type?: string | null - file_path?: string - id?: string - title?: string | null - uploaded_by?: string | null - } - Relationships: [ - { - foreignKeyName: "applicant_documents_applicant_id_fkey" - columns: ["applicant_id"] - isOneToOne: false - referencedRelation: "applicants" - referencedColumns: ["id"] - }, - ] - } - applicant_notes: { - Row: { - applicant_id: string - author_id: string | null - body: string - created_at: string - id: string - is_confidential: boolean - } - Insert: { - applicant_id: string - author_id?: string | null - body: string - created_at?: string - id?: string - is_confidential?: boolean - } - Update: { - applicant_id?: string - author_id?: string | null - body?: string - created_at?: string - id?: string - is_confidential?: boolean - } - Relationships: [ - { - foreignKeyName: "applicant_notes_applicant_id_fkey" - columns: ["applicant_id"] - isOneToOne: false - referencedRelation: "applicants" - referencedColumns: ["id"] - }, - ] - } - applicant_stage_history: { - Row: { - applicant_id: string - changed_at: string - changed_by: string | null - from_stage_id: string | null - id: string - note: string | null - to_stage_id: string | null - } - Insert: { - applicant_id: string - changed_at?: string - changed_by?: string | null - from_stage_id?: string | null - id?: string - note?: string | null - to_stage_id?: string | null - } - Update: { - applicant_id?: string - changed_at?: string - changed_by?: string | null - from_stage_id?: string | null - id?: string - note?: string | null - to_stage_id?: string | null - } - Relationships: [ - { - foreignKeyName: "applicant_stage_history_applicant_id_fkey" - columns: ["applicant_id"] - isOneToOne: false - referencedRelation: "applicants" - referencedColumns: ["id"] - }, - { - foreignKeyName: "applicant_stage_history_from_stage_id_fkey" - columns: ["from_stage_id"] - isOneToOne: false - referencedRelation: "applicant_stages" - referencedColumns: ["id"] - }, - { - foreignKeyName: "applicant_stage_history_to_stage_id_fkey" - columns: ["to_stage_id"] - isOneToOne: false - referencedRelation: "applicant_stages" - referencedColumns: ["id"] - }, - ] - } - applicant_stages: { - Row: { - created_at: string - id: string - is_active: boolean - is_terminal: boolean - name: string - slug: string - sort_order: number - } - Insert: { - created_at?: string - id?: string - is_active?: boolean - is_terminal?: boolean - name: string - slug: string - sort_order?: number - } - Update: { - created_at?: string - id?: string - is_active?: boolean - is_terminal?: boolean - name?: string - slug?: string - sort_order?: number - } - Relationships: [] - } - applicants: { - Row: { - applied_on: string - campus_id: string | null - created_at: string - created_by: string | null - desired_pay_cents: number | null - desired_start_date: string | null - email: string | null - first_name: string - hired_on: string | null - hired_user_id: string | null - id: string - is_active: boolean - last_name: string - phone: string | null - position_applied: string - rating: number | null - resume_path: string | null - source: string | null - stage_id: string | null - updated_at: string - } - Insert: { - applied_on?: string - campus_id?: string | null - created_at?: string - created_by?: string | null - desired_pay_cents?: number | null - desired_start_date?: string | null - email?: string | null - first_name: string - hired_on?: string | null - hired_user_id?: string | null - id?: string - is_active?: boolean - last_name: string - phone?: string | null - position_applied: string - rating?: number | null - resume_path?: string | null - source?: string | null - stage_id?: string | null - updated_at?: string - } - Update: { - applied_on?: string - campus_id?: string | null - created_at?: string - created_by?: string | null - desired_pay_cents?: number | null - desired_start_date?: string | null - email?: string | null - first_name?: string - hired_on?: string | null - hired_user_id?: string | null - id?: string - is_active?: boolean - last_name?: string - phone?: string | null - position_applied?: string - rating?: number | null - resume_path?: string | null - source?: string | null - stage_id?: string | null - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "applicants_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "applicants_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "applicants_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "applicants_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "applicants_stage_id_fkey" - columns: ["stage_id"] - isOneToOne: false - referencedRelation: "applicant_stages" - referencedColumns: ["id"] - }, - ] - } - assignments: { - Row: { - category_id: string | null - class_id: string - created_at: string - created_by: string | null - date: string | null - id: string - max_points: number - name: string - } - Insert: { - category_id?: string | null - class_id: string - created_at?: string - created_by?: string | null - date?: string | null - id?: string - max_points?: number - name: string - } - Update: { - category_id?: string | null - class_id?: string - created_at?: string - created_by?: string | null - date?: string | null - id?: string - max_points?: number - name?: string - } - Relationships: [ - { - foreignKeyName: "assignments_category_id_fkey" - columns: ["category_id"] - isOneToOne: false - referencedRelation: "grade_categories" - referencedColumns: ["id"] - }, - { - foreignKeyName: "assignments_class_id_fkey" - columns: ["class_id"] - isOneToOne: false - referencedRelation: "classes" - referencedColumns: ["id"] - }, - ] - } - attendance: { - Row: { - absence_reason: string | null - campus_id: string | null - check_in_at: string | null - check_out_at: string | null - checked_in_by: string | null - checked_out_by: string | null - created_at: string - date: string - early_arrival: boolean - early_pickup: boolean - expected_arrival: string | null - expected_departure: string | null - id: string - is_manual_override: boolean - late_arrival: boolean - late_pickup: boolean - note: string | null - override_reason: string | null - recorded_by: string | null - status: Database["public"]["Enums"]["attendance_status"] - student_id: string - updated_at: string - was_scheduled: boolean - } - Insert: { - absence_reason?: string | null - campus_id?: string | null - check_in_at?: string | null - check_out_at?: string | null - checked_in_by?: string | null - checked_out_by?: string | null - created_at?: string - date: string - early_arrival?: boolean - early_pickup?: boolean - expected_arrival?: string | null - expected_departure?: string | null - id?: string - is_manual_override?: boolean - late_arrival?: boolean - late_pickup?: boolean - note?: string | null - override_reason?: string | null - recorded_by?: string | null - status?: Database["public"]["Enums"]["attendance_status"] - student_id: string - updated_at?: string - was_scheduled?: boolean - } - Update: { - absence_reason?: string | null - campus_id?: string | null - check_in_at?: string | null - check_out_at?: string | null - checked_in_by?: string | null - checked_out_by?: string | null - created_at?: string - date?: string - early_arrival?: boolean - early_pickup?: boolean - expected_arrival?: string | null - expected_departure?: string | null - id?: string - is_manual_override?: boolean - late_arrival?: boolean - late_pickup?: boolean - note?: string | null - override_reason?: string | null - recorded_by?: string | null - status?: Database["public"]["Enums"]["attendance_status"] - student_id?: string - updated_at?: string - was_scheduled?: boolean - } - Relationships: [ - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "attendance_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "attendance_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - attendance_overrides: { - Row: { - attendance_id: string - changed_at: string - changed_by: string | null - field: string - id: number - new_value: string | null - original_value: string | null - reason: string | null - student_id: string - } - Insert: { - attendance_id: string - changed_at?: string - changed_by?: string | null - field: string - id?: never - new_value?: string | null - original_value?: string | null - reason?: string | null - student_id: string - } - Update: { - attendance_id?: string - changed_at?: string - changed_by?: string | null - field?: string - id?: never - new_value?: string | null - original_value?: string | null - reason?: string | null - student_id?: string - } - Relationships: [ - { - foreignKeyName: "attendance_overrides_attendance_id_fkey" - columns: ["attendance_id"] - isOneToOne: false - referencedRelation: "attendance" - referencedColumns: ["id"] - }, - { - foreignKeyName: "attendance_overrides_attendance_id_fkey" - columns: ["attendance_id"] - isOneToOne: false - referencedRelation: "v_attendance_detail" - referencedColumns: ["attendance_id"] - }, - { - foreignKeyName: "attendance_overrides_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "attendance_overrides_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - audit_log: { - Row: { - action: string - actor_id: string | null - changed_columns: string[] | null - id: number - new_data: Json | null - occurred_at: string - old_data: Json | null - record_id: string | null - table_name: string - } - Insert: { - action: string - actor_id?: string | null - changed_columns?: string[] | null - id?: never - new_data?: Json | null - occurred_at?: string - old_data?: Json | null - record_id?: string | null - table_name: string - } - Update: { - action?: string - actor_id?: string | null - changed_columns?: string[] | null - id?: never - new_data?: Json | null - occurred_at?: string - old_data?: Json | null - record_id?: string | null - table_name?: string - } - Relationships: [] - } - authorized_pickups: { - Row: { - alt_phone: string | null - created_at: string - id: string - is_authorized: boolean - kind: string - name: string - notes: string | null - parenting_plan_id: string | null - phone: string | null - relationship: string | null - restriction_reason: string | null - sort_order: number - student_id: string - } - Insert: { - alt_phone?: string | null - created_at?: string - id?: string - is_authorized?: boolean - kind?: string - name: string - notes?: string | null - parenting_plan_id?: string | null - phone?: string | null - relationship?: string | null - restriction_reason?: string | null - sort_order?: number - student_id: string - } - Update: { - alt_phone?: string | null - created_at?: string - id?: string - is_authorized?: boolean - kind?: string - name?: string - notes?: string | null - parenting_plan_id?: string | null - phone?: string | null - relationship?: string | null - restriction_reason?: string | null - sort_order?: number - student_id?: string - } - Relationships: [ - { - foreignKeyName: "authorized_pickups_parenting_plan_id_fkey" - columns: ["parenting_plan_id"] - isOneToOne: false - referencedRelation: "parenting_plans" - referencedColumns: ["id"] - }, - { - foreignKeyName: "authorized_pickups_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "authorized_pickups_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - billing_settings: { - Row: { - auto_assess_penalties: boolean - default_due_days: number - early_dropoff_fee_cents: number - id: boolean - invoice_number_prefix: string - late_pickup_fee_cents: number - legacy_attendance_autocharge: boolean - updated_at: string - } - Insert: { - auto_assess_penalties?: boolean - default_due_days?: number - early_dropoff_fee_cents?: number - id?: boolean - invoice_number_prefix?: string - late_pickup_fee_cents?: number - legacy_attendance_autocharge?: boolean - updated_at?: string - } - Update: { - auto_assess_penalties?: boolean - default_due_days?: number - early_dropoff_fee_cents?: number - id?: boolean - invoice_number_prefix?: string - late_pickup_fee_cents?: number - legacy_attendance_autocharge?: boolean - updated_at?: string - } - Relationships: [] - } - calendar_events: { - Row: { - all_day: boolean - campus_id: string | null - created_at: string - created_by: string | null - date: string - description: string | null - end_date: string | null - end_time: string | null - event_type: string - id: string - is_admin_only: boolean - start_time: string | null - title: string - visible_to_roles: Database["public"]["Enums"]["app_role"][] - } - Insert: { - all_day?: boolean - campus_id?: string | null - created_at?: string - created_by?: string | null - date: string - description?: string | null - end_date?: string | null - end_time?: string | null - event_type?: string - id?: string - is_admin_only?: boolean - start_time?: string | null - title: string - visible_to_roles?: Database["public"]["Enums"]["app_role"][] - } - Update: { - all_day?: boolean - campus_id?: string | null - created_at?: string - created_by?: string | null - date?: string - description?: string | null - end_date?: string | null - end_time?: string | null - event_type?: string - id?: string - is_admin_only?: boolean - start_time?: string | null - title?: string - visible_to_roles?: Database["public"]["Enums"]["app_role"][] - } - Relationships: [ - { - foreignKeyName: "calendar_events_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "calendar_events_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "calendar_events_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "calendar_events_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - campus_programs: { - Row: { - campus_id: string - created_at: string - description: string | null - id: string - is_active: boolean - max_age_months: number | null - min_age_months: number | null - name: string - } - Insert: { - campus_id: string - created_at?: string - description?: string | null - id?: string - is_active?: boolean - max_age_months?: number | null - min_age_months?: number | null - name: string - } - Update: { - campus_id?: string - created_at?: string - description?: string | null - id?: string - is_active?: boolean - max_age_months?: number | null - min_age_months?: number | null - name?: string - } - Relationships: [ - { - foreignKeyName: "campus_programs_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "campus_programs_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "campus_programs_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "campus_programs_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - campuses: { - Row: { - campus_type: string | null - code: string | null - created_at: string - created_by: string | null - early_dropoff_time: string | null - email: string | null - grade_levels_served: string[] - id: string - is_active: boolean - late_pickup_cutoff: string | null - mailing_city: string | null - mailing_country: string | null - mailing_postal_code: string | null - mailing_state: string | null - mailing_street1: string | null - mailing_street2: string | null - max_age_months: number | null - min_age_months: number | null - name: string - notes: string | null - operating_hours: Json - phone: string | null - physical_city: string | null - physical_country: string - physical_postal_code: string | null - physical_state: string | null - physical_street1: string | null - physical_street2: string | null - standard_dismissal_time: string | null - standard_start_time: string | null - student_capacity: number | null - timezone: string - updated_at: string - } - Insert: { - campus_type?: string | null - code?: string | null - created_at?: string - created_by?: string | null - early_dropoff_time?: string | null - email?: string | null - grade_levels_served?: string[] - id?: string - is_active?: boolean - late_pickup_cutoff?: string | null - mailing_city?: string | null - mailing_country?: string | null - mailing_postal_code?: string | null - mailing_state?: string | null - mailing_street1?: string | null - mailing_street2?: string | null - max_age_months?: number | null - min_age_months?: number | null - name: string - notes?: string | null - operating_hours?: Json - phone?: string | null - physical_city?: string | null - physical_country?: string - physical_postal_code?: string | null - physical_state?: string | null - physical_street1?: string | null - physical_street2?: string | null - standard_dismissal_time?: string | null - standard_start_time?: string | null - student_capacity?: number | null - timezone?: string - updated_at?: string - } - Update: { - campus_type?: string | null - code?: string | null - created_at?: string - created_by?: string | null - early_dropoff_time?: string | null - email?: string | null - grade_levels_served?: string[] - id?: string - is_active?: boolean - late_pickup_cutoff?: string | null - mailing_city?: string | null - mailing_country?: string | null - mailing_postal_code?: string | null - mailing_state?: string | null - mailing_street1?: string | null - mailing_street2?: string | null - max_age_months?: number | null - min_age_months?: number | null - name?: string - notes?: string | null - operating_hours?: Json - phone?: string | null - physical_city?: string | null - physical_country?: string - physical_postal_code?: string | null - physical_state?: string | null - physical_street1?: string | null - physical_street2?: string | null - standard_dismissal_time?: string | null - standard_start_time?: string | null - student_capacity?: number | null - timezone?: string - updated_at?: string - } - Relationships: [] - } - certification_types: { - Row: { - created_at: string - description: string | null - id: string - is_active: boolean - issuing_body: string | null - name: string - renewal_reminder_days: number - slug: string - validity_months: number | null - } - Insert: { - created_at?: string - description?: string | null - id?: string - is_active?: boolean - issuing_body?: string | null - name: string - renewal_reminder_days?: number - slug: string - validity_months?: number | null - } - Update: { - created_at?: string - description?: string | null - id?: string - is_active?: boolean - issuing_body?: string | null - name?: string - renewal_reminder_days?: number - slug?: string - validity_months?: number | null - } - Relationships: [] - } - classes: { - Row: { - created_at: string - id: string - name: string - teacher_id: string | null - } - Insert: { - created_at?: string - id?: string - name: string - teacher_id?: string | null - } - Update: { - created_at?: string - id?: string - name?: string - teacher_id?: string | null - } - Relationships: [] - } - compliance_requirements: { - Row: { - applies_to_roles: Database["public"]["Enums"]["app_role"][] - campus_id: string | null - certification_type_id: string - created_at: string - grace_period_days: number - id: string - is_mandatory: boolean - notes: string | null - } - Insert: { - applies_to_roles?: Database["public"]["Enums"]["app_role"][] - campus_id?: string | null - certification_type_id: string - created_at?: string - grace_period_days?: number - id?: string - is_mandatory?: boolean - notes?: string | null - } - Update: { - applies_to_roles?: Database["public"]["Enums"]["app_role"][] - campus_id?: string | null - certification_type_id?: string - created_at?: string - grace_period_days?: number - id?: string - is_mandatory?: boolean - notes?: string | null - } - Relationships: [ - { - foreignKeyName: "compliance_requirements_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "compliance_requirements_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "compliance_requirements_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "compliance_requirements_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "compliance_requirements_certification_type_id_fkey" - columns: ["certification_type_id"] - isOneToOne: false - referencedRelation: "certification_types" - referencedColumns: ["id"] - }, - ] - } - contracts: { - Row: { - created_at: string - file_path: string - id: string - student_id: string - title: string | null - uploaded_by: string | null - } - Insert: { - created_at?: string - file_path: string - id?: string - student_id: string - title?: string | null - uploaded_by?: string | null - } - Update: { - created_at?: string - file_path?: string - id?: string - student_id?: string - title?: string | null - uploaded_by?: string | null - } - Relationships: [ - { - foreignKeyName: "contracts_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "contracts_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - deletion_requests: { - Row: { - id: string - reason: string - record_id: string - requested_at: string - requested_by: string | null - review_note: string | null - reviewed_at: string | null - reviewed_by: string | null - status: string - table_name: string - } - Insert: { - id?: string - reason: string - record_id: string - requested_at?: string - requested_by?: string | null - review_note?: string | null - reviewed_at?: string | null - reviewed_by?: string | null - status?: string - table_name: string - } - Update: { - id?: string - reason?: string - record_id?: string - requested_at?: string - requested_by?: string | null - review_note?: string | null - reviewed_at?: string | null - reviewed_by?: string | null - status?: string - table_name?: string - } - Relationships: [] - } - form_responses: { - Row: { - data_json: Json - form_id: string - id: string - student_id: string | null - submitted_at: string - submitted_by: string - } - Insert: { - data_json?: Json - form_id: string - id?: string - student_id?: string | null - submitted_at?: string - submitted_by: string - } - Update: { - data_json?: Json - form_id?: string - id?: string - student_id?: string | null - submitted_at?: string - submitted_by?: string - } - Relationships: [ - { - foreignKeyName: "form_responses_form_id_fkey" - columns: ["form_id"] - isOneToOne: false - referencedRelation: "forms" - referencedColumns: ["id"] - }, - { - foreignKeyName: "form_responses_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "form_responses_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - forms: { - Row: { - active: boolean - created_at: string - created_by: string | null - description: string | null - id: string - schema_json: Json - title: string - } - Insert: { - active?: boolean - created_at?: string - created_by?: string | null - description?: string | null - id?: string - schema_json?: Json - title: string - } - Update: { - active?: boolean - created_at?: string - created_by?: string | null - description?: string | null - id?: string - schema_json?: Json - title?: string - } - Relationships: [] - } - grade_categories: { - Row: { - class_id: string | null - created_at: string - id: string - name: string - sort_order: number - weight: number - } - Insert: { - class_id?: string | null - created_at?: string - id?: string - name: string - sort_order?: number - weight?: number - } - Update: { - class_id?: string | null - created_at?: string - id?: string - name?: string - sort_order?: number - weight?: number - } - Relationships: [ - { - foreignKeyName: "grade_categories_class_id_fkey" - columns: ["class_id"] - isOneToOne: false - referencedRelation: "classes" - referencedColumns: ["id"] - }, - ] - } - grade_scale: { - Row: { - class_id: string | null - created_at: string - id: string - letter: string - min_percent: number - } - Insert: { - class_id?: string | null - created_at?: string - id?: string - letter: string - min_percent: number - } - Update: { - class_id?: string | null - created_at?: string - id?: string - letter?: string - min_percent?: number - } - Relationships: [ - { - foreignKeyName: "grade_scale_class_id_fkey" - columns: ["class_id"] - isOneToOne: false - referencedRelation: "classes" - referencedColumns: ["id"] - }, - ] - } - grades: { - Row: { - assignment_id: string - created_at: string - id: string - points: number | null - student_id: string - updated_at: string - } - Insert: { - assignment_id: string - created_at?: string - id?: string - points?: number | null - student_id: string - updated_at?: string - } - Update: { - assignment_id?: string - created_at?: string - id?: string - points?: number | null - student_id?: string - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "grades_assignment_id_fkey" - columns: ["assignment_id"] - isOneToOne: false - referencedRelation: "assignments" - referencedColumns: ["id"] - }, - { - foreignKeyName: "grades_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "grades_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - household_member_contacts: { - Row: { - created_at: string - id: string - is_primary: boolean - kind: string - label: string | null - member_id: string - value: string - } - Insert: { - created_at?: string - id?: string - is_primary?: boolean - kind: string - label?: string | null - member_id: string - value: string - } - Update: { - created_at?: string - id?: string - is_primary?: boolean - kind?: string - label?: string | null - member_id?: string - value?: string - } - Relationships: [ - { - foreignKeyName: "household_member_contacts_member_id_fkey" - columns: ["member_id"] - isOneToOne: false - referencedRelation: "household_members" - referencedColumns: ["id"] - }, - ] - } - household_members: { - Row: { - billing_share_percent: number | null - can_pick_up: boolean - can_view_records: boolean - city: string | null - communication_allowed: boolean - created_at: string - emergency_priority: number | null - first_name: string - household_id: string - id: string - is_billing_responsible: boolean - is_emergency_contact: boolean - last_name: string - notes: string | null - postal_code: string | null - preferred_contact_method: string - receives_invoices: boolean - relationship: string | null - restricted_record_categories: string[] - state: string | null - street1: string | null - street2: string | null - updated_at: string - user_id: string | null - } - Insert: { - billing_share_percent?: number | null - can_pick_up?: boolean - can_view_records?: boolean - city?: string | null - communication_allowed?: boolean - created_at?: string - emergency_priority?: number | null - first_name: string - household_id: string - id?: string - is_billing_responsible?: boolean - is_emergency_contact?: boolean - last_name: string - notes?: string | null - postal_code?: string | null - preferred_contact_method?: string - receives_invoices?: boolean - relationship?: string | null - restricted_record_categories?: string[] - state?: string | null - street1?: string | null - street2?: string | null - updated_at?: string - user_id?: string | null - } - Update: { - billing_share_percent?: number | null - can_pick_up?: boolean - can_view_records?: boolean - city?: string | null - communication_allowed?: boolean - created_at?: string - emergency_priority?: number | null - first_name?: string - household_id?: string - id?: string - is_billing_responsible?: boolean - is_emergency_contact?: boolean - last_name?: string - notes?: string | null - postal_code?: string | null - preferred_contact_method?: string - receives_invoices?: boolean - relationship?: string | null - restricted_record_categories?: string[] - state?: string | null - street1?: string | null - street2?: string | null - updated_at?: string - user_id?: string | null - } - Relationships: [ - { - foreignKeyName: "household_members_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "household_members_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - ] - } - household_students: { - Row: { - created_at: string - household_id: string - id: string - is_primary_household: boolean - student_id: string - } - Insert: { - created_at?: string - household_id: string - id?: string - is_primary_household?: boolean - student_id: string - } - Update: { - created_at?: string - household_id?: string - id?: string - is_primary_household?: boolean - student_id?: string - } - Relationships: [ - { - foreignKeyName: "household_students_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "household_students_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - { - foreignKeyName: "household_students_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "household_students_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - households: { - Row: { - billing_email: string | null - city: string | null - communicate_separately: boolean - country: string - created_at: string - created_by: string | null - id: string - name: string - notes: string | null - phone: string | null - postal_code: string | null - state: string | null - street1: string | null - street2: string | null - updated_at: string - } - Insert: { - billing_email?: string | null - city?: string | null - communicate_separately?: boolean - country?: string - created_at?: string - created_by?: string | null - id?: string - name: string - notes?: string | null - phone?: string | null - postal_code?: string | null - state?: string | null - street1?: string | null - street2?: string | null - updated_at?: string - } - Update: { - billing_email?: string | null - city?: string | null - communicate_separately?: boolean - country?: string - created_at?: string - created_by?: string | null - id?: string - name?: string - notes?: string | null - phone?: string | null - postal_code?: string | null - state?: string | null - street1?: string | null - street2?: string | null - updated_at?: string - } - Relationships: [] - } - intake_tokens: { - Row: { - created_at: string - created_by: string | null - expires_at: string - id: string - student_id: string - token: string - used_at: string | null - } - Insert: { - created_at?: string - created_by?: string | null - expires_at: string - id?: string - student_id: string - token: string - used_at?: string | null - } - Update: { - created_at?: string - created_by?: string | null - expires_at?: string - id?: string - student_id?: string - token?: string - used_at?: string | null - } - Relationships: [ - { - foreignKeyName: "intake_tokens_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "intake_tokens_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - integration_sync_logs: { - Row: { - detail: Json - error_message: string | null - finished_at: string | null - id: number - integration_id: string - records_processed: number - started_at: string - status: string - } - Insert: { - detail?: Json - error_message?: string | null - finished_at?: string | null - id?: never - integration_id: string - records_processed?: number - started_at?: string - status?: string - } - Update: { - detail?: Json - error_message?: string | null - finished_at?: string | null - id?: never - integration_id?: string - records_processed?: number - started_at?: string - status?: string - } - Relationships: [ - { - foreignKeyName: "integration_sync_logs_integration_id_fkey" - columns: ["integration_id"] - isOneToOne: false - referencedRelation: "integrations" - referencedColumns: ["id"] - }, - ] - } - integrations: { - Row: { - campus_id: string | null - category: string - config: Json - created_at: string - created_by: string | null - credential_ref: string | null - id: string - is_active: boolean - last_sync_at: string | null - last_sync_status: string | null - name: string - provider: string - updated_at: string - } - Insert: { - campus_id?: string | null - category?: string - config?: Json - created_at?: string - created_by?: string | null - credential_ref?: string | null - id?: string - is_active?: boolean - last_sync_at?: string | null - last_sync_status?: string | null - name: string - provider: string - updated_at?: string - } - Update: { - campus_id?: string | null - category?: string - config?: Json - created_at?: string - created_by?: string | null - credential_ref?: string | null - id?: string - is_active?: boolean - last_sync_at?: string | null - last_sync_status?: string | null - name?: string - provider?: string - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "integrations_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "integrations_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "integrations_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "integrations_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - invoice_batches: { - Row: { - billing_period_end: string - billing_period_start: string - confirmed_at: string | null - confirmed_by: string | null - created_at: string - created_by: string | null - criteria: Json - id: string - name: string | null - previewed_at: string | null - previewed_by: string | null - status: string - student_count: number - total_cents: number - } - Insert: { - billing_period_end: string - billing_period_start: string - confirmed_at?: string | null - confirmed_by?: string | null - created_at?: string - created_by?: string | null - criteria?: Json - id?: string - name?: string | null - previewed_at?: string | null - previewed_by?: string | null - status?: string - student_count?: number - total_cents?: number - } - Update: { - billing_period_end?: string - billing_period_start?: string - confirmed_at?: string | null - confirmed_by?: string | null - created_at?: string - created_by?: string | null - criteria?: Json - id?: string - name?: string | null - previewed_at?: string | null - previewed_by?: string | null - status?: string - student_count?: number - total_cents?: number - } - Relationships: [] - } - invoice_documents: { - Row: { - created_at: string - file_path: string - id: string - invoice_id: string - title: string | null - uploaded_by: string | null - } - Insert: { - created_at?: string - file_path: string - id?: string - invoice_id: string - title?: string | null - uploaded_by?: string | null - } - Update: { - created_at?: string - file_path?: string - id?: string - invoice_id?: string - title?: string | null - uploaded_by?: string | null - } - Relationships: [ - { - foreignKeyName: "invoice_documents_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "invoices" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoice_documents_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "v_billing_detail" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "invoice_documents_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "v_outstanding_invoices" - referencedColumns: ["invoice_id"] - }, - ] - } - invoice_line_items: { - Row: { - adjustment_rule_id: string | null - amount_cents: number - campus_id: string | null - credit_id: string | null - description: string - detail: Json - id: string - invoice_id: string - line_kind: string - quantity: number - scholarship_id: string | null - sort_order: number - tuition_rate_id: string | null - unit_amount_cents: number - } - Insert: { - adjustment_rule_id?: string | null - amount_cents: number - campus_id?: string | null - credit_id?: string | null - description: string - detail?: Json - id?: string - invoice_id: string - line_kind: string - quantity?: number - scholarship_id?: string | null - sort_order?: number - tuition_rate_id?: string | null - unit_amount_cents?: number - } - Update: { - adjustment_rule_id?: string | null - amount_cents?: number - campus_id?: string | null - credit_id?: string | null - description?: string - detail?: Json - id?: string - invoice_id?: string - line_kind?: string - quantity?: number - scholarship_id?: string | null - sort_order?: number - tuition_rate_id?: string | null - unit_amount_cents?: number - } - Relationships: [ - { - foreignKeyName: "invoice_line_items_adjustment_rule_id_fkey" - columns: ["adjustment_rule_id"] - isOneToOne: false - referencedRelation: "tuition_adjustment_rules" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoice_line_items_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoice_line_items_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "invoice_line_items_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "invoice_line_items_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "invoice_line_items_credit_id_fkey" - columns: ["credit_id"] - isOneToOne: false - referencedRelation: "student_credits" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoice_line_items_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "invoices" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoice_line_items_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "v_billing_detail" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "invoice_line_items_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "v_outstanding_invoices" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "invoice_line_items_scholarship_id_fkey" - columns: ["scholarship_id"] - isOneToOne: false - referencedRelation: "scholarships" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoice_line_items_tuition_rate_id_fkey" - columns: ["tuition_rate_id"] - isOneToOne: false - referencedRelation: "tuition_rates" - referencedColumns: ["id"] - }, - ] - } - invoices: { - Row: { - amount_paid_cents: number - attendance_basis: string | null - balance_due_cents: number | null - batch_id: string | null - billing_period_end: string - billing_period_start: string - calculation_log: Json - campus_id: string | null - created_at: string - credits_cents: number - discounts_cents: number - due_date: string - household_id: string | null - id: string - invoice_date: string - invoice_number: string - issued_at: string | null - issued_by: string | null - notes: string | null - payment_plan_id: string | null - payment_type: string | null - penalties_cents: number - requires_signature: boolean - scheduled_days: number | null - scholarship_cents: number - signature_data: string | null - signed_at: string | null - signed_by: string | null - status: string - student_id: string - subtotal_cents: number - total_cents: number - tuition_tier_id: string | null - updated_at: string - } - Insert: { - amount_paid_cents?: number - attendance_basis?: string | null - balance_due_cents?: number | null - batch_id?: string | null - billing_period_end: string - billing_period_start: string - calculation_log?: Json - campus_id?: string | null - created_at?: string - credits_cents?: number - discounts_cents?: number - due_date?: string - household_id?: string | null - id?: string - invoice_date?: string - invoice_number: string - issued_at?: string | null - issued_by?: string | null - notes?: string | null - payment_plan_id?: string | null - payment_type?: string | null - penalties_cents?: number - requires_signature?: boolean - scheduled_days?: number | null - scholarship_cents?: number - signature_data?: string | null - signed_at?: string | null - signed_by?: string | null - status?: string - student_id: string - subtotal_cents?: number - total_cents?: number - tuition_tier_id?: string | null - updated_at?: string - } - Update: { - amount_paid_cents?: number - attendance_basis?: string | null - balance_due_cents?: number | null - batch_id?: string | null - billing_period_end?: string - billing_period_start?: string - calculation_log?: Json - campus_id?: string | null - created_at?: string - credits_cents?: number - discounts_cents?: number - due_date?: string - household_id?: string | null - id?: string - invoice_date?: string - invoice_number?: string - issued_at?: string | null - issued_by?: string | null - notes?: string | null - payment_plan_id?: string | null - payment_type?: string | null - penalties_cents?: number - requires_signature?: boolean - scheduled_days?: number | null - scholarship_cents?: number - signature_data?: string | null - signed_at?: string | null - signed_by?: string | null - status?: string - student_id?: string - subtotal_cents?: number - total_cents?: number - tuition_tier_id?: string | null - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "invoices_batch_fk" - columns: ["batch_id"] - isOneToOne: false - referencedRelation: "invoice_batches" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "invoices_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - { - foreignKeyName: "invoices_payment_plan_id_fkey" - columns: ["payment_plan_id"] - isOneToOne: false - referencedRelation: "payment_plans" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - { - foreignKeyName: "invoices_tuition_tier_id_fkey" - columns: ["tuition_tier_id"] - isOneToOne: false - referencedRelation: "tuition_tiers" - referencedColumns: ["id"] - }, - ] - } - ledger_entries: { - Row: { - amount_cents: number - attendance_id: string | null - category: Database["public"]["Enums"]["ledger_category"] - created_at: string - created_by: string | null - date: string - id: string - kind: Database["public"]["Enums"]["ledger_kind"] - note: string | null - student_id: string - } - Insert: { - amount_cents: number - attendance_id?: string | null - category?: Database["public"]["Enums"]["ledger_category"] - created_at?: string - created_by?: string | null - date?: string - id?: string - kind: Database["public"]["Enums"]["ledger_kind"] - note?: string | null - student_id: string - } - Update: { - amount_cents?: number - attendance_id?: string | null - category?: Database["public"]["Enums"]["ledger_category"] - created_at?: string - created_by?: string | null - date?: string - id?: string - kind?: Database["public"]["Enums"]["ledger_kind"] - note?: string | null - student_id?: string - } - Relationships: [ - { - foreignKeyName: "ledger_entries_attendance_id_fkey" - columns: ["attendance_id"] - isOneToOne: true - referencedRelation: "attendance" - referencedColumns: ["id"] - }, - { - foreignKeyName: "ledger_entries_attendance_id_fkey" - columns: ["attendance_id"] - isOneToOne: true - referencedRelation: "v_attendance_detail" - referencedColumns: ["attendance_id"] - }, - { - foreignKeyName: "ledger_entries_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "ledger_entries_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - mail_server_settings: { - Row: { - id: boolean - imap_host: string - imap_port: number - imap_secure: boolean - smtp_host: string - smtp_port: number - smtp_secure: boolean - updated_at: string - updated_by: string | null - } - Insert: { - id?: boolean - imap_host: string - imap_port?: number - imap_secure?: boolean - smtp_host: string - smtp_port?: number - smtp_secure?: boolean - updated_at?: string - updated_by?: string | null - } - Update: { - id?: boolean - imap_host?: string - imap_port?: number - imap_secure?: boolean - smtp_host?: string - smtp_port?: number - smtp_secure?: boolean - updated_at?: string - updated_by?: string | null - } - Relationships: [] - } - message_threads: { - Row: { - created_at: string - created_by: string - id: string - student_id: string | null - subject: string | null - updated_at: string - } - Insert: { - created_at?: string - created_by: string - id?: string - student_id?: string | null - subject?: string | null - updated_at?: string - } - Update: { - created_at?: string - created_by?: string - id?: string - student_id?: string | null - subject?: string | null - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "message_threads_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "message_threads_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - messages: { - Row: { - body: string - created_at: string - id: string - sender_id: string - thread_id: string - } - Insert: { - body: string - created_at?: string - id?: string - sender_id: string - thread_id: string - } - Update: { - body?: string - created_at?: string - id?: string - sender_id?: string - thread_id?: string - } - Relationships: [ - { - foreignKeyName: "messages_thread_id_fkey" - columns: ["thread_id"] - isOneToOne: false - referencedRelation: "message_threads" - referencedColumns: ["id"] - }, - ] - } - note_categories: { - Row: { - created_at: string - default_visible_to_roles: Database["public"]["Enums"]["app_role"][] - description: string | null - id: string - is_active: boolean - is_confidential: boolean - name: string - slug: string - sort_order: number - } - Insert: { - created_at?: string - default_visible_to_roles?: Database["public"]["Enums"]["app_role"][] - description?: string | null - id?: string - is_active?: boolean - is_confidential?: boolean - name: string - slug: string - sort_order?: number - } - Update: { - created_at?: string - default_visible_to_roles?: Database["public"]["Enums"]["app_role"][] - description?: string | null - id?: string - is_active?: boolean - is_confidential?: boolean - name?: string - slug?: string - sort_order?: number - } - Relationships: [] - } - parent_students: { - Row: { - created_at: string - id: string - parent_id: string - relationship: string | null - student_id: string - } - Insert: { - created_at?: string - id?: string - parent_id: string - relationship?: string | null - student_id: string - } - Update: { - created_at?: string - id?: string - parent_id?: string - relationship?: string | null - student_id?: string - } - Relationships: [ - { - foreignKeyName: "parent_students_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "parent_students_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - parenting_plans: { - Row: { - created_at: string - created_by: string | null - description: string | null - document_path: string | null - effective_date: string - expiration_date: string | null - household_id: string | null - id: string - is_court_ordered: boolean - restricts_billing: boolean - restricts_communication: boolean - restricts_pickup: boolean - restricts_record_access: boolean - student_id: string - title: string - updated_at: string - } - Insert: { - created_at?: string - created_by?: string | null - description?: string | null - document_path?: string | null - effective_date?: string - expiration_date?: string | null - household_id?: string | null - id?: string - is_court_ordered?: boolean - restricts_billing?: boolean - restricts_communication?: boolean - restricts_pickup?: boolean - restricts_record_access?: boolean - student_id: string - title: string - updated_at?: string - } - Update: { - created_at?: string - created_by?: string | null - description?: string | null - document_path?: string | null - effective_date?: string - expiration_date?: string | null - household_id?: string | null - id?: string - is_court_ordered?: boolean - restricts_billing?: boolean - restricts_communication?: boolean - restricts_pickup?: boolean - restricts_record_access?: boolean - student_id?: string - title?: string - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "parenting_plans_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "parenting_plans_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - { - foreignKeyName: "parenting_plans_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "parenting_plans_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - payment_allocations: { - Row: { - allocated_at: string - allocated_by: string | null - amount_cents: number - id: string - invoice_id: string - payment_id: string - } - Insert: { - allocated_at?: string - allocated_by?: string | null - amount_cents: number - id?: string - invoice_id: string - payment_id: string - } - Update: { - allocated_at?: string - allocated_by?: string | null - amount_cents?: number - id?: string - invoice_id?: string - payment_id?: string - } - Relationships: [ - { - foreignKeyName: "payment_allocations_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "invoices" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payment_allocations_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "v_billing_detail" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "payment_allocations_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "v_outstanding_invoices" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "payment_allocations_payment_id_fkey" - columns: ["payment_id"] - isOneToOne: false - referencedRelation: "payments" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payment_allocations_payment_id_fkey" - columns: ["payment_id"] - isOneToOne: false - referencedRelation: "v_payment_detail" - referencedColumns: ["payment_id"] - }, - ] - } - payment_plans: { - Row: { - autopay_authorized: boolean - campus_id: string | null - created_at: string - created_by: string | null - day_of_period: number | null - down_payment_cents: number - end_date: string | null - frequency: string - grace_period_days: number - household_id: string | null - id: string - installment_amount_cents: number - installment_count: number | null - late_fee_cents: number - missed_payment_action: string | null - name: string - notes: string | null - payment_method: string | null - scholarship_contribution_cents: number - start_date: string - status: string - student_id: string | null - total_obligation_cents: number | null - updated_at: string - } - Insert: { - autopay_authorized?: boolean - campus_id?: string | null - created_at?: string - created_by?: string | null - day_of_period?: number | null - down_payment_cents?: number - end_date?: string | null - frequency?: string - grace_period_days?: number - household_id?: string | null - id?: string - installment_amount_cents: number - installment_count?: number | null - late_fee_cents?: number - missed_payment_action?: string | null - name: string - notes?: string | null - payment_method?: string | null - scholarship_contribution_cents?: number - start_date?: string - status?: string - student_id?: string | null - total_obligation_cents?: number | null - updated_at?: string - } - Update: { - autopay_authorized?: boolean - campus_id?: string | null - created_at?: string - created_by?: string | null - day_of_period?: number | null - down_payment_cents?: number - end_date?: string | null - frequency?: string - grace_period_days?: number - household_id?: string | null - id?: string - installment_amount_cents?: number - installment_count?: number | null - late_fee_cents?: number - missed_payment_action?: string | null - name?: string - notes?: string | null - payment_method?: string | null - scholarship_contribution_cents?: number - start_date?: string - status?: string - student_id?: string | null - total_obligation_cents?: number | null - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "payment_plans_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payment_plans_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "payment_plans_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "payment_plans_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "payment_plans_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payment_plans_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - { - foreignKeyName: "payment_plans_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payment_plans_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - payments: { - Row: { - amount_cents: number - campus_id: string | null - created_at: string - document_path: string | null - effective_date: string - household_id: string | null - id: string - kind: string - method: string - notes: string | null - payer_name: string | null - received_at: string - received_by: string | null - reference_number: string | null - reverses_payment_id: string | null - scholarship_id: string | null - status: string - student_id: string | null - third_party_name: string | null - updated_at: string - void_reason: string | null - } - Insert: { - amount_cents: number - campus_id?: string | null - created_at?: string - document_path?: string | null - effective_date?: string - household_id?: string | null - id?: string - kind?: string - method: string - notes?: string | null - payer_name?: string | null - received_at?: string - received_by?: string | null - reference_number?: string | null - reverses_payment_id?: string | null - scholarship_id?: string | null - status?: string - student_id?: string | null - third_party_name?: string | null - updated_at?: string - void_reason?: string | null - } - Update: { - amount_cents?: number - campus_id?: string | null - created_at?: string - document_path?: string | null - effective_date?: string - household_id?: string | null - id?: string - kind?: string - method?: string - notes?: string | null - payer_name?: string | null - received_at?: string - received_by?: string | null - reference_number?: string | null - reverses_payment_id?: string | null - scholarship_id?: string | null - status?: string - student_id?: string | null - third_party_name?: string | null - updated_at?: string - void_reason?: string | null - } - Relationships: [ - { - foreignKeyName: "payments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "payments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "payments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "payments_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - { - foreignKeyName: "payments_reverses_payment_id_fkey" - columns: ["reverses_payment_id"] - isOneToOne: false - referencedRelation: "payments" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_reverses_payment_id_fkey" - columns: ["reverses_payment_id"] - isOneToOne: false - referencedRelation: "v_payment_detail" - referencedColumns: ["payment_id"] - }, - { - foreignKeyName: "payments_scholarship_id_fkey" - columns: ["scholarship_id"] - isOneToOne: false - referencedRelation: "scholarships" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - penalty_events: { - Row: { - approved_at: string | null - approved_by: string | null - attendance_id: string | null - campus_id: string | null - computed_fee_cents: number - created_at: string - event_type: string - final_fee_cents: number - id: string - invoice_id: string | null - is_waived: boolean - minutes_over: number - notes: string | null - notification_method: string | null - occurred_on: string - override_reason: string | null - parent_notified_at: string | null - recorded_by: string | null - rule_id: string | null - student_id: string - updated_at: string - waived_at: string | null - waived_by: string | null - waiver_reason: string | null - } - Insert: { - approved_at?: string | null - approved_by?: string | null - attendance_id?: string | null - campus_id?: string | null - computed_fee_cents?: number - created_at?: string - event_type: string - final_fee_cents?: number - id?: string - invoice_id?: string | null - is_waived?: boolean - minutes_over?: number - notes?: string | null - notification_method?: string | null - occurred_on?: string - override_reason?: string | null - parent_notified_at?: string | null - recorded_by?: string | null - rule_id?: string | null - student_id: string - updated_at?: string - waived_at?: string | null - waived_by?: string | null - waiver_reason?: string | null - } - Update: { - approved_at?: string | null - approved_by?: string | null - attendance_id?: string | null - campus_id?: string | null - computed_fee_cents?: number - created_at?: string - event_type?: string - final_fee_cents?: number - id?: string - invoice_id?: string | null - is_waived?: boolean - minutes_over?: number - notes?: string | null - notification_method?: string | null - occurred_on?: string - override_reason?: string | null - parent_notified_at?: string | null - recorded_by?: string | null - rule_id?: string | null - student_id?: string - updated_at?: string - waived_at?: string | null - waived_by?: string | null - waiver_reason?: string | null - } - Relationships: [ - { - foreignKeyName: "penalty_events_attendance_id_fkey" - columns: ["attendance_id"] - isOneToOne: false - referencedRelation: "attendance" - referencedColumns: ["id"] - }, - { - foreignKeyName: "penalty_events_attendance_id_fkey" - columns: ["attendance_id"] - isOneToOne: false - referencedRelation: "v_attendance_detail" - referencedColumns: ["attendance_id"] - }, - { - foreignKeyName: "penalty_events_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "penalty_events_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "penalty_events_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "penalty_events_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "penalty_events_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "invoices" - referencedColumns: ["id"] - }, - { - foreignKeyName: "penalty_events_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "v_billing_detail" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "penalty_events_invoice_id_fkey" - columns: ["invoice_id"] - isOneToOne: false - referencedRelation: "v_outstanding_invoices" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "penalty_events_rule_id_fkey" - columns: ["rule_id"] - isOneToOne: false - referencedRelation: "penalty_rules" - referencedColumns: ["id"] - }, - { - foreignKeyName: "penalty_events_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "penalty_events_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - penalty_rules: { - Row: { - allowed_time: string | null - amount_cents: number - campus_id: string | null - created_at: string - created_by: string | null - effective_end: string | null - effective_start: string - escalated_amount_cents: number | null - grace_period_minutes: number - id: string - increment_minutes: number | null - is_active: boolean - max_fee_cents: number | null - method: string - name: string - notes: string | null - notify_parent: boolean - priority: number - requires_approval: boolean - rule_type: string - threshold_count: number | null - threshold_window_days: number | null - updated_at: string - waiver_roles: Database["public"]["Enums"]["app_role"][] - } - Insert: { - allowed_time?: string | null - amount_cents?: number - campus_id?: string | null - created_at?: string - created_by?: string | null - effective_end?: string | null - effective_start?: string - escalated_amount_cents?: number | null - grace_period_minutes?: number - id?: string - increment_minutes?: number | null - is_active?: boolean - max_fee_cents?: number | null - method?: string - name: string - notes?: string | null - notify_parent?: boolean - priority?: number - requires_approval?: boolean - rule_type: string - threshold_count?: number | null - threshold_window_days?: number | null - updated_at?: string - waiver_roles?: Database["public"]["Enums"]["app_role"][] - } - Update: { - allowed_time?: string | null - amount_cents?: number - campus_id?: string | null - created_at?: string - created_by?: string | null - effective_end?: string | null - effective_start?: string - escalated_amount_cents?: number | null - grace_period_minutes?: number - id?: string - increment_minutes?: number | null - is_active?: boolean - max_fee_cents?: number | null - method?: string - name?: string - notes?: string | null - notify_parent?: boolean - priority?: number - requires_approval?: boolean - rule_type?: string - threshold_count?: number | null - threshold_window_days?: number | null - updated_at?: string - waiver_roles?: Database["public"]["Enums"]["app_role"][] - } - Relationships: [ - { - foreignKeyName: "penalty_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "penalty_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "penalty_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "penalty_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - plan_accommodations: { - Row: { - category: string - created_at: string - description: string - id: string - plan_id: string - setting: string | null - sort_order: number - } - Insert: { - category?: string - created_at?: string - description: string - id?: string - plan_id: string - setting?: string | null - sort_order?: number - } - Update: { - category?: string - created_at?: string - description?: string - id?: string - plan_id?: string - setting?: string | null - sort_order?: number - } - Relationships: [ - { - foreignKeyName: "plan_accommodations_plan_id_fkey" - columns: ["plan_id"] - isOneToOne: false - referencedRelation: "student_plans" - referencedColumns: ["id"] - }, - ] - } - plan_details: { - Row: { - confidential_notes: string | null - consent_date: string | null - eligibility_category: string | null - eligibility_notes: string | null - evaluation_summary: string | null - last_evaluation_date: string | null - parent_concerns: string | null - plan_id: string - student_strengths: string | null - updated_at: string - } - Insert: { - confidential_notes?: string | null - consent_date?: string | null - eligibility_category?: string | null - eligibility_notes?: string | null - evaluation_summary?: string | null - last_evaluation_date?: string | null - parent_concerns?: string | null - plan_id: string - student_strengths?: string | null - updated_at?: string - } - Update: { - confidential_notes?: string | null - consent_date?: string | null - eligibility_category?: string | null - eligibility_notes?: string | null - evaluation_summary?: string | null - last_evaluation_date?: string | null - parent_concerns?: string | null - plan_id?: string - student_strengths?: string | null - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "plan_details_plan_id_fkey" - columns: ["plan_id"] - isOneToOne: true - referencedRelation: "student_plans" - referencedColumns: ["id"] - }, - ] - } - plan_documents: { - Row: { - created_at: string - file_path: string - id: string - plan_id: string - title: string | null - uploaded_by: string | null - } - Insert: { - created_at?: string - file_path: string - id?: string - plan_id: string - title?: string | null - uploaded_by?: string | null - } - Update: { - created_at?: string - file_path?: string - id?: string - plan_id?: string - title?: string | null - uploaded_by?: string | null - } - Relationships: [ - { - foreignKeyName: "plan_documents_plan_id_fkey" - columns: ["plan_id"] - isOneToOne: false - referencedRelation: "student_plans" - referencedColumns: ["id"] - }, - ] - } - plan_goal_progress: { - Row: { - created_at: string - date: string - goal_id: string - id: string - narrative: string | null - recorded_by: string | null - value: number | null - } - Insert: { - created_at?: string - date?: string - goal_id: string - id?: string - narrative?: string | null - recorded_by?: string | null - value?: number | null - } - Update: { - created_at?: string - date?: string - goal_id?: string - id?: string - narrative?: string | null - recorded_by?: string | null - value?: number | null - } - Relationships: [ - { - foreignKeyName: "plan_goal_progress_goal_id_fkey" - columns: ["goal_id"] - isOneToOne: false - referencedRelation: "plan_goals" - referencedColumns: ["id"] - }, - ] - } - plan_goals: { - Row: { - area: string | null - baseline: string | null - created_at: string - id: string - plan_id: string - sort_order: number - statement: string - status: Database["public"]["Enums"]["plan_goal_status"] - target_criteria: string | null - target_date: string | null - target_value: number | null - unit: string | null - updated_at: string - } - Insert: { - area?: string | null - baseline?: string | null - created_at?: string - id?: string - plan_id: string - sort_order?: number - statement: string - status?: Database["public"]["Enums"]["plan_goal_status"] - target_criteria?: string | null - target_date?: string | null - target_value?: number | null - unit?: string | null - updated_at?: string - } - Update: { - area?: string | null - baseline?: string | null - created_at?: string - id?: string - plan_id?: string - sort_order?: number - statement?: string - status?: Database["public"]["Enums"]["plan_goal_status"] - target_criteria?: string | null - target_date?: string | null - target_value?: number | null - unit?: string | null - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "plan_goals_plan_id_fkey" - columns: ["plan_id"] - isOneToOne: false - referencedRelation: "student_plans" - referencedColumns: ["id"] - }, - ] - } - plan_meeting_attendees: { - Row: { - attended: boolean - created_at: string - id: string - meeting_id: string - name: string - team_role: string | null - user_id: string | null - } - Insert: { - attended?: boolean - created_at?: string - id?: string - meeting_id: string - name: string - team_role?: string | null - user_id?: string | null - } - Update: { - attended?: boolean - created_at?: string - id?: string - meeting_id?: string - name?: string - team_role?: string | null - user_id?: string | null - } - Relationships: [ - { - foreignKeyName: "plan_meeting_attendees_meeting_id_fkey" - columns: ["meeting_id"] - isOneToOne: false - referencedRelation: "plan_meetings" - referencedColumns: ["id"] - }, - ] - } - plan_meetings: { - Row: { - created_at: string - created_by: string | null - id: string - location: string | null - meeting_date: string - meeting_type: Database["public"]["Enums"]["plan_meeting_type"] - notes: string | null - outcome: string | null - plan_id: string - } - Insert: { - created_at?: string - created_by?: string | null - id?: string - location?: string | null - meeting_date: string - meeting_type?: Database["public"]["Enums"]["plan_meeting_type"] - notes?: string | null - outcome?: string | null - plan_id: string - } - Update: { - created_at?: string - created_by?: string | null - id?: string - location?: string | null - meeting_date?: string - meeting_type?: Database["public"]["Enums"]["plan_meeting_type"] - notes?: string | null - outcome?: string | null - plan_id?: string - } - Relationships: [ - { - foreignKeyName: "plan_meetings_plan_id_fkey" - columns: ["plan_id"] - isOneToOne: false - referencedRelation: "student_plans" - referencedColumns: ["id"] - }, - ] - } - plan_services: { - Row: { - created_at: string - delivery: string | null - end_date: string | null - id: string - location: string | null - minutes_per_session: number | null - period: string - plan_id: string - provider_id: string | null - provider_name: string | null - service_type: string - sessions_per_period: number | null - start_date: string | null - } - Insert: { - created_at?: string - delivery?: string | null - end_date?: string | null - id?: string - location?: string | null - minutes_per_session?: number | null - period?: string - plan_id: string - provider_id?: string | null - provider_name?: string | null - service_type: string - sessions_per_period?: number | null - start_date?: string | null - } - Update: { - created_at?: string - delivery?: string | null - end_date?: string | null - id?: string - location?: string | null - minutes_per_session?: number | null - period?: string - plan_id?: string - provider_id?: string | null - provider_name?: string | null - service_type?: string - sessions_per_period?: number | null - start_date?: string | null - } - Relationships: [ - { - foreignKeyName: "plan_services_plan_id_fkey" - columns: ["plan_id"] - isOneToOne: false - referencedRelation: "student_plans" - referencedColumns: ["id"] - }, - ] - } - profiles: { - Row: { - created_at: string - email: string | null - full_name: string | null - id: string - phone: string | null - updated_at: string - } - Insert: { - created_at?: string - email?: string | null - full_name?: string | null - id: string - phone?: string | null - updated_at?: string - } - Update: { - created_at?: string - email?: string | null - full_name?: string | null - id?: string - phone?: string | null - updated_at?: string - } - Relationships: [] - } - ratio_rules: { - Row: { - campus_id: string | null - classroom_id: string | null - created_at: string - created_by: string | null - effective_end: string | null - effective_start: string - grade_level: string | null - id: string - is_active: boolean - licensing_reference: string | null - max_age_months: number | null - max_group_size: number | null - min_age_months: number | null - name: string - notes: string | null - priority: number - program_id: string | null - students_per_staff: number - updated_at: string - } - Insert: { - campus_id?: string | null - classroom_id?: string | null - created_at?: string - created_by?: string | null - effective_end?: string | null - effective_start?: string - grade_level?: string | null - id?: string - is_active?: boolean - licensing_reference?: string | null - max_age_months?: number | null - max_group_size?: number | null - min_age_months?: number | null - name: string - notes?: string | null - priority?: number - program_id?: string | null - students_per_staff: number - updated_at?: string - } - Update: { - campus_id?: string | null - classroom_id?: string | null - created_at?: string - created_by?: string | null - effective_end?: string | null - effective_start?: string - grade_level?: string | null - id?: string - is_active?: boolean - licensing_reference?: string | null - max_age_months?: number | null - max_group_size?: number | null - min_age_months?: number | null - name?: string - notes?: string | null - priority?: number - program_id?: string | null - students_per_staff?: number - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "ratio_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "ratio_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "ratio_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "ratio_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "ratio_rules_classroom_id_fkey" - columns: ["classroom_id"] - isOneToOne: false - referencedRelation: "classes" - referencedColumns: ["id"] - }, - { - foreignKeyName: "ratio_rules_program_id_fkey" - columns: ["program_id"] - isOneToOne: false - referencedRelation: "campus_programs" - referencedColumns: ["id"] - }, - ] - } - ratio_snapshots: { - Row: { - actual_students_per_staff: number | null - campus_id: string - date: string - id: number - is_compliant: boolean | null - note: string | null - present_staff: number - present_students: number - required_students_per_staff: number | null - rule_id: string | null - taken_at: string - } - Insert: { - actual_students_per_staff?: number | null - campus_id: string - date?: string - id?: never - is_compliant?: boolean | null - note?: string | null - present_staff: number - present_students: number - required_students_per_staff?: number | null - rule_id?: string | null - taken_at?: string - } - Update: { - actual_students_per_staff?: number | null - campus_id?: string - date?: string - id?: never - is_compliant?: boolean | null - note?: string | null - present_staff?: number - present_students?: number - required_students_per_staff?: number | null - rule_id?: string | null - taken_at?: string - } - Relationships: [ - { - foreignKeyName: "ratio_snapshots_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "ratio_snapshots_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "ratio_snapshots_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "ratio_snapshots_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "ratio_snapshots_rule_id_fkey" - columns: ["rule_id"] - isOneToOne: false - referencedRelation: "ratio_rules" - referencedColumns: ["id"] - }, - ] - } - reminders: { - Row: { - body: string | null - channel: string - created_at: string - created_by: string | null - dismissed_at: string | null - id: string - related_certification_id: string | null - related_invoice_id: string | null - related_student_id: string | null - remind_at: string - sent_at: string | null - task_id: string | null - title: string - user_id: string - } - Insert: { - body?: string | null - channel?: string - created_at?: string - created_by?: string | null - dismissed_at?: string | null - id?: string - related_certification_id?: string | null - related_invoice_id?: string | null - related_student_id?: string | null - remind_at: string - sent_at?: string | null - task_id?: string | null - title: string - user_id: string - } - Update: { - body?: string | null - channel?: string - created_at?: string - created_by?: string | null - dismissed_at?: string | null - id?: string - related_certification_id?: string | null - related_invoice_id?: string | null - related_student_id?: string | null - remind_at?: string - sent_at?: string | null - task_id?: string | null - title?: string - user_id?: string - } - Relationships: [ - { - foreignKeyName: "reminders_related_certification_id_fkey" - columns: ["related_certification_id"] - isOneToOne: false - referencedRelation: "staff_certifications" - referencedColumns: ["id"] - }, - { - foreignKeyName: "reminders_related_certification_id_fkey" - columns: ["related_certification_id"] - isOneToOne: false - referencedRelation: "v_certification_expiry" - referencedColumns: ["certification_id"] - }, - { - foreignKeyName: "reminders_related_invoice_id_fkey" - columns: ["related_invoice_id"] - isOneToOne: false - referencedRelation: "invoices" - referencedColumns: ["id"] - }, - { - foreignKeyName: "reminders_related_invoice_id_fkey" - columns: ["related_invoice_id"] - isOneToOne: false - referencedRelation: "v_billing_detail" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "reminders_related_invoice_id_fkey" - columns: ["related_invoice_id"] - isOneToOne: false - referencedRelation: "v_outstanding_invoices" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "reminders_related_student_id_fkey" - columns: ["related_student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "reminders_related_student_id_fkey" - columns: ["related_student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - { - foreignKeyName: "reminders_task_id_fkey" - columns: ["task_id"] - isOneToOne: false - referencedRelation: "tasks" - referencedColumns: ["id"] - }, - { - foreignKeyName: "reminders_task_id_fkey" - columns: ["task_id"] - isOneToOne: false - referencedRelation: "v_open_tasks" - referencedColumns: ["task_id"] - }, - ] - } - scholarships: { - Row: { - award_amount_cents: number - created_at: string - created_by: string | null - document_path: string | null - external_reference: string | null - frequency: string - funding_period_end: string | null - funding_period_start: string - id: string - notes: string | null - program_name: string - status: string - student_id: string - updated_at: string - } - Insert: { - award_amount_cents: number - created_at?: string - created_by?: string | null - document_path?: string | null - external_reference?: string | null - frequency?: string - funding_period_end?: string | null - funding_period_start?: string - id?: string - notes?: string | null - program_name?: string - status?: string - student_id: string - updated_at?: string - } - Update: { - award_amount_cents?: number - created_at?: string - created_by?: string | null - document_path?: string | null - external_reference?: string | null - frequency?: string - funding_period_end?: string | null - funding_period_start?: string - id?: string - notes?: string | null - program_name?: string - status?: string - student_id?: string - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "scholarships_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "scholarships_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - staff_attendance: { - Row: { - campus_id: string - check_in_at: string | null - check_out_at: string | null - classroom_id: string | null - counts_toward_ratio: boolean - created_at: string - date: string - id: string - note: string | null - recorded_by: string | null - status: string - updated_at: string - user_id: string - } - Insert: { - campus_id: string - check_in_at?: string | null - check_out_at?: string | null - classroom_id?: string | null - counts_toward_ratio?: boolean - created_at?: string - date: string - id?: string - note?: string | null - recorded_by?: string | null - status?: string - updated_at?: string - user_id: string - } - Update: { - campus_id?: string - check_in_at?: string | null - check_out_at?: string | null - classroom_id?: string | null - counts_toward_ratio?: boolean - created_at?: string - date?: string - id?: string - note?: string | null - recorded_by?: string | null - status?: string - updated_at?: string - user_id?: string - } - Relationships: [ - { - foreignKeyName: "staff_attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "staff_attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "staff_attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "staff_attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "staff_attendance_classroom_id_fkey" - columns: ["classroom_id"] - isOneToOne: false - referencedRelation: "classes" - referencedColumns: ["id"] - }, - ] - } - staff_campus_assignments: { - Row: { - campus_id: string - created_at: string - end_date: string | null - id: string - is_primary: boolean - start_date: string | null - title: string | null - user_id: string - } - Insert: { - campus_id: string - created_at?: string - end_date?: string | null - id?: string - is_primary?: boolean - start_date?: string | null - title?: string | null - user_id: string - } - Update: { - campus_id?: string - created_at?: string - end_date?: string | null - id?: string - is_primary?: boolean - start_date?: string | null - title?: string | null - user_id?: string - } - Relationships: [ - { - foreignKeyName: "staff_campus_assignments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "staff_campus_assignments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "staff_campus_assignments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "staff_campus_assignments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - staff_certifications: { - Row: { - certificate_number: string | null - certification_type_id: string - created_at: string - document_path: string | null - expires_on: string | null - id: string - issued_on: string | null - notes: string | null - status: string - updated_at: string - user_id: string - verified_at: string | null - verified_by: string | null - } - Insert: { - certificate_number?: string | null - certification_type_id: string - created_at?: string - document_path?: string | null - expires_on?: string | null - id?: string - issued_on?: string | null - notes?: string | null - status?: string - updated_at?: string - user_id: string - verified_at?: string | null - verified_by?: string | null - } - Update: { - certificate_number?: string | null - certification_type_id?: string - created_at?: string - document_path?: string | null - expires_on?: string | null - id?: string - issued_on?: string | null - notes?: string | null - status?: string - updated_at?: string - user_id?: string - verified_at?: string | null - verified_by?: string | null - } - Relationships: [ - { - foreignKeyName: "staff_certifications_certification_type_id_fkey" - columns: ["certification_type_id"] - isOneToOne: false - referencedRelation: "certification_types" - referencedColumns: ["id"] - }, - ] - } - student_alert_acknowledgments: { - Row: { - acknowledged_at: string - alert_id: string - id: string - note: string | null - user_id: string - } - Insert: { - acknowledged_at?: string - alert_id: string - id?: string - note?: string | null - user_id: string - } - Update: { - acknowledged_at?: string - alert_id?: string - id?: string - note?: string | null - user_id?: string - } - Relationships: [ - { - foreignKeyName: "student_alert_acknowledgments_alert_id_fkey" - columns: ["alert_id"] - isOneToOne: false - referencedRelation: "student_alerts" - referencedColumns: ["id"] - }, - ] - } - student_alert_views: { - Row: { - alert_id: string - id: string - user_id: string - viewed_at: string - } - Insert: { - alert_id: string - id?: string - user_id: string - viewed_at?: string - } - Update: { - alert_id?: string - id?: string - user_id?: string - viewed_at?: string - } - Relationships: [ - { - foreignKeyName: "student_alert_views_alert_id_fkey" - columns: ["alert_id"] - isOneToOne: false - referencedRelation: "student_alerts" - referencedColumns: ["id"] - }, - ] - } - student_alerts: { - Row: { - alert_type: string - created_at: string - created_by: string | null - description: string - document_path: string | null - effective_date: string - expiration_date: string | null - id: string - is_active: boolean - parenting_plan_id: string | null - requires_acknowledgment: boolean - severity: string - student_id: string - title: string - updated_at: string - visible_to_roles: Database["public"]["Enums"]["app_role"][] - } - Insert: { - alert_type: string - created_at?: string - created_by?: string | null - description: string - document_path?: string | null - effective_date?: string - expiration_date?: string | null - id?: string - is_active?: boolean - parenting_plan_id?: string | null - requires_acknowledgment?: boolean - severity?: string - student_id: string - title: string - updated_at?: string - visible_to_roles?: Database["public"]["Enums"]["app_role"][] - } - Update: { - alert_type?: string - created_at?: string - created_by?: string | null - description?: string - document_path?: string | null - effective_date?: string - expiration_date?: string | null - id?: string - is_active?: boolean - parenting_plan_id?: string | null - requires_acknowledgment?: boolean - severity?: string - student_id?: string - title?: string - updated_at?: string - visible_to_roles?: Database["public"]["Enums"]["app_role"][] - } - Relationships: [ - { - foreignKeyName: "student_alerts_parenting_plan_id_fkey" - columns: ["parenting_plan_id"] - isOneToOne: false - referencedRelation: "parenting_plans" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_alerts_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_alerts_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - student_campus_schedules: { - Row: { - assignment_type: string - campus_id: string - created_at: string - created_by: string | null - early_dropoff: boolean - effective_end: string | null - effective_start: string - expected_arrival: string | null - expected_departure: string | null - friday: boolean - id: string - late_pickup: boolean - monday: boolean - notes: string | null - saturday: boolean - scheduled_days_per_week: number | null - student_id: string - sunday: boolean - thursday: boolean - tuesday: boolean - updated_at: string - wednesday: boolean - } - Insert: { - assignment_type?: string - campus_id: string - created_at?: string - created_by?: string | null - early_dropoff?: boolean - effective_end?: string | null - effective_start?: string - expected_arrival?: string | null - expected_departure?: string | null - friday?: boolean - id?: string - late_pickup?: boolean - monday?: boolean - notes?: string | null - saturday?: boolean - scheduled_days_per_week?: number | null - student_id: string - sunday?: boolean - thursday?: boolean - tuesday?: boolean - updated_at?: string - wednesday?: boolean - } - Update: { - assignment_type?: string - campus_id?: string - created_at?: string - created_by?: string | null - early_dropoff?: boolean - effective_end?: string | null - effective_start?: string - expected_arrival?: string | null - expected_departure?: string | null - friday?: boolean - id?: string - late_pickup?: boolean - monday?: boolean - notes?: string | null - saturday?: boolean - scheduled_days_per_week?: number | null - student_id?: string - sunday?: boolean - thursday?: boolean - tuesday?: boolean - updated_at?: string - wednesday?: boolean - } - Relationships: [ - { - foreignKeyName: "student_campus_schedules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_campus_schedules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "student_campus_schedules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "student_campus_schedules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "student_campus_schedules_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_campus_schedules_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - student_credits: { - Row: { - amount_applied_cents: number - amount_cents: number - expires_on: string | null - id: string - is_void: boolean - issued_at: string - issued_by: string | null - reason: string - student_id: string - } - Insert: { - amount_applied_cents?: number - amount_cents: number - expires_on?: string | null - id?: string - is_void?: boolean - issued_at?: string - issued_by?: string | null - reason: string - student_id: string - } - Update: { - amount_applied_cents?: number - amount_cents?: number - expires_on?: string | null - id?: string - is_void?: boolean - issued_at?: string - issued_by?: string | null - reason?: string - student_id?: string - } - Relationships: [ - { - foreignKeyName: "student_credits_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_credits_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - student_curriculum_logins: { - Row: { - created_at: string - id: string - parent_account: string | null - parent_password: string | null - student_id: string - student_login: string | null - student_password: string | null - website: string | null - } - Insert: { - created_at?: string - id?: string - parent_account?: string | null - parent_password?: string | null - student_id: string - student_login?: string | null - student_password?: string | null - website?: string | null - } - Update: { - created_at?: string - id?: string - parent_account?: string | null - parent_password?: string | null - student_id?: string - student_login?: string | null - student_password?: string | null - website?: string | null - } - Relationships: [ - { - foreignKeyName: "student_curriculum_logins_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_curriculum_logins_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - student_guardians: { - Row: { - address: string | null - city: string | null - created_at: string - email: string | null - employer: string | null - full_name: string - id: string - is_primary: boolean - phone: string | null - relationship: string | null - state: string | null - student_id: string - zip: string | null - } - Insert: { - address?: string | null - city?: string | null - created_at?: string - email?: string | null - employer?: string | null - full_name: string - id?: string - is_primary?: boolean - phone?: string | null - relationship?: string | null - state?: string | null - student_id: string - zip?: string | null - } - Update: { - address?: string | null - city?: string | null - created_at?: string - email?: string | null - employer?: string | null - full_name?: string - id?: string - is_primary?: boolean - phone?: string | null - relationship?: string | null - state?: string | null - student_id?: string - zip?: string | null - } - Relationships: [ - { - foreignKeyName: "student_guardians_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_guardians_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - student_note_attachments: { - Row: { - content_type: string | null - created_at: string - file_name: string | null - file_path: string - id: string - note_id: string - uploaded_by: string | null - } - Insert: { - content_type?: string | null - created_at?: string - file_name?: string | null - file_path: string - id?: string - note_id: string - uploaded_by?: string | null - } - Update: { - content_type?: string | null - created_at?: string - file_name?: string | null - file_path?: string - id?: string - note_id?: string - uploaded_by?: string | null - } - Relationships: [ - { - foreignKeyName: "student_note_attachments_note_id_fkey" - columns: ["note_id"] - isOneToOne: false - referencedRelation: "student_notes" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_note_attachments_note_id_fkey" - columns: ["note_id"] - isOneToOne: false - referencedRelation: "v_pending_followups" - referencedColumns: ["note_id"] - }, - ] - } - student_notes: { - Row: { - author_id: string | null - body: string - campus_id: string | null - category_id: string - created_at: string - follow_up_date: string | null - household_member_id: string | null - id: string - occurred_at: string - parent_visible: boolean - related_alert_id: string | null - related_attendance_id: string | null - related_ledger_entry_id: string | null - related_note_id: string | null - related_thread_id: string | null - resolution_status: string - resolved_at: string | null - resolved_by: string | null - student_id: string - title: string - updated_at: string - visible_to_roles: Database["public"]["Enums"]["app_role"][] - } - Insert: { - author_id?: string | null - body: string - campus_id?: string | null - category_id: string - created_at?: string - follow_up_date?: string | null - household_member_id?: string | null - id?: string - occurred_at?: string - parent_visible?: boolean - related_alert_id?: string | null - related_attendance_id?: string | null - related_ledger_entry_id?: string | null - related_note_id?: string | null - related_thread_id?: string | null - resolution_status?: string - resolved_at?: string | null - resolved_by?: string | null - student_id: string - title: string - updated_at?: string - visible_to_roles?: Database["public"]["Enums"]["app_role"][] - } - Update: { - author_id?: string | null - body?: string - campus_id?: string | null - category_id?: string - created_at?: string - follow_up_date?: string | null - household_member_id?: string | null - id?: string - occurred_at?: string - parent_visible?: boolean - related_alert_id?: string | null - related_attendance_id?: string | null - related_ledger_entry_id?: string | null - related_note_id?: string | null - related_thread_id?: string | null - resolution_status?: string - resolved_at?: string | null - resolved_by?: string | null - student_id?: string - title?: string - updated_at?: string - visible_to_roles?: Database["public"]["Enums"]["app_role"][] - } - Relationships: [ - { - foreignKeyName: "student_notes_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "student_notes_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "student_notes_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "student_notes_category_id_fkey" - columns: ["category_id"] - isOneToOne: false - referencedRelation: "note_categories" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_household_member_id_fkey" - columns: ["household_member_id"] - isOneToOne: false - referencedRelation: "household_members" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_related_alert_id_fkey" - columns: ["related_alert_id"] - isOneToOne: false - referencedRelation: "student_alerts" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_related_attendance_id_fkey" - columns: ["related_attendance_id"] - isOneToOne: false - referencedRelation: "attendance" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_related_attendance_id_fkey" - columns: ["related_attendance_id"] - isOneToOne: false - referencedRelation: "v_attendance_detail" - referencedColumns: ["attendance_id"] - }, - { - foreignKeyName: "student_notes_related_ledger_entry_id_fkey" - columns: ["related_ledger_entry_id"] - isOneToOne: false - referencedRelation: "ledger_entries" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_related_note_id_fkey" - columns: ["related_note_id"] - isOneToOne: false - referencedRelation: "student_notes" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_related_note_id_fkey" - columns: ["related_note_id"] - isOneToOne: false - referencedRelation: "v_pending_followups" - referencedColumns: ["note_id"] - }, - { - foreignKeyName: "student_notes_related_thread_id_fkey" - columns: ["related_thread_id"] - isOneToOne: false - referencedRelation: "message_threads" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - student_plans: { - Row: { - case_manager_id: string | null - created_at: string - created_by: string | null - effective_date: string | null - end_date: string | null - id: string - next_annual_review_date: string | null - next_reevaluation_date: string | null - plan_type: Database["public"]["Enums"]["plan_type"] - status: Database["public"]["Enums"]["plan_status"] - student_id: string - updated_at: string - } - Insert: { - case_manager_id?: string | null - created_at?: string - created_by?: string | null - effective_date?: string | null - end_date?: string | null - id?: string - next_annual_review_date?: string | null - next_reevaluation_date?: string | null - plan_type: Database["public"]["Enums"]["plan_type"] - status?: Database["public"]["Enums"]["plan_status"] - student_id: string - updated_at?: string - } - Update: { - case_manager_id?: string | null - created_at?: string - created_by?: string | null - effective_date?: string | null - end_date?: string | null - id?: string - next_annual_review_date?: string | null - next_reevaluation_date?: string | null - plan_type?: Database["public"]["Enums"]["plan_type"] - status?: Database["public"]["Enums"]["plan_status"] - student_id?: string - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "student_plans_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_plans_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - student_tag_assignments: { - Row: { - assigned_at: string - assigned_by: string | null - id: string - notes: string | null - student_id: string - tag_id: string - } - Insert: { - assigned_at?: string - assigned_by?: string | null - id?: string - notes?: string | null - student_id: string - tag_id: string - } - Update: { - assigned_at?: string - assigned_by?: string | null - id?: string - notes?: string | null - student_id?: string - tag_id?: string - } - Relationships: [ - { - foreignKeyName: "student_tag_assignments_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_tag_assignments_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - { - foreignKeyName: "student_tag_assignments_tag_id_fkey" - columns: ["tag_id"] - isOneToOne: false - referencedRelation: "student_tags" - referencedColumns: ["id"] - }, - ] - } - student_tags: { - Row: { - color: string | null - created_at: string - description: string | null - id: string - is_active: boolean - is_system: boolean - name: string - slug: string - sort_order: number - } - Insert: { - color?: string | null - created_at?: string - description?: string | null - id?: string - is_active?: boolean - is_system?: boolean - name: string - slug: string - sort_order?: number - } - Update: { - color?: string | null - created_at?: string - description?: string | null - id?: string - is_active?: boolean - is_system?: boolean - name?: string - slug?: string - sort_order?: number - } - Relationships: [] - } - student_tuition_assignments: { - Row: { - amount_cents: number - approved_at: string | null - approved_by: string | null - campus_id: string | null - created_at: string - created_by: string | null - document_path: string | null - end_date: string | null - frequency: string - id: string - last_modified_by: string | null - reason: string - start_date: string - student_id: string - updated_at: string - } - Insert: { - amount_cents: number - approved_at?: string | null - approved_by?: string | null - campus_id?: string | null - created_at?: string - created_by?: string | null - document_path?: string | null - end_date?: string | null - frequency?: string - id?: string - last_modified_by?: string | null - reason: string - start_date?: string - student_id: string - updated_at?: string - } - Update: { - amount_cents?: number - approved_at?: string | null - approved_by?: string | null - campus_id?: string | null - created_at?: string - created_by?: string | null - document_path?: string | null - end_date?: string | null - frequency?: string - id?: string - last_modified_by?: string | null - reason?: string - start_date?: string - student_id?: string - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "student_tuition_assignments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_tuition_assignments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "student_tuition_assignments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "student_tuition_assignments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "student_tuition_assignments_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_tuition_assignments_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - students: { - Row: { - agreement_signed_by: string | null - agreement_signed_date: string | null - allergies: string | null - attendance_basis: string - backup_transport_plan: string | null - calendar_basis: string - chronic_conditions: string | null - class_id: string | null - created_at: string - custody_agreement: string | null - daily_tuition_cents: number | null - disciplinary_history: string | null - dismissal_methods: string[] - dismissal_other: string | null - dob: string | null - enrollment_end_date: string | null - enrollment_start_date: string | null - enrollment_status: string - first_name: string - gender: string | null - grade_level: string | null - home_ed_eval_due: string | null - id: string - interests: string | null - is_support_student: boolean - last_name: string - middle_name: string | null - notes: string | null - other_info: string | null - payment_plan_id: string | null - photo_path: string | null - photo_release: boolean - physician_phone: string | null - portfolio_keeper: string | null - preferred_name: string | null - preferred_start_date: string | null - previous_schools: string | null - primary_campus_id: string | null - primary_physician: string | null - program_id: string | null - special_needs: string | null - tuition_tier_id: string | null - updated_at: string - user_id: string | null - } - Insert: { - agreement_signed_by?: string | null - agreement_signed_date?: string | null - allergies?: string | null - attendance_basis?: string - backup_transport_plan?: string | null - calendar_basis?: string - chronic_conditions?: string | null - class_id?: string | null - created_at?: string - custody_agreement?: string | null - daily_tuition_cents?: number | null - disciplinary_history?: string | null - dismissal_methods?: string[] - dismissal_other?: string | null - dob?: string | null - enrollment_end_date?: string | null - enrollment_start_date?: string | null - enrollment_status?: string - first_name: string - gender?: string | null - grade_level?: string | null - home_ed_eval_due?: string | null - id?: string - interests?: string | null - is_support_student?: boolean - last_name: string - middle_name?: string | null - notes?: string | null - other_info?: string | null - payment_plan_id?: string | null - photo_path?: string | null - photo_release?: boolean - physician_phone?: string | null - portfolio_keeper?: string | null - preferred_name?: string | null - preferred_start_date?: string | null - previous_schools?: string | null - primary_campus_id?: string | null - primary_physician?: string | null - program_id?: string | null - special_needs?: string | null - tuition_tier_id?: string | null - updated_at?: string - user_id?: string | null - } - Update: { - agreement_signed_by?: string | null - agreement_signed_date?: string | null - allergies?: string | null - attendance_basis?: string - backup_transport_plan?: string | null - calendar_basis?: string - chronic_conditions?: string | null - class_id?: string | null - created_at?: string - custody_agreement?: string | null - daily_tuition_cents?: number | null - disciplinary_history?: string | null - dismissal_methods?: string[] - dismissal_other?: string | null - dob?: string | null - enrollment_end_date?: string | null - enrollment_start_date?: string | null - enrollment_status?: string - first_name?: string - gender?: string | null - grade_level?: string | null - home_ed_eval_due?: string | null - id?: string - interests?: string | null - is_support_student?: boolean - last_name?: string - middle_name?: string | null - notes?: string | null - other_info?: string | null - payment_plan_id?: string | null - photo_path?: string | null - photo_release?: boolean - physician_phone?: string | null - portfolio_keeper?: string | null - preferred_name?: string | null - preferred_start_date?: string | null - previous_schools?: string | null - primary_campus_id?: string | null - primary_physician?: string | null - program_id?: string | null - special_needs?: string | null - tuition_tier_id?: string | null - updated_at?: string - user_id?: string | null - } - Relationships: [ - { - foreignKeyName: "students_class_id_fkey" - columns: ["class_id"] - isOneToOne: false - referencedRelation: "classes" - referencedColumns: ["id"] - }, - { - foreignKeyName: "students_payment_plan_id_fkey" - columns: ["payment_plan_id"] - isOneToOne: false - referencedRelation: "payment_plans" - referencedColumns: ["id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "students_program_id_fkey" - columns: ["program_id"] - isOneToOne: false - referencedRelation: "campus_programs" - referencedColumns: ["id"] - }, - { - foreignKeyName: "students_tuition_tier_id_fkey" - columns: ["tuition_tier_id"] - isOneToOne: false - referencedRelation: "tuition_tiers" - referencedColumns: ["id"] - }, - ] - } - tasks: { - Row: { - assigned_to: string | null - campus_id: string | null - completed_at: string | null - completed_by: string | null - created_at: string - created_by: string | null - description: string | null - due_date: string | null - id: string - priority: string - related_applicant_id: string | null - related_invoice_id: string | null - related_note_id: string | null - related_student_id: string | null - status: string - title: string - updated_at: string - visible_to_roles: Database["public"]["Enums"]["app_role"][] - } - Insert: { - assigned_to?: string | null - campus_id?: string | null - completed_at?: string | null - completed_by?: string | null - created_at?: string - created_by?: string | null - description?: string | null - due_date?: string | null - id?: string - priority?: string - related_applicant_id?: string | null - related_invoice_id?: string | null - related_note_id?: string | null - related_student_id?: string | null - status?: string - title: string - updated_at?: string - visible_to_roles?: Database["public"]["Enums"]["app_role"][] - } - Update: { - assigned_to?: string | null - campus_id?: string | null - completed_at?: string | null - completed_by?: string | null - created_at?: string - created_by?: string | null - description?: string | null - due_date?: string | null - id?: string - priority?: string - related_applicant_id?: string | null - related_invoice_id?: string | null - related_note_id?: string | null - related_student_id?: string | null - status?: string - title?: string - updated_at?: string - visible_to_roles?: Database["public"]["Enums"]["app_role"][] - } - Relationships: [ - { - foreignKeyName: "tasks_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tasks_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "tasks_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "tasks_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "tasks_related_applicant_id_fkey" - columns: ["related_applicant_id"] - isOneToOne: false - referencedRelation: "applicants" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tasks_related_invoice_id_fkey" - columns: ["related_invoice_id"] - isOneToOne: false - referencedRelation: "invoices" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tasks_related_invoice_id_fkey" - columns: ["related_invoice_id"] - isOneToOne: false - referencedRelation: "v_billing_detail" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "tasks_related_invoice_id_fkey" - columns: ["related_invoice_id"] - isOneToOne: false - referencedRelation: "v_outstanding_invoices" - referencedColumns: ["invoice_id"] - }, - { - foreignKeyName: "tasks_related_note_id_fkey" - columns: ["related_note_id"] - isOneToOne: false - referencedRelation: "student_notes" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tasks_related_note_id_fkey" - columns: ["related_note_id"] - isOneToOne: false - referencedRelation: "v_pending_followups" - referencedColumns: ["note_id"] - }, - { - foreignKeyName: "tasks_related_student_id_fkey" - columns: ["related_student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tasks_related_student_id_fkey" - columns: ["related_student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - thread_participants: { - Row: { - id: string - thread_id: string - user_id: string - } - Insert: { - id?: string - thread_id: string - user_id: string - } - Update: { - id?: string - thread_id?: string - user_id?: string - } - Relationships: [ - { - foreignKeyName: "thread_participants_thread_id_fkey" - columns: ["thread_id"] - isOneToOne: false - referencedRelation: "message_threads" - referencedColumns: ["id"] - }, - ] - } - tuition_adjustment_rules: { - Row: { - amount_basis: string - amount_cents: number | null - campus_id: string | null - created_at: string - created_by: string | null - effective_end: string | null - effective_start: string - id: string - is_active: boolean - name: string - notes: string | null - percent: number | null - priority: number - requires_support_student: boolean | null - requires_tag_slug: string | null - rule_type: string - tier_id: string | null - updated_at: string - } - Insert: { - amount_basis: string - amount_cents?: number | null - campus_id?: string | null - created_at?: string - created_by?: string | null - effective_end?: string | null - effective_start?: string - id?: string - is_active?: boolean - name: string - notes?: string | null - percent?: number | null - priority?: number - requires_support_student?: boolean | null - requires_tag_slug?: string | null - rule_type: string - tier_id?: string | null - updated_at?: string - } - Update: { - amount_basis?: string - amount_cents?: number | null - campus_id?: string | null - created_at?: string - created_by?: string | null - effective_end?: string | null - effective_start?: string - id?: string - is_active?: boolean - name?: string - notes?: string | null - percent?: number | null - priority?: number - requires_support_student?: boolean | null - requires_tag_slug?: string | null - rule_type?: string - tier_id?: string | null - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "tuition_adjustment_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tuition_adjustment_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "tuition_adjustment_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "tuition_adjustment_rules_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "tuition_adjustment_rules_tier_id_fkey" - columns: ["tier_id"] - isOneToOne: false - referencedRelation: "tuition_tiers" - referencedColumns: ["id"] - }, - ] - } - tuition_rates: { - Row: { - amount_cents: number - attendance_basis: string | null - campus_id: string | null - created_at: string - created_by: string | null - effective_end: string | null - effective_start: string - id: string - is_active: boolean - max_days: number | null - min_days: number | null - notes: string | null - priority: number - program_id: string | null - rate_basis: string - requires_scholarship: boolean | null - requires_support_student: boolean | null - tier_id: string | null - updated_at: string - } - Insert: { - amount_cents: number - attendance_basis?: string | null - campus_id?: string | null - created_at?: string - created_by?: string | null - effective_end?: string | null - effective_start?: string - id?: string - is_active?: boolean - max_days?: number | null - min_days?: number | null - notes?: string | null - priority?: number - program_id?: string | null - rate_basis: string - requires_scholarship?: boolean | null - requires_support_student?: boolean | null - tier_id?: string | null - updated_at?: string - } - Update: { - amount_cents?: number - attendance_basis?: string | null - campus_id?: string | null - created_at?: string - created_by?: string | null - effective_end?: string | null - effective_start?: string - id?: string - is_active?: boolean - max_days?: number | null - min_days?: number | null - notes?: string | null - priority?: number - program_id?: string | null - rate_basis?: string - requires_scholarship?: boolean | null - requires_support_student?: boolean | null - tier_id?: string | null - updated_at?: string - } - Relationships: [ - { - foreignKeyName: "tuition_rates_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tuition_rates_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "tuition_rates_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "tuition_rates_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "tuition_rates_program_id_fkey" - columns: ["program_id"] - isOneToOne: false - referencedRelation: "campus_programs" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tuition_rates_tier_id_fkey" - columns: ["tier_id"] - isOneToOne: false - referencedRelation: "tuition_tiers" - referencedColumns: ["id"] - }, - ] - } - tuition_tiers: { - Row: { - created_at: string - description: string | null - id: string - is_active: boolean - name: string - slug: string - sort_order: number - } - Insert: { - created_at?: string - description?: string | null - id?: string - is_active?: boolean - name: string - slug: string - sort_order?: number - } - Update: { - created_at?: string - description?: string | null - id?: string - is_active?: boolean - name?: string - slug?: string - sort_order?: number - } - Relationships: [] - } - user_mailboxes: { - Row: { - created_at: string - created_by: string | null - email: string - last_verified_at: string | null - secret_ciphertext: string - secret_iv: string - secret_tag: string - updated_at: string - user_id: string - } - Insert: { - created_at?: string - created_by?: string | null - email: string - last_verified_at?: string | null - secret_ciphertext: string - secret_iv: string - secret_tag: string - updated_at?: string - user_id: string - } - Update: { - created_at?: string - created_by?: string | null - email?: string - last_verified_at?: string | null - secret_ciphertext?: string - secret_iv?: string - secret_tag?: string - updated_at?: string - user_id?: string - } - Relationships: [] - } - user_roles: { - Row: { - created_at: string - id: string - role: Database["public"]["Enums"]["app_role"] - user_id: string - } - Insert: { - created_at?: string - id?: string - role: Database["public"]["Enums"]["app_role"] - user_id: string - } - Update: { - created_at?: string - id?: string - role?: Database["public"]["Enums"]["app_role"] - user_id?: string - } - Relationships: [] - } - vacation_balances: { - Row: { - id: string - overridden_by: string | null - override_reason: string | null - override_weeks: number | null - policy_id: string | null - policy_year: number - student_id: string - updated_at: string - weeks_allotted: number - weeks_remaining: number | null - weeks_used: number - } - Insert: { - id?: string - overridden_by?: string | null - override_reason?: string | null - override_weeks?: number | null - policy_id?: string | null - policy_year: number - student_id: string - updated_at?: string - weeks_allotted?: number - weeks_remaining?: number | null - weeks_used?: number - } - Update: { - id?: string - overridden_by?: string | null - override_reason?: string | null - override_weeks?: number | null - policy_id?: string | null - policy_year?: number - student_id?: string - updated_at?: string - weeks_allotted?: number - weeks_remaining?: number | null - weeks_used?: number - } - Relationships: [ - { - foreignKeyName: "vacation_balances_policy_id_fkey" - columns: ["policy_id"] - isOneToOne: false - referencedRelation: "vacation_policies" - referencedColumns: ["id"] - }, - { - foreignKeyName: "vacation_balances_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "vacation_balances_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - vacation_policies: { - Row: { - applies_to_attendance_basis: string | null - applies_to_calendar_basis: string | null - campus_id: string | null - created_at: string - id: string - is_active: boolean - min_increment_days: number - name: string - notes: string | null - partial_weeks_allowed: boolean - priority: number - reset_day: number - reset_month: number - tuition_due_during_vacation: boolean - updated_at: string - weeks_per_year: number - } - Insert: { - applies_to_attendance_basis?: string | null - applies_to_calendar_basis?: string | null - campus_id?: string | null - created_at?: string - id?: string - is_active?: boolean - min_increment_days?: number - name: string - notes?: string | null - partial_weeks_allowed?: boolean - priority?: number - reset_day?: number - reset_month?: number - tuition_due_during_vacation?: boolean - updated_at?: string - weeks_per_year?: number - } - Update: { - applies_to_attendance_basis?: string | null - applies_to_calendar_basis?: string | null - campus_id?: string | null - created_at?: string - id?: string - is_active?: boolean - min_increment_days?: number - name?: string - notes?: string | null - partial_weeks_allowed?: boolean - priority?: number - reset_day?: number - reset_month?: number - tuition_due_during_vacation?: boolean - updated_at?: string - weeks_per_year?: number - } - Relationships: [ - { - foreignKeyName: "vacation_policies_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "vacation_policies_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "vacation_policies_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "vacation_policies_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - vacation_requests: { - Row: { - approved_at: string | null - approved_by: string | null - created_at: string - end_date: string - id: string - notes: string | null - policy_year: number - reason: string | null - requested_by: string | null - start_date: string - status: string - student_id: string - tuition_due: boolean - updated_at: string - weeks_charged: number - } - Insert: { - approved_at?: string | null - approved_by?: string | null - created_at?: string - end_date: string - id?: string - notes?: string | null - policy_year: number - reason?: string | null - requested_by?: string | null - start_date: string - status?: string - student_id: string - tuition_due?: boolean - updated_at?: string - weeks_charged?: number - } - Update: { - approved_at?: string | null - approved_by?: string | null - created_at?: string - end_date?: string - id?: string - notes?: string | null - policy_year?: number - reason?: string | null - requested_by?: string | null - start_date?: string - status?: string - student_id?: string - tuition_due?: boolean - updated_at?: string - weeks_charged?: number - } - Relationships: [ - { - foreignKeyName: "vacation_requests_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "vacation_requests_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - } - Views: { - v_attendance_by_campus_day: { - Row: { - absent: number | null - attendance_rate_percent: number | null - campus_id: string | null - campus_name: string | null - campus_transfers: number | null - date: string | null - early_arrivals: number | null - early_pickups: number | null - excused: number | null - fee_cents: number | null - late_arrivals: number | null - late_pickups: number | null - manual_overrides: number | null - on_vacation: number | null - present: number | null - scheduled: number | null - } - Relationships: [ - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - v_attendance_detail: { - Row: { - absence_reason: string | null - actual_campus: string | null - actual_campus_id: string | null - attendance_basis: string | null - attendance_id: string | null - calendar_basis: string | null - campus_transfer: boolean | null - check_in_at: string | null - check_out_at: string | null - class_id: string | null - class_name: string | null - date: string | null - early_arrival: boolean | null - early_pickup: boolean | null - fee_cents: number | null - is_manual_override: boolean | null - iso_week: string | null - late_arrival: boolean | null - late_pickup: boolean | null - month: string | null - primary_campus: string | null - primary_campus_id: string | null - status: Database["public"]["Enums"]["attendance_status"] | null - student_id: string | null - student_name: string | null - teacher_id: string | null - was_scheduled: boolean | null - } - Relationships: [ - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["actual_campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["actual_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["actual_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "attendance_campus_id_fkey" - columns: ["actual_campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "attendance_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "attendance_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - { - foreignKeyName: "students_class_id_fkey" - columns: ["class_id"] - isOneToOne: false - referencedRelation: "classes" - referencedColumns: ["id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - v_attendance_summary: { - Row: { - absent_days: number | null - attendance_rate_percent: number | null - excused_days: number | null - late_days: number | null - month: string | null - present_days: number | null - primary_campus_id: string | null - recorded_days: number | null - student_id: string | null - student_name: string | null - } - Relationships: [ - { - foreignKeyName: "attendance_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "attendance_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - v_billing_detail: { - Row: { - amount_paid_cents: number | null - attendance_basis: string | null - balance_due_cents: number | null - billing_period_end: string | null - billing_period_start: string | null - billing_week: string | null - campus_id: string | null - campus_name: string | null - days_overdue: number | null - due_date: string | null - has_scholarship: boolean | null - household_id: string | null - household_name: string | null - invoice_date: string | null - invoice_id: string | null - invoice_number: string | null - is_past_due: boolean | null - on_payment_plan: boolean | null - payment_plan_id: string | null - penalties_cents: number | null - scholarship_cents: number | null - status: string | null - student_id: string | null - student_name: string | null - total_cents: number | null - tuition_tier: string | null - tuition_tier_id: string | null - } - Relationships: [ - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "invoices_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - { - foreignKeyName: "invoices_payment_plan_id_fkey" - columns: ["payment_plan_id"] - isOneToOne: false - referencedRelation: "payment_plans" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - { - foreignKeyName: "invoices_tuition_tier_id_fkey" - columns: ["tuition_tier_id"] - isOneToOne: false - referencedRelation: "tuition_tiers" - referencedColumns: ["id"] - }, - ] - } - v_campus_billing_summary: { - Row: { - campus_id: string | null - campus_name: string | null - delinquent_accounts: number | null - invoice_count: number | null - past_due_cents: number | null - payment_plan_balance_cents: number | null - scholarship_applied_cents: number | null - scholarship_pending_cents: number | null - total_collected_cents: number | null - total_invoiced_cents: number | null - total_unpaid_cents: number | null - } - Relationships: [] - } - v_campus_enrollment: { - Row: { - campus_id: string | null - campus_name: string | null - capacity_used_percent: number | null - enrolled_count: number | null - full_time_count: number | null - is_active: boolean | null - part_time_count: number | null - student_capacity: number | null - support_count: number | null - } - Relationships: [] - } - v_certification_expiry: { - Row: { - certification_id: string | null - certification_name: string | null - days_until_expiry: number | null - expires_on: string | null - expiry_state: string | null - issued_on: string | null - staff_name: string | null - status: string | null - user_id: string | null - } - Relationships: [] - } - v_household_balances: { - Row: { - balance_due_cents: number | null - household_id: string | null - household_name: string | null - invoiced_cents: number | null - paid_cents: number | null - student_count: number | null - } - Relationships: [] - } - v_household_receivables: { - Row: { - balance_cents: number | null - household_id: string | null - household_name: string | null - invoiced_cents: number | null - paid_cents: number | null - past_due_cents: number | null - students: number | null - worst_days_overdue: number | null - } - Relationships: [ - { - foreignKeyName: "invoices_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - ] - } - v_open_tasks: { - Row: { - assigned_to: string | null - assigned_to_name: string | null - campus_id: string | null - campus_name: string | null - due_date: string | null - due_state: string | null - priority: string | null - related_student_id: string | null - status: string | null - task_id: string | null - title: string | null - } - Relationships: [ - { - foreignKeyName: "tasks_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tasks_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "tasks_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "tasks_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "tasks_related_student_id_fkey" - columns: ["related_student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "tasks_related_student_id_fkey" - columns: ["related_student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - v_outstanding_invoices: { - Row: { - amount_paid_cents: number | null - balance_due_cents: number | null - billing_period_end: string | null - billing_period_start: string | null - campus_id: string | null - campus_name: string | null - days_overdue: number | null - due_date: string | null - household_id: string | null - invoice_date: string | null - invoice_id: string | null - invoice_number: string | null - status: string | null - student_id: string | null - student_name: string | null - total_cents: number | null - } - Relationships: [ - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "invoices_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "invoices_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - { - foreignKeyName: "invoices_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "invoices_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - v_payment_detail: { - Row: { - amount_cents: number | null - campus_id: string | null - campus_name: string | null - effective_date: string | null - household_id: string | null - kind: string | null - method: string | null - notes: string | null - payer_name: string | null - payment_id: string | null - received_at: string | null - received_by: string | null - reference_number: string | null - reverses_payment_id: string | null - scholarship_id: string | null - status: string | null - student_id: string | null - student_name: string | null - third_party_name: string | null - void_reason: string | null - } - Relationships: [ - { - foreignKeyName: "payments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "payments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "payments_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "payments_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - { - foreignKeyName: "payments_reverses_payment_id_fkey" - columns: ["reverses_payment_id"] - isOneToOne: false - referencedRelation: "payments" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_reverses_payment_id_fkey" - columns: ["reverses_payment_id"] - isOneToOne: false - referencedRelation: "v_payment_detail" - referencedColumns: ["payment_id"] - }, - { - foreignKeyName: "payments_scholarship_id_fkey" - columns: ["scholarship_id"] - isOneToOne: false - referencedRelation: "scholarships" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "payments_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - v_pending_followups: { - Row: { - author_id: string | null - campus_id: string | null - category: string | null - days_overdue: number | null - follow_up_date: string | null - note_id: string | null - resolution_status: string | null - student_id: string | null - student_name: string | null - title: string | null - } - Relationships: [ - { - foreignKeyName: "student_notes_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "student_notes_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "student_notes_campus_id_fkey" - columns: ["campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "student_notes_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "student_notes_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - v_scheduled_vs_actual: { - Row: { - attendance_basis: string | null - days_scheduled: number | null - month: string | null - primary_campus_id: string | null - scheduled_and_present: number | null - scheduled_but_absent: number | null - student_id: string | null - student_name: string | null - unscheduled_but_present: number | null - vacation_days: number | null - } - Relationships: [ - { - foreignKeyName: "attendance_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "attendance_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - ] - } - v_student_directory: { - Row: { - active_alert_count: number | null - attendance_basis: string | null - calendar_basis: string | null - dob: string | null - enrollment_status: string | null - first_name: string | null - grade_level: string | null - household_id: string | null - household_name: string | null - is_support_student: boolean | null - last_name: string | null - middle_name: string | null - preferred_name: string | null - primary_campus: string | null - primary_campus_id: string | null - scheduled_campuses: string[] | null - scheduled_days_per_week: number | null - student_id: string | null - tuition_tier: string | null - } - Relationships: [ - { - foreignKeyName: "household_students_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "households" - referencedColumns: ["id"] - }, - { - foreignKeyName: "household_students_household_id_fkey" - columns: ["household_id"] - isOneToOne: false - referencedRelation: "v_household_balances" - referencedColumns: ["household_id"] - }, - ] - } - v_student_ledger: { - Row: { - amount_cents: number | null - campus_id: string | null - direction: string | null - effective_date: string | null - entered_by: string | null - method: string | null - ref_id: string | null - reference: string | null - running_balance_cents: number | null - sort_ts: string | null - source: string | null - student_id: string | null - student_name: string | null - txn_date: string | null - } - Relationships: [] - } - v_vacation_status: { - Row: { - campus_name: string | null - is_overridden: boolean | null - pending_requests: number | null - policy_year: number | null - primary_campus_id: string | null - student_id: string | null - student_name: string | null - weeks_allotted: number | null - weeks_remaining: number | null - weeks_used: number | null - } - Relationships: [ - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "campuses" - referencedColumns: ["id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_billing_summary" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_campus_enrollment" - referencedColumns: ["campus_id"] - }, - { - foreignKeyName: "students_primary_campus_id_fkey" - columns: ["primary_campus_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["primary_campus_id"] - }, - { - foreignKeyName: "vacation_balances_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "students" - referencedColumns: ["id"] - }, - { - foreignKeyName: "vacation_balances_student_id_fkey" - columns: ["student_id"] - isOneToOne: false - referencedRelation: "v_student_directory" - referencedColumns: ["student_id"] - }, - ] - } - } - Functions: { - active_student_alerts: { - Args: { _student: string } - Returns: { - alert_type: string - created_at: string - created_by: string | null - description: string - document_path: string | null - effective_date: string - expiration_date: string | null - id: string - is_active: boolean - parenting_plan_id: string | null - requires_acknowledgment: boolean - severity: string - student_id: string - title: string - updated_at: string - visible_to_roles: Database["public"]["Enums"]["app_role"][] - }[] - SetofOptions: { - from: "*" - to: "student_alerts" - isOneToOne: false - isSetofReturn: true - } - } - allocate_payment_oldest_first: { - Args: { _payment: string } - Returns: number - } - assess_attendance_penalties: { - Args: { _attendance: string } - Returns: number - } - campus_pending_scholarship_cents: { - Args: { _campus: string } - Returns: number - } - campus_ratio: { - Args: { _campus: string; _date: string } - Returns: { - actual_students_per_staff: number - campus_id: string - campus_name: string - is_compliant: boolean - present_staff: number - present_students: number - required_students_per_staff: number - rule_id: string - scheduled_staff: number - scheduled_students: number - staff_required: number - }[] - } - campus_roll_call: { - Args: { _campus: string; _date: string } - Returns: { - alert_count: number - attendance_id: string - check_in_at: string - check_out_at: string - class_name: string - early_arrival: boolean - early_pickup: boolean - expected_arrival: string - expected_departure: string - first_name: string - is_manual_override: boolean - last_name: string - late_arrival: boolean - late_pickup: boolean - photo_path: string - preferred_name: string - status: Database["public"]["Enums"]["attendance_status"] - student_id: string - was_scheduled: boolean - }[] - } - can_access_student: { Args: { _student: string }; Returns: boolean } - can_edit_goal: { Args: { _goal: string }; Returns: boolean } - can_edit_meeting: { Args: { _meeting: string }; Returns: boolean } - can_edit_plan: { Args: { _plan: string }; Returns: boolean } - can_guardian_view_category: { - Args: { _category: string; _student: string } - Returns: boolean - } - can_manage_student: { Args: { _student: string }; Returns: boolean } - can_view_goal: { Args: { _goal: string }; Returns: boolean } - can_view_meeting: { Args: { _meeting: string }; Returns: boolean } - can_view_plan_full: { Args: { _plan: string }; Returns: boolean } - can_view_plan_impl: { Args: { _plan: string }; Returns: boolean } - compute_all_invoice_lines: { - Args: { _from: string; _student: string; _to: string } - Returns: { - adjustment_rule_id: string - amount_cents: number - campus_id: string - credit_id: string - description: string - detail: Json - line_kind: string - quantity: number - scholarship_id: string - sort_order: number - tuition_rate_id: string - unit_amount_cents: number - }[] - } - compute_invoice_lines: { - Args: { _from: string; _student: string; _to: string } - Returns: { - adjustment_rule_id: string - amount_cents: number - campus_id: string - credit_id: string - description: string - detail: Json - line_kind: string - quantity: number - scholarship_id: string - sort_order: number - tuition_rate_id: string - unit_amount_cents: number - }[] - } - compute_penalty_fee: { - Args: { - _escalated?: boolean - _minutes_over: number - _rule: Database["public"]["Tables"]["penalty_rules"]["Row"] - } - Returns: number - } - compute_penalty_lines: { - Args: { _from: string; _student: string; _to: string } - Returns: { - adjustment_rule_id: string - amount_cents: number - campus_id: string - credit_id: string - description: string - detail: Json - line_kind: string - quantity: number - scholarship_id: string - sort_order: number - tuition_rate_id: string - unit_amount_cents: number - }[] - } - create_invoice: { - Args: { - _batch?: string - _from: string - _status?: string - _student: string - _to: string - } - Returns: string - } - current_user_has_any_role: { - Args: { _roles: Database["public"]["Enums"]["app_role"][] } - Returns: boolean - } - current_user_has_role: { - Args: { _role: Database["public"]["Enums"]["app_role"] } - Returns: boolean - } - eligible_students_for_batch: { - Args: { _criteria: Json; _from: string; _to: string } - Returns: { - student_id: string - }[] - } - family_responsibility_cents: { Args: { _plan: string }; Returns: number } - generate_invoice_batch: { Args: { _batch: string }; Returns: number } - has_campus_access: { Args: { _campus: string }; Returns: boolean } - has_role: { - Args: { - _role: Database["public"]["Enums"]["app_role"] - _user_id: string - } - Returns: boolean - } - invoice_recipients: { - Args: { _student: string } - Returns: { - email: string - full_name: string - member_id: string - user_id: string - }[] - } - is_auditor: { Args: never; Returns: boolean } - is_billing_admin: { Args: never; Returns: boolean } - is_household_guardian_of: { Args: { _student: string }; Returns: boolean } - is_management: { Args: never; Returns: boolean } - is_org_admin: { Args: never; Returns: boolean } - is_parent_of: { Args: { _student: string }; Returns: boolean } - is_service_context: { Args: never; Returns: boolean } - is_student_account: { Args: { _student: string }; Returns: boolean } - is_super_admin: { Args: never; Returns: boolean } - is_thread_participant: { Args: { _thread: string }; Returns: boolean } - mark_penalties_invoiced: { - Args: { _from: string; _invoice: string; _student: string; _to: string } - Returns: number - } - next_invoice_number: { Args: never; Returns: string } - payment_unallocated_cents: { Args: { _payment: string }; Returns: number } - preview_invoice_batch: { - Args: { _batch: string } - Returns: { - campus_name: string - scheduled_days: number - student_id: string - student_name: string - subtotal_cents: number - total_cents: number - }[] - } - recalc_vacation_balance: { - Args: { _student: string; _year: number } - Returns: undefined - } - refresh_invoice_paid: { Args: { _invoice: string }; Returns: undefined } - refund_payment: { - Args: { _amount_cents: number; _payment: string; _reason: string } - Returns: string - } - resolve_penalty_rule: { - Args: { _campus: string; _on: string; _type: string } - Returns: { - allowed_time: string | null - amount_cents: number - campus_id: string | null - created_at: string - created_by: string | null - effective_end: string | null - effective_start: string - escalated_amount_cents: number | null - grace_period_minutes: number - id: string - increment_minutes: number | null - is_active: boolean - max_fee_cents: number | null - method: string - name: string - notes: string | null - notify_parent: boolean - priority: number - requires_approval: boolean - rule_type: string - threshold_count: number | null - threshold_window_days: number | null - updated_at: string - waiver_roles: Database["public"]["Enums"]["app_role"][] - } - SetofOptions: { - from: "*" - to: "penalty_rules" - isOneToOne: true - isSetofReturn: false - } - } - resolve_ratio_rule: { - Args: { - _age_months?: number - _campus: string - _classroom?: string - _on: string - } - Returns: { - campus_id: string | null - classroom_id: string | null - created_at: string - created_by: string | null - effective_end: string | null - effective_start: string - grade_level: string | null - id: string - is_active: boolean - licensing_reference: string | null - max_age_months: number | null - max_group_size: number | null - min_age_months: number | null - name: string - notes: string | null - priority: number - program_id: string | null - students_per_staff: number - updated_at: string - } - SetofOptions: { - from: "*" - to: "ratio_rules" - isOneToOne: true - isSetofReturn: false - } - } - resolve_tuition_override: { - Args: { _on: string; _student: string } - Returns: { - amount_cents: number - approved_at: string | null - approved_by: string | null - campus_id: string | null - created_at: string - created_by: string | null - document_path: string | null - end_date: string | null - frequency: string - id: string - last_modified_by: string | null - reason: string - start_date: string - student_id: string - updated_at: string - } - SetofOptions: { - from: "*" - to: "student_tuition_assignments" - isOneToOne: true - isSetofReturn: false - } - } - resolve_tuition_rate: { - Args: { _campus: string; _days?: number; _on: string; _student: string } - Returns: { - amount_cents: number - attendance_basis: string | null - campus_id: string | null - created_at: string - created_by: string | null - effective_end: string | null - effective_start: string - id: string - is_active: boolean - max_days: number | null - min_days: number | null - notes: string | null - priority: number - program_id: string | null - rate_basis: string - requires_scholarship: boolean | null - requires_support_student: boolean | null - tier_id: string | null - updated_at: string - } - SetofOptions: { - from: "*" - to: "tuition_rates" - isOneToOne: true - isSetofReturn: false - } - } - resolve_vacation_policy: { - Args: { _student: string } - Returns: { - applies_to_attendance_basis: string | null - applies_to_calendar_basis: string | null - campus_id: string | null - created_at: string - id: string - is_active: boolean - min_increment_days: number - name: string - notes: string | null - partial_weeks_allowed: boolean - priority: number - reset_day: number - reset_month: number - tuition_due_during_vacation: boolean - updated_at: string - weeks_per_year: number - } - SetofOptions: { - from: "*" - to: "vacation_policies" - isOneToOne: true - isSetofReturn: false - } - } - reverse_payment: { - Args: { _payment: string; _reason: string } - Returns: string - } - staff_compliance_gaps: { - Args: { _user: string } - Returns: { - campus_id: string - certification_name: string - certification_type_id: string - expires_on: string - gap_kind: string - }[] - } - student_campus_ids: { - Args: { _from?: string; _student: string; _to?: string } - Returns: string[] - } - student_display_name: { Args: { _student: string }; Returns: string } - student_has_tag: { - Args: { _slug: string; _student: string } - Returns: boolean - } - student_scheduled_days: { - Args: { _from: string; _student: string; _to: string } - Returns: { - campus_id: string - days_per_week: number - total_days: number - weeks: number - }[] - } - take_ratio_snapshot: { Args: { _campus: string }; Returns: number } - teaches_class: { Args: { _class: string }; Returns: boolean } - teaches_student: { Args: { _student: string }; Returns: boolean } - unacknowledged_alerts: { - Args: { _student: string } - Returns: { - alert_type: string - created_at: string - created_by: string | null - description: string - document_path: string | null - effective_date: string - expiration_date: string | null - id: string - is_active: boolean - parenting_plan_id: string | null - requires_acknowledgment: boolean - severity: string - student_id: string - title: string - updated_at: string - visible_to_roles: Database["public"]["Enums"]["app_role"][] - }[] - SetofOptions: { - from: "*" - to: "student_alerts" - isOneToOne: false - isSetofReturn: true - } - } - user_campus_ids: { Args: never; Returns: string[] } - user_household_ids: { Args: never; Returns: string[] } - vacation_entitlement_weeks: { - Args: { _student: string; _year: number } - Returns: number - } - vacation_year_for: { - Args: { _on: string; _student: string } - Returns: number - } - } - Enums: { - app_role: - | "admin" - | "teacher" - | "parent" - | "student" - | "super_admin" - | "org_admin" - | "campus_admin" - | "management" - | "billing_admin" - | "staff" - | "auditor" - attendance_status: - | "present" - | "absent" - | "late" - | "excused" - | "vacation" - | "holiday" - ledger_category: "tuition" | "late_pickup" | "activity" | "other" - ledger_kind: "charge" | "payment" - plan_goal_status: - | "not_started" - | "in_progress" - | "met" - | "not_met" - | "discontinued" - plan_meeting_type: - | "initial" - | "annual_review" - | "reevaluation" - | "eligibility" - | "amendment" - | "other" - plan_status: "draft" | "active" | "archived" - plan_type: "iep" | "section_504" - } - CompositeTypes: { - [_ in never]: never - } - } -} - -type DatabaseWithoutInternals = Omit - -type DefaultSchema = DatabaseWithoutInternals[Extract] - -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 = { - graphql_public: { - Enums: {}, - }, - public: { - Enums: { - app_role: [ - "admin", - "teacher", - "parent", - "student", - "super_admin", - "org_admin", - "campus_admin", - "management", - "billing_admin", - "staff", - "auditor", - ], - attendance_status: [ - "present", - "absent", - "late", - "excused", - "vacation", - "holiday", - ], - ledger_category: ["tuition", "late_pickup", "activity", "other"], - ledger_kind: ["charge", "payment"], - plan_goal_status: [ - "not_started", - "in_progress", - "met", - "not_met", - "discontinued", - ], - plan_meeting_type: [ - "initial", - "annual_review", - "reevaluation", - "eligibility", - "amendment", - "other", - ], - plan_status: ["draft", "active", "archived"], - plan_type: ["iep", "section_504"], - }, - }, -} as const