返回 AiToEarn
statement.shema.ts
根目录 / project / aitoearn-electron / server / src / db / schema / statement.shema.ts
1 /*
2 * @Author: nevin
3 * @Date: 2022-11-16 22:04:18
4 * @LastEditTime: 2025-02-27 15:18:16
5 * @LastEditors: nevin
6 * @Description: 用户流水
7 */
8 import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
9 import { TimeTemp } from './time.tamp';
10 import { Decimal128 } from 'mongodb';
11
12 @Schema({
13 collection: 'statement',
14 versionKey: false,
15 toJSON: { virtuals: true },
16 toObject: { virtuals: true },
17 timestamps: false,
18 })
19 export class Statement extends TimeTemp {
20 @Prop({
21 required: true,
22 })
23 userId: string;
24
25 @Prop({
26 type: Decimal128,
27 required: true,
28 default: 0,
29 })
30 balance: Decimal128;
31 }
32
33 export const StatementSchema = SchemaFactory.createForClass(Statement);
34
34 lines TYPESCRIPT