@taqtile/nodenab
Version:
Uma biblioteca para remessa e retorno de arquivos 400 e 240 do padrão cnab
23 lines (18 loc) • 715 B
JavaScript
const IntercambioBancarioFileAbstract = require('./IntercambioBancarioFileAbstract');
const Picture = require('./Format/Picture');
module.exports = class IntercambioBancarioRemessaFileAbstract extends IntercambioBancarioFileAbstract {
constructor(model) {
super();
this._model = model;
}
_encode(fieldsDef, modelSection) {
let encoded = '';
Object.keys(fieldsDef).forEach((field) => {
if (modelSection[field] !== undefined) {
let format = fieldsDef[field]['picture'];
encoded += Picture.encode(modelSection[field], format, { fieldDesc : fieldsDef[field] , field})
}
});
return encoded;
}
};