Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Entity, Column } from 'typeorm';
import { BaseEntity } from '../../../shared/model/entities/base-entity.entity';
import { ApiModelPropertyOptional } from '@nestjs/swagger';
import { CrudValidationGroups } from '@nestjsx/crud';
import { IsDefined, IsOptional, MaxLength, IsEmail } from 'class-validator';
@Entity()
export class Employee extends BaseEntity {
@ApiModelPropertyOptional()
@IsDefined({ groups: [CrudValidationGroups.CREATE] })
@IsOptional({ groups: [CrudValidationGroups.UPDATE] })
@MaxLength(255)
@Column('varchar', { length: 255, nullable: true })
name?: string;
@ApiModelPropertyOptional()
@IsDefined({ groups: [CrudValidationGroups.CREATE] })
@IsOptional({ groups: [CrudValidationGroups.UPDATE] })
@MaxLength(255)
@Column('varchar', { length: 255, nullable: true })
surname?: string;
@ApiModelPropertyOptional()
@IsDefined({ groups: [CrudValidationGroups.CREATE] })
@IsOptional({ groups: [CrudValidationGroups.UPDATE] })
@MaxLength(255)