add carrera
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { AlumnoSancion } from 'src/alumno_sancion/entities/alumno_sancion.entity';
|
||||
import { Carrera } from 'src/carrera/entities/carrera.entity';
|
||||
import { DetalleServicio } from 'src/detalle_servicio/entities/detalle_servicio.entity';
|
||||
import { Recibo } from 'src/recibo/entities/recibo.entity';
|
||||
import {
|
||||
@@ -10,23 +11,6 @@ import {
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
@Entity({ name: 'carrera' })
|
||||
export class Carrera {
|
||||
@PrimaryGeneratedColumn({ name: 'id_carrera', type: 'int', unsigned: true })
|
||||
id_carrera: number;
|
||||
|
||||
@Column({
|
||||
name: 'carrera',
|
||||
type: 'varchar',
|
||||
length: 100,
|
||||
nullable: false,
|
||||
})
|
||||
carrera: string;
|
||||
|
||||
@OneToMany(() => Alumno, (student) => student.carrera)
|
||||
estudiantes: Alumno[];
|
||||
}
|
||||
|
||||
@Entity({ name: 'alumno' })
|
||||
export class Alumno {
|
||||
@PrimaryGeneratedColumn({ name: 'id_cuenta', type: 'int', unsigned: true })
|
||||
|
||||
@@ -2,13 +2,14 @@ import { Module } from '@nestjs/common';
|
||||
import { AlumnoService } from './student.service';
|
||||
import { AlumnoController } from './student.controller';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { Alumno, Carrera } from './entities/student.entity';
|
||||
import { Alumno } from './entities/student.entity';
|
||||
import { Carrera } from 'src/carrera/entities/carrera.entity';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Alumno,Carrera])],
|
||||
imports: [TypeOrmModule.forFeature([Alumno, Carrera])],
|
||||
controllers: [AlumnoController],
|
||||
providers: [AlumnoService],
|
||||
exports:[AlumnoService]
|
||||
exports: [AlumnoService],
|
||||
})
|
||||
export class AlumnoModule {}
|
||||
//IO
|
||||
//IO
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Injectable, NotFoundException } from '@nestjs/common';
|
||||
import { CreateStudentDto } from './dto/create-student.dto';
|
||||
import { Alumno, Carrera } from './entities/student.entity';
|
||||
import { Alumno } from './entities/student.entity';
|
||||
import { EntityManager, Repository } from 'typeorm';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Carrera } from 'src/carrera/entities/carrera.entity';
|
||||
|
||||
@Injectable()
|
||||
export class AlumnoService {
|
||||
|
||||
Reference in New Issue
Block a user