From e6dded8ab502563ef77bc0e6d21d6b352e3e42a6 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 7 Aug 2026 13:03:40 +0000 Subject: [PATCH] Modified by www.SourceFiles.app --- src/integrations/supabase/types.ts | 723 ++++++++++++++++++++++++++++- 1 file changed, 721 insertions(+), 2 deletions(-) diff --git a/src/integrations/supabase/types.ts b/src/integrations/supabase/types.ts index 8e099a6..2c3dbb6 100644 --- a/src/integrations/supabase/types.ts +++ b/src/integrations/supabase/types.ts @@ -342,33 +342,102 @@ export type Database = { } 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_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"] @@ -385,6 +454,64 @@ export type Database = { }, ] } + 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_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 @@ -2730,6 +2857,179 @@ export type Database = { } 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_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_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 @@ -2904,6 +3204,83 @@ export type Database = { }, ] } + 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_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 @@ -3164,6 +3541,8 @@ export type Database = { 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 @@ -3186,6 +3565,8 @@ export type Database = { 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 @@ -3208,6 +3589,8 @@ export type Database = { 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 @@ -4501,6 +4884,218 @@ export type Database = { } 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_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_summary: { @@ -4835,6 +5430,46 @@ export type Database = { isSetofReturn: true } } + 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 } @@ -4928,6 +5563,45 @@ export type Database = { total_cents: number }[] } + recalc_vacation_balance: { + Args: { _student: string; _year: number } + Returns: undefined + } + 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: { @@ -4984,6 +5658,33 @@ export type Database = { 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 + } + } staff_compliance_gaps: { Args: { _user: string } Returns: { @@ -5011,6 +5712,7 @@ export type Database = { 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: { @@ -5042,6 +5744,10 @@ export type Database = { } user_campus_ids: { Args: never; Returns: string[] } user_household_ids: { Args: never; Returns: string[] } + vacation_year_for: { + Args: { _on: string; _student: string } + Returns: number + } } Enums: { app_role: @@ -5056,7 +5762,13 @@ export type Database = { | "billing_admin" | "staff" | "auditor" - attendance_status: "present" | "absent" | "late" | "excused" + attendance_status: + | "present" + | "absent" + | "late" + | "excused" + | "vacation" + | "holiday" ledger_category: "tuition" | "late_pickup" | "activity" | "other" ledger_kind: "charge" | "payment" plan_goal_status: @@ -5217,7 +5929,14 @@ export const Constants = { "staff", "auditor", ], - attendance_status: ["present", "absent", "late", "excused"], + attendance_status: [ + "present", + "absent", + "late", + "excused", + "vacation", + "holiday", + ], ledger_category: ["tuition", "late_pickup", "activity", "other"], ledger_kind: ["charge", "payment"], plan_goal_status: [