426 lines
12 KiB
TypeScript
426 lines
12 KiB
TypeScript
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<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
|
|
__InternalSupabase: {
|
|
PostgrestVersion: "14.5"
|
|
}
|
|
public: {
|
|
Tables: {
|
|
addresses: {
|
|
Row: {
|
|
address_line: string
|
|
created_at: string
|
|
id: string
|
|
is_default: boolean
|
|
label: string
|
|
notes: string | null
|
|
phone: string
|
|
recipient_name: string
|
|
user_id: string
|
|
}
|
|
Insert: {
|
|
address_line: string
|
|
created_at?: string
|
|
id?: string
|
|
is_default?: boolean
|
|
label: string
|
|
notes?: string | null
|
|
phone: string
|
|
recipient_name: string
|
|
user_id: string
|
|
}
|
|
Update: {
|
|
address_line?: string
|
|
created_at?: string
|
|
id?: string
|
|
is_default?: boolean
|
|
label?: string
|
|
notes?: string | null
|
|
phone?: string
|
|
recipient_name?: string
|
|
user_id?: string
|
|
}
|
|
Relationships: []
|
|
}
|
|
order_items: {
|
|
Row: {
|
|
created_at: string
|
|
id: string
|
|
order_id: string
|
|
product_id: string
|
|
product_name: string
|
|
quantity: number
|
|
unit_price: number
|
|
}
|
|
Insert: {
|
|
created_at?: string
|
|
id?: string
|
|
order_id: string
|
|
product_id: string
|
|
product_name: string
|
|
quantity: number
|
|
unit_price: number
|
|
}
|
|
Update: {
|
|
created_at?: string
|
|
id?: string
|
|
order_id?: string
|
|
product_id?: string
|
|
product_name?: string
|
|
quantity?: number
|
|
unit_price?: number
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "order_items_order_id_fkey"
|
|
columns: ["order_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "orders"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
orders: {
|
|
Row: {
|
|
address_id: string | null
|
|
created_at: string
|
|
customer_name: string | null
|
|
customer_phone: string | null
|
|
delivery_address: string | null
|
|
delivery_fee: number
|
|
delivery_notes: string | null
|
|
id: string
|
|
item_count: number
|
|
order_number: string
|
|
status: string
|
|
subtotal: number
|
|
total: number
|
|
user_id: string | null
|
|
}
|
|
Insert: {
|
|
address_id?: string | null
|
|
created_at?: string
|
|
customer_name?: string | null
|
|
customer_phone?: string | null
|
|
delivery_address?: string | null
|
|
delivery_fee?: number
|
|
delivery_notes?: string | null
|
|
id?: string
|
|
item_count?: number
|
|
order_number: string
|
|
status?: string
|
|
subtotal?: number
|
|
total?: number
|
|
user_id?: string | null
|
|
}
|
|
Update: {
|
|
address_id?: string | null
|
|
created_at?: string
|
|
customer_name?: string | null
|
|
customer_phone?: string | null
|
|
delivery_address?: string | null
|
|
delivery_fee?: number
|
|
delivery_notes?: string | null
|
|
id?: string
|
|
item_count?: number
|
|
order_number?: string
|
|
status?: string
|
|
subtotal?: number
|
|
total?: number
|
|
user_id?: string | null
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "orders_address_id_fkey"
|
|
columns: ["address_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "addresses"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
payment_methods: {
|
|
Row: {
|
|
brand: string
|
|
cardholder_name: string | null
|
|
created_at: string
|
|
expiry_month: number
|
|
expiry_year: number
|
|
id: string
|
|
is_default: boolean
|
|
last4: string
|
|
user_id: string
|
|
}
|
|
Insert: {
|
|
brand: string
|
|
cardholder_name?: string | null
|
|
created_at?: string
|
|
expiry_month: number
|
|
expiry_year: number
|
|
id?: string
|
|
is_default?: boolean
|
|
last4: string
|
|
user_id: string
|
|
}
|
|
Update: {
|
|
brand?: string
|
|
cardholder_name?: string | null
|
|
created_at?: string
|
|
expiry_month?: number
|
|
expiry_year?: number
|
|
id?: string
|
|
is_default?: boolean
|
|
last4?: string
|
|
user_id?: string
|
|
}
|
|
Relationships: []
|
|
}
|
|
profiles: {
|
|
Row: {
|
|
created_at: string
|
|
full_name: string | null
|
|
id: string
|
|
is_admin: boolean
|
|
phone: string | null
|
|
updated_at: string
|
|
}
|
|
Insert: {
|
|
created_at?: string
|
|
full_name?: string | null
|
|
id: string
|
|
is_admin?: boolean
|
|
phone?: string | null
|
|
updated_at?: string
|
|
}
|
|
Update: {
|
|
created_at?: string
|
|
full_name?: string | null
|
|
id?: string
|
|
is_admin?: boolean
|
|
phone?: string | null
|
|
updated_at?: string
|
|
}
|
|
Relationships: []
|
|
}
|
|
wallet_transactions: {
|
|
Row: {
|
|
amount: number
|
|
created_at: string
|
|
description: string | null
|
|
id: string
|
|
order_id: string | null
|
|
title: string
|
|
type: string
|
|
wallet_id: string
|
|
}
|
|
Insert: {
|
|
amount: number
|
|
created_at?: string
|
|
description?: string | null
|
|
id?: string
|
|
order_id?: string | null
|
|
title: string
|
|
type: string
|
|
wallet_id: string
|
|
}
|
|
Update: {
|
|
amount?: number
|
|
created_at?: string
|
|
description?: string | null
|
|
id?: string
|
|
order_id?: string | null
|
|
title?: string
|
|
type?: string
|
|
wallet_id?: string
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "wallet_transactions_order_id_fkey"
|
|
columns: ["order_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "orders"
|
|
referencedColumns: ["id"]
|
|
},
|
|
{
|
|
foreignKeyName: "wallet_transactions_wallet_id_fkey"
|
|
columns: ["wallet_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "wallets"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
wallets: {
|
|
Row: {
|
|
balance: number
|
|
created_at: string
|
|
currency: string
|
|
id: string
|
|
updated_at: string
|
|
user_id: string
|
|
}
|
|
Insert: {
|
|
balance?: number
|
|
created_at?: string
|
|
currency?: string
|
|
id?: string
|
|
updated_at?: string
|
|
user_id: string
|
|
}
|
|
Update: {
|
|
balance?: number
|
|
created_at?: string
|
|
currency?: string
|
|
id?: string
|
|
updated_at?: string
|
|
user_id?: string
|
|
}
|
|
Relationships: []
|
|
}
|
|
}
|
|
Views: {
|
|
[_ in never]: never
|
|
}
|
|
Functions: {
|
|
[_ in never]: never
|
|
}
|
|
Enums: {
|
|
[_ in never]: never
|
|
}
|
|
CompositeTypes: {
|
|
[_ in never]: never
|
|
}
|
|
}
|
|
}
|
|
|
|
type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">
|
|
|
|
type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]
|
|
|
|
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 = {
|
|
public: {
|
|
Enums: {},
|
|
},
|
|
} as const
|