Catalogo, versione di libro/ebook, ecc... quantità

This commit is contained in:
Surya Paolo
2024-05-05 13:55:43 +02:00
parent 07973fbf0a
commit 3fcff43af0
3 changed files with 143 additions and 74 deletions

View File

@@ -56,9 +56,49 @@ const productSchema = new Schema({
type: Number,
required: true,
},
sale_price: {
type: Number,
},
arrvariazioni: [
{
active: {
type: Boolean,
},
versione: {
type: Number,
},
status: { //publish
type: String,
},
price: {
type: Number,
},
sale_price: {
type: Number,
},
quantita: { // in magazzino
type: Number,
},
numpages: {
type: Number,
},
formato: {
type: String,
},
tipologia: {
type: String,
},
edizione: {
type: String,
},
preOrderDate: {
type: Date
},
addtocart_link: {
type: String
},
eta: {
type: String
},
}
],
price_acquistato: {
type: Number,
required: true,
@@ -80,14 +120,10 @@ const productSchema = new Schema({
type: Number,
default: 0,
},
stockQty: { // in magazzino
type: Number,
default: 0,
},
status: { //publish
type: String,
},
stockBloccatiQty: { // Prenotati Bloccati
type: Number,
default: 0,
@@ -149,9 +185,6 @@ const productSchema = new Schema({
note: {
type: String,
},
versione: {
type: Number,
},
producer_name: {
type: String,
},
@@ -332,12 +365,6 @@ module.exports.findAllIdApp = async function (idapp, code, id, all) {
}
}
},
{
$unwind: {
path: '$producer',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'providers',