返回 AiToEarn
userWalletAccount.shema.ts
根目录 / project / aitoearn-electron / server / src / db / schema / userWalletAccount.shema.ts
1 /*
2 * @Author: nevin
3 * @Date: 2022-11-16 22:04:18
4 * @LastEditTime: 2025-04-27 12:11:39
5 * @LastEditors: nevin
6 * @Description: 用户钱包账户
7 */
8 import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
9 import { TimeTemp } from './time.tamp';
10
11 export enum WalletAccountType {
12 ZFB = 'ZFB',
13 WX_PAY = 'WX_PAY',
14 }
15
16 @Schema({
17 collection: 'userWalletAccount',
18 versionKey: false,
19 toJSON: { virtuals: true },
20 toObject: { virtuals: true },
21 timestamps: false,
22 })
23 export class UserWalletAccount extends TimeTemp {
24 id: string;
25
26 @Prop({
27 required: true,
28 })
29 userId: string;
30
31 @Prop({
32 required: true,
33 })
34 userName: string; // 真实姓名
35
36 @Prop({
37 required: false,
38 })
39 account?: string; // 账号
40
41 @Prop({
42 required: true,
43 })
44 cardNum: string; // 身份证号
45
46 @Prop({
47 required: true,
48 })
49 phone: string; // 绑定的手机号
50
51 @Prop({
52 required: true,
53 enum: WalletAccountType,
54 })
55 type: WalletAccountType;
56
57 @Prop({
58 required: true,
59 default: false,
60 })
61 isDef: boolean; // 是否默认
62 }
63
64 export const UserWalletAccountSchema =
65 SchemaFactory.createForClass(UserWalletAccount);
66
66 lines TYPESCRIPT