Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-16 22:45:54 +00:00
co-authored by renee-png
parent f1b1cc8f6d
commit dc787df0aa
2 changed files with 836 additions and 4 deletions
+470 -4
View File
@@ -14,16 +14,470 @@ export type Database = {
}
public: {
Tables: {
[_ in never]: never
cases: {
Row: {
assigned_attorney_id: string | null
case_number: string
client_id: string
closed_at: string | null
created_at: string
created_by: string | null
default_hourly_rate: number | null
description: string | null
id: string
opened_at: string
practice_area: string | null
status: Database["public"]["Enums"]["case_status"]
title: string
updated_at: string
}
Insert: {
assigned_attorney_id?: string | null
case_number: string
client_id: string
closed_at?: string | null
created_at?: string
created_by?: string | null
default_hourly_rate?: number | null
description?: string | null
id?: string
opened_at?: string
practice_area?: string | null
status?: Database["public"]["Enums"]["case_status"]
title: string
updated_at?: string
}
Update: {
assigned_attorney_id?: string | null
case_number?: string
client_id?: string
closed_at?: string | null
created_at?: string
created_by?: string | null
default_hourly_rate?: number | null
description?: string | null
id?: string
opened_at?: string
practice_area?: string | null
status?: Database["public"]["Enums"]["case_status"]
title?: string
updated_at?: string
}
Relationships: [
{
foreignKeyName: "cases_client_id_fkey"
columns: ["client_id"]
isOneToOne: false
referencedRelation: "clients"
referencedColumns: ["id"]
},
]
}
clients: {
Row: {
address_line1: string | null
address_line2: string | null
board_members: Json
city: string | null
client_type: Database["public"]["Enums"]["client_type"]
created_at: string
created_by: string | null
id: string
management_company: string | null
name: string
notes: string | null
num_units: number | null
postal_code: string | null
primary_contact_email: string | null
primary_contact_name: string | null
primary_contact_phone: string | null
state: string | null
updated_at: string
}
Insert: {
address_line1?: string | null
address_line2?: string | null
board_members?: Json
city?: string | null
client_type?: Database["public"]["Enums"]["client_type"]
created_at?: string
created_by?: string | null
id?: string
management_company?: string | null
name: string
notes?: string | null
num_units?: number | null
postal_code?: string | null
primary_contact_email?: string | null
primary_contact_name?: string | null
primary_contact_phone?: string | null
state?: string | null
updated_at?: string
}
Update: {
address_line1?: string | null
address_line2?: string | null
board_members?: Json
city?: string | null
client_type?: Database["public"]["Enums"]["client_type"]
created_at?: string
created_by?: string | null
id?: string
management_company?: string | null
name?: string
notes?: string | null
num_units?: number | null
postal_code?: string | null
primary_contact_email?: string | null
primary_contact_name?: string | null
primary_contact_phone?: string | null
state?: string | null
updated_at?: string
}
Relationships: []
}
documents: {
Row: {
case_id: string
created_at: string
description: string | null
id: string
mime_type: string | null
name: string
size_bytes: number | null
storage_path: string
uploaded_by: string | null
}
Insert: {
case_id: string
created_at?: string
description?: string | null
id?: string
mime_type?: string | null
name: string
size_bytes?: number | null
storage_path: string
uploaded_by?: string | null
}
Update: {
case_id?: string
created_at?: string
description?: string | null
id?: string
mime_type?: string | null
name?: string
size_bytes?: number | null
storage_path?: string
uploaded_by?: string | null
}
Relationships: [
{
foreignKeyName: "documents_case_id_fkey"
columns: ["case_id"]
isOneToOne: false
referencedRelation: "cases"
referencedColumns: ["id"]
},
]
}
expenses: {
Row: {
amount: number
billable: boolean
case_id: string
created_at: string
description: string
expense_date: string
id: string
invoice_id: string | null
receipt_storage_path: string | null
updated_at: string
user_id: string
}
Insert: {
amount: number
billable?: boolean
case_id: string
created_at?: string
description: string
expense_date?: string
id?: string
invoice_id?: string | null
receipt_storage_path?: string | null
updated_at?: string
user_id: string
}
Update: {
amount?: number
billable?: boolean
case_id?: string
created_at?: string
description?: string
expense_date?: string
id?: string
invoice_id?: string | null
receipt_storage_path?: string | null
updated_at?: string
user_id?: string
}
Relationships: [
{
foreignKeyName: "expenses_case_id_fkey"
columns: ["case_id"]
isOneToOne: false
referencedRelation: "cases"
referencedColumns: ["id"]
},
{
foreignKeyName: "expenses_invoice_fk"
columns: ["invoice_id"]
isOneToOne: false
referencedRelation: "invoices"
referencedColumns: ["id"]
},
]
}
invoices: {
Row: {
amount_paid: number
case_id: string | null
client_id: string
created_at: string
created_by: string | null
due_date: string | null
id: string
invoice_number: string
issue_date: string
notes: string | null
paid_at: string | null
status: Database["public"]["Enums"]["invoice_status"]
subtotal: number
tax: number
total: number
updated_at: string
}
Insert: {
amount_paid?: number
case_id?: string | null
client_id: string
created_at?: string
created_by?: string | null
due_date?: string | null
id?: string
invoice_number: string
issue_date?: string
notes?: string | null
paid_at?: string | null
status?: Database["public"]["Enums"]["invoice_status"]
subtotal?: number
tax?: number
total?: number
updated_at?: string
}
Update: {
amount_paid?: number
case_id?: string | null
client_id?: string
created_at?: string
created_by?: string | null
due_date?: string | null
id?: string
invoice_number?: string
issue_date?: string
notes?: string | null
paid_at?: string | null
status?: Database["public"]["Enums"]["invoice_status"]
subtotal?: number
tax?: number
total?: number
updated_at?: string
}
Relationships: [
{
foreignKeyName: "invoices_case_id_fkey"
columns: ["case_id"]
isOneToOne: false
referencedRelation: "cases"
referencedColumns: ["id"]
},
{
foreignKeyName: "invoices_client_id_fkey"
columns: ["client_id"]
isOneToOne: false
referencedRelation: "clients"
referencedColumns: ["id"]
},
]
}
profiles: {
Row: {
created_at: string
email: string
full_name: string
id: string
updated_at: string
}
Insert: {
created_at?: string
email?: string
full_name?: string
id: string
updated_at?: string
}
Update: {
created_at?: string
email?: string
full_name?: string
id?: string
updated_at?: string
}
Relationships: []
}
status_updates: {
Row: {
body: string
case_id: string
created_at: string
created_by: string | null
id: string
report_storage_path: string | null
title: string
}
Insert: {
body: string
case_id: string
created_at?: string
created_by?: string | null
id?: string
report_storage_path?: string | null
title: string
}
Update: {
body?: string
case_id?: string
created_at?: string
created_by?: string | null
id?: string
report_storage_path?: string | null
title?: string
}
Relationships: [
{
foreignKeyName: "status_updates_case_id_fkey"
columns: ["case_id"]
isOneToOne: false
referencedRelation: "cases"
referencedColumns: ["id"]
},
]
}
time_entries: {
Row: {
billable: boolean
case_id: string
created_at: string
description: string
hourly_rate: number
hours: number
id: string
invoice_id: string | null
updated_at: string
user_id: string
work_date: string
}
Insert: {
billable?: boolean
case_id: string
created_at?: string
description: string
hourly_rate?: number
hours: number
id?: string
invoice_id?: string | null
updated_at?: string
user_id: string
work_date?: string
}
Update: {
billable?: boolean
case_id?: string
created_at?: string
description?: string
hourly_rate?: number
hours?: number
id?: string
invoice_id?: string | null
updated_at?: string
user_id?: string
work_date?: string
}
Relationships: [
{
foreignKeyName: "time_entries_case_id_fkey"
columns: ["case_id"]
isOneToOne: false
referencedRelation: "cases"
referencedColumns: ["id"]
},
{
foreignKeyName: "time_entries_invoice_fk"
columns: ["invoice_id"]
isOneToOne: false
referencedRelation: "invoices"
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
can_access_case: {
Args: { _case_id: string; _user_id: string }
Returns: boolean
}
has_role: {
Args: {
_role: Database["public"]["Enums"]["app_role"]
_user_id: string
}
Returns: boolean
}
is_admin: { Args: { _user_id: string }; Returns: boolean }
}
Enums: {
[_ in never]: never
app_role: "admin" | "attorney" | "staff"
case_status:
| "intake"
| "active"
| "on_hold"
| "closed_won"
| "closed_lost"
| "closed"
client_type: "hoa" | "individual" | "business"
invoice_status: "draft" | "sent" | "paid" | "overdue" | "void"
}
CompositeTypes: {
[_ in never]: never
@@ -150,6 +604,18 @@ export type CompositeTypes<
export const Constants = {
public: {
Enums: {},
Enums: {
app_role: ["admin", "attorney", "staff"],
case_status: [
"intake",
"active",
"on_hold",
"closed_won",
"closed_lost",
"closed",
],
client_type: ["hoa", "individual", "business"],
invoice_status: ["draft", "sent", "paid", "overdue", "void"],
},
},
} as const