Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-06-30 20:40:17 +00:00
co-authored by renee-png
parent 4ca9d41165
commit 1fdd309ca8
5 changed files with 9288 additions and 4 deletions
+519 -4
View File
@@ -14,16 +14,526 @@ export type Database = {
}
public: {
Tables: {
[_ in never]: never
attendance: {
Row: {
created_at: string
date: string
id: string
note: string | null
recorded_by: string | null
status: Database["public"]["Enums"]["attendance_status"]
student_id: string
}
Insert: {
created_at?: string
date: string
id?: string
note?: string | null
recorded_by?: string | null
status?: Database["public"]["Enums"]["attendance_status"]
student_id: string
}
Update: {
created_at?: string
date?: string
id?: string
note?: string | null
recorded_by?: string | null
status?: Database["public"]["Enums"]["attendance_status"]
student_id?: string
}
Relationships: [
{
foreignKeyName: "attendance_student_id_fkey"
columns: ["student_id"]
isOneToOne: false
referencedRelation: "students"
referencedColumns: ["id"]
},
]
}
authorized_pickups: {
Row: {
created_at: string
id: string
name: string
phone: string | null
relationship: string | null
student_id: string
}
Insert: {
created_at?: string
id?: string
name: string
phone?: string | null
relationship?: string | null
student_id: string
}
Update: {
created_at?: string
id?: string
name?: string
phone?: string | null
relationship?: string | null
student_id?: string
}
Relationships: [
{
foreignKeyName: "authorized_pickups_student_id_fkey"
columns: ["student_id"]
isOneToOne: false
referencedRelation: "students"
referencedColumns: ["id"]
},
]
}
calendar_events: {
Row: {
created_at: string
created_by: string | null
date: string
description: string | null
end_date: string | null
id: string
title: string
}
Insert: {
created_at?: string
created_by?: string | null
date: string
description?: string | null
end_date?: string | null
id?: string
title: string
}
Update: {
created_at?: string
created_by?: string | null
date?: string
description?: string | null
end_date?: string | null
id?: string
title?: string
}
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: []
}
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"]
},
]
}
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"]
},
]
}
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: []
}
ledger_entries: {
Row: {
amount_cents: number
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
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
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_student_id_fkey"
columns: ["student_id"]
isOneToOne: false
referencedRelation: "students"
referencedColumns: ["id"]
},
]
}
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"]
},
]
}
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"]
},
]
}
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"]
},
]
}
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: []
}
students: {
Row: {
allergies: string | null
class_id: string | null
created_at: string
dob: string | null
first_name: string
id: string
last_name: string
notes: string | null
photo_release: boolean
updated_at: string
}
Insert: {
allergies?: string | null
class_id?: string | null
created_at?: string
dob?: string | null
first_name: string
id?: string
last_name: string
notes?: string | null
photo_release?: boolean
updated_at?: string
}
Update: {
allergies?: string | null
class_id?: string | null
created_at?: string
dob?: string | null
first_name?: string
id?: string
last_name?: string
notes?: string | null
photo_release?: boolean
updated_at?: string
}
Relationships: [
{
foreignKeyName: "students_class_id_fkey"
columns: ["class_id"]
isOneToOne: false
referencedRelation: "classes"
referencedColumns: ["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"]
},
]
}
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: []
}
}
Views: {
[_ in never]: never
}
Functions: {
[_ in never]: never
current_user_has_role: {
Args: { _role: Database["public"]["Enums"]["app_role"] }
Returns: boolean
}
has_role: {
Args: {
_role: Database["public"]["Enums"]["app_role"]
_user_id: string
}
Returns: boolean
}
is_parent_of: { Args: { _student: string }; Returns: boolean }
is_thread_participant: { Args: { _thread: string }; Returns: boolean }
teaches_student: { Args: { _student: string }; Returns: boolean }
}
Enums: {
[_ in never]: never
app_role: "admin" | "teacher" | "parent"
attendance_status: "present" | "absent" | "late" | "excused"
ledger_category: "tuition" | "late_pickup" | "activity" | "other"
ledger_kind: "charge" | "payment"
}
CompositeTypes: {
[_ in never]: never
@@ -150,6 +660,11 @@ export type CompositeTypes<
export const Constants = {
public: {
Enums: {},
Enums: {
app_role: ["admin", "teacher", "parent"],
attendance_status: ["present", "absent", "late", "excused"],
ledger_category: ["tuition", "late_pickup", "activity", "other"],
ledger_kind: ["charge", "payment"],
},
},
} as const