refactor: rename Materia to Asignatura across the codebase
- Updated type definitions and interfaces to replace 'Materia' with 'Asignatura'. - Refactored components and routes to reflect the new naming convention. - Adjusted related types and constants for consistency. - Removed the old Materia type definition and added Asignatura type definition. - Ensured all references in UI components and logic are updated accordingly. fix #50
This commit is contained in:
119
src/types/asignatura.ts
Normal file
119
src/types/asignatura.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
export type AsignaturaTab =
|
||||
| 'datos-generales'
|
||||
| 'contenido-tematico'
|
||||
| 'bibliografia'
|
||||
| 'ia-asignatura'
|
||||
| 'documento-sep'
|
||||
| 'historial'
|
||||
|
||||
export interface Asignatura {
|
||||
id: string
|
||||
nombre: string
|
||||
clave: string
|
||||
creditos?: number
|
||||
lineaCurricular?: string
|
||||
ciclo?: string
|
||||
planId: string
|
||||
planNombre: string
|
||||
carrera: string
|
||||
facultad: string
|
||||
estructuraId: string
|
||||
}
|
||||
|
||||
export interface CampoEstructura {
|
||||
id: string
|
||||
nombre: string
|
||||
tipo: 'texto' | 'texto_largo' | 'lista' | 'numero'
|
||||
obligatorio: boolean
|
||||
descripcion?: string
|
||||
placeholder?: string
|
||||
}
|
||||
|
||||
export interface AsignaturaStructure {
|
||||
id: string
|
||||
nombre: string
|
||||
campos: Array<CampoEstructura>
|
||||
}
|
||||
|
||||
export interface Tema {
|
||||
id: string
|
||||
nombre: string
|
||||
descripcion?: string
|
||||
horasEstimadas?: number
|
||||
}
|
||||
|
||||
export interface UnidadTematica {
|
||||
id: string
|
||||
nombre: string
|
||||
numero: number
|
||||
temas: Array<Tema>
|
||||
}
|
||||
|
||||
export interface BibliografiaEntry {
|
||||
id: string
|
||||
tipo: 'BASICA' | 'COMPLEMENTARIA'
|
||||
cita: string
|
||||
fuenteBibliotecaId?: string
|
||||
fuenteBiblioteca?: LibraryResource
|
||||
}
|
||||
|
||||
export interface LibraryResource {
|
||||
id: string
|
||||
titulo: string
|
||||
autor: string
|
||||
editorial?: string
|
||||
anio?: number
|
||||
isbn?: string
|
||||
tipo: 'libro' | 'articulo' | 'revista' | 'recurso_digital'
|
||||
disponible: boolean
|
||||
}
|
||||
|
||||
export interface IAMessage {
|
||||
id: string
|
||||
role: 'user' | 'assistant'
|
||||
content: string
|
||||
timestamp: Date
|
||||
campoAfectado?: string
|
||||
sugerencia?: IASugerencia
|
||||
}
|
||||
|
||||
export interface IASugerencia {
|
||||
campoId: string
|
||||
campoNombre: string
|
||||
valorActual: string
|
||||
valorSugerido: string
|
||||
aceptada?: boolean
|
||||
}
|
||||
|
||||
export interface CambioAsignatura {
|
||||
id: string
|
||||
tipo: 'datos' | 'contenido' | 'bibliografia' | 'ia' | 'documento'
|
||||
descripcion: string
|
||||
usuario: string
|
||||
fecha: Date
|
||||
detalles?: Record<string, any>
|
||||
}
|
||||
|
||||
export interface DocumentoAsignatura {
|
||||
id: string
|
||||
asignaturaId: string
|
||||
version: number
|
||||
fechaGeneracion: Date
|
||||
url?: string
|
||||
estado: 'generando' | 'listo' | 'error'
|
||||
}
|
||||
|
||||
export interface AsignaturaDetailState {
|
||||
asignatura: Asignatura | null
|
||||
estructura: AsignaturaStructure | null
|
||||
datosGenerales: Record<string, any>
|
||||
contenidoTematico: Array<UnidadTematica>
|
||||
bibliografia: Array<BibliografiaEntry>
|
||||
iaMessages: Array<IAMessage>
|
||||
documentoSep: DocumentoAsignatura | null
|
||||
historial: Array<CambioAsignatura>
|
||||
activeTab: AsignaturaTab
|
||||
isSaving: boolean
|
||||
isLoading: boolean
|
||||
errorMessage: string | null
|
||||
}
|
||||
Reference in New Issue
Block a user