- Cataloghi: pagine, schede, formato

This commit is contained in:
Surya Paolo
2024-11-19 19:18:54 +01:00
parent 73cf977754
commit b1b952d120
16 changed files with 74 additions and 54 deletions

View File

@@ -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 };