add pagination and fix bug

This commit is contained in:
Mr Swift
2024-08-07 15:42:53 +03:30
parent 13f991eab2
commit db6c8d6681
13 changed files with 322 additions and 156 deletions
+26 -26
View File
@@ -1,41 +1,41 @@
const mongoose = require('mongoose')
const deviceSchema = mongoose.Schema({
model:String,
IMEI:{
type:String,
unique:[true,"این ایدی در سامانه موجود است"]
model: String,
IMEI: {
type: String,
unique: [true, "این ایدی در سامانه موجود است"]
},
tomanPrice:{
type:Number,
min:0,
default:0
tomanPrice: {
type: Number,
min: 0,
default: 0
},
dollarProfit:{
type:Number,
min:0,
default:0
dollarProfit: {
type: Number,
min: 0,
default: 0
},
profit:{
type:Number,
min:0,
default:0
profit: {
type: Number,
min: 0,
default: 0
},
score:{
type:Number,
min:0
score: {
type: Number,
min: 0
},
renewalProfit:{
type:Number,
min:0
renewalProfit: {
type: Number,
min: 0
},
status:{
type:Number,
enum:[
status: {
type: Number,
enum: [
0, // not installed
1 // installed
],
default:0
default: 0
}
})