const mongoose = require('mongoose') const RenewalSchema = mongoose.Schema({ deviceId: { type: String, ref: 'Device' }, renewDate: Date, renewType: { type: String, }, price: { type: Number, min: 0 }, profit: { type: Number, min: 0, unique: true, default: 0, required: true }, dollarProfit: { type: Number, min: 0 }, userId: { type: String, ref: 'User' }, }) module.exports = mongoose.model('Renewal', RenewalSchema)