96 lines
1.5 KiB
TypeScript
96 lines
1.5 KiB
TypeScript
import { IsArray, IsBoolean, IsInt, IsNumber, IsOptional, IsString, Min } from 'class-validator';
|
||
|
||
export class CheckInDto {
|
||
@IsInt()
|
||
studentId: number;
|
||
|
||
@IsInt()
|
||
roomId: number;
|
||
|
||
@IsString()
|
||
checkInDate: string; // YYYY-MM-DD
|
||
|
||
@IsOptional()
|
||
@IsString()
|
||
billingStartDate?: string; // 默认=checkInDate,可调整
|
||
|
||
@IsOptional()
|
||
@IsString()
|
||
notes?: string;
|
||
|
||
@IsOptional()
|
||
@IsString()
|
||
stayType?: string;
|
||
|
||
@IsOptional()
|
||
@IsBoolean()
|
||
collectDeposit?: boolean;
|
||
|
||
@IsOptional()
|
||
@IsNumber()
|
||
@Min(0.01)
|
||
depositAmount?: number;
|
||
|
||
@IsInt()
|
||
bedId: number;
|
||
|
||
@IsOptional()
|
||
@IsInt()
|
||
lockerId?: number;
|
||
}
|
||
|
||
export class CheckOutDto {
|
||
@IsString()
|
||
checkOutDate: string;
|
||
|
||
@IsOptional()
|
||
@IsString()
|
||
billingEndDate?: string; // 默认=checkOutDate
|
||
|
||
@IsOptional()
|
||
@IsString()
|
||
checkOutReason?: string;
|
||
}
|
||
|
||
export class TransferRoomDto {
|
||
@IsInt()
|
||
newRoomId: number;
|
||
|
||
@IsString()
|
||
transferDate: string; // YYYY-MM-DD
|
||
|
||
@IsOptional()
|
||
@IsString()
|
||
oldBillingEndDate?: string; // 旧房计费截止日,默认=transferDate
|
||
|
||
@IsInt()
|
||
newBedId: number;
|
||
|
||
@IsOptional()
|
||
@IsInt()
|
||
newLockerId?: number;
|
||
@IsOptional()
|
||
@IsString()
|
||
newBillingStartDate?: string; // 新房计费起始日,默认=transferDate次日
|
||
|
||
@IsOptional()
|
||
@IsString()
|
||
reason?: string;
|
||
}
|
||
|
||
export class BatchCheckOutDto {
|
||
@IsArray()
|
||
ids: number[];
|
||
|
||
@IsString()
|
||
checkOutDate: string; // YYYY-MM-DD
|
||
|
||
@IsOptional()
|
||
@IsString()
|
||
billingEndDate?: string; // 默认=checkOutDate
|
||
|
||
@IsOptional()
|
||
@IsString()
|
||
checkOutReason?: string;
|
||
}
|