Skip to content

Commit

Permalink
FCRM-5349 - Changed Request Product 1 to use the EA Maps Service (#420)
Browse files Browse the repository at this point in the history
* FCRM-5349 added configs for eamaps product 1 requests

* FCRM-5349 wip towards replacing the p1 download with eaMaps service

* FCRM-5349 removed pdf and releated unit tests

* FCRM-5349 added tests to cover validateSchema

* FCRM-5349 added test to cover server/routes/product-1.js

* FCRM-5349 increased tests to fully cover getProduct1.js

* FCRM-5349 added unit tests to cover getToken

* FCRM-5349 removed the keepAlive http agent

* FCRM-5349 changes to pass Code Analysis
  • Loading branch information
markfee authored Nov 15, 2024
1 parent e30b739 commit 216ab4b
Show file tree
Hide file tree
Showing 16 changed files with 410 additions and 469 deletions.
6 changes: 5 additions & 1 deletion config/.env-example
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ siteUrl=http://dummyuri
functionAppUrl==http://dummyuri
ignoreUseAutomatedService=true
placeApiUrl=http://dummyuri
#AGOL
agolClientId=TEST_AGOL_CLIENT_ID
agolClientSecret=TEST_AGOL_CLIENT_SECRET
agolServiceUrl=http://dummyAgolUrl
agolCustomerTeamEndPoint=/Flood_Map_for_Planning_Query_Service_NON_PRODUCTION/FeatureServer/0
agolLocalAuthorityEndPoint=/Flood_Map_for_Planning_Query_Service_NON_PRODUCTION/FeatureServer/1
agolIsEnglandEndPoint=/Flood_Map_for_Planning_Query_Service_NON_PRODUCTION/FeatureServer/2
agolFloodZonesRiversAndSeaEndPoint=/Flood_Zones_2_and_3_Rivers_and_Sea_NON_PRODUCTION/FeatureServer/0

#EA Maps
eamapsServiceUrl=http://dummyEAMapslUrl
eamapsProduct1User=PRODUCT1_USER
eamapsProduct1Password=PRODUCT1_PASSWORD
7 changes: 7 additions & 0 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ const config = {
localAuthorityEndPoint: process.env.agolLocalAuthorityEndPoint,
isEnglandEndPoint: process.env.agolIsEnglandEndPoint,
floodZonesRiversAndSeaEndPoint: process.env.agolFloodZonesRiversAndSeaEndPoint
},
eamaps: {
serviceUrl: process.env.eamapsServiceUrl,
product1User: process.env.eamapsProduct1User,
product1Password: process.env.eamapsProduct1Password,
product1EndPoint: '/rest/services/FMfP/FMFPGetProduct1/GPServer/fmfp_get_product1/execute',
tokenEndPoint: '/tokens/generateToken'
}
}

Expand Down
7 changes: 7 additions & 0 deletions config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ const schema = Joi.object({
localAuthorityEndPoint: Joi.string().required(),
isEnglandEndPoint: Joi.string().required(),
floodZonesRiversAndSeaEndPoint: Joi.string().required()
},
eamaps: {
serviceUrl: Joi.string().uri().required(),
product1User: Joi.string().required(),
product1Password: Joi.string().required(),
product1EndPoint: Joi.string().required(),
tokenEndPoint: Joi.string().required()
}
})

Expand Down
37 changes: 37 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"devDependencies": {
"@hapi/code": "^8.0.7",
"@hapi/lab": "^25.3.2",
"axios-mock-adapter": "^2.1.0",
"babel-core": "^6.26.3",
"babel-preset-es2015": "^6.24.1",
"babelify": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion server/plugins/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const routes = [].concat(
require('../routes/os-get-capabilities'),
require('../routes/os-maps-proxy'),
require('../routes/feedback'),
require('../routes/pdf'),
require('../routes/product-1'),
require('../routes/os-terms'),
require('../routes/error'),
require('../routes/cookies'),
Expand Down
Loading

0 comments on commit 216ab4b

Please sign in to comment.