endpoints carrito
This commit is contained in:
parent
29bb3fe79b
commit
854e46036d
@ -29,7 +29,7 @@ import { CarreraProgramaModule } from './carrera-programa/carrera-programa.modul
|
|||||||
|
|
||||||
import { Carrera } from './carrera/carrera.entity';
|
import { Carrera } from './carrera/carrera.entity';
|
||||||
import { CarreraPrograma } from './carrera-programa/carrera-programa.entity';
|
import { CarreraPrograma } from './carrera-programa/carrera-programa.entity';
|
||||||
import { Carrito } from './carrito/carrito.entity';
|
import { Carrito } from './carrito/entity/carrito.entity';
|
||||||
import { Dia } from './dia/dia.entity';
|
import { Dia } from './dia/dia.entity';
|
||||||
import { Equipo } from './equipo/equipo.entity';
|
import { Equipo } from './equipo/equipo.entity';
|
||||||
import { EquipoTipoEntrada } from './equipo-tipo-entrada/equipo-tipo-entrada.entity';
|
import { EquipoTipoEntrada } from './equipo-tipo-entrada/equipo-tipo-entrada.entity';
|
||||||
|
@ -1,7 +1,22 @@
|
|||||||
import { Controller } from '@nestjs/common';
|
import { Controller, Get, Post, Put } from '@nestjs/common';
|
||||||
import { CarritoService } from './carrito.service';
|
import { CarritoService } from './carrito.service';
|
||||||
|
|
||||||
@Controller('carrito')
|
@Controller('carrito')
|
||||||
export class CarritoController {
|
export class CarritoController {
|
||||||
constructor(private carritoService: CarritoService) {}
|
constructor(private carritoService: CarritoService) {}
|
||||||
|
|
||||||
|
@Post()
|
||||||
|
create() {}
|
||||||
|
|
||||||
|
@Get()
|
||||||
|
get() {}
|
||||||
|
|
||||||
|
@Get('carrito')
|
||||||
|
carrito() {}
|
||||||
|
|
||||||
|
@Get('carritos')
|
||||||
|
carritos() {}
|
||||||
|
|
||||||
|
@Put()
|
||||||
|
update() {}
|
||||||
}
|
}
|
||||||
|
@ -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 { CarritoController } from './carrito.controller';
|
import { CarritoController } from './carrito.controller';
|
||||||
import { Carrito } from './carrito.entity';
|
|
||||||
import { CarritoService } from './carrito.service';
|
import { CarritoService } from './carrito.service';
|
||||||
|
import { Carrito } from './entity/carrito.entity';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [TypeOrmModule.forFeature([Carrito])],
|
imports: [TypeOrmModule.forFeature([Carrito])],
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { Repository } from 'typeorm';
|
import { Repository } from 'typeorm';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
import { Carrito } from './carrito.entity';
|
import { Carrito } from './entity/carrito.entity';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CarritoService {
|
export class CarritoService {
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
import {
|
import {
|
||||||
Entity,
|
|
||||||
Column,
|
Column,
|
||||||
PrimaryGeneratedColumn,
|
Entity,
|
||||||
OneToMany,
|
|
||||||
ManyToOne,
|
|
||||||
JoinColumn,
|
JoinColumn,
|
||||||
|
ManyToOne,
|
||||||
|
OneToMany,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
import { Modulo } from '../modulo/entity/modulo.entity';
|
import { Equipo } from '../../equipo/equipo.entity';
|
||||||
import { Equipo } from '../equipo/equipo.entity';
|
import { Modulo } from '../../modulo/entity/modulo.entity';
|
||||||
import { TipoCarrito } from '../tipo-carrito/tipo-carrito.entity';
|
import { TipoCarrito } from '../../tipo-carrito/tipo-carrito.entity';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class Carrito {
|
export class Carrito {
|
||||||
@PrimaryGeneratedColumn()
|
@PrimaryGeneratedColumn()
|
||||||
id_carrito: number;
|
id_carrito: number;
|
||||||
|
|
||||||
@Column()
|
@Column({ type: Boolean, nullable: false, default: false })
|
||||||
carrito: string;
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
activo: boolean;
|
activo: boolean;
|
||||||
|
|
||||||
|
@Column({ type: String, nullable: false, length: 50 })
|
||||||
|
carrito: string;
|
||||||
|
|
||||||
@ManyToOne(() => Modulo, (modulo) => modulo.carritos)
|
@ManyToOne(() => Modulo, (modulo) => modulo.carritos)
|
||||||
@JoinColumn({ name: 'id_modulo' })
|
@JoinColumn({ name: 'id_modulo' })
|
||||||
modulo: Modulo;
|
modulo: Modulo;
|
@ -6,7 +6,7 @@ import {
|
|||||||
ManyToOne,
|
ManyToOne,
|
||||||
JoinColumn,
|
JoinColumn,
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
import { Carrito } from '../carrito/carrito.entity';
|
import { Carrito } from '../carrito/entity/carrito.entity';
|
||||||
import { Motivo } from '../motivo/motivo.entity';
|
import { Motivo } from '../motivo/motivo.entity';
|
||||||
import { Prestamo } from '../prestamo/prestamo.entity';
|
import { Prestamo } from '../prestamo/prestamo.entity';
|
||||||
import { Programa } from '../programa/programa.entity';
|
import { Programa } from '../programa/programa.entity';
|
||||||
|
@ -11,19 +11,22 @@ export class Institucion {
|
|||||||
@PrimaryGeneratedColumn()
|
@PrimaryGeneratedColumn()
|
||||||
id_institucion: number;
|
id_institucion: number;
|
||||||
|
|
||||||
@Column()
|
@Column({ type: Number, nullable: false, default: 7 })
|
||||||
dias_multa_retraso: number;
|
dias_multa_retraso: number;
|
||||||
|
|
||||||
@Column()
|
@Column({ type: String, nullable: false })
|
||||||
institucion: string;
|
institucion: string;
|
||||||
|
|
||||||
@Column()
|
@Column({ type: String, nullable: false, length: 50 })
|
||||||
logo: string;
|
logo: string;
|
||||||
|
|
||||||
@Column()
|
@Column({ type: Number, nullable: false, default: 15 })
|
||||||
|
tiempo_entrega: number;
|
||||||
|
|
||||||
|
@Column({ type: Number, nullable: false, default: 120 })
|
||||||
tiempo_prestamo: number;
|
tiempo_prestamo: number;
|
||||||
|
|
||||||
@Column()
|
@Column({ type: Number, nullable: false, default: 10 })
|
||||||
tiempo_recoger: number;
|
tiempo_recoger: number;
|
||||||
|
|
||||||
@OneToMany(() => Carrera, (carrera) => carrera.institucion)
|
@OneToMany(() => Carrera, (carrera) => carrera.institucion)
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
OneToMany,
|
OneToMany,
|
||||||
PrimaryGeneratedColumn,
|
PrimaryGeneratedColumn,
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
import { Carrito } from '../../carrito/carrito.entity';
|
import { Carrito } from '../../carrito/entity/carrito.entity';
|
||||||
import { Institucion } from '../../institucion/entity/institucion.entity';
|
import { Institucion } from '../../institucion/entity/institucion.entity';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
|
import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
|
||||||
import { Carrito } from '../carrito/carrito.entity';
|
import { Carrito } from '../carrito/entity/carrito.entity';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class TipoCarrito {
|
export class TipoCarrito {
|
||||||
|
Loading…
Reference in New Issue
Block a user