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,29 +3,33 @@ 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,
|
||||||
status: {
|
status: {
|
||||||
type: Number,
|
type: Number,
|
||||||
enum: [
|
enum: [
|
||||||
0, // Pending
|
0, // Pending
|
||||||
1, // Accepted
|
1, // Accepted
|
||||||
2, // Rejected
|
2 // Rejected
|
||||||
],
|
],
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
registerDate: Date,
|
registerDate: Date,
|
||||||
installationDate: Date,
|
installationDate: Date,
|
||||||
check:{
|
check: {
|
||||||
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