This service is used to store claimed trusts for use within the claim a trust journey
- A call is made to the
get
endpoint with valid authentication headers - A
TrustClaim
is found for the request
This is dependent on the
internalId
within the authenticated request
- The
TrustClaim
is returned in the following form:
{
"internalId": "some-authenticated-internal-id",
"id": "1234567890",
"managedByAgent": true
}
the
id
is the 10 digit UTR, or the 15 digit URN associated with the trust andmanagedByAgent
is derived from answers in the claim a trust journey
- All error responses will be returned in the following form:
{
"status": "integer representing the http response code",
"message": "description of the error that has occurred",
"errors": "(optional) mixed type holding information regarding the errors"
}
- A call is made to the
get
endpoint with valid authentication headers - No
TrustClaim
is found for the request
This is dependent on the
internalId
within the authenticated request
- A
Not Found
response is returned
- A call is made to the
get
endpoint with invalid or no authentication headers - An empty
Unauthorized
response is returned
- Successful requests will contain a body in the format as follows:
{
"id": "a string representing the tax reference to associate with this internalId",
"managedByAgent": "boolean derived from answers in the claim a trust journey"
}
- A call is made to the
store
endpoint with valid authentication header and a valid request body - The
TrustClaim
is successfully stored within thetrusts-store
This trust claim will now be associated with the
internalId
within the authenticated request
- The
201 Created
response will return a representation of what has been stored in the following form:
{
"internalId": "some-authenticated-internal-id",
"id": "1234567890",
"managedByAgent": true
}
- All error responses will be returned in the following form:
{
"status": "integer representing the http response code",
"message": "description of the error that has occurred",
"errors": "(optional) mixed type holding information regarding the errors"
}
- A call is made to the
store
endpoint with valid authentication headers and an invalid request body - A
TrustClaim
is unable to be parsed - A
400 Bad Request
response is returned
- A call is made to the
store
endpoint with valid authentication headers and an invalid request body - An error occurs when writing to
trusts-store
- A
500 Internal Server Error
is returned with additional write error information as follows:
[
{
"index 0": [{ "code": 50, "message": "some other mongo write error" }]
},
{
"index 1": [
{ "code": 50, "message": "some mongo write error" },
{ "code": 120, "message": "another mongo write error" }
]
}
]
Successful requests will contain the status of the tasks relevant to a given identifier. In registration this is the draft ID, and in maintain this is the identifier of the trust (i.e. the UTR or URN). The status can be any of the following:
Completed // the task is completed
InProgress // the task has been started but not finished
NotStarted // the task has not been started
CannotStartYet // the task cannot be started yet as other tasks must be finished first
NoActionNeeded // the task does not require completion in order for the user to be able to submit a declaration
If a document does not exist for the given identifier, a set of tasks with a default state of NotStartedYet
are returned.
A 401 Unauthorised
response is returned for a request with invalid authentication.
Successful requests will contain the status of the updated tasks relevant to a given identifier. In registration this is the draft ID, and in maintain this is the identifier of the trust (i.e. the UTR or URN). The status can be any of the following:
Completed // the task is completed
InProgress // the task has been started but not finished
NotStarted // the task has not been started
CannotStartYet // the task cannot be started yet as other tasks must be finished first
NoActionNeeded // the task does not require completion in order for the user to be able to submit a declaration
- A
400 Bad Request
response is returned for a request with a body that cannot be validated as an instance ofTasks
. - A
401 Unauthorised
response is returned for a request with invalid authentication.
Successful requests will reset the status of all tasks to NotStartedYet
relevant to a given identifier. In registration this is the draft ID, and in maintain this is the identifier of the trust (i.e. the UTR or URN).
A 401 Unauthorised
response is returned for a request with invalid authentication.
Successful requests will contain the status of the updated task relevant to a given identifier. In registration this is the draft ID, and in maintain this is the identifier of the trust (i.e. the UTR or URN). The status can be any of the following:
Completed // the task is completed
InProgress // the task has been started but not finished
NotStarted // the task has not been started
CannotStartYet // the task cannot be started yet as other tasks must be finished first
NoActionNeeded // the task does not require completion in order for the user to be able to submit a declaration
- A
400 Bad Request
response is returned for a request with a body that cannot be validated as an instance ofTaskStatus
. - A
401 Unauthorised
response is returned for a request with invalid authentication.
- Start the service locally with
sbt run
in the root directory - The service can be started via service manager with
sm --start TRUSTS_STORE
or as part of theTRUSTS_ALL
profile
- Run the unit tests by running
sbt test
in the root directory - Run the integration tests (requires
MongoDB
) by runningit:test
in the root directory
This code is open source software licensed under the Apache 2.0 License.