merge Sam and profesor m.s.c

This commit is contained in:
TuNombreDeUsuario
2024-06-14 14:33:27 -06:00
parent 2c6a2af1a3
commit d37ce982d0
7 changed files with 118 additions and 0 deletions
+2
View File
@@ -6,6 +6,7 @@ import { AuthModule } from './auth/auth.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UsersModule } from './users/users.module';
import { User } from "./users/entities/user.entity";
import { ProfesorModule } from './profesor/profesor.module';
@Module({
imports: [
@@ -29,6 +30,7 @@ import { User } from "./users/entities/user.entity";
synchronize:true,
}),
}),
ProfesorModule,
],
controllers: [AppController],
providers: [AppService],
@@ -8,41 +8,58 @@ export class profesor{
@Column({length:11 ,nullable:false})
id_usuario: number;
@Column({length:10, nullable:true})
num_trabajador: string;
@Column({length:80, nullable:false})
nombre: string;
@Column({length:10, nullable:true})
rfc: string;
@Column({length:3, nullable:true})
homoclave: string;
@Column({length:13, nullable:true})
tel_oficina: string;
@Column({length:10, nullable:true})
extension: string;
@Column({length:13, nullable:true})
tel_personal: string;
@Column({length:65, nullable:true})
correo_pcp: string;
@Column({length:65, nullable:true})
correo_per: string;
@Column({length:11, nullable:true})
id_adscripcion: number;
@Column({length:11, nullable:true})
id_categoria: number;
@Column({length:11, nullable:true})
id_edificio: number;
@Column({length:256, nullable:true})
ubicacion: string;
@Column({length:150, nullable:true})
fotografia: string;
@Column({ nullable:false})
activo: boolean = false;
@Column({ nullable:false})
mostrar: boolean = true;
@Column({ nullable:false})
fecha_alta: Date;
@Column({ nullable:false})
fecha_actualizacion: Timestamp;
+18
View File
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { ProfesorController } from './profesor.controller';
describe('ProfesorController', () => {
let controller: ProfesorController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [ProfesorController],
}).compile();
controller = module.get<ProfesorController>(ProfesorController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});
+33
View File
@@ -0,0 +1,33 @@
import { Body, Controller, Delete, Get, Post } from '@nestjs/common';
import { ProfesorService } from './profesor.service';
@Controller('profesor')
export class profesorController {
constructor(private profesorService: ProfesorService) {}
@Post("alta")
async postRegister(@Body() data:profeDto){
return this.profesorService.register(data);
}
@Post("midificacion")
async postModify(@Body() data:profeDto){
return this.profesorService.modify(data);
}
@Delete("borrado")
async remove(@Body() data:profeDto){
return this.profesorService.remove(data);
}
@Get("profile")
async profile(){
return this.profesorService.profile();
}
@Get("profile/filter")
async filter(@Body() data:profeDto){
return this.profesorService.filter(data);
}
}
+4
View File
@@ -0,0 +1,4 @@
import { Module } from '@nestjs/common';
@Module({})
export class ProfesorModule {}
+18
View File
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { ProfesorService } from './profesor.service';
describe('ProfesorService', () => {
let service: ProfesorService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [ProfesorService],
}).compile();
service = module.get<ProfesorService>(ProfesorService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
+26
View File
@@ -0,0 +1,26 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class ProfesorService {
async register(){
}
async modify(){
}
async remove(){
}
async profile(){
}
async filter(){
}
}