algo
This commit is contained in:
parent
854e46036d
commit
d0c8d08ce5
@ -27,7 +27,7 @@ import { TipoEntradaModule } from './tipo-entrada/tipo-entrada.module';
|
||||
import { EquipoTipoEntradaModule } from './equipo-tipo-entrada/equipo-tipo-entrada.module';
|
||||
import { CarreraProgramaModule } from './carrera-programa/carrera-programa.module';
|
||||
|
||||
import { Carrera } from './carrera/carrera.entity';
|
||||
import { Carrera } from './carrera/entity/carrera.entity';
|
||||
import { CarreraPrograma } from './carrera-programa/carrera-programa.entity';
|
||||
import { Carrito } from './carrito/entity/carrito.entity';
|
||||
import { Dia } from './dia/dia.entity';
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { Controller } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Put } from '@nestjs/common';
|
||||
import { CarreraProgramaService } from './carrera-programa.service';
|
||||
|
||||
@Controller('carrera-programa')
|
||||
export class CarreraProgramaController {
|
||||
constructor(private carreraProgramaService: CarreraProgramaService) {}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,11 +1,5 @@
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
PrimaryGeneratedColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
import { Carrera } from '../carrera/carrera.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, ManyToOne, JoinColumn } from 'typeorm';
|
||||
import { Carrera } from '../carrera/entity/carrera.entity';
|
||||
import { Programa } from '../programa/programa.entity';
|
||||
|
||||
@Entity()
|
||||
@ -13,11 +7,11 @@ export class CarreraPrograma {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_carrera_programa: number;
|
||||
|
||||
@ManyToOne(() => Programa, (programa) => programa.carrerasPrograma)
|
||||
@JoinColumn({ name: 'id_programa' })
|
||||
programa: Programa;
|
||||
|
||||
@ManyToOne(() => Carrera, (carrera) => carrera.carreraProgramas)
|
||||
@JoinColumn({ name: 'id_carrera' })
|
||||
carrera: Carrera;
|
||||
|
||||
@ManyToOne(() => Programa, (programa) => programa.carrerasPrograma)
|
||||
@JoinColumn({ name: 'id_programa' })
|
||||
programa: Programa;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { CarreraProgramaController } from './carrera-programa.controller';
|
||||
import { CarreraPrograma } from './carrera-programa.entity';
|
||||
import { CarreraProgramaService } from './carrera-programa.service';
|
||||
import { CarreraPrograma } from './carrera-programa.entity';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([CarreraPrograma])],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Repository } from 'typeorm';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { CarreraPrograma } from './carrera-programa.entity';
|
||||
|
||||
@Injectable()
|
||||
|
@ -1,7 +1,13 @@
|
||||
import { Controller } from '@nestjs/common';
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { CarreraService } from './carrera.service';
|
||||
|
||||
@Controller('carrera')
|
||||
export class CarreraController {
|
||||
constructor(private carreraService: CarreraService) {}
|
||||
|
||||
@Get()
|
||||
get() {}
|
||||
|
||||
@Get("carreras")
|
||||
carreras() {}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { CarreraController } from './carrera.controller';
|
||||
import { Carrera } from './carrera.entity';
|
||||
import { CarreraService } from './carrera.service';
|
||||
import { Carrera } from './entity/carrera.entity';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Carrera])],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Repository } from 'typeorm';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Carrera } from './carrera.entity';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Carrera } from './entity/carrera.entity';
|
||||
|
||||
@Injectable()
|
||||
export class CarreraService {
|
||||
|
@ -1,33 +1,33 @@
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
PrimaryGeneratedColumn,
|
||||
OneToMany,
|
||||
ManyToOne,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { Institucion } from '../institucion/entity/institucion.entity';
|
||||
import { Usuario } from '../usuario/usuario.entity';
|
||||
import { CarreraPrograma } from '../carrera-programa/carrera-programa.entity';
|
||||
import { CarreraPrograma } from '../../carrera-programa/carrera-programa.entity';
|
||||
import { Institucion } from '../../institucion/entity/institucion.entity';
|
||||
import { Usuario } from '../../usuario/usuario.entity';
|
||||
|
||||
@Entity()
|
||||
export class Carrera {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_carrera: number;
|
||||
|
||||
@Column()
|
||||
@Column({ type: String, nullable: false, length: 150 })
|
||||
carrera: string;
|
||||
|
||||
@ManyToOne(() => Institucion, (institucion) => institucion.carreras)
|
||||
@JoinColumn({ name: 'id_institucion' })
|
||||
institucion: Institucion;
|
||||
|
||||
@OneToMany(() => Usuario, (usuario) => usuario.carrera)
|
||||
usuarios: Usuario[];
|
||||
|
||||
@OneToMany(
|
||||
() => CarreraPrograma,
|
||||
(carreraPrograma) => carreraPrograma.carrera,
|
||||
)
|
||||
carreraProgramas: CarreraPrograma[];
|
||||
|
||||
@OneToMany(() => Usuario, (usuario) => usuario.carrera)
|
||||
usuarios: Usuario[];
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { Carrera } from '../../carrera/carrera.entity';
|
||||
import { Carrera } from '../../carrera/entity/carrera.entity';
|
||||
import { InstitucionDia } from '../../institucion-dia/institucion-dia.entity';
|
||||
import { InstitucionInfraccion } from '../../institucion-infraccion/institucion-infraccion.entity';
|
||||
import { Modulo } from '../../modulo/entity/modulo.entity';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Injectable, NotFoundException } from '@nestjs/common';
|
||||
import { Repository } from 'typeorm';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Institucion } from './entity/institucion.entity';
|
||||
|
||||
@Injectable()
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
import { Carrera } from '../carrera/carrera.entity';
|
||||
import { Carrera } from '../carrera/entity/carrera.entity';
|
||||
import { Institucion } from '../institucion/entity/institucion.entity';
|
||||
import { Prestamo } from '../prestamo/prestamo.entity';
|
||||
import { TipoUsuario } from '../tipo-usuario/tipo-usuario.entity';
|
||||
|
Loading…
Reference in New Issue
Block a user