forked from wangziqi/gongxue-base
46 lines
892 B
TypeScript
46 lines
892 B
TypeScript
import { ArrayNotEmpty, IsArray, IsIn, IsInt, IsNotEmpty, IsOptional, IsString, Matches, MaxLength } from 'class-validator';
|
|
|
|
export class GenerateBillsDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@Matches(/^[\w-]{8,64}$/)
|
|
operationId?: string;
|
|
|
|
@IsString()
|
|
@Matches(/^\d{4}-\d{2}$/)
|
|
billingMonth: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
periodStart?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
periodEnd?: string;
|
|
}
|
|
|
|
export class UpdateBillStatusDto {
|
|
@IsIn(['unpaid', 'partially_paid', 'paid'])
|
|
status: 'unpaid' | 'partially_paid' | 'paid';
|
|
}
|
|
|
|
export class CancelBillDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@Matches(/^[\w-]{8,64}$/)
|
|
operationId?: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@Matches(/\S/)
|
|
@MaxLength(300)
|
|
reason: string;
|
|
}
|
|
|
|
export class BatchUpdateBillStatusDto extends UpdateBillStatusDto {
|
|
@IsArray()
|
|
@ArrayNotEmpty()
|
|
@IsInt({ each: true })
|
|
ids: number[];
|
|
}
|