We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa501d9 commit 95b1c6aCopy full SHA for 95b1c6a
models/transaction.model.js
@@ -6,11 +6,17 @@ const transactionSchema = new Schema(
6
user_id: {
7
type: Schema.Types.ObjectId,
8
ref: 'User',
9
+ required:true
10
},
11
type:{
12
type:String,
13
enum: ["credit", "debit"]
14
15
+ slot_id:
16
+ {
17
+ type:Schema.Types.ObjectId,
18
+ ref:'Slot',
19
+ },
20
amount:{
21
type:Schema.Types.Decimal128,
22
required:true
services/booking.service.js
@@ -41,7 +41,8 @@ const NewBooking = async (bookingBody) => {
41
user_id:user._id,
42
type:'debit',
43
amount:parseFloat(bookingBody.amount),
44
- remarks:'book_slot'
+ remarks:'book_slot',
45
+ slot_id:slot._id
46
};
47
await Transaction.create(transaction);
48
return result;
0 commit comments