aggiornamento cataloghi, search
This commit is contained in:
52
src/server/models/t_web_disponibles.js
Executable file
52
src/server/models/t_web_disponibles.js
Executable file
@@ -0,0 +1,52 @@
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
const TWebDisponibileSchema = new mongoose.Schema({
|
||||
Progressivo: {
|
||||
type: mongoose.Schema.Types.Long || Number, // Usa 'mongoose-long' se vuoi long int
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
Codice: {
|
||||
type: String,
|
||||
maxlength: 50,
|
||||
required: true,
|
||||
index: true, // usato nei lookup e nei match
|
||||
},
|
||||
QtaDisponibile: {
|
||||
type: mongoose.Decimal128,
|
||||
default: 0,
|
||||
},
|
||||
Giac: {
|
||||
type: mongoose.Decimal128,
|
||||
default: 0,
|
||||
},
|
||||
DataOra: {
|
||||
type: Date,
|
||||
default: Date.now,
|
||||
index: true, // per ordinamento
|
||||
},
|
||||
Enabled: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
DataOraSito: {
|
||||
type: Date,
|
||||
},
|
||||
Ean13: {
|
||||
type: String,
|
||||
maxlength: 20,
|
||||
},
|
||||
QtaDisponibileOld: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
}, {
|
||||
collection: 't_web_disponibiles', // nome della collezione esatto
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('TWebDisponibile', TWebDisponibileSchema);
|
||||
|
||||
module.exports.createIndexes()
|
||||
.then(() => { })
|
||||
.catch((err) => { throw err; });
|
||||
Reference in New Issue
Block a user