INIT models

This commit is contained in:
Mr Swift
2024-08-05 15:25:30 +03:30
parent 5e46989357
commit f708d708d1
5 changed files with 40 additions and 2 deletions
+33
View File
@@ -0,0 +1,33 @@
const mongoose = require('mongoose')
const BankSchema = mongoose.Schema({
holderName:String,
cardNumber:{
type:Number,
},
shabaNumber:{
type:Number,
}
})
const WithdrawSchema = mongoose.Schema({
card:BankSchema,
amount:{
type:Number,
min:0
},
userId:{
type:String,
ref:'User'
},
status:{
type:Number,
enum:[
0, // Pending
1, // Accepted
2, // deposited
]
},
depositDate:Date
})
module.exports = mongoose.model('Withdraw', WithdrawSchema)