forked from wangziqi/gongxue-base
由 OCR(open-codereview.ai,deepseek-v4-flash)审查驱动修复: - wallets 原子扣款防 double-spend;refund 条件更新幂等;findTransactions 分页 - financial/imports/occupancies/attendance 事务与 advisory lock;重复生成/提交幂等 - 矛盾校验器、日期区间、实体双映射/DECIMAL/nullable、时区统一(china-time) - rbac-seed 防重激活、exam 权限恢复、状态一致性、路由顺序、N+1/IN 分块等性能项 Reviewed-by: OCR (open-codereview.ai)
60 lines
1.0 KiB
TypeScript
60 lines
1.0 KiB
TypeScript
import {
|
||
ArrayMaxSize,
|
||
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}-(0[1-9]|1[0-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;
|
||
}
|
||
|
||
/** 批量确认账单请求体:ids 校验为整数数组且最多 500 条。 */
|
||
export class BatchIdsBodyDto {
|
||
@IsArray()
|
||
@IsInt({ each: true })
|
||
@ArrayMaxSize(500)
|
||
ids: number[];
|
||
|
||
@IsIn(['unpaid', 'partially_paid', 'paid'])
|
||
status: 'unpaid' | 'partially_paid' | 'paid';
|
||
}
|