Creacion de entities
This commit is contained in:
@@ -1 +1,23 @@
|
|||||||
export class CreatePeriodoDto {}
|
import {
|
||||||
|
IsString,
|
||||||
|
Length,
|
||||||
|
IsDateString,
|
||||||
|
IsOptional,
|
||||||
|
IsBoolean,
|
||||||
|
} from 'class-validator';
|
||||||
|
|
||||||
|
export class CreatePeriodoDto {
|
||||||
|
@IsString()
|
||||||
|
@Length(6, 6)
|
||||||
|
semestre: string;
|
||||||
|
|
||||||
|
@IsDateString()
|
||||||
|
fecha_inicio_servicio: string;
|
||||||
|
|
||||||
|
@IsDateString()
|
||||||
|
fecha_fin_servicio: string;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsBoolean()
|
||||||
|
activo?: boolean;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
export class PeriodoDto {
|
||||||
|
id_periodo: number;
|
||||||
|
semestre: string;
|
||||||
|
fecha_inicio_servicio: Date;
|
||||||
|
fecha_fin_servicio: Date;
|
||||||
|
activo: boolean;
|
||||||
|
}
|
||||||
@@ -1 +1,23 @@
|
|||||||
export class Periodo {}
|
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
|
|
||||||
|
@Entity({ name: 'periodo' })
|
||||||
|
export class Periodo {
|
||||||
|
@PrimaryGeneratedColumn({ name: 'id_periodo', type: 'int' })
|
||||||
|
id_periodo: number;
|
||||||
|
|
||||||
|
@Column({ type: 'char', length: 6, nullable: false })
|
||||||
|
semestre: string;
|
||||||
|
|
||||||
|
@Column({ name: 'fecha_inicio_servicio', type: 'date', nullable: false })
|
||||||
|
fecha_inicio_servicio: Date;
|
||||||
|
|
||||||
|
@Column({ name: 'fecha_fin_servicio', type: 'date', nullable: false })
|
||||||
|
fecha_fin_servicio: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'bit',
|
||||||
|
width: 1,
|
||||||
|
default: () => "b'1'",
|
||||||
|
})
|
||||||
|
activo: boolean;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1,7 @@
|
|||||||
export class CreateServicioDto {}
|
import { IsString, MaxLength } from 'class-validator';
|
||||||
|
|
||||||
|
export class CreateServicioDto {
|
||||||
|
@IsString()
|
||||||
|
@MaxLength(45)
|
||||||
|
servicio: string;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export class ServicioDto {
|
||||||
|
id_servicio: number;
|
||||||
|
servicio: string;
|
||||||
|
}
|
||||||
@@ -1 +1,10 @@
|
|||||||
export class Servicio {}
|
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
|
||||||
|
|
||||||
|
@Entity({ name: 'servicio' })
|
||||||
|
export class Servicio {
|
||||||
|
@PrimaryGeneratedColumn({ name: 'id_servicio', type: 'int' })
|
||||||
|
id_servicio: number;
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', length: 45, nullable: false })
|
||||||
|
servicio: string;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user