Skip to content

Commit

Permalink
Fix north east issue with registration blank screen (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohith1122 authored Aug 18, 2023
1 parent 7fa91f7 commit d9a451a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ In the cloud environment, service data is imported into the DynamoDB from the Do

In the local and in the dev environments, the Authentication mechanism of the API is mocked, and as such, the following token must be provided in API requests: MOCK_POSTCODE_API_ACCESS_TOKEN

In the local environment dynamodb-admin runs on port 8001 to see the table data

### Manual check

Once the application is spun up, use postman to call the available endpoints of the API. Full API documentation can be found at the Swagger endpoint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class LocalDynamoConfig {
String entry10 = "{\"postcode\":\"S12HE\",\"easting\":\"435364\", \"northing\":\"387300\",\"name\":\"NHS SHEFFIELD CCG\"}";
String entry11 = "{\"postcode\":\"DL170HF\",\"easting\":\"428580\", \"northing\":\"529821\",\"name\":\"NHS DURHAM DALES\"}";
String entry12 = "{\"postcode\":\"DH88TF\",\"easting\":\"428580\", \"northing\":\"529821\",\"name\":\"NHS DURHAM DALES\"}";
String entry13 = "{\"postcode\":\"NE639UZ\",\"easting\":\"427406\", \"northing\":\"587768\",\"name\":\"NHS Northumberland CCG\"}";


@Bean
Expand All @@ -84,7 +85,7 @@ public void setupDynamoTables() {
}
log.info("Table created: " + tableDescription.table());

String[] itemsStrings = new String[]{entry1, entry2, entry3, entry4, entry5, entry6, entry7, entry8, entry9,entry10,entry11,entry12};
String[] itemsStrings = new String[]{entry1, entry2, entry3, entry4, entry5, entry6, entry7, entry8, entry9,entry10,entry11,entry12,entry13};
List<PutItemRequest> items = Arrays.stream(itemsStrings)
.map(this::jsonToMap)
.filter(Objects::nonNull)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ public RegionRecord getRegionRecord(String postcode) {
);
regionRecord = regionRecordList.get(index);
}
if (regionRecord.getRegion().equals("North East")){
regionRecord.setRegion("Yorkshire and The Humber");
log.info("Updated region from North East to Yorkshire and The Humber: {}, {}",postcode, regionRecord);
}
return regionRecord;
}

Expand Down Expand Up @@ -276,6 +280,7 @@ public CCGRecord getCCGRecord(String postcode, String district) {
log.error("An error with the binary search {}", e.getMessage());
}

log.info("Found CCG Records: {}",ccgRecord);
return ccgRecord;
}

Expand Down
12 changes: 11 additions & 1 deletion build/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,17 @@ services:
default:
aliases:
- dynamo.pc.local

dynamodb-admin:
image: aaronshaf/dynamodb-admin
ports:
- "8001:8001"
environment:
DYNAMO_ENDPOINT: "http://dynamodb-local:8000"
AWS_REGION: "eu-west-2"
AWS_ACCESS_KEY_ID: local
AWS_SECRET_ACCESS_KEY: local
depends_on:
- dynamodb-local
networks:
default:
external:
Expand Down
1 change: 1 addition & 0 deletions data/dynamo/test/01-postcode-location-mapping-table.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ aws dynamodb put-item --region eu-west-2 --table-name service-finder-local-postc
aws dynamodb put-item --region eu-west-2 --table-name service-finder-local-postcode-location-mapping --item "{\"postcode\":{\"S\":\"S12HE\"},\"easting\":{\"N\":\"435364\"}, \"northing\":{\"N\":\"387300\"},\"name\":{\"S\":\"NHS SHEFFIELD CCG\"}}" --endpoint-url http://localhost:8000
aws dynamodb put-item --region eu-west-2 --table-name service-finder-local-postcode-location-mapping --item "{\"postcode\":{\"S\":\"DL170HF\"},\"easting\":{\"N\":\"428580\"}, \"northing\":{\"N\":\"529821\"},\"name\":{\"S\":\"NHS DURHAM DALES\"}}" --endpoint-url http://localhost:8000
aws dynamodb put-item --region eu-west-2 --table-name service-finder-local-postcode-location-mapping --item "{\"postcode\":{\"S\":\"DH88TF\"},\"easting\":{\"N\":\"428580\"}, \"northing\":{\"N\":\"529821\"},\"name\":{\"S\":\"NHS DURHAM DALES\"}}" --endpoint-url http://localhost:8000
aws dynamodb put-item --region eu-west-2 --table-name service-finder-local-postcode-location-mapping --item "{\"postcode\":{\"S\":\"NE639UZ\"},\"easting\":{\"N\":\"427406\"}, \"northing\":{\"N\":\"587768\"},\"name\":{\"S\":\"NHS Northumberland CCG\"}}" --endpoint-url http://localhost:8000

0 comments on commit d9a451a

Please sign in to comment.