Skip to content

Commit

Permalink
Correcting read me (#128)
Browse files Browse the repository at this point in the history
* few corrections in readme and MatchType

* aligning MatchTypes with LRS responses

* updated match endpoint in swagger doc too

* ktlint correction
  • Loading branch information
lalithanagarur authored Mar 11, 2025
1 parent 2ece9e3 commit 2f599d6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 72 deletions.
45 changes: 4 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ The match will be saved as a `MatchEntity` in the database.
"matchingUln": "1234567890",
"givenName": "John",
"familyName": "Smith",
"matchType": "POSSIBLE_MATCH",
"countOfReturnedULNs": "2"
"matchType": "Possible match",
"countOfReturnedUlns": "2"
}
</pre>
</details>
Expand All @@ -287,8 +287,8 @@ The match will be saved as a `MatchEntity` in the database.
<br>
<pre>
{
"matchType": "NO_MATCH_RETURNED_FROM_LRS",
"countOfReturnedULNs": "0"
"matchType": "No match returned from LRS",
"countOfReturnedUlns": "0"
}
</pre>
</details>
Expand All @@ -300,43 +300,6 @@ Response codes:
* 403 - Forbidden
* 500 - Likely that the database is unreachable

### `POST:/match/:nomisId`
This endpoint is to confirm a match between a learner's NOMIS ID and ULN.
The givenName and familyName should be as per the LRS data for a match.
The match will be saved as a `MatchEntity` in the database.

<details>
<summary>Example request body for a match:</summary>
<br>
<pre>
{
"matchingUln": "1234567890",
"givenName": "John",
"familyName": "Smith",
"matchType": "POSSIBLE_MATCH",
"countOfReturnedULNs": "2"
}
</pre>
</details>

<details>
<summary>Example request body for a no match:</summary>
<br>
<pre>
{
"matchType": "NO_MATCH_SELECTED",
"countOfReturnedULNs": "6"
}
</pre>
</details>

Response codes:
* 201 - Created
* 400 - Bad Request, malformed ULN or json body
* 401 - Unauthorised
* 403 - Forbidden
* 500 - Likely that the database is unreachable

### `GET:/match/:nomisId`
This endpoint is to search the database for a match given a NOMIS ID.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonValue

enum class MatchType(val description: String) {
NO_MATCH_RETURNED_FROM_LRS("No match returned from LRS"),
EXACT_MATCH("Exact match"),
POSSIBLE_MATCH("Possible match"),
LINKED_LEARNER_MATCH("linked learner match"),
TOO_MANY_RESULTS("Too many results"),
NO_MATCH_RETURNED_FROM_LRS("No Match"),
EXACT_MATCH("Exact Match"),
POSSIBLE_MATCH("Possible Match"),
LINKED_LEARNER_MATCH("Linked Learner Match"),
TOO_MANY_RESULTS("Too Many Matches"),
;

@JsonValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,11 @@ import uk.gov.justice.hmpps.kotlin.common.ErrorResponse
"matchingUln": "1026893096",
"givenName": "Darcie",
"familyName": "Tucker",
"matchType": "EXACT_MATCH",
"matchType": "Exact Match",
"countOfReturnedUlns": "1"
}
""",
),
ExampleObject(
name = "Confirm no match selected Request",
value = """
{
"matchingUln": "",
"givenName": "",
"familyName": "",
"matchType": "NO_MATCH_SELECTED",
"countOfReturnedUlns": "2"
}
""",
),
ExampleObject(
name = "Confirm no match found Request",
value = """
{
"matchingUln": "",
"givenName": "",
"familyName": "",
"matchType": "NO_MATCH_RETURNED_FROM_LRS",
"countOfReturnedUlns": "0"
}
""",
),
],
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import uk.gov.justice.hmpps.kotlin.common.ErrorResponse
name = "Confirm no match Request",
value = """
{
"matchType": "NO_MATCH_RETURNED_FROM_LRS",
"matchType": "No Match",
"countOfReturnedUlns": "0"
}
""",
Expand Down

0 comments on commit 2f599d6

Please sign in to comment.