add pagination and fix bug

This commit is contained in:
Mr Swift
2024-08-07 15:42:53 +03:30
parent 13f991eab2
commit db6c8d6681
13 changed files with 322 additions and 156 deletions
+21 -21
View File
@@ -2,40 +2,40 @@ const mongoose = require('mongoose')
const BankSchema = mongoose.Schema({
holderName:String,
PAN:{
type:Number,
holderName: String,
PAN: {
type: Number,
},
IBAN:{
type:Number,
IBAN: {
type: Number,
}
})
})
/// /////////////////////////////////////////////////////
const WithdrawSchema = mongoose.Schema({
card:BankSchema,
amount:{
type:Number,
min:0
card: BankSchema,
amount: {
type: Number,
min: 0
},
dollarAmount:{
type:Number,
min:0
dollarAmount: {
type: Number,
min: 0
},
userId:{
type:String,
ref:'User'
userId: {
type: String,
ref: 'User'
},
status:{
type:Number,
enum:[
status: {
type: Number,
enum: [
0, // Pending
1, // Accepted
2, // deposited
]
},
depositDate:Date,
trackingNumber:String
depositDate: Date,
trackingNumber: String
})
module.exports = mongoose.model('Withdraw', WithdrawSchema)