Backend service for the Senior Accounting Officer APIs.
The app runs on port 10060.
It currently proxies requests to senior-accounting-officer-stubs, which is expected on port 10061 via:
Current route:
PUT /senior-accounting-officer/subscriptions/:saoSubscriptionId
The endpoint accepts a raw JSON request body and forwards it to the downstream stubs service at:
PUT /subscriptions/:saoSubscriptionId
The downstream response is passed through unchanged, including:
204with no body on success400with the downstream JSON error payload on validation failures
Example request:
curl -i \
-X PUT 'http://localhost:10060/senior-accounting-officer/subscriptions/123' \
-H 'Content-Type: application/json' \
--data-raw '{
"safeId": "XE000123456789",
"company": {
"companyName": "Acme Manufacturing Ltd",
"uniqueTaxReference": "1234567890",
"companyRegistrationNumber": "OC123456"
},
"contacts": [
{
"name": "Jane Doe",
"email": "jane.doe@example.com"
}
]
}'Focused unit test:
sbt testFocused integration test:
sbt it/testThis repository utilises play-swagger to generate an open api specification using a code-first approach.
The schema is generated upon running sbt run. It can be found in /target/swagger/swagger.json from the root of the repository.
The schema is served from http://localhost:10060/swagger.
You can view the docs by:
- running
sm2 -start DEVHUB_PREVIEW_OPENAPI - accessing http://localhost:9680/api-documentation/docs/openapi/preview in a web browser
- Providing the URL
http://localhost:10060/swaggerand submitting the form
Users can import the collection into Bruno and, once the required environment setup is complete, run the protected service requests directly.
Bruno is an open-source API client used for manual exploratory testing and cross-team collaboration. It allows you to create, manage and run HTTP requests against a service directly from a collection stored in a repository.
Bruno is the recommended API client tool for use on the MDTP platform, as detailed in the MDTP Handbook
"MDTP recommends the Bruno API client tool for manual exploratory testing and cross-team collaboration. Only tools that have been reviewed and approved by Platform Security are permitted for use."
- Download and install Bruno.
- Start the needed services in a terminal session with the following command:
sm2 --start SAO_ALL- Open Bruno.
- From the Bruno menu select Open Collection.
- Navigate to the bruno folder in the repository.
- Click the Open button.
- In Bruno, select the local environment from the environment dropdown.
- Select a request from the collection in the left-hand panel.
- Click Send to execute the request.
- Verify the response status and body match the expected output.
This code is open source software licensed under the Apache 2.0 License.