Skip to content

Commit 95b1c6a

Browse files
committed
transaction schema updated
1 parent aa501d9 commit 95b1c6a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

models/transaction.model.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ const transactionSchema = new Schema(
66
user_id: {
77
type: Schema.Types.ObjectId,
88
ref: 'User',
9+
required:true
910
},
1011
type:{
1112
type:String,
1213
enum: ["credit", "debit"]
1314
},
15+
slot_id:
16+
{
17+
type:Schema.Types.ObjectId,
18+
ref:'Slot',
19+
},
1420
amount:{
1521
type:Schema.Types.Decimal128,
1622
required:true

services/booking.service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const NewBooking = async (bookingBody) => {
4141
user_id:user._id,
4242
type:'debit',
4343
amount:parseFloat(bookingBody.amount),
44-
remarks:'book_slot'
44+
remarks:'book_slot',
45+
slot_id:slot._id
4546
};
4647
await Transaction.create(transaction);
4748
return result;

0 commit comments

Comments
 (0)