Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UML-3042 add other names (also known as) field #96

Merged
merged 9 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ login-api-gateway:

logs:
docker-compose logs --tail=100 -f $(c)

unit-tests-all:
docker-compose run unit-test-lpa-data
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ is a bit more of an in depth set up process required.
- Set the Default Test Runner to 'pytest'
- Right click on the tests folder (or single file) > 'Run pytest in tests'


These tests can also be run with docker, first [set up docker environment](#running-the-api-locally).
Then:
```shell
docker-compose run unit-test-lpa-data
```

## Integration Tests

1. [Set up local environment](#set-up-local-development-environment-outside-of-docker)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
POSTGRES_PASSWORD: password #pragma: allowlist secret
POSTGRES_DB: postgres
broker_app:
image: pactfoundation/pact-broker
image: pactfoundation/pact-cli:latest-multi
ports:
- "9293:80"
- "9292:9292"
Expand Down
6 changes: 2 additions & 4 deletions integration_tests/v1/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@
"method": "GET",
},
"online_tool_endpoint": {
"url": "https://uml-XXXX.dev.lpa.api.opg.service.justice.gov.uk/v1/lpa"
"-online-tool/lpas",
"url": "https://uml-XXXX.dev.lpa.api.opg.service.justice.gov.uk/v1/lpa-online-tool/lpas",
"method": "GET",
"valid_lpa_online_tool_ids": ["A33718377316"],
"invalid_lpa_online_tool_ids": ["banana"],
},
"use_an_lpa_endpoint": {
"url": "https://uml-XXXX.dev.lpa.api.opg.service.justice.gov.uk/v1/use"
"-an-lpa/lpas",
"url": "https://uml-XXXX.dev.lpa.api.opg.service.justice.gov.uk/v1/use-an-lpa/lpas",
"method": "GET",
"valid_sirius_uids": ["700000000047"],
"invalid_sirius_uids": ["9"],
Expand Down
12 changes: 12 additions & 0 deletions integration_tests/v1/response_schemas/use_an_lpa_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
"firstname": {
"type": "string"
},
"otherNames": {
"type": ["string", "null"]
},
"middlenames": {
"type": ["string", "null"]
},
Expand Down Expand Up @@ -103,6 +106,7 @@
"email",
"salutation",
"firstname",
"otherNames",
"middlenames",
"surname",
"addresses",
Expand Down Expand Up @@ -160,6 +164,9 @@
"firstname": {
"type": "string"
},
"otherNames": {
"type": ["string", "null"]
},
"middlenames": {
"type": ["string", "null"]
},
Expand Down Expand Up @@ -228,6 +235,7 @@
"email",
"salutation",
"firstname",
"otherNames",
"middlenames",
"surname",
"addresses",
Expand Down Expand Up @@ -269,6 +277,9 @@
"firstname": {
"type": "string"
},
"otherNames": {
"type": ["string", "null"]
},
"middlenames": {
"type": ["string", "null"]
},
Expand Down Expand Up @@ -331,6 +342,7 @@
"email",
"salutation",
"firstname",
"otherNames",
"middlenames",
"surname",
"addresses"
Expand Down
1 change: 1 addition & 0 deletions lambda_functions/v1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WORKDIR /var/www/lambda_functions/v1
# Install Python Dependencies
COPY requirements requirements
RUN cat ./requirements/*.txt | uniq | grep -v "#" > ./requirements/local-requirements.txt
RUN pip install --upgrade pip
RUN pip install -r ./requirements/local-requirements.txt

EXPOSE 4343
Expand Down
8 changes: 7 additions & 1 deletion lambda_functions/v1/openapi/lpa-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ components:
- dob
- salutation
- firstname
- otherNames
- middlenames
- surname
- companyName
Expand Down Expand Up @@ -668,9 +669,14 @@ components:
description: The case actor's first name
example: Ian
maxLength: 255
otherNames:
type: string
description: The case actor's other name
example: George
maxLength: 255
middlenames:
type: string
description: The case actor's last name
description: The case actor's middle name
example: Deputy
maxLength: 255
surname:
Expand Down
1 change: 0 additions & 1 deletion lambda_functions/v1/requirements/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ validators==0.18.2
yarl==1.6.3
importlib-metadata==4.13.0
opg-sirius-service==2.1.1
localstack-client==1.39
2 changes: 1 addition & 1 deletion lambda_functions/v1/requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Update this date to trigger update of layers: 20230619
Flask==2.2.5
markupsafe==2.1.1
localstack-client==1.10
localstack-client==1.39
redis==3.5.3
requests==2.31.0
Werkzeug==3.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"dob": "1972-05-10",
"email": "[email protected]",
"firstname": "Trevor",
"otherNames": null,
"id": 7,
"middlenames": null,
"salutation": "Mr",
Expand Down Expand Up @@ -54,6 +55,7 @@
"dob": null,
"email": null,
"firstname": "Julian",
"otherNames": null,
"id": 5,
"middlenames": null,
"salutation": "Mr",
Expand All @@ -79,6 +81,7 @@
"dob": "1952-07-17",
"email": "[email protected]",
"firstname": "changeme",
"otherNames": "Lucy",
"id": 1,
"middlenames": "Lucille",
"salutation": "Mrs",
Expand Down Expand Up @@ -114,6 +117,7 @@
"dob": null,
"email": "",
"firstname": null,
"otherNames": null,
"id": 6,
"middlenames": null,
"salutation": null,
Expand Down
2 changes: 1 addition & 1 deletion mock_sirius_backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# our base image
FROM python:3.6-slim
FROM python:3.8-slim

WORKDIR /var/www/
COPY requirements.txt .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dob": "1972-05-10",
"email": "[email protected]",
"firstname": "Trevor",
"otherNames": null,
"id": 7,
"middlenames": null,
"salutation": "Mr",
Expand Down Expand Up @@ -56,6 +57,7 @@
"dob": null,
"email": null,
"firstname": "Julian",
"otherNames": null,
"id": 5,
"middlenames": null,
"salutation": "Mr",
Expand All @@ -82,6 +84,7 @@
"dob": "1952-07-17",
"email": "[email protected]",
"firstname": "changeme",
"otherNames": "Lucy",
"id": 1,
"middlenames": "Lucille",
"salutation": "Mrs",
Expand Down Expand Up @@ -118,6 +121,7 @@
"dob": null,
"email": "",
"firstname": null,
"otherNames": null,
"id": 6,
"middlenames": null,
"salutation": null,
Expand Down
Loading
Loading