monorepo packages (#344)
This commit is contained in:
29
projects/app/src/service/models/pay.ts
Normal file
29
projects/app/src/service/models/pay.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Schema, model, models, Model } from 'mongoose';
|
||||
import { PaySchema as PayType } from '@/types/mongoSchema';
|
||||
const PaySchema = new Schema({
|
||||
userId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'user',
|
||||
required: true
|
||||
},
|
||||
createTime: {
|
||||
type: Date,
|
||||
default: () => new Date()
|
||||
},
|
||||
price: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
orderId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
status: {
|
||||
// 支付的状态
|
||||
type: String,
|
||||
default: 'NOTPAY',
|
||||
enum: ['SUCCESS', 'REFUND', 'NOTPAY', 'CLOSED']
|
||||
}
|
||||
});
|
||||
|
||||
export const Pay: Model<PayType> = models['pay'] || model('pay', PaySchema);
|
||||
Reference in New Issue
Block a user