se hizo el service cuestionario-alumno
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export class CreateProgramaDto {}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/mapped-types';
|
||||
import { CreateProgramaDto } from './create-programa.dto';
|
||||
|
||||
export class UpdateProgramaDto extends PartialType(CreateProgramaDto) {}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { Servicio } from "src/servicio/entities/servicio.entity";
|
||||
import { Usuario } from "src/usuario/entities/usuario.entity";
|
||||
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
|
||||
@Entity('programa')
|
||||
export class Programa {
|
||||
@PrimaryGeneratedColumn()
|
||||
idPrograma: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 120 })
|
||||
institucion: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 120 })
|
||||
dependencia: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 280 })
|
||||
programa: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 20 })
|
||||
clavePrograma: string;
|
||||
|
||||
@Column({ type: 'boolean', default: false })
|
||||
acatlan: boolean;
|
||||
|
||||
@Column({ type: 'boolean', default: true })
|
||||
activo: boolean;
|
||||
|
||||
@ManyToOne(()=>Usuario,(usuario)=>usuario.programa)
|
||||
usuario:Usuario;
|
||||
|
||||
@OneToMany(()=>Servicio,(servicio)=>servicio.cuestionarioAlumno2)
|
||||
servicio:Servicio[];
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { ProgramaService } from './programa.service';
|
||||
import { CreateProgramaDto } from './dto/create-programa.dto';
|
||||
import { UpdateProgramaDto } from './dto/update-programa.dto';
|
||||
|
||||
@Controller('programa')
|
||||
export class ProgramaController {
|
||||
constructor(private readonly programaService: ProgramaService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createProgramaDto: CreateProgramaDto) {
|
||||
return this.programaService.create(createProgramaDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.programaService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.programaService.findOne(+id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateProgramaDto: UpdateProgramaDto) {
|
||||
return this.programaService.update(+id, updateProgramaDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.programaService.remove(+id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ProgramaService } from './programa.service';
|
||||
import { ProgramaController } from './programa.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [ProgramaController],
|
||||
providers: [ProgramaService],
|
||||
})
|
||||
export class ProgramaModule {}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CreateProgramaDto } from './dto/create-programa.dto';
|
||||
import { UpdateProgramaDto } from './dto/update-programa.dto';
|
||||
|
||||
@Injectable()
|
||||
export class ProgramaService {
|
||||
create(createProgramaDto: CreateProgramaDto) {
|
||||
return 'This action adds a new programa';
|
||||
}
|
||||
|
||||
findAll() {
|
||||
return `This action returns all programa`;
|
||||
}
|
||||
|
||||
findOne(id: number) {
|
||||
return `This action returns a #${id} programa`;
|
||||
}
|
||||
|
||||
update(id: number, updateProgramaDto: UpdateProgramaDto) {
|
||||
return `This action updates a #${id} programa`;
|
||||
}
|
||||
|
||||
remove(id: number) {
|
||||
return `This action removes a #${id} programa`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user