| 1 | /* |
| 2 | * @Author: nevin |
| 3 | * @Date: 2025-02-15 20:59:55 |
| 4 | * @LastEditTime: 2025-04-27 12:11:19 |
| 5 | * @LastEditors: nevin |
| 6 | * @Description: |
| 7 | */ |
| 8 | import { ApiProperty } from '@nestjs/swagger'; |
| 9 | import { Expose } from 'class-transformer'; |
| 10 | import { IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator'; |
| 11 | import { |
| 12 | UserWalletAccount, |
| 13 | WalletAccountType, |
| 14 | } from 'src/db/schema/userWalletAccount.shema'; |
| 15 | |
| 16 | export class CreateUserWalletAccountDto implements Partial<UserWalletAccount> { |
| 17 | @ApiProperty({ type: String }) |
| 18 | @IsString({ message: '账号号码必须是字符串' }) |
| 19 | @IsOptional() |
| 20 | @Expose() |
| 21 | account?: string; |
| 22 | |
| 23 | @ApiProperty({ type: String }) |
| 24 | @IsNotEmpty({ message: '姓名不能为空' }) |
| 25 | @IsString() |
| 26 | @Expose() |
| 27 | userName: string; |
| 28 | |
| 29 | @ApiProperty({ type: String }) |
| 30 | @IsNotEmpty({ message: '身份证不能为空' }) |
| 31 | @IsString() |
| 32 | @Expose() |
| 33 | cardNum: string; |
| 34 | |
| 35 | @ApiProperty({ type: String }) |
| 36 | @IsNotEmpty({ message: '手机号不能为空' }) |
| 37 | @IsString() |
| 38 | @Expose() |
| 39 | phone: string; |
| 40 | |
| 41 | @ApiProperty({ enum: WalletAccountType }) |
| 42 | @IsNotEmpty({ message: '钱包类型不能为空' }) |
| 43 | @IsEnum(WalletAccountType) |
| 44 | @Expose() |
| 45 | type: WalletAccountType; |
| 46 | } |
| 47 |