forked from wangziqi/gongxue-base
refactor: resolve remaining field audit issues
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IsString, IsOptional, IsInt, IsEnum, Min, IsNumber } from 'class-validator';
|
||||
import { IsString, IsOptional, IsInt, IsEnum, IsIn, Min, IsNumber } from 'class-validator';
|
||||
|
||||
export class CreateRoomDto {
|
||||
@IsString()
|
||||
@@ -20,6 +20,10 @@ export class CreateRoomDto {
|
||||
@IsString()
|
||||
roomType?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsIn(['男', '女'])
|
||||
gender?: '男' | '女' | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
rentalCategory?: string;
|
||||
@@ -27,7 +31,6 @@ export class CreateRoomDto {
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
monthlyRate?: number;
|
||||
|
||||
}
|
||||
|
||||
export class UpdateRoomDto {
|
||||
@@ -53,8 +56,8 @@ export class UpdateRoomDto {
|
||||
roomType?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
gender?: string;
|
||||
@IsIn(['男', '女'])
|
||||
gender?: '男' | '女' | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsEnum(['available', 'full', 'maintenance'])
|
||||
|
||||
Reference in New Issue
Block a user