- Cataloghi: BestSeller, Novità
This commit is contained in:
@@ -59,6 +59,7 @@ const catalogo = new Schema(
|
||||
productTypes: [{ type: Number }],
|
||||
excludeproductTypes: [{ type: Number }],
|
||||
Editore: [{ type: String }],
|
||||
sort: { type: Number },
|
||||
pdf: { type: Boolean },
|
||||
pdf_filename: { type: String },
|
||||
printable: { type: Boolean },
|
||||
@@ -74,7 +75,7 @@ const catalogo = new Schema(
|
||||
{
|
||||
scheda: MySchedaSchema,
|
||||
order: { type: Number },
|
||||
numSchede: { type: Number },
|
||||
numPagineMax: { type: Number },
|
||||
/*arrProdToShow: {
|
||||
type: [[mongoose.Schema.Types.Mixed]], // Definizione tipo
|
||||
select: false // Imposta il campo come non selezionabile
|
||||
@@ -343,7 +344,7 @@ MyElemSchema.statics.findallSchedeTemplate = async function (idapp) {
|
||||
|
||||
// Estrai le schede che hanno isTemplate = true
|
||||
const schedeTemplate = ris.flatMap(elem =>
|
||||
elem.catalogo && elem.catalogo.arrSchede ? elem.catalogo.arrSchede.filter(scheda => scheda.scheda.isTemplate) : []
|
||||
elem.catalogo && elem.catalogo.arrSchede ? elem.catalogo.arrSchede.filter(scheda => scheda.scheda?.isTemplate) : []
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -22,6 +22,9 @@ const ISize = new Schema({
|
||||
const IFont = new Schema({
|
||||
name: { type: String },
|
||||
size: { type: String },
|
||||
line_height: { type: Number },
|
||||
posiz_text: { type: Number },
|
||||
perc_text: { type: String },
|
||||
});
|
||||
|
||||
const IBorders = new Schema({
|
||||
@@ -50,6 +53,11 @@ const IDimensioni = new Schema({
|
||||
imgsfondo: IImg,
|
||||
text_html: IText,
|
||||
});
|
||||
const IPagina = new Schema({
|
||||
dimensioni: IDimensioni,
|
||||
testo_up: IText,
|
||||
testo_down: IText,
|
||||
});
|
||||
|
||||
const IAreaDiStampa = new Schema({
|
||||
margini: IBorders,
|
||||
@@ -61,6 +69,27 @@ const IAreaDiStampa = new Schema({
|
||||
scalecanvas: Number,
|
||||
});
|
||||
|
||||
const INovita = new Schema(
|
||||
{
|
||||
show: Boolean,
|
||||
months: Number,
|
||||
}
|
||||
);
|
||||
|
||||
const IBestseller = new Schema(
|
||||
{
|
||||
show: Boolean,
|
||||
primiNInClassifica: Number,
|
||||
}
|
||||
);
|
||||
|
||||
const IEtichette = new Schema(
|
||||
{
|
||||
novita: INovita,
|
||||
bestseller: IBestseller,
|
||||
}
|
||||
);
|
||||
|
||||
const IBarCode = new Schema(
|
||||
{
|
||||
show: Boolean,
|
||||
@@ -72,7 +101,7 @@ const IBarCode = new Schema(
|
||||
);
|
||||
|
||||
const IElementiScheda = new Schema({
|
||||
pagina: IDimensioni,
|
||||
pagina: IPagina,
|
||||
riga: IDimensioni,
|
||||
scheda_prodotto: IDimensioni,
|
||||
immagine_prodotto: IDimensioni,
|
||||
@@ -81,15 +110,15 @@ const IElementiScheda = new Schema({
|
||||
const scheletroScheda = {
|
||||
idapp: { type: String },
|
||||
isTemplate: { type: Boolean },
|
||||
linkIdTemplate: { type: String },
|
||||
name: { type: String },
|
||||
line_height: { type: Number },
|
||||
numschede_perRiga: { type: Number },
|
||||
numschede_perCol: { type: Number },
|
||||
show_separatore: { type: Boolean },
|
||||
testo_right: IText,
|
||||
testo_bottom: IText,
|
||||
posiz_text: { type: Number },
|
||||
barcode: IBarCode,
|
||||
etichette: IEtichette,
|
||||
|
||||
dimensioni: IElementiScheda,
|
||||
|
||||
|
||||
@@ -129,6 +129,20 @@ const productInfoSchema = new Schema({
|
||||
productTypes: [{
|
||||
type: Number,
|
||||
}],
|
||||
totaleVenduti: Number,
|
||||
venditeLastM: Number,
|
||||
venditeLast6M: Number,
|
||||
venditeLastY: Number,
|
||||
venditeLast2Y: Number,
|
||||
dataUltimoOrdine: Date,
|
||||
rank3M: Number,
|
||||
rank6M: Number,
|
||||
rank1Y: Number,
|
||||
|
||||
descrizione_breve_macro: String,
|
||||
descrizione_completa_macro: String,
|
||||
sottotitolo: String,
|
||||
link_macro: String,
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user