se crearon algunas tablas
This commit is contained in:
Generated
+64
-1
@@ -10,10 +10,12 @@
|
||||
"license": "UNLICENSED",
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^11.0.1",
|
||||
"@nestjs/config": "^4.0.2",
|
||||
"@nestjs/core": "^11.0.1",
|
||||
"@nestjs/mapped-types": "*",
|
||||
"@nestjs/platform-express": "^11.0.1",
|
||||
"@nestjs/typeorm": "^11.0.0",
|
||||
"class-validator": "^0.14.1",
|
||||
"reflect-metadata": "^0.2.2",
|
||||
"rxjs": "^7.8.1",
|
||||
"typeorm": "^0.3.21"
|
||||
@@ -2298,6 +2300,21 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@nestjs/config": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/config/-/config-4.0.2.tgz",
|
||||
"integrity": "sha512-McMW6EXtpc8+CwTUwFdg6h7dYcBUpH5iUILCclAsa+MbCEvC9ZKu4dCHRlJqALuhjLw97pbQu62l4+wRwGeZqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dotenv": "16.4.7",
|
||||
"dotenv-expand": "12.0.1",
|
||||
"lodash": "4.17.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
||||
"rxjs": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@nestjs/core": {
|
||||
"version": "11.0.12",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.0.12.tgz",
|
||||
@@ -3282,6 +3299,12 @@
|
||||
"@types/superagent": "^8.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/validator": {
|
||||
"version": "13.12.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.12.3.tgz",
|
||||
"integrity": "sha512-2ipwZ2NydGQJImne+FhNdhgRM37e9lCev99KnqkbFHd94Xn/mErARWI1RSLem1QA19ch5kOhzIZd7e8CA2FI8g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/yargs": {
|
||||
"version": "17.0.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz",
|
||||
@@ -4723,6 +4746,17 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/class-validator": {
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.1.tgz",
|
||||
"integrity": "sha512-2VEG9JICxIqTpoK1eMzZqaV+u/EiwEJkMGzTrZf6sU/fwsnOITVgYJ8yojSy6CaXtO9V0Cc6ZQZ8h8m4UBuLwQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/validator": "^13.11.8",
|
||||
"libphonenumber-js": "^1.10.53",
|
||||
"validator": "^13.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cli-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
|
||||
@@ -5286,6 +5320,21 @@
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv-expand": {
|
||||
"version": "12.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-12.0.1.tgz",
|
||||
"integrity": "sha512-LaKRbou8gt0RNID/9RoI+J2rvXsBRPMV7p+ElHlPhcSARbCPDYcYG2s1TIzAfWv4YSgyY5taidWzzs31lNV3yQ==",
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"dotenv": "^16.4.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
@@ -8000,6 +8049,12 @@
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/libphonenumber-js": {
|
||||
"version": "1.12.6",
|
||||
"resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.6.tgz",
|
||||
"integrity": "sha512-PJiS4ETaUfCOFLpmtKzAbqZQjCCKVu2OhTV4SVNNE7c2nu/dACvtCqj4L0i/KWNnIgRv7yrILvBj5Lonv5Ncxw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lines-and-columns": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
|
||||
@@ -8037,7 +8092,6 @@
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.memoize": {
|
||||
@@ -11136,6 +11190,15 @@
|
||||
"node": ">=10.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/validator": {
|
||||
"version": "13.15.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-13.15.0.tgz",
|
||||
"integrity": "sha512-36B2ryl4+oL5QxZ3AzD0t5SsMNGvTtQHpjgFO5tbNxfXbMFkY822ktCDe1MnlqV3301QQI9SLHDNJokDI+Z9pA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^11.0.1",
|
||||
"@nestjs/config": "^4.0.2",
|
||||
"@nestjs/core": "^11.0.1",
|
||||
"@nestjs/mapped-types": "*",
|
||||
"@nestjs/platform-express": "^11.0.1",
|
||||
"@nestjs/typeorm": "^11.0.0",
|
||||
"class-validator": "^0.14.1",
|
||||
"reflect-metadata": "^0.2.2",
|
||||
"rxjs": "^7.8.1",
|
||||
"typeorm": "^0.3.21"
|
||||
|
||||
+33
-1
@@ -10,9 +10,41 @@ import { PreguntaModule } from './pregunta/pregunta.module';
|
||||
import { TipoPreguntaModule } from './tipo_pregunta/tipo_pregunta.module';
|
||||
import { OpcionModule } from './opcion/opcion.module';
|
||||
import { PreguntaOpcionModule } from './pregunta_opcion/pregunta_opcion.module';
|
||||
import { RespuestaParticipanteCerradaModule } from './respuesta_participante_cerrada/respuesta_participante_cerrada.module';
|
||||
import { CuestionarioRespondidoModule } from './cuestionario_respondido/cuestionario_respondido.module';
|
||||
import { RespuestaParticipanteAbiertaModule } from './respuesta_participante_abierta/respuesta_participante_abierta.module';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
|
||||
|
||||
@Module({
|
||||
imports: [CuestionarioModule, TipoCuestionarioModule, CuestionarioSeccionModule, SeccionModule, SeccionPreguntaModule, PreguntaModule, TipoPreguntaModule, OpcionModule, PreguntaOpcionModule],
|
||||
imports: [
|
||||
ConfigModule.forRoot(),
|
||||
TypeOrmModule.forRoot({
|
||||
type: 'mysql',
|
||||
host: process.env.db_host,
|
||||
username: process.env.db_username,
|
||||
database: process.env.db_database,
|
||||
password: process.env.db_password,
|
||||
port: Number(process.env.db_port),
|
||||
synchronize: true,
|
||||
dropSchema: true, // elimina la base de datos
|
||||
// logging: true, // Habilita los logs para depuración
|
||||
autoLoadEntities: true, // Carga automáticamente las entidades
|
||||
|
||||
}),
|
||||
CuestionarioModule,
|
||||
TipoCuestionarioModule,
|
||||
CuestionarioSeccionModule,
|
||||
SeccionModule,
|
||||
SeccionPreguntaModule,
|
||||
PreguntaModule,
|
||||
TipoPreguntaModule,
|
||||
OpcionModule, PreguntaOpcionModule,
|
||||
RespuestaParticipanteCerradaModule,
|
||||
CuestionarioRespondidoModule,
|
||||
RespuestaParticipanteAbiertaModule],
|
||||
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
})
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
import { CuestionarioSeccion } from 'src/cuestionario_seccion/entities/cuestionario_seccion.entity';
|
||||
import { TipoCuestionario } from 'src/tipo_cuestionario/entities/tipo_cuestionario.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, ManyToMany, ManyToOne } from 'typeorm';
|
||||
|
||||
|
||||
|
||||
@Entity('cuestionario')
|
||||
export class Cuestionario {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_cuestionario: number;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
nombre_form: string;
|
||||
|
||||
@Column({ type: 'int' })
|
||||
contador_secciones: number;
|
||||
|
||||
@Column({ type: 'text', nullable: true })
|
||||
descripcion: string;
|
||||
|
||||
@Column({ type: 'boolean', default: true })
|
||||
editable: boolean;
|
||||
|
||||
@Column({ type: 'datetime', nullable: true })
|
||||
fecha_fin: Date;
|
||||
|
||||
@Column({ type: 'datetime', nullable: true })
|
||||
fecha_inicio: Date;
|
||||
|
||||
|
||||
@OneToMany(() => CuestionarioSeccion,(cuestionario_seccion) => cuestionario_seccion.id_cuestionario)
|
||||
cuestionarioSeccion:CuestionarioSeccion[]
|
||||
|
||||
@OneToMany(()=> Cuestionario, (cuestionario) => cuestionario.id_cuestionario)
|
||||
@Column({ type: 'int' })
|
||||
id_cuestionario_original: number;
|
||||
|
||||
@OneToMany(()=> TipoCuestionario, (tipo_cuestionario) => tipo_cuestionario.id_tipo_cuestionario )
|
||||
@Column({ type: 'int' })
|
||||
id_tipo_cuestionario: number;
|
||||
|
||||
@ManyToOne(()=> Cuestionario, (cuestionario) => cuestionario.id_cuestionario)
|
||||
Cuestionario: Cuestionario[];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { CuestionarioRespondidoController } from './cuestionario_respondido.controller';
|
||||
import { CuestionarioRespondidoService } from './cuestionario_respondido.service';
|
||||
|
||||
describe('CuestionarioRespondidoController', () => {
|
||||
let controller: CuestionarioRespondidoController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [CuestionarioRespondidoController],
|
||||
providers: [CuestionarioRespondidoService],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<CuestionarioRespondidoController>(CuestionarioRespondidoController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { CuestionarioRespondidoService } from './cuestionario_respondido.service';
|
||||
import { CreateCuestionarioRespondidoDto } from './dto/create-cuestionario_respondido.dto';
|
||||
import { UpdateCuestionarioRespondidoDto } from './dto/update-cuestionario_respondido.dto';
|
||||
|
||||
@Controller('cuestionario-respondido')
|
||||
export class CuestionarioRespondidoController {
|
||||
constructor(private readonly cuestionarioRespondidoService: CuestionarioRespondidoService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createCuestionarioRespondidoDto: CreateCuestionarioRespondidoDto) {
|
||||
return this.cuestionarioRespondidoService.create(createCuestionarioRespondidoDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.cuestionarioRespondidoService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.cuestionarioRespondidoService.findOne(+id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateCuestionarioRespondidoDto: UpdateCuestionarioRespondidoDto) {
|
||||
return this.cuestionarioRespondidoService.update(+id, updateCuestionarioRespondidoDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.cuestionarioRespondidoService.remove(+id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { CuestionarioRespondidoService } from './cuestionario_respondido.service';
|
||||
import { CuestionarioRespondidoController } from './cuestionario_respondido.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [CuestionarioRespondidoController],
|
||||
providers: [CuestionarioRespondidoService],
|
||||
})
|
||||
export class CuestionarioRespondidoModule {}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { CuestionarioRespondidoService } from './cuestionario_respondido.service';
|
||||
|
||||
describe('CuestionarioRespondidoService', () => {
|
||||
let service: CuestionarioRespondidoService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [CuestionarioRespondidoService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<CuestionarioRespondidoService>(CuestionarioRespondidoService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CreateCuestionarioRespondidoDto } from './dto/create-cuestionario_respondido.dto';
|
||||
import { UpdateCuestionarioRespondidoDto } from './dto/update-cuestionario_respondido.dto';
|
||||
|
||||
@Injectable()
|
||||
export class CuestionarioRespondidoService {
|
||||
create(createCuestionarioRespondidoDto: CreateCuestionarioRespondidoDto) {
|
||||
return 'This action adds a new cuestionarioRespondido';
|
||||
}
|
||||
|
||||
findAll() {
|
||||
return `This action returns all cuestionarioRespondido`;
|
||||
}
|
||||
|
||||
findOne(id: number) {
|
||||
return `This action returns a #${id} cuestionarioRespondido`;
|
||||
}
|
||||
|
||||
update(id: number, updateCuestionarioRespondidoDto: UpdateCuestionarioRespondidoDto) {
|
||||
return `This action updates a #${id} cuestionarioRespondido`;
|
||||
}
|
||||
|
||||
remove(id: number) {
|
||||
return `This action removes a #${id} cuestionarioRespondido`;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export class CreateCuestionarioRespondidoDto {}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/mapped-types';
|
||||
import { CreateCuestionarioRespondidoDto } from './create-cuestionario_respondido.dto';
|
||||
|
||||
export class UpdateCuestionarioRespondidoDto extends PartialType(CreateCuestionarioRespondidoDto) {}
|
||||
@@ -0,0 +1 @@
|
||||
export class CuestionarioRespondido {}
|
||||
@@ -1 +1,21 @@
|
||||
export class CuestionarioSeccion {}
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
|
||||
import { Cuestionario } from '../../cuestionario/entities/cuestionario.entity'; // Asegúrate de importar la entidad Cuestionario
|
||||
import { Seccion } from 'src/seccion/entities/seccion.entity';
|
||||
|
||||
@Entity('cuestionario_seccion')
|
||||
export class CuestionarioSeccion {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_cuestionario_seccion: number;
|
||||
|
||||
@Column({ type: 'tinyint' })
|
||||
posicion: number;
|
||||
|
||||
|
||||
@ManyToOne(() => Cuestionario, (cuestionario) => cuestionario.id_cuestionario)
|
||||
@Column({ type: 'int' })
|
||||
id_cuestionario: number;
|
||||
|
||||
@ManyToOne(() => Seccion, (seccion) => seccion.id_seccion)
|
||||
@Column({type:'int'})
|
||||
id_seccion:number;
|
||||
}
|
||||
|
||||
@@ -1 +1,11 @@
|
||||
export class CreateOpcionDto {}
|
||||
import { IsString, MaxLength } from "class-validator";
|
||||
|
||||
export class CreateOpcionDto {
|
||||
|
||||
|
||||
@IsString()
|
||||
@MaxLength(50)
|
||||
opcion: string;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
|
||||
@Entity()
|
||||
export class Opcion {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_opcion: number;
|
||||
|
||||
@Column({ type: String, nullable: false, length: 200, default: '' })
|
||||
opcion: string;
|
||||
|
||||
@OneToMany(() => PreguntaOpcion, (preguntaOpcion) => preguntaOpcion.Opcion)
|
||||
Preguntas: PreguntaOpcion[];
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +1,21 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CreateOpcionDto } from './dto/create-opcion.dto';
|
||||
import { UpdateOpcionDto } from './dto/update-opcion.dto';
|
||||
import { Opcion } from './entities/opcion.entity';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
@Injectable()
|
||||
export class OpcionService {
|
||||
create(createOpcionDto: CreateOpcionDto) {
|
||||
return 'This action adds a new opcion';
|
||||
constructor(
|
||||
@InjectRepository(Opcion)
|
||||
private repository: Repository<Opcion>,
|
||||
){}
|
||||
|
||||
|
||||
|
||||
create():Promise<Opcion> {
|
||||
return this.repository.save(this.repository.create());
|
||||
}
|
||||
|
||||
findAll() {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export class CreateRespuestaParticipanteAbiertaDto {}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/mapped-types';
|
||||
import { CreateRespuestaParticipanteAbiertaDto } from './create-respuesta_participante_abierta.dto';
|
||||
|
||||
export class UpdateRespuestaParticipanteAbiertaDto extends PartialType(CreateRespuestaParticipanteAbiertaDto) {}
|
||||
@@ -0,0 +1 @@
|
||||
export class RespuestaParticipanteAbierta {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { RespuestaParticipanteAbiertaController } from './respuesta_participante_abierta.controller';
|
||||
import { RespuestaParticipanteAbiertaService } from './respuesta_participante_abierta.service';
|
||||
|
||||
describe('RespuestaParticipanteAbiertaController', () => {
|
||||
let controller: RespuestaParticipanteAbiertaController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [RespuestaParticipanteAbiertaController],
|
||||
providers: [RespuestaParticipanteAbiertaService],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<RespuestaParticipanteAbiertaController>(RespuestaParticipanteAbiertaController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { RespuestaParticipanteAbiertaService } from './respuesta_participante_abierta.service';
|
||||
import { CreateRespuestaParticipanteAbiertaDto } from './dto/create-respuesta_participante_abierta.dto';
|
||||
import { UpdateRespuestaParticipanteAbiertaDto } from './dto/update-respuesta_participante_abierta.dto';
|
||||
|
||||
@Controller('respuesta-participante-abierta')
|
||||
export class RespuestaParticipanteAbiertaController {
|
||||
constructor(private readonly respuestaParticipanteAbiertaService: RespuestaParticipanteAbiertaService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createRespuestaParticipanteAbiertaDto: CreateRespuestaParticipanteAbiertaDto) {
|
||||
return this.respuestaParticipanteAbiertaService.create(createRespuestaParticipanteAbiertaDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.respuestaParticipanteAbiertaService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.respuestaParticipanteAbiertaService.findOne(+id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateRespuestaParticipanteAbiertaDto: UpdateRespuestaParticipanteAbiertaDto) {
|
||||
return this.respuestaParticipanteAbiertaService.update(+id, updateRespuestaParticipanteAbiertaDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.respuestaParticipanteAbiertaService.remove(+id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { RespuestaParticipanteAbiertaService } from './respuesta_participante_abierta.service';
|
||||
import { RespuestaParticipanteAbiertaController } from './respuesta_participante_abierta.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [RespuestaParticipanteAbiertaController],
|
||||
providers: [RespuestaParticipanteAbiertaService],
|
||||
})
|
||||
export class RespuestaParticipanteAbiertaModule {}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { RespuestaParticipanteAbiertaService } from './respuesta_participante_abierta.service';
|
||||
|
||||
describe('RespuestaParticipanteAbiertaService', () => {
|
||||
let service: RespuestaParticipanteAbiertaService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [RespuestaParticipanteAbiertaService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<RespuestaParticipanteAbiertaService>(RespuestaParticipanteAbiertaService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CreateRespuestaParticipanteAbiertaDto } from './dto/create-respuesta_participante_abierta.dto';
|
||||
import { UpdateRespuestaParticipanteAbiertaDto } from './dto/update-respuesta_participante_abierta.dto';
|
||||
|
||||
@Injectable()
|
||||
export class RespuestaParticipanteAbiertaService {
|
||||
create(createRespuestaParticipanteAbiertaDto: CreateRespuestaParticipanteAbiertaDto) {
|
||||
return 'This action adds a new respuestaParticipanteAbierta';
|
||||
}
|
||||
|
||||
findAll() {
|
||||
return `This action returns all respuestaParticipanteAbierta`;
|
||||
}
|
||||
|
||||
findOne(id: number) {
|
||||
return `This action returns a #${id} respuestaParticipanteAbierta`;
|
||||
}
|
||||
|
||||
update(id: number, updateRespuestaParticipanteAbiertaDto: UpdateRespuestaParticipanteAbiertaDto) {
|
||||
return `This action updates a #${id} respuestaParticipanteAbierta`;
|
||||
}
|
||||
|
||||
remove(id: number) {
|
||||
return `This action removes a #${id} respuestaParticipanteAbierta`;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export class CreateRespuestaParticipanteCerradaDto {}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/mapped-types';
|
||||
import { CreateRespuestaParticipanteCerradaDto } from './create-respuesta_participante_cerrada.dto';
|
||||
|
||||
export class UpdateRespuestaParticipanteCerradaDto extends PartialType(CreateRespuestaParticipanteCerradaDto) {}
|
||||
@@ -0,0 +1 @@
|
||||
export class RespuestaParticipanteCerrada {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { RespuestaParticipanteCerradaController } from './respuesta_participante_cerrada.controller';
|
||||
import { RespuestaParticipanteCerradaService } from './respuesta_participante_cerrada.service';
|
||||
|
||||
describe('RespuestaParticipanteCerradaController', () => {
|
||||
let controller: RespuestaParticipanteCerradaController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [RespuestaParticipanteCerradaController],
|
||||
providers: [RespuestaParticipanteCerradaService],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<RespuestaParticipanteCerradaController>(RespuestaParticipanteCerradaController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { RespuestaParticipanteCerradaService } from './respuesta_participante_cerrada.service';
|
||||
import { CreateRespuestaParticipanteCerradaDto } from './dto/create-respuesta_participante_cerrada.dto';
|
||||
import { UpdateRespuestaParticipanteCerradaDto } from './dto/update-respuesta_participante_cerrada.dto';
|
||||
|
||||
@Controller('respuesta-participante-cerrada')
|
||||
export class RespuestaParticipanteCerradaController {
|
||||
constructor(private readonly respuestaParticipanteCerradaService: RespuestaParticipanteCerradaService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createRespuestaParticipanteCerradaDto: CreateRespuestaParticipanteCerradaDto) {
|
||||
return this.respuestaParticipanteCerradaService.create(createRespuestaParticipanteCerradaDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.respuestaParticipanteCerradaService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.respuestaParticipanteCerradaService.findOne(+id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateRespuestaParticipanteCerradaDto: UpdateRespuestaParticipanteCerradaDto) {
|
||||
return this.respuestaParticipanteCerradaService.update(+id, updateRespuestaParticipanteCerradaDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.respuestaParticipanteCerradaService.remove(+id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { RespuestaParticipanteCerradaService } from './respuesta_participante_cerrada.service';
|
||||
import { RespuestaParticipanteCerradaController } from './respuesta_participante_cerrada.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [RespuestaParticipanteCerradaController],
|
||||
providers: [RespuestaParticipanteCerradaService],
|
||||
})
|
||||
export class RespuestaParticipanteCerradaModule {}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { RespuestaParticipanteCerradaService } from './respuesta_participante_cerrada.service';
|
||||
|
||||
describe('RespuestaParticipanteCerradaService', () => {
|
||||
let service: RespuestaParticipanteCerradaService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [RespuestaParticipanteCerradaService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<RespuestaParticipanteCerradaService>(RespuestaParticipanteCerradaService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CreateRespuestaParticipanteCerradaDto } from './dto/create-respuesta_participante_cerrada.dto';
|
||||
import { UpdateRespuestaParticipanteCerradaDto } from './dto/update-respuesta_participante_cerrada.dto';
|
||||
|
||||
@Injectable()
|
||||
export class RespuestaParticipanteCerradaService {
|
||||
create(createRespuestaParticipanteCerradaDto: CreateRespuestaParticipanteCerradaDto) {
|
||||
return 'This action adds a new respuestaParticipanteCerrada';
|
||||
}
|
||||
|
||||
findAll() {
|
||||
return `This action returns all respuestaParticipanteCerrada`;
|
||||
}
|
||||
|
||||
findOne(id: number) {
|
||||
return `This action returns a #${id} respuestaParticipanteCerrada`;
|
||||
}
|
||||
|
||||
update(id: number, updateRespuestaParticipanteCerradaDto: UpdateRespuestaParticipanteCerradaDto) {
|
||||
return `This action updates a #${id} respuestaParticipanteCerrada`;
|
||||
}
|
||||
|
||||
remove(id: number) {
|
||||
return `This action removes a #${id} respuestaParticipanteCerrada`;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { CuestionarioSeccion } from 'src/cuestionario_seccion/entities/cuestionario_seccion.entity';
|
||||
import { SeccionPregunta } from 'src/seccion_pregunta/entities/seccion_pregunta.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm';
|
||||
|
||||
@Entity('seccion')
|
||||
export class Seccion {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_seccion: number;
|
||||
|
||||
@Column({ type: 'int' })
|
||||
contador_pregunta: number;
|
||||
|
||||
@Column({ type: 'text', nullable: true })
|
||||
descripcion: string;
|
||||
|
||||
@Column({ type: 'text', nullable: true })
|
||||
titulo: string;
|
||||
|
||||
@OneToMany(() => CuestionarioSeccion,(cuestionario_seccion) => cuestionario_seccion.id_seccion )
|
||||
seccion:CuestionarioSeccion[];
|
||||
|
||||
@OneToMany(()=> SeccionPregunta, (seccion_pregunta)=> seccion_pregunta.id_seccion)
|
||||
seccion_pregunta:SeccionPregunta[];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Cuestionario } from 'src/cuestionario/entities/cuestionario.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToMany, ManyToOne } from 'typeorm';
|
||||
|
||||
@Entity('tipo_cuestionario')
|
||||
export class TipoCuestionario {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_tipo_cuestionario: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 30 })
|
||||
tipo_cuestionario: string;
|
||||
|
||||
@ManyToOne(()=> Cuestionario,(cuestionario)=> cuestionario.id_tipo_cuestionario)
|
||||
cuestionario:Cuestionario[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user