add profit to installed device
This commit is contained in:
@@ -55,7 +55,8 @@ module.exports.deviceRegistration = [
|
|||||||
status: 1,
|
status: 1,
|
||||||
registerDate: new Date(),
|
registerDate: new Date(),
|
||||||
userId: req.user_id,
|
userId: req.user_id,
|
||||||
IMEI: req.body.IMEI
|
IMEI: req.body.IMEI,
|
||||||
|
profit: fee.amount
|
||||||
}
|
}
|
||||||
// 1.add to installed device
|
// 1.add to installed device
|
||||||
const installedDevice = await InstalledDevice.create(data)
|
const installedDevice = await InstalledDevice.create(data)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ const mongoose = require('mongoose')
|
|||||||
const InstalledDeviceSchema = mongoose.Schema({
|
const InstalledDeviceSchema = mongoose.Schema({
|
||||||
deviceId: {
|
deviceId: {
|
||||||
type: String,
|
type: String,
|
||||||
ref: "Device"
|
ref: 'Device'
|
||||||
},
|
},
|
||||||
IMEI: String,
|
IMEI: String,
|
||||||
deviceType: String,
|
deviceType: String,
|
||||||
@@ -12,7 +12,7 @@ const InstalledDeviceSchema = mongoose.Schema({
|
|||||||
enum: [
|
enum: [
|
||||||
0, // Pending
|
0, // Pending
|
||||||
1, // Accepted
|
1, // Accepted
|
||||||
2, // Rejected
|
2 // Rejected
|
||||||
],
|
],
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
@@ -22,10 +22,14 @@ const InstalledDeviceSchema = mongoose.Schema({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
profit: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
userId: {
|
userId: {
|
||||||
type: String,
|
type: String,
|
||||||
ref: 'UserGPS'
|
ref: 'UserGPS'
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
module.exports = mongoose.model('InstalledDevice', InstalledDeviceSchema)
|
module.exports = mongoose.model('InstalledDevice', InstalledDeviceSchema)
|
||||||
|
|||||||
Reference in New Issue
Block a user