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
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
export type MateriaTab =
|
||||
| 'datos-generales'
|
||||
| 'contenido-tematico'
|
||||
| 'bibliografia'
|
||||
| 'ia-materia'
|
||||
| 'documento-sep'
|
||||
| 'historial';
|
||||
|
||||
export interface Materia {
|
||||
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 MateriaStructure {
|
||||
id: string;
|
||||
nombre: string;
|
||||
campos: CampoEstructura[];
|
||||
}
|
||||
|
||||
export interface Tema {
|
||||
id: string;
|
||||
nombre: string;
|
||||
descripcion?: string;
|
||||
horasEstimadas?: number;
|
||||
}
|
||||
|
||||
export interface UnidadTematica {
|
||||
id: string;
|
||||
nombre: string;
|
||||
numero: number;
|
||||
temas: 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 CambioMateria {
|
||||
id: string;
|
||||
tipo: 'datos' | 'contenido' | 'bibliografia' | 'ia' | 'documento';
|
||||
descripcion: string;
|
||||
usuario: string;
|
||||
fecha: Date;
|
||||
detalles?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface DocumentoMateria {
|
||||
id: string;
|
||||
materiaId: string;
|
||||
version: number;
|
||||
fechaGeneracion: Date;
|
||||
url?: string;
|
||||
estado: 'generando' | 'listo' | 'error';
|
||||
}
|
||||
|
||||
export interface MateriaDetailState {
|
||||
materia: Materia | null;
|
||||
estructura: MateriaStructure | null;
|
||||
datosGenerales: Record<string, any>;
|
||||
contenidoTematico: UnidadTematica[];
|
||||
bibliografia: BibliografiaEntry[];
|
||||
iaMessages: IAMessage[];
|
||||
documentoSep: DocumentoMateria | null;
|
||||
historial: CambioMateria[];
|
||||
activeTab: MateriaTab;
|
||||
isSaving: boolean;
|
||||
isLoading: boolean;
|
||||
errorMessage: string | null;
|
||||
}
|
||||
@@ -12,9 +12,9 @@ export type TipoPlan =
|
||||
| 'Doctorado'
|
||||
| 'Especialidad'
|
||||
|
||||
export type TipoMateria = 'obligatoria' | 'optativa' | 'troncal'
|
||||
export type TipoAsignatura = 'obligatoria' | 'optativa' | 'troncal'
|
||||
|
||||
export type MateriaStatus = 'borrador' | 'revisada' | 'aprobada'
|
||||
export type AsignaturaStatus = 'borrador' | 'revisada' | 'aprobada'
|
||||
|
||||
export interface Facultad {
|
||||
id: string
|
||||
@@ -36,15 +36,15 @@ export interface LineaCurricular {
|
||||
color?: string
|
||||
}
|
||||
|
||||
export interface Materia {
|
||||
export interface Asignatura {
|
||||
id: string
|
||||
clave: string
|
||||
nombre: string
|
||||
creditos: number
|
||||
ciclo: number | null
|
||||
lineaCurricularId: string | null
|
||||
tipo: TipoMateria
|
||||
estado: MateriaStatus
|
||||
tipo: TipoAsignatura
|
||||
estado: AsignaturaStatus
|
||||
orden?: number
|
||||
hd: number // <--- Añadir
|
||||
hi: number // <--- Añadir
|
||||
@@ -103,7 +103,7 @@ export interface DocumentoPlan {
|
||||
export type PlanTab =
|
||||
| 'datos-generales'
|
||||
| 'mapa-curricular'
|
||||
| 'materias'
|
||||
| 'asignaturas'
|
||||
| 'flujo'
|
||||
| 'ia'
|
||||
| 'documento'
|
||||
|
||||
Reference in New Issue
Block a user