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',
};
const dateRange = (start, end) => {
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
module.exports = {
name,
version,
orderOperations,
productString: `${name} ${version}`,
dateRange,
};

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('../consts');
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('../consts');
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('../consts');
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('../consts');
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('../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 PTK = require('./PTK');
const HAC = require('./HAC');
const Z53 = require('./Z53');
module.exports = {
INI,
HIA,
HPB,
Z53,
AZV,
CD1,