Split user

This commit is contained in:
Mr Swift
2024-08-22 13:58:09 +03:30
parent 3d059cad1f
commit 10be64ec43
22 changed files with 618 additions and 307 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ const AwardRequestSchema = mongoose.Schema({
},
userId:{
type:String,
ref:'User'
ref:'UserGPS'
},
desc:String,
metaData:Object,
+1 -1
View File
@@ -19,7 +19,7 @@ const InstalledDeviceSchema = mongoose.Schema({
installationDate: Date,
userId: {
type: String,
ref: 'User'
ref: 'UserGPS'
},
})
+1 -1
View File
@@ -26,7 +26,7 @@ const RenewalSchema = mongoose.Schema({
},
userId: {
type: String,
ref: 'User'
ref: 'UserGPS'
},
})
-23
View File
@@ -1,23 +0,0 @@
const mongoose = require('mongoose')
const RequestSchema = mongoose.Schema({
userId: {
type: String,
ref: 'User'
},
shopName: String,
shopNumber: String,
shopAddress: String,
birthDate: String,
status: {
type: Number,
enum: [
0, // Pending
1, // Accepted
2 // Rejected
],
default: 0
}
})
module.exports = mongoose.model('RequestGPS', RequestSchema)
+1 -1
View File
@@ -12,7 +12,7 @@ const ScoreSchema = mongoose.Schema({
},
userId: {
type: String,
ref: 'User'
ref: 'UserGPS'
},
})
+57
View File
@@ -0,0 +1,57 @@
const mongoose = require('mongoose')
const BankSchema = mongoose.Schema({
holderName: String,
PAN: {
type: Number,
},
IBAN: {
type: String,
}
})
const UserSchema = mongoose.Schema({
first_name: String,
last_name: String,
national_code: String,
province_name: String,
city_name: String,
address: String,
mobile_number: String,
cell_number:String,
password: String,
profilePic: {
type: String,
default: "noPic"
},
shopName: String,
birthDate: 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 },
/// /////////////
token: String,
otp:String
})
module.exports = mongoose.model('UserGPS', UserSchema)
+1 -1
View File
@@ -24,7 +24,7 @@ const WithdrawSchema = mongoose.Schema({
},
userId: {
type: String,
ref: 'User'
ref: 'UserGPS'
},
status: {
type: Number,
-35
View File
@@ -1,15 +1,5 @@
const mongoose = require('mongoose')
const BankSchema = mongoose.Schema({
holderName:String,
PAN:{
type:Number,
},
IBAN:{
type:String,
}
})
const UserSchema = mongoose.Schema({
// for admins
@@ -54,31 +44,6 @@ const UserSchema = mongoose.Schema({
last_name: String,
password: String,
// for GPS
profilePic:{
type:String,
default:"noPic"
},
shopName:String,
shopNumber:String,
shopAddress:String,
birthDate:String,
walletBalance:{
type:Number,
min:0,
default:0
},
dollarBalance:{
type:Number,
min:0,
default:0
},
score:{
type:Number,
min:0,
default:0
},
cardBank:[BankSchema],
/// //////////////////////////////// user confirmations