diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index ed25089..3ab59bc 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -20,9 +20,9 @@ jobs: - name: Verify generated types are checked in run: | - supabase gen types typescript --local > types.gen.ts - if ! git diff --ignore-space-at-eol --exit-code --quiet types.gen.ts; then - echo "Detected uncommitted changes after build. See status below:" + supabase gen types typescript --local > database-types.ts + if ! git diff --ignore-space-at-eol --exit-code --quiet database-types.ts; then + echo "Detected uncommitted changes after build. See status below:" git diff exit 1 - fi \ No newline at end of file + fi diff --git a/database-types.ts b/database-types.ts index f7f6bb9..437ea25 100644 --- a/database-types.ts +++ b/database-types.ts @@ -88,12 +88,10 @@ export type Database = { asignatura_hash: string | null codigo: string | null contenido_tematico: Json - conversation_id: string | null creado_en: string creado_por: string | null creditos: number datos: Json - estado: Database["public"]["Enums"]["estado_asignatura"] estructura_id: string | null horas_academicas: number | null horas_independientes: number | null @@ -113,12 +111,10 @@ export type Database = { asignatura_hash?: string | null codigo?: string | null contenido_tematico?: Json - conversation_id?: string | null creado_en?: string creado_por?: string | null creditos: number datos?: Json - estado?: Database["public"]["Enums"]["estado_asignatura"] estructura_id?: string | null horas_academicas?: number | null horas_independientes?: number | null @@ -138,12 +134,10 @@ export type Database = { asignatura_hash?: string | null codigo?: string | null contenido_tematico?: Json - conversation_id?: string | null creado_en?: string creado_por?: string | null creditos?: number datos?: Json - estado?: Database["public"]["Enums"]["estado_asignatura"] estructura_id?: string | null horas_academicas?: number | null horas_independientes?: number | null @@ -392,6 +386,135 @@ export type Database = { }, ] } + conversaciones_asignatura: { + Row: { + archivado_en: string | null + archivado_por: string | null + asignatura_id: string + conversacion_json: Json + creado_en: string + creado_por: string | null + estado: Database["public"]["Enums"]["estado_conversacion"] + id: string + intento_archivado: number + openai_conversation_id: string + } + Insert: { + archivado_en?: string | null + archivado_por?: string | null + asignatura_id: string + conversacion_json?: Json + creado_en?: string + creado_por?: string | null + estado?: Database["public"]["Enums"]["estado_conversacion"] + id?: string + intento_archivado?: number + openai_conversation_id: string + } + Update: { + archivado_en?: string | null + archivado_por?: string | null + asignatura_id?: string + conversacion_json?: Json + creado_en?: string + creado_por?: string | null + estado?: Database["public"]["Enums"]["estado_conversacion"] + id?: string + intento_archivado?: number + openai_conversation_id?: string + } + Relationships: [ + { + foreignKeyName: "conversaciones_asignatura_archivado_por_fkey" + columns: ["archivado_por"] + isOneToOne: false + referencedRelation: "usuarios_app" + referencedColumns: ["id"] + }, + { + foreignKeyName: "conversaciones_asignatura_asignatura_id_fkey" + columns: ["asignatura_id"] + isOneToOne: false + referencedRelation: "asignaturas" + referencedColumns: ["id"] + }, + { + foreignKeyName: "conversaciones_asignatura_creado_por_fkey" + columns: ["creado_por"] + isOneToOne: false + referencedRelation: "usuarios_app" + referencedColumns: ["id"] + }, + ] + } + conversaciones_plan: { + Row: { + archivado_en: string | null + archivado_por: string | null + conversacion_json: Json | null + creado_en: string + creado_por: string | null + estado: Database["public"]["Enums"]["estado_conversacion"] + id: string + intento_archivado: number + openai_conversation_id: string + plan_estudio_id: string + } + Insert: { + archivado_en?: string | null + archivado_por?: string | null + conversacion_json?: Json | null + creado_en?: string + creado_por?: string | null + estado?: Database["public"]["Enums"]["estado_conversacion"] + id?: string + intento_archivado?: number + openai_conversation_id: string + plan_estudio_id: string + } + Update: { + archivado_en?: string | null + archivado_por?: string | null + conversacion_json?: Json | null + creado_en?: string + creado_por?: string | null + estado?: Database["public"]["Enums"]["estado_conversacion"] + id?: string + intento_archivado?: number + openai_conversation_id?: string + plan_estudio_id?: string + } + Relationships: [ + { + foreignKeyName: "conversaciones_plan_archivado_por_fkey" + columns: ["archivado_por"] + isOneToOne: false + referencedRelation: "usuarios_app" + referencedColumns: ["id"] + }, + { + foreignKeyName: "conversaciones_plan_creado_por_fkey" + columns: ["creado_por"] + isOneToOne: false + referencedRelation: "usuarios_app" + referencedColumns: ["id"] + }, + { + foreignKeyName: "conversaciones_plan_plan_estudio_id_fkey" + columns: ["plan_estudio_id"] + isOneToOne: false + referencedRelation: "planes_estudio" + referencedColumns: ["id"] + }, + { + foreignKeyName: "conversaciones_plan_plan_estudio_id_fkey" + columns: ["plan_estudio_id"] + isOneToOne: false + referencedRelation: "plantilla_plan" + referencedColumns: ["plan_estudio_id"] + }, + ] + } estados_plan: { Row: { clave: string @@ -675,7 +798,6 @@ export type Database = { actualizado_en: string actualizado_por: string | null carrera_id: string - conversation_id: string | null creado_en: string creado_por: string | null datos: Json @@ -696,7 +818,6 @@ export type Database = { actualizado_en?: string actualizado_por?: string | null carrera_id: string - conversation_id?: string | null creado_en?: string creado_por?: string | null datos?: Json @@ -717,7 +838,6 @@ export type Database = { actualizado_en?: string actualizado_por?: string | null carrera_id?: string - conversation_id?: string | null creado_en?: string creado_por?: string | null datos?: Json @@ -1087,7 +1207,7 @@ export type Database = { unaccent_immutable: { Args: { "": string }; Returns: string } } Enums: { - estado_asignatura: "borrador" | "revisada" | "aprobada" | "generando" + estado_conversacion: "ACTIVA" | "ARCHIVANDO" | "ARCHIVADA" | "ERROR" estado_tarea_revision: "PENDIENTE" | "COMPLETADA" | "OMITIDA" fuente_cambio: "HUMANO" | "IA" nivel_plan_estudio: @@ -1260,7 +1380,7 @@ export const Constants = { }, public: { Enums: { - estado_asignatura: ["borrador", "revisada", "aprobada", "generando"], + estado_conversacion: ["ACTIVA", "ARCHIVANDO", "ARCHIVADA", "ERROR"], estado_tarea_revision: ["PENDIENTE", "COMPLETADA", "OMITIDA"], fuente_cambio: ["HUMANO", "IA"], nivel_plan_estudio: [