Twilioapp-admin/types/database.ts
mars f20988b90c feat: 完成所有页面的演示模式实现
- 更新 DashboardLayout 组件,统一使用演示模式布局
- 实现仪表盘页面的完整演示数据和功能
- 完成用户管理页面的演示模式,包含搜索、过滤、分页等功能
- 实现通话记录页面的演示数据和录音播放功能
- 完成翻译员管理页面的演示模式
- 实现订单管理页面的完整功能
- 完成发票管理页面的演示数据
- 更新文档管理页面
- 添加 utils.ts 工具函数库
- 完善 API 路由和数据库结构
- 修复各种 TypeScript 类型错误
- 统一界面风格和用户体验
2025-06-30 19:42:43 +08:00

520 lines
15 KiB
TypeScript

export type Json =
| string
| number
| boolean
| null
| { [key: string]: Json | undefined }
| Json[]
export interface Database {
public: {
Tables: {
users: {
Row: {
id: string
email: string
name: string
phone?: string
user_type: 'individual' | 'enterprise'
status: 'active' | 'inactive'
enterprise_id?: string
avatar_url?: string
created_at: string
updated_at: string
}
Insert: {
id?: string
email: string
name: string
phone?: string
user_type: 'individual' | 'enterprise'
status?: 'active' | 'inactive'
enterprise_id?: string
avatar_url?: string
created_at?: string
updated_at?: string
}
Update: {
id?: string
email?: string
name?: string
phone?: string
user_type?: 'individual' | 'enterprise'
status?: 'active' | 'inactive'
enterprise_id?: string
avatar_url?: string
created_at?: string
updated_at?: string
}
}
enterprises: {
Row: {
id: string
name: string
contact_person: string
contact_email: string
contact_phone: string
address: string
tax_number?: string
status: 'active' | 'inactive'
created_at: string
updated_at: string
}
Insert: {
id?: string
name: string
contact_person: string
contact_email: string
contact_phone: string
address: string
tax_number?: string
status?: 'active' | 'inactive'
created_at?: string
updated_at?: string
}
Update: {
id?: string
name?: string
contact_person?: string
contact_email?: string
contact_phone?: string
address?: string
tax_number?: string
status?: 'active' | 'inactive'
created_at?: string
updated_at?: string
}
}
enterprise_contracts: {
Row: {
id: string
enterprise_id: string
contract_number: string
contract_type: string
start_date: string
end_date: string
total_amount: number
currency: string
status: 'active' | 'expired' | 'terminated'
service_rates: Json
created_at: string
updated_at: string
}
Insert: {
id?: string
enterprise_id: string
contract_number: string
contract_type: string
start_date: string
end_date: string
total_amount: number
currency?: string
status?: 'active' | 'expired' | 'terminated'
service_rates?: Json
created_at?: string
updated_at?: string
}
Update: {
id?: string
enterprise_id?: string
contract_number?: string
contract_type?: string
start_date?: string
end_date?: string
total_amount?: number
currency?: string
status?: 'active' | 'expired' | 'terminated'
service_rates?: Json
created_at?: string
updated_at?: string
}
}
enterprise_bills: {
Row: {
id: string
enterprise_id: string
bill_number: string
billing_period_start: string
billing_period_end: string
total_amount: number
currency: string
status: 'draft' | 'sent' | 'paid' | 'overdue'
items: Json
created_at: string
updated_at: string
}
Insert: {
id?: string
enterprise_id: string
bill_number: string
billing_period_start: string
billing_period_end: string
total_amount: number
currency?: string
status?: 'draft' | 'sent' | 'paid' | 'overdue'
items?: Json
created_at?: string
updated_at?: string
}
Update: {
id?: string
enterprise_id?: string
bill_number?: string
billing_period_start?: string
billing_period_end?: string
total_amount?: number
currency?: string
status?: 'draft' | 'sent' | 'paid' | 'overdue'
items?: Json
created_at?: string
updated_at?: string
}
}
orders: {
Row: {
id: string
order_number: string
user_id: string
user_name: string
user_email: string
service_type: 'ai_voice' | 'ai_video' | 'sign_language' | 'human_interpretation' | 'document_translation'
service_name: string
source_language: string
target_language: string
duration?: number
status: 'pending' | 'processing' | 'completed' | 'cancelled' | 'failed'
priority: 'urgent' | 'high' | 'normal' | 'low'
cost: number
currency: string
scheduled_time?: string
started_time?: string
completed_time?: string
interpreter_id?: string
interpreter_name?: string
notes?: string
created_at: string
updated_at: string
}
Insert: {
id?: string
order_number: string
user_id: string
user_name: string
user_email: string
service_type: 'ai_voice' | 'ai_video' | 'sign_language' | 'human_interpretation' | 'document_translation'
service_name: string
source_language: string
target_language: string
duration?: number
status?: 'pending' | 'processing' | 'completed' | 'cancelled' | 'failed'
priority?: 'urgent' | 'high' | 'normal' | 'low'
cost: number
currency?: string
scheduled_time?: string
started_time?: string
completed_time?: string
interpreter_id?: string
interpreter_name?: string
notes?: string
created_at?: string
updated_at?: string
}
Update: {
id?: string
order_number?: string
user_id?: string
user_name?: string
user_email?: string
service_type?: 'ai_voice' | 'ai_video' | 'sign_language' | 'human_interpretation' | 'document_translation'
service_name?: string
source_language?: string
target_language?: string
duration?: number
status?: 'pending' | 'processing' | 'completed' | 'cancelled' | 'failed'
priority?: 'urgent' | 'high' | 'normal' | 'low'
cost?: number
currency?: string
scheduled_time?: string
started_time?: string
completed_time?: string
interpreter_id?: string
interpreter_name?: string
notes?: string
created_at?: string
updated_at?: string
}
}
invoices: {
Row: {
id: string
invoice_number: string
user_id: string
user_name: string
user_email: string
order_id?: string
invoice_type: 'personal' | 'enterprise'
personal_name?: string
company_name?: string
tax_number?: string
company_address?: string
subtotal: number
tax_amount: number
total_amount: number
currency: string
status: 'draft' | 'issued' | 'paid' | 'cancelled'
issue_date?: string
due_date?: string
paid_date?: string
items: Json
created_at: string
updated_at: string
}
Insert: {
id?: string
invoice_number: string
user_id: string
user_name: string
user_email: string
order_id?: string
invoice_type: 'personal' | 'enterprise'
personal_name?: string
company_name?: string
tax_number?: string
company_address?: string
subtotal: number
tax_amount: number
total_amount: number
currency?: string
status?: 'draft' | 'issued' | 'paid' | 'cancelled'
issue_date?: string
due_date?: string
paid_date?: string
items?: Json
created_at?: string
updated_at?: string
}
Update: {
id?: string
invoice_number?: string
user_id?: string
user_name?: string
user_email?: string
order_id?: string
invoice_type?: 'personal' | 'enterprise'
personal_name?: string
company_name?: string
tax_number?: string
company_address?: string
subtotal?: number
tax_amount?: number
total_amount?: number
currency?: string
status?: 'draft' | 'issued' | 'paid' | 'cancelled'
issue_date?: string
due_date?: string
paid_date?: string
items?: Json
created_at?: string
updated_at?: string
}
}
interpreters: {
Row: {
id: string
name: string
email: string
phone: string
languages: string[]
specialties: string[]
status: 'online' | 'offline' | 'busy'
rating: number
total_calls: number
hourly_rate: number
currency: string
avatar_url?: string
bio?: string
created_at: string
updated_at: string
}
Insert: {
id?: string
name: string
email: string
phone: string
languages: string[]
specialties: string[]
status?: 'online' | 'offline' | 'busy'
rating?: number
total_calls?: number
hourly_rate: number
currency?: string
avatar_url?: string
bio?: string
created_at?: string
updated_at?: string
}
Update: {
id?: string
name?: string
email?: string
phone?: string
languages?: string[]
specialties?: string[]
status?: 'online' | 'offline' | 'busy'
rating?: number
total_calls?: number
hourly_rate?: number
currency?: string
avatar_url?: string
bio?: string
created_at?: string
updated_at?: string
}
}
calls: {
Row: {
id: string
user_id: string
interpreter_id?: string
service_type: 'ai_voice' | 'ai_video' | 'sign_language' | 'human_interpretation'
source_language: string
target_language: string
status: 'waiting' | 'connecting' | 'active' | 'completed' | 'failed'
duration?: number
cost: number
currency: string
quality_rating?: number
started_at?: string
ended_at?: string
created_at: string
updated_at: string
}
Insert: {
id?: string
user_id: string
interpreter_id?: string
service_type: 'ai_voice' | 'ai_video' | 'sign_language' | 'human_interpretation'
source_language: string
target_language: string
status?: 'waiting' | 'connecting' | 'active' | 'completed' | 'failed'
duration?: number
cost: number
currency?: string
quality_rating?: number
started_at?: string
ended_at?: string
created_at?: string
updated_at?: string
}
Update: {
id?: string
user_id?: string
interpreter_id?: string
service_type?: 'ai_voice' | 'ai_video' | 'sign_language' | 'human_interpretation'
source_language?: string
target_language?: string
status?: 'waiting' | 'connecting' | 'active' | 'completed' | 'failed'
duration?: number
cost?: number
currency?: string
quality_rating?: number
started_at?: string
ended_at?: string
created_at?: string
updated_at?: string
}
}
documents: {
Row: {
id: string
user_id: string
filename: string
original_name: string
file_size: number
file_type: string
source_language: string
target_language: string
status: 'uploaded' | 'processing' | 'completed' | 'failed'
progress: number
cost: number
currency: string
translated_file_url?: string
created_at: string
updated_at: string
}
Insert: {
id?: string
user_id: string
filename: string
original_name: string
file_size: number
file_type: string
source_language: string
target_language: string
status?: 'uploaded' | 'processing' | 'completed' | 'failed'
progress?: number
cost: number
currency?: string
translated_file_url?: string
created_at?: string
updated_at?: string
}
Update: {
id?: string
user_id?: string
filename?: string
original_name?: string
file_size?: number
file_type?: string
source_language?: string
target_language?: string
status?: 'uploaded' | 'processing' | 'completed' | 'failed'
progress?: number
cost?: number
currency?: string
translated_file_url?: string
created_at?: string
updated_at?: string
}
}
system_settings: {
Row: {
id: string
key: string
value: Json
description?: string
created_at: string
updated_at: string
}
Insert: {
id?: string
key: string
value: Json
description?: string
created_at?: string
updated_at?: string
}
Update: {
id?: string
key?: string
value?: Json
description?: string
created_at?: string
updated_at?: string
}
}
}
Views: {
[_ in never]: never
}
Functions: {
[_ in never]: never
}
Enums: {
[_ in never]: never
}
CompositeTypes: {
[_ in never]: never
}
}
}