INIT models

This commit is contained in:
Mr Swift
2024-08-05 15:25:30 +03:30
parent 5e46989357
commit f708d708d1
5 changed files with 40 additions and 2 deletions
+1 -1
View File
@@ -250,7 +250,7 @@ module.exports.delete_admin = [
module.exports.permissions = [
(req, res) => {
return res.json(permissions)
return res.status(200).json(permissions)
}
]
@@ -13,8 +13,20 @@ const InstalledDeviceSchema = mongoose.Schema({
2, // Rejected
]
},
dollarProfit:{
type:Number,
min:0
},
score:{
type:Number,
min:0
},
registerDate:Date,
installationDate:Date
installationDate:Date,
userId:{
type:String,
ref:'User'
},
})
module.exports = mongoose.model('InstalledDevice', InstalledDeviceSchema)
+26
View File
@@ -0,0 +1,26 @@
const mongoose = require('mongoose')
const ScoreSchema = mongoose.Schema({
deviceId:{
type:String,
ref:'Device'
},
renewDate:Date,
renewType:{
type:String,
},
price:{
type:Number,
min:0
},
profit:{
type:Number,
min:0
},
dollarProfit:{
type:Number,
min:0
},
})
module.exports = mongoose.model('Score', ScoreSchema)