Guaranteed Minimum Pension microservice with HIP (Hosted Integration Platform) and DES (Data Exchange Service) integration.
- SCON validation via HIP (Hosted Integration Platform)
- Fallback to DES (Data Exchange Service) when HIP is unavailable
- Secure logging with sensitive data redaction
- Caching for improved performance
- Comprehensive test coverage (98.68% statement, 91.43% branch)
- An SCON always begins with S (mandatory).
- It’s followed by a digit indicating the scheme type (e.g. 0,1,2,4,5,6,8 depending on the scheme rules).
- Then 6 more digits.
- Suffix letter, must avoid certain letters [GIOSUVZ].
| PATH | Supported Methods | Description |
|---|---|---|
/:userId/gmp/calculate |
POST | Requests a GMP calculation for a specific user |
/:userId/gmp/validateScon |
POST | Validates the SCON for the specified user |
Calculates GMP for a specific user. This method calls into a connected DES service to perform the actual calculation, and returns the result.
Request
| Field | Description |
|---|---|
| scon | The person's scheme contracted out number |
| nino | The national insurance number |
| surname | The person's surname |
| firstForename | The person's forename |
| calcType | Optional The calculation type |
| revaluationDate | Optional The date on which the GMP should be revalued |
| revaluationRate | Optional The rate at which the GMP should be revalued |
| requestEarnings | Optional Whether constants and earnings values should be returned in the response |
| dualCalc | Optional Whether opposite gender calculation should be performed |
| terminationDate | Optional The date on which the member left the scheme |
Example JSON response:
{
"name": "J Bloggs",
"nino": "<user national insurance number>",
"scon": "<user scon>",
"revaluationRate": "HMRC",
"revaluationDate": "2016-08-27",
"calculationPeriods": [],
"globalErrorCode": 0,
"spaDate": "2010-02-25",
"payableAgeDate": "2016-03-01",
"dateOfDeath": "1999-05-01",
"dualCalc": false,
"calcType": 1
}An API method to validate whether a user's SCON exists or not. The service will attempt to use HIP (Hosted Integration Platform) by default, with a fallback to DES (Data Exchange Service) if configured.
POST /:userId/gmp/validateScon
Content-Type: application/json
{
"scon": "S1401234Q"
}| Field | Required | Description |
|---|---|---|
| scon | Yes | The user's SCON to validate (3-10 alphanumeric characters) |
{
"sconExists": true
}| Status | Description | Response Body |
|---|---|---|
| 400 Bad Request | Invalid SCON format | {"error": "Invalid SCON format"} |
| 500 Internal Server Error | Service unavailable | {"error": "Service unavailable"} |
- HIP Integration: Validates SCONs using the Hosted Integration Platform
- Caching: Responses are cached to improve performance
- Secure Logging: All logs are automatically redacted to protect sensitive information
- Fallback Mechanism: Automatically falls back to DES if HIP is unavailable (configurable)
- Java 8 or later
- sbt 1.5.0 or later
- Service Manager (for dependent services)
-
Start required services using Service Manager:
sm2 --start GMP_ALL
-
Run the application:
sbt run
The following configuration options are available in application.conf:
| Setting | Default | Description |
|---|---|---|
app.hip.enabled |
true |
Enable/disable HIP integration |
app.hip.url |
- | Base URL for HIP service |
app.hip.authorisationToken |
- | Authorization token for HIP |
app.cache.enabled |
true |
Enable/disable response caching |
Run all tests:
sbt testGenerate coverage report:
sbt clean coverage test coverageReportThe application uses SLF4J with Logback for logging. Sensitive data is automatically redacted from logs.
- Log Levels:
ERROR: Application errors and exceptionsWARN: Non-critical issuesINFO: Important application eventsDEBUG: Detailed debug information (sensitive data is redacted)
Example log output:
[INFO] [ValidateSconController] HIP validation successful for SCON: S14******
[WARN] [HipConnector] HIP service returned 400 for SCON: S14******
This code is open source software licensed under the Apache 2.0 License.