Split user
This commit is contained in:
@@ -7,7 +7,7 @@ const AwardRequestSchema = mongoose.Schema({
|
||||
},
|
||||
userId:{
|
||||
type:String,
|
||||
ref:'User'
|
||||
ref:'UserGPS'
|
||||
},
|
||||
desc:String,
|
||||
metaData:Object,
|
||||
|
||||
@@ -19,7 +19,7 @@ const InstalledDeviceSchema = mongoose.Schema({
|
||||
installationDate: Date,
|
||||
userId: {
|
||||
type: String,
|
||||
ref: 'User'
|
||||
ref: 'UserGPS'
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ const RenewalSchema = mongoose.Schema({
|
||||
},
|
||||
userId: {
|
||||
type: String,
|
||||
ref: 'User'
|
||||
ref: 'UserGPS'
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -12,7 +12,7 @@ const ScoreSchema = mongoose.Schema({
|
||||
},
|
||||
userId: {
|
||||
type: String,
|
||||
ref: 'User'
|
||||
ref: 'UserGPS'
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -24,7 +24,7 @@ const WithdrawSchema = mongoose.Schema({
|
||||
},
|
||||
userId: {
|
||||
type: String,
|
||||
ref: 'User'
|
||||
ref: 'UserGPS'
|
||||
},
|
||||
status: {
|
||||
type: Number,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user