2021-03-17 14:27:09 +00:00
|
|
|
const insertShelving = require('./methods/insertShelving');
|
|
|
|
const bindShelving = require('./methods/bindShelving');
|
2021-03-16 14:22:25 +00:00
|
|
|
const filter = require('./utilities/filter');
|
2021-03-12 12:54:21 +00:00
|
|
|
const insertDB = require('./db/insertDB')
|
2021-03-11 15:39:10 +00:00
|
|
|
|
2021-03-11 15:58:34 +00:00
|
|
|
function bindShelvingTag(barcode, shelving, level){
|
2021-03-16 11:25:32 +00:00
|
|
|
if(filter.isBarcode(barcode)){
|
|
|
|
if(filter.isShelving(shelving)){
|
2021-03-16 14:22:25 +00:00
|
|
|
let shelvingId = shelving + level;
|
|
|
|
insertShelving.insertShelving(shelvingId);
|
|
|
|
bindShelving.bindShelving(barcode, shelvingId);
|
|
|
|
insertDB.insertDB(barcode, shelving, level);
|
2021-03-11 15:58:34 +00:00
|
|
|
}else{
|
2021-03-15 10:43:42 +00:00
|
|
|
console.log("¡MATRICULA INCORRECTA!")
|
2021-03-11 15:58:34 +00:00
|
|
|
}
|
|
|
|
}else{
|
|
|
|
console.log("¡CODIGO DE ETIQUETA INCORRECTO!")
|
|
|
|
}
|
2021-03-11 15:39:10 +00:00
|
|
|
}
|
|
|
|
///DATOS INTRODUCIDOS POR EL USUARIO////
|
2021-03-16 14:22:25 +00:00
|
|
|
var barcode = "A0A3B8224DBF"; //valido = "A0A3B82"+ 4 CARACTERES HEXADECIMALES (0-F)
|
2021-03-16 11:25:47 +00:00
|
|
|
var shelving = "ABC"; //valido = 3 CARACTERES LETRAS (A-Z)
|
|
|
|
var level = "4";
|
2021-03-11 15:39:10 +00:00
|
|
|
//////////////////////////////////////
|
|
|
|
|
2021-03-16 07:58:58 +00:00
|
|
|
bindShelvingTag(barcode, shelving, level);
|
|
|
|
|
|
|
|
|