2021-06-03 22:56:50 -07:00
|
|
|
const mongoose = require("mongoose");
|
2021-04-10 00:47:40 -07:00
|
|
|
|
2021-06-03 22:56:50 -07:00
|
|
|
const Schema = mongoose.Schema;
|
2021-04-10 00:47:40 -07:00
|
|
|
|
|
|
|
const orderSchema = new Schema({
|
2021-06-03 22:56:50 -07:00
|
|
|
user: {
|
|
|
|
type: mongoose.Types.ObjectId,
|
|
|
|
ref: "User",
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
course: {
|
|
|
|
type: mongoose.Types.ObjectId,
|
|
|
|
ref: "CourseType",
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
paymentSuccess: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
paymentDetail: {
|
|
|
|
type: Object,
|
|
|
|
},
|
|
|
|
orderId: {
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
});
|
2021-04-10 00:47:40 -07:00
|
|
|
|
2021-06-03 22:56:50 -07:00
|
|
|
module.exports = mongoose.model("Order", orderSchema);
|