42 lines
754 B
JavaScript
42 lines
754 B
JavaScript
const mongoose = require('mongoose')
|
|
|
|
|
|
const BankSchema = mongoose.Schema({
|
|
holderName: String,
|
|
PAN: {
|
|
type: Number,
|
|
},
|
|
IBAN: {
|
|
type: Number,
|
|
}
|
|
})
|
|
|
|
/// /////////////////////////////////////////////////////
|
|
const WithdrawSchema = mongoose.Schema({
|
|
card: BankSchema,
|
|
amount: {
|
|
type: Number,
|
|
min: 0
|
|
},
|
|
dollarAmount: {
|
|
type: Number,
|
|
min: 0
|
|
},
|
|
userId: {
|
|
type: String,
|
|
ref: 'User'
|
|
},
|
|
status: {
|
|
type: Number,
|
|
enum: [
|
|
0, // Pending
|
|
1, // Accepted
|
|
2, // deposited
|
|
]
|
|
},
|
|
depositDate: Date,
|
|
trackingNumber: String
|
|
})
|
|
|
|
module.exports = mongoose.model('Withdraw', WithdrawSchema)
|