mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-11-23 14:42:06 +00:00
20 lines
698 B
JavaScript
20 lines
698 B
JavaScript
'use strict';
|
|
|
|
const constants = require('../../consts');
|
|
|
|
const iniSerializer = require('./serializers/ini');
|
|
const downloadSerializer = require('./serializers/download');
|
|
const uploadSerializer = require('./serializers/upload');
|
|
|
|
module.exports = {
|
|
use(order, client) {
|
|
const operation = order.operation.toUpperCase();
|
|
|
|
if (operation === constants.orderOperations.ini) return iniSerializer.use(order, client);
|
|
if (operation === constants.orderOperations.download) return downloadSerializer.use(order, client);
|
|
if (operation === constants.orderOperations.upload) return uploadSerializer.use(order, client);
|
|
|
|
throw Error('Error from orders/orders.js: Wrong order version/type.');
|
|
},
|
|
};
|