Creacion de entities
This commit is contained in:
@@ -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