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'; 'use strict';
const dateRange = (start, end) => { const utils = require('../utils');
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('../utils');
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('../utils');
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('../utils');
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('../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 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,

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,
};