const mongoose = require('mongoose')

const RenewalSchema = mongoose.Schema({
    deviceId: {
        type: String,
        ref: 'Device'
    },
    IMEI: {
        type: String,
    },
    renewDate: Date,
    renewType: {
        type: String,
    },
    price: {
        type: Number,
        min: 0
    },
    profit: {
        type: Number,
        min: 0,
        unique: true,
        default: 0,
        required: true
    },
    userId: {
        type: String,
        ref: 'UserGPS'
    },
})

module.exports = mongoose.model('Renewal', RenewalSchema)
