nuevas tablas por nuevos requisitos
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { ProgramaController } from './programa.controller';
|
||||
|
||||
describe('ProgramaController', () => {
|
||||
let controller: ProgramaController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [ProgramaController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<ProgramaController>(ProgramaController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
import { Controller } from '@nestjs/common';
|
||||
|
||||
@Controller('programa')
|
||||
export class ProgramaController {}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
|
||||
import { Equipo } from '../equipo/equipo.entity';
|
||||
import { CarreraPrograma } from '../carrera-programa/carrera-programa.entity';
|
||||
|
||||
@Entity()
|
||||
export class Programa {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_programa: number;
|
||||
|
||||
@Column()
|
||||
programa: string;
|
||||
|
||||
@OneToMany(() => Equipo, (equipo) => equipo.programa)
|
||||
equipos: Equipo[];
|
||||
|
||||
@OneToMany(
|
||||
() => CarreraPrograma,
|
||||
(carreraPrograma) => carreraPrograma.programa,
|
||||
)
|
||||
carrerasPrograma: CarreraPrograma[];
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { ProgramaController } from './programa.controller';
|
||||
import { Programa } from './programa.entity';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Programa])],
|
||||
controllers: [ProgramaController],
|
||||
})
|
||||
export class ProgramaModule {}
|
||||
Reference in New Issue
Block a user