forked from wangziqi/gongxue-base
feat: add student wallet utility billing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IsInt, IsString, IsNumber, IsOptional } from 'class-validator';
|
||||
import { IsIn, IsInt, IsString, IsNumber, IsOptional, Matches, Min } from 'class-validator';
|
||||
|
||||
export class CreateRoomExpenseDto {
|
||||
@IsInt()
|
||||
@@ -52,3 +52,28 @@ export class BatchRoomExpenseDto {
|
||||
|
||||
expenses: { roomId: number; expenseType: string; amount: number; description?: string }[];
|
||||
}
|
||||
|
||||
|
||||
export class CreateStudentUtilityBillDto {
|
||||
@IsInt()
|
||||
studentId: number;
|
||||
|
||||
@IsIn(['water', 'electricity'])
|
||||
expenseType: 'water' | 'electricity';
|
||||
|
||||
@IsNumber({ maxDecimalPlaces: 2 })
|
||||
@Min(0.01)
|
||||
amount: number;
|
||||
|
||||
@IsString()
|
||||
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
||||
periodStart: string;
|
||||
|
||||
@IsString()
|
||||
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
||||
periodEnd: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user