// Auto-generated by the Supabase MCP (`generate_typescript_types`). // Source of truth for the orders schema + the order_status enum used // across the order-lifecycle code (orders POST, /checkout, the Stripe // webhook, the approve route, admin views). // // Regenerate after any schema/enum migration: // - via the Supabase MCP tool `generate_typescript_types` // - or `supabase gen types typescript --project-id ` via the CLI // // To get full inference on supabase client calls, swap the untyped // `supabaseAdmin()` / `supabaseServer()` clients to use `Database` as // the generic, e.g. `createClient(url, key)`. Until then this // file just serves as a checked-in reference + a place to import the // `Database['public']['Enums']['order_status']` literal-union from. 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(URL, KEY) __InternalSupabase: { PostgrestVersion: "14.5" } public: { Tables: { generations: { Row: { clean_url: string created_at: string id: string model: string order_id: string prompt: string published: boolean rejected_at: string | null watermarked_url: string } Insert: { clean_url: string created_at?: string id?: string model: string order_id: string prompt: string published?: boolean rejected_at?: string | null watermarked_url: string } Update: { clean_url?: string created_at?: string id?: string model?: string order_id?: string prompt?: string published?: boolean rejected_at?: string | null watermarked_url?: string } Relationships: [ { foreignKeyName: "generations_order_id_fkey" columns: ["order_id"] isOneToOne: false referencedRelation: "orders" referencedColumns: ["id"] }, ] } orders: { Row: { config: Json created_at: string current_generation_id: string | null custom_style_analyzed_at: string | null custom_style_description: string | null custom_style_url: string | null id: string pet_photo_urls: string[] price_cents: number prodigi_order_id: string | null revision_note: string | null shipping_address: Json | null tracking_number: string | null tracking_url: string | null carrier: string | null status: Database["public"]["Enums"]["order_status"] stripe_payment_intent_id: string | null stripe_session_id: string | null terms_accepted_at: string | null updated_at: string user_email: string user_id: string } Insert: { config: Json created_at?: string current_generation_id?: string | null custom_style_analyzed_at?: string | null custom_style_description?: string | null custom_style_url?: string | null id: string pet_photo_urls?: string[] price_cents: number prodigi_order_id?: string | null revision_note?: string | null shipping_address?: Json | null tracking_number?: string | null tracking_url?: string | null carrier?: string | null status?: Database["public"]["Enums"]["order_status"] stripe_payment_intent_id?: string | null stripe_session_id?: string | null terms_accepted_at?: string | null updated_at?: string user_email: string user_id: string } Update: { config?: Json created_at?: string current_generation_id?: string | null custom_style_analyzed_at?: string | null custom_style_description?: string | null custom_style_url?: string | null id?: string pet_photo_urls?: string[] price_cents?: number prodigi_order_id?: string | null revision_note?: string | null shipping_address?: Json | null tracking_number?: string | null tracking_url?: string | null carrier?: string | null status?: Database["public"]["Enums"]["order_status"] stripe_payment_intent_id?: string | null stripe_session_id?: string | null terms_accepted_at?: string | null updated_at?: string user_email?: string user_id?: string } Relationships: [ { foreignKeyName: "orders_current_generation_fk" columns: ["current_generation_id"] isOneToOne: false referencedRelation: "generations" referencedColumns: ["id"] }, ] } } Views: { [_ in never]: never } Functions: { [_ in never]: never } Enums: { order_status: | "pending_payment" | "abandoned" | "pending_design" | "awaiting_approval" | "revision_requested" | "approved" | "in_production" | "shipped" | "cancelled" // Legacy enum labels — still present in the PG enum because we // renamed `paid` → `approved` via ALTER TYPE RENAME VALUE // (no rows ever had `delivered`). Kept in the union so any // historical SQL or admin tools that mention them still type- // check. New code should never set these. | "delivered" } CompositeTypes: { [_ in never]: never } } } type DatabaseWithoutInternals = Omit type DefaultSchema = DatabaseWithoutInternals[Extract] 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: { order_status: [ "pending_payment", "abandoned", "pending_design", "awaiting_approval", "revision_requested", "approved", "in_production", "shipped", "cancelled", // Legacy enum label (dead — no rows). See union type above. "delivered", ], }, }, } as const