"inicialización"

This commit is contained in:
2025-03-26 14:39:56 -06:00
commit 767a765f68
88 changed files with 12971 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
export class CreateOpcionDto {}
+4
View File
@@ -0,0 +1,4 @@
import { PartialType } from '@nestjs/mapped-types';
import { CreateOpcionDto } from './create-opcion.dto';
export class UpdateOpcionDto extends PartialType(CreateOpcionDto) {}
+20
View File
@@ -0,0 +1,20 @@
import { Test, TestingModule } from '@nestjs/testing';
import { OpcionController } from './opcion.controller';
import { OpcionService } from './opcion.service';
describe('OpcionController', () => {
let controller: OpcionController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [OpcionController],
providers: [OpcionService],
}).compile();
controller = module.get<OpcionController>(OpcionController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});
+34
View File
@@ -0,0 +1,34 @@
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { OpcionService } from './opcion.service';
import { CreateOpcionDto } from './dto/create-opcion.dto';
import { UpdateOpcionDto } from './dto/update-opcion.dto';
@Controller('opcion')
export class OpcionController {
constructor(private readonly opcionService: OpcionService) {}
@Post()
create(@Body() createOpcionDto: CreateOpcionDto) {
return this.opcionService.create(createOpcionDto);
}
@Get()
findAll() {
return this.opcionService.findAll();
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.opcionService.findOne(+id);
}
@Patch(':id')
update(@Param('id') id: string, @Body() updateOpcionDto: UpdateOpcionDto) {
return this.opcionService.update(+id, updateOpcionDto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.opcionService.remove(+id);
}
}
+9
View File
@@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { OpcionService } from './opcion.service';
import { OpcionController } from './opcion.controller';
@Module({
controllers: [OpcionController],
providers: [OpcionService],
})
export class OpcionModule {}
+18
View File
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { OpcionService } from './opcion.service';
describe('OpcionService', () => {
let service: OpcionService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [OpcionService],
}).compile();
service = module.get<OpcionService>(OpcionService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
+26
View File
@@ -0,0 +1,26 @@
import { Injectable } from '@nestjs/common';
import { CreateOpcionDto } from './dto/create-opcion.dto';
import { UpdateOpcionDto } from './dto/update-opcion.dto';
@Injectable()
export class OpcionService {
create(createOpcionDto: CreateOpcionDto) {
return 'This action adds a new opcion';
}
findAll() {
return `This action returns all opcion`;
}
findOne(id: number) {
return `This action returns a #${id} opcion`;
}
update(id: number, updateOpcionDto: UpdateOpcionDto) {
return `This action updates a #${id} opcion`;
}
remove(id: number) {
return `This action removes a #${id} opcion`;
}
}