29 lines
992 B
JavaScript
29 lines
992 B
JavaScript
const insertShelving = require('./methods/insertShelving');
|
|
const bindShelving = require('./methods/bindShelving');
|
|
const filter = require('./utilities/filter');
|
|
const insertDB = require('./db/insertDB')
|
|
|
|
function bindShelvingTag(barcode, shelving, level){
|
|
if(filter.isBarcode(barcode)){
|
|
if(filter.isShelving(shelving)){
|
|
let shelvingId = shelving + level;
|
|
insertShelving.insertShelving(shelvingId);
|
|
bindShelving.bindShelving(barcode, shelvingId);
|
|
insertDB.insertDB(barcode, shelving, level);
|
|
}else{
|
|
console.log("¡MATRICULA INCORRECTA!")
|
|
}
|
|
}else{
|
|
console.log("¡CODIGO DE ETIQUETA INCORRECTO!")
|
|
}
|
|
}
|
|
///DATOS INTRODUCIDOS POR EL USUARIO////
|
|
var barcode = "A0A3B8224DBF"; //valido = "A0A3B82"+ 4 CARACTERES HEXADECIMALES (0-F)
|
|
var shelving = "ABC"; //valido = 3 CARACTERES LETRAS (A-Z)
|
|
var level = "4";
|
|
//////////////////////////////////////
|
|
|
|
bindShelvingTag(barcode, shelving, level);
|
|
|
|
|