2025-10-21 20:54:03 +02:00
|
|
|
const mongoose = require('mongoose');
|
|
|
|
|
|
|
|
|
|
const itemSchema = new mongoose.Schema({
|
|
|
|
|
name: {
|
2025-11-04 11:35:45 +01:00
|
|
|
en: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
nl: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true
|
|
|
|
|
}
|
2025-10-21 20:54:03 +02:00
|
|
|
},
|
|
|
|
|
description: {
|
2025-11-04 11:35:45 +01:00
|
|
|
en: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: ''
|
|
|
|
|
},
|
|
|
|
|
nl: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: ''
|
|
|
|
|
}
|
2025-10-21 20:54:03 +02:00
|
|
|
},
|
|
|
|
|
location: {
|
|
|
|
|
type: String,
|
|
|
|
|
enum: ['Heerlen', 'Maastricht', 'Sittard'],
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
quantity: {
|
|
|
|
|
type: Number,
|
|
|
|
|
required: true,
|
|
|
|
|
min: 0
|
|
|
|
|
},
|
|
|
|
|
imageUrl: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: '/images/default-item.png'
|
|
|
|
|
},
|
|
|
|
|
reserved: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 0,
|
|
|
|
|
min: 0
|
|
|
|
|
}
|
|
|
|
|
}, { timestamps: true });
|
|
|
|
|
|
|
|
|
|
module.exports = mongoose.model('Item', itemSchema);
|