pos-be/src/modules/web-information/gate/infrastructure/dto/gate.dto.ts

46 lines
1008 B
TypeScript

import { BaseStatusDto } from 'src/core/modules/infrastructure/dto/base-status.dto';
import { GateEntity } from '../../domain/entities/gate.entity';
import { GateType } from '../../constants';
import { ApiProperty } from '@nestjs/swagger';
import { IsObject, IsString } from 'class-validator';
import { Exclude } from 'class-transformer';
import { ItemEntity } from 'src/modules/item-related/item/domain/entities/item.entity';
export class GateDto extends BaseStatusDto implements GateEntity {
@ApiProperty({
type: String,
required: true,
example: GateType.GATE_IN,
})
@IsString()
type: GateType;
@ApiProperty({
type: String,
required: true,
example: '41245',
})
code: string;
@ApiProperty({
type: String,
required: false,
example: '41245',
})
note: string;
@ApiProperty({
type: Object,
required: true,
example: {
id: 'uuid',
name: 'whana',
},
})
@IsObject()
item: ItemEntity;
@Exclude()
item_id: string;
}