Merge pull request #7 from anandsahil/addCAMT53OrderType

* Add Z53 order type
* Create utils container and move dateRange functionality to there
This commit is contained in:
Dimitar Nanov 2019-08-01 16:59:25 +03:00 committed by GitHub
commit 3ef32c8ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 41 additions and 48 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
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 PTK = require('./PTK');
const HAC = require('./HAC');
const Z53 = require('./Z53');
module.exports = {
INI,
HIA,
HPB,
Z53,
AZV,
CD1,

18
lib/utils.js Normal file
View File

@ -0,0 +1,18 @@
'use strict';
const dateRange = (start, end) => {
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
module.exports = {
dateRange,
};