-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPayment.js
38 lines (36 loc) · 823 Bytes
/
Payment.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const mongoose = require("mongoose");
const Schema = mongoose.Schema
const paymentSchema = new mongoose.Schema({
user: {
type: Schema.Types.ObjectId,
ref: "user",
required: true
},
product: {
type: Schema.Types.ObjectId,
ref: "product",
required: true
},
method: {
type: String,
enum: ['Cash on Delivery','manual','khalti']
},
amount: {
type: Number,
required: true
},
transactionCode: {
type: String,
required: true,
unique: true
},
from:{
type:Number,
max: 9999999999 //!esewa && receiverNumber
},
isDeleted: {
type: Date,
default: null
}
}, { timestamps: true });
module.exports = mongoose.model("appointment", paymentSchema);