- Cataloghi: pagine, schede, formato
This commit is contained in:
@@ -4,7 +4,7 @@ const Schema = mongoose.Schema;
|
||||
const tools = require('../tools/general');
|
||||
const { ObjectID, ObjectId } = require('mongodb');
|
||||
|
||||
const { MySchedaSchema, IDimensioni } = require('../models/myscheda');
|
||||
const { MySchedaSchema, IDimensioni, IImg } = require('../models/myscheda');
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
@@ -15,6 +15,10 @@ mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const IElementiPagina = new Schema({
|
||||
pagina: IDimensioni,
|
||||
});
|
||||
|
||||
const myCard = new Schema(
|
||||
{
|
||||
imagefile: String,
|
||||
@@ -48,13 +52,6 @@ const elemText = new Schema(
|
||||
}
|
||||
);
|
||||
|
||||
const IElementiPagina = new Schema(
|
||||
{
|
||||
pagina: IDimensioni,
|
||||
riga: IDimensioni,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
const catalogo = new Schema(
|
||||
{
|
||||
@@ -63,9 +60,8 @@ const catalogo = new Schema(
|
||||
excludeproductTypes: [{ type: Number }],
|
||||
Editore: [{ type: String }],
|
||||
pdf: { type: Boolean },
|
||||
pdf_filename: { type: String },
|
||||
printable: { type: Boolean },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
|
||||
first_page_img: { type: String },
|
||||
first_page_html: { type: String },
|
||||
@@ -76,17 +72,10 @@ const catalogo = new Schema(
|
||||
last_page_height: { type: Number },
|
||||
last_page_width: { type: Number },
|
||||
|
||||
margine_pagina: { type: String },
|
||||
margine_riga: { type: String },
|
||||
margine_paginaPrintable: { type: String },
|
||||
margine_rigaPrintable: { type: String },
|
||||
imgsfondo_def: IImg,
|
||||
|
||||
dimensioni_def: IElementiPagina,
|
||||
|
||||
backgroundimage: { type: String },
|
||||
backgroundimage_printable: { type: String },
|
||||
backgroundSize: { type: String },
|
||||
backgroundSize_printable: { type: String },
|
||||
widthpagPrintable: { type: Number },
|
||||
|
||||
// -------------------
|
||||
arrSchede: [
|
||||
{
|
||||
|
||||
@@ -16,6 +16,11 @@ mongoose.plugin(schema => {
|
||||
const ISize = new Schema({
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
fit: { type: String },
|
||||
});
|
||||
const IFont = new Schema({
|
||||
name: { type: String },
|
||||
size: { type: String },
|
||||
});
|
||||
|
||||
const IBorders = new Schema({
|
||||
@@ -24,12 +29,33 @@ const IBorders = new Schema({
|
||||
left: { type: String },
|
||||
right: { type: String },
|
||||
})
|
||||
const IImg = new Schema({
|
||||
imagefile: { type: String },
|
||||
fit: { type: String },
|
||||
})
|
||||
|
||||
const IDimensioni = new Schema({
|
||||
size: ISize,
|
||||
margini: IBorders,
|
||||
padding: IBorders,
|
||||
imgsfondo: IImg,
|
||||
});
|
||||
|
||||
const IBarCode = new Schema(
|
||||
{
|
||||
show: Boolean,
|
||||
format: String,
|
||||
size: ISize,
|
||||
font: IFont,
|
||||
}
|
||||
);
|
||||
const IText = new Schema(
|
||||
{
|
||||
contenuto: String,
|
||||
maxlength: Number,
|
||||
}
|
||||
);
|
||||
|
||||
const IElementiScheda = new Schema({
|
||||
pagina: IDimensioni,
|
||||
riga: IDimensioni,
|
||||
@@ -44,16 +70,13 @@ const scheletroScheda = {
|
||||
line_height: { type: Number },
|
||||
numschede_perRiga: { type: Number },
|
||||
numschede_perCol: { type: Number },
|
||||
text: { type: String },
|
||||
testo_right: IText,
|
||||
testo_bottom: IText,
|
||||
posiz_text: { type: Number },
|
||||
|
||||
barcode: IBarCode,
|
||||
|
||||
dimensioni: IElementiScheda,
|
||||
|
||||
bgimg: { type: String },
|
||||
bgimg_printable: { type: String },
|
||||
bgSize: { type: String },
|
||||
bgSize_Printable: { type: String },
|
||||
|
||||
productTypes: [{ type: Number }],
|
||||
excludeproductTypes: [{ type: Number }],
|
||||
editore: [{ type: String }],
|
||||
@@ -90,4 +113,4 @@ MyScheda.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyScheda, MySchedaSchema, IDimensioni };
|
||||
module.exports = { MyScheda, MySchedaSchema, IDimensioni, IImg };
|
||||
|
||||
@@ -76,9 +76,12 @@ const productSchema = new Schema({
|
||||
quantita: { // in magazzino
|
||||
type: Number,
|
||||
},
|
||||
numpages: {
|
||||
pagine: {
|
||||
type: Number,
|
||||
},
|
||||
misure: {
|
||||
type: String,
|
||||
},
|
||||
formato: {
|
||||
type: String,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user