- Altri aggiornamenti della scheda

This commit is contained in:
Surya Paolo
2025-04-24 19:31:40 +02:00
parent 4b4e3963ac
commit 95793fd73f
5 changed files with 23 additions and 3 deletions

View File

@@ -62,6 +62,7 @@ const catalogo = new Schema(
editore: [{ type: String }],
argomenti: [{ type: String }],
idCollane: [{ type: Number }],
idTipologia: [{ type: Number }],
sort_field: { type: String },
sort_dir: { type: Number },
pdf: { type: Boolean },

View File

@@ -130,6 +130,7 @@ const scheletroScheda = {
productTypes: [{ type: Number }],
excludeproductTypes: [{ type: Number }],
idTipologia: [{ type: Number }],
editore: [{ type: String }],
argomenti: [{ type: String }],
idCollane: [{ type: Number }],

View File

@@ -82,6 +82,12 @@ const productSchema = new Schema({
misure: {
type: String,
},
edizione: {
type: String,
},
ristampa: {
type: String,
},
formato: {
type: String,
},

View File

@@ -147,6 +147,10 @@ const productInfoSchema = new Schema({
type: Date,
},
date_updated_fromGM: {
type: Date,
},
totVen: Number,
totFat: Number,
vLast3M: Number,

View File

@@ -636,6 +636,7 @@ class Macro {
idStatoProdotto: product.idStatoProdotto || undefined,
date_pub: product.date_pub || undefined,
sottotitolo: product.sottotitolo || undefined,
...(product.date_updated_fromGM ? { date_updated_fromGM: product.date_updated_fromGM } : {}),
};
} catch (e) {
console.error('Errore preparaProductInfo :', e);
@@ -729,18 +730,22 @@ class Macro {
Edizione: productGM.Edizione,
Pagine: productGM.Pagine,
misure: productGM.Misure,
edizione: productGM.Edizione,
ristampa: productGM.Ristampa,
eta: productGM.FasciaEta,
// addtocart_link: '',
Quantita: productGM.QtaDisponibile || undefined,
date_pub: tools.getDateFromISOString(productGM.DataPubblicazione),
date_pub: productGM.DataPubblicazione ? tools.getDateFromISOString(productGM.DataPubblicazione) : null,
sottotitolo: productGM.Sottotitolo,
productTypes: [shared_consts.PRODUCTTYPE.PRODUCT],
date_updated_fromGM: new Date(),
}
let vers = 0;
//if (productGM.DescrizioneTipologia === 'Usato')
// vers = shared_consts.PRODUCTTYPE.USATO;
/*
if (productGM.DescrizioneTipologia === 'Download')
vers = shared_consts.PRODUCTTYPE.DOWNLOAD;
else if (productGM.DescrizioneTipologia === 'DVD')
@@ -755,8 +760,9 @@ class Macro {
vers = shared_consts.PRODUCTTYPE.STREAMING;
else
vers = shared_consts.PRODUCTTYPE.NUOVO;
recproduct.Versione = vers;
*/
return recproduct
@@ -914,7 +920,7 @@ class Macro {
preparaVariazione(product) {
return {
active: true,
versione: product.Versione,
// versione: product.Versione,
status: product.Stato || null,
price: product.price ? parseFloat(tools.convertPriceEurToValue(product.price)) : null,
sale_price: product.sale_price ? parseFloat(tools.convertPriceEurToValue(product.sale_price)) : null,
@@ -925,6 +931,8 @@ class Macro {
edizione: product.Edizione || '',
pagine: tools.isValidNumber(product.Pagine) ? tools.convstrToInt(product.Pagine) : 0,
misure: product.misure || '',
edizione: product.edizione || '',
ristampa: product.ristampa || '',
eta: product.eta || '',
addtocart_link: product.addtocart_link || '',
quantita: product.Quantita ? parseInt(product.Quantita) : 0,