add new order type XZ53 and removed repeated dateRange to consts

This commit is contained in:
anandsahil 2019-08-01 14:00:07 +02:00
parent 01d4634d86
commit 5ff3147124
7 changed files with 36 additions and 48 deletions

View File

@ -10,9 +10,22 @@ const orderOperations = {
download: 'DOWNLOAD', download: 'DOWNLOAD',
}; };
const dateRange = (start, end) => {
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
module.exports = { module.exports = {
name, name,
version, version,
orderOperations, orderOperations,
productString: `${name} ${version}`, productString: `${name} ${version}`,
dateRange,
}; };

View File

@ -1,23 +1,13 @@
'use strict'; 'use strict';
const dateRange = (start, end) => { const utils = require('../consts');
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
module.exports = (start = null, end = null) => ({ module.exports = (start = null, end = null) => ({
version: 'h004', version: 'h004',
orderDetails: { orderDetails: {
OrderType: 'HAC', OrderType: 'HAC',
OrderAttribute: 'DZHNN', OrderAttribute: 'DZHNN',
StandardOrderParams: dateRange(start, end), StandardOrderParams: utils.dateRange(start, end),
}, },
operation: 'download', operation: 'download',
}); });

View File

@ -1,23 +1,13 @@
'use strict'; 'use strict';
const dateRange = (start, end) => { const utils = require('../consts');
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
module.exports = (start = null, end = null) => ({ module.exports = (start = null, end = null) => ({
version: 'h004', version: 'h004',
orderDetails: { orderDetails: {
OrderType: 'PTK', OrderType: 'PTK',
OrderAttribute: 'DZHNN', OrderAttribute: 'DZHNN',
StandardOrderParams: dateRange(start, end), StandardOrderParams: utils.dateRange(start, end),
}, },
operation: 'download', operation: 'download',
}); });

View File

@ -1,23 +1,13 @@
'use strict'; 'use strict';
const dateRange = (start, end) => { const utils = require('../consts');
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
module.exports = (start = null, end = null) => ({ module.exports = (start = null, end = null) => ({
version: 'h004', version: 'h004',
orderDetails: { orderDetails: {
OrderType: 'STA', OrderType: 'STA',
OrderAttribute: 'DZHNN', OrderAttribute: 'DZHNN',
StandardOrderParams: dateRange(start, end), StandardOrderParams: utils.dateRange(start, end),
}, },
operation: 'download', operation: 'download',
}); });

View File

@ -1,23 +1,13 @@
'use strict'; 'use strict';
const dateRange = (start, end) => { const utils = require('../consts');
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
module.exports = (start = null, end = null) => ({ module.exports = (start = null, end = null) => ({
version: 'h004', version: 'h004',
orderDetails: { orderDetails: {
OrderType: 'VMK', OrderType: 'VMK',
OrderAttribute: 'DZHNN', OrderAttribute: 'DZHNN',
StandardOrderParams: dateRange(start, end), StandardOrderParams: utils.dateRange(start, end),
}, },
operation: 'download', operation: 'download',
}); });

View File

@ -0,0 +1,13 @@
'use strict';
const utils = require('../consts');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'Z53',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -22,11 +22,13 @@ const HPD = require('./HPD');
const HKD = require('./HKD'); const HKD = require('./HKD');
const PTK = require('./PTK'); const PTK = require('./PTK');
const HAC = require('./HAC'); const HAC = require('./HAC');
const Z53 = require('./Z53');
module.exports = { module.exports = {
INI, INI,
HIA, HIA,
HPB, HPB,
Z53,
AZV, AZV,
CD1, CD1,