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