73 lines
1.8 KiB
TypeScript
73 lines
1.8 KiB
TypeScript
import { ApiProperty, IntersectionType, PartialType } from '@nestjs/swagger';
|
||
import { IsArray, IsNumber, IsOptional, IsString } from 'class-validator';
|
||
import { PagerDto } from '~/common/dto/pager.dto';
|
||
import { Storage } from '../tools/storage/storage.entity';
|
||
|
||
export class VehicleUsageDto {
|
||
@ApiProperty({ description: '年度' })
|
||
@IsNumber()
|
||
year: number;
|
||
|
||
@ApiProperty({ description: '外出使用的车辆名称(字典)' })
|
||
@IsNumber()
|
||
vechicleId: number;
|
||
|
||
@ApiProperty({ description: '申请人' })
|
||
@IsString()
|
||
applicant: string;
|
||
|
||
@ApiProperty({ description: '出行司机', nullable: true })
|
||
@IsOptional()
|
||
@IsString()
|
||
driver: string;
|
||
|
||
@ApiProperty({ description: '当前车辆里程数(KM)' })
|
||
@IsOptional()
|
||
@IsNumber()
|
||
currentMileage: number;
|
||
|
||
@ApiProperty({ description: '预计出行开始时间' })
|
||
@IsOptional()
|
||
expectedStartDate: Date;
|
||
|
||
@ApiProperty({ description: '预计出行结束时间' })
|
||
@IsOptional()
|
||
expectedEndDate: Date;
|
||
|
||
@ApiProperty({ description: '使用事由' })
|
||
@IsOptional()
|
||
purpose: string;
|
||
|
||
@ApiProperty({ description: '实际回司时间' })
|
||
@IsOptional()
|
||
actualReturnTime: Date;
|
||
|
||
@ApiProperty({ description: '回城车辆里程数(KM)' })
|
||
@IsOptional()
|
||
returnMileage: number;
|
||
|
||
@ApiProperty({ description: '审核人' })
|
||
@IsOptional()
|
||
reviewer: string;
|
||
|
||
@ApiProperty({ description: '审核状态:0待审核,1同意,2.不同意(字典)' })
|
||
@IsOptional()
|
||
status: number;
|
||
|
||
@ApiProperty({ description: '备注' })
|
||
@IsOptional()
|
||
remark: string;
|
||
}
|
||
|
||
export class VehicleUsageUpdateDto extends PartialType(VehicleUsageDto) {
|
||
@ApiProperty({ description: '附件' })
|
||
@IsOptional()
|
||
@IsArray()
|
||
fileIds: number[];
|
||
}
|
||
|
||
export class VehicleUsageQueryDto extends IntersectionType(
|
||
PagerDto<VehicleUsageDto>,
|
||
PartialType(VehicleUsageDto)
|
||
) {}
|