update: remove dollor from wallet and unit

This commit is contained in:
mahyargdz
2024-12-30 16:03:02 +03:30
parent 0d8ba394b1
commit cd61741d06
13 changed files with 462 additions and 490 deletions
+36 -36
View File
@@ -1,42 +1,42 @@
const mongoose = require('mongoose')
const deviceSchema = mongoose.Schema({
model: String,
IMEI: {
type: String,
unique: [true, "این ایدی در سامانه موجود است"]
},
tomanPrice: {
type: Number,
min: 0,
default: 0
},
dollarProfit: {
type: Number,
min: 0,
default: 0
},
profit: {
type: Number,
min: 0,
default: 0
},
score: {
type: Number,
min: 0
},
renewalProfit: {
type: Number,
min: 0
},
status: {
type: Number,
enum: [
0, // not installed
1 // installed
],
default: 0
}
model: String,
IMEI: {
type: String,
unique: [true, 'این ایدی در سامانه موجود است']
},
tomanPrice: {
type: Number,
min: 0,
default: 0
},
// dollarProfit: {
// type: Number,
// min: 0,
// default: 0
// },
profit: {
type: Number,
min: 0,
default: 0
},
score: {
type: Number,
min: 0
},
renewalProfit: {
type: Number,
min: 0
},
status: {
type: Number,
enum: [
0, // not installed
1 // installed
],
default: 0
}
})
module.exports = mongoose.model('Device', deviceSchema)
+45 -47
View File
@@ -1,58 +1,56 @@
const mongoose = require('mongoose')
const BankSchema = mongoose.Schema({
holderName: String,
PAN: {
type: Number,
},
IBAN: {
type: String,
}
holderName: String,
PAN: {
type: Number
},
IBAN: {
type: String
}
})
const UserSchema = mongoose.Schema({
first_name: String,
last_name: String,
national_code: String,
province_name: Object,
city_name: Object,
address: String,
mobile_number: String,
cell_number:String,
password: String,
profilePic: {
type: String,
default: "noPic"
},
shopName: String,
birthDate: String,
lastIP:String,
walletBalance: {
type: Number,
min: 0,
default: 0
},
dollarBalance: {
type: Number,
min: 0,
default: 0
},
score: {
type: Number,
min: 0,
default: 0
},
cardBank: [BankSchema],
active:{ type: Boolean, default: false },
first_name: String,
last_name: String,
national_code: String,
province_name: Object,
city_name: Object,
address: String,
mobile_number: String,
cell_number: String,
password: String,
profilePic: {
type: String,
default: 'noPic'
},
shopName: String,
birthDate: String,
lastIP: String,
walletBalance: {
type: Number,
min: 0,
default: 0
},
// dollarBalance: {
// type: Number,
// min: 0,
// default: 0
// },
score: {
type: Number,
min: 0,
default: 0
},
cardBank: [BankSchema],
active: { type: Boolean, default: false },
/// //////////////////////////////// user confirmations
seenByAdmin: { type: Boolean, default: false },
/// //////////////////////////////// user confirmations
seenByAdmin: { type: Boolean, default: false },
/// /////////////
token: String,
otp:String
/// /////////////
token: String,
otp: String
})
module.exports = mongoose.model('UserGPS', UserSchema)
+30 -31
View File
@@ -1,41 +1,40 @@
const mongoose = require('mongoose')
const BankSchema = mongoose.Schema({
holderName: String,
PAN: {
type: Number,
},
IBAN: {
type: String,
}
holderName: String,
PAN: {
type: Number
},
IBAN: {
type: String
}
})
/// /////////////////////////////////////////////////////
const WithdrawSchema = mongoose.Schema({
card: BankSchema,
amount: {
type: Number,
min: 0
},
dollarAmount: {
type: Number,
min: 0
},
userId: {
type: String,
ref: 'UserGPS'
},
status: {
type: Number,
enum: [
0, // Pending
1, // Accepted
2, // deposited
]
},
depositDate: Date,
trackingNumber: String
card: BankSchema,
amount: {
type: Number,
min: 0
},
// dollarAmount: {
// type: Number,
// min: 0
// },
userId: {
type: String,
ref: 'UserGPS'
},
status: {
type: Number,
enum: [
0, // Pending
1, // Accepted
2 // deposited
]
},
depositDate: Date,
trackingNumber: String
})
module.exports = mongoose.model('Withdraw', WithdrawSchema)