Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-britton-moj authored Feb 4, 2025
1 parent 13bef85 commit a02cfc7
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"limitedAccessOffender": false,
"timeline": [
{
"assessmentPk": 9641348,
"assessmentPk": 9641349,
"assessmentType": "LAYER1",
"initiationDate": "2022-07-27T12:10:58",
"status": "OPEN"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
"completedDate": "2022-07-21T15:43:12"
},
{
"assessmentPk": 9639348,
"assessmentPk": 9641348,
"assessmentType": "LAYER3",
"initiationDate": "2022-07-21T15:43:58",
"status": "COMPLETE",
"completedDate": "2022-07-27T12:09:41"
},
{
"assessmentPk": 9641348,
"assessmentPk": 9639349,
"assessmentType": "LAYER3",
"initiationDate": "2022-07-27T12:10:58",
"status": "OPEN"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"method": "GET",
"url": "/eor/oasys/ap/health/D006296/ALLOW/9641348/OPEN",
"url": "/eor/oasys/ap/health/D006296/ALLOW/9641348/COMPLETE",
"headers": {
"Authorization": {
"matches": "^Bearer (.*)$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"method": "GET",
"url": "/eor/oasys/ap/needs/D006296/ALLOW/9641348/OPEN",
"url": "/eor/oasys/ap/needs/D006296/ALLOW/9641348/COMPLETE",
"headers": {
"Authorization": {
"matches": "^Bearer (.*)$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"method": "GET",
"url": "/eor/oasys/ap/offence/D006296/ALLOW/9641348/OPEN",
"url": "/eor/oasys/ap/offence/D006296/ALLOW/9641348/COMPLETE",
"headers": {
"Authorization": {
"matches": "^Bearer (.*)$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"method": "GET",
"url": "/eor/oasys/ap/riskass/D006296/ALLOW/9641348/OPEN",
"url": "/eor/oasys/ap/riskass/D006296/ALLOW/9641348/COMPLETE",
"headers": {
"Authorization": {
"matches": "^Bearer (.*)$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"method": "GET",
"url": "/eor/oasys/ap/rmp/D006296/ALLOW/9641348/OPEN",
"url": "/eor/oasys/ap/rmp/D006296/ALLOW/9641348/COMPLETE",
"headers": {
"Authorization": {
"matches": "^Bearer (.*)$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"method": "GET",
"url": "/eor/oasys/ap/riskind/D006296/ALLOW/9641348/OPEN",
"url": "/eor/oasys/ap/riskind/D006296/ALLOW/9641348/COMPLETE",
"headers": {
"Authorization": {
"matches": "^Bearer (.*)$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"method": "GET",
"url": "/eor/oasys/ap/roshsum/D006296/ALLOW/9641348/OPEN",
"url": "/eor/oasys/ap/roshsum/D006296/ALLOW/9641348/COMPLETE",
"headers": {
"Authorization": {
"matches": "^Bearer (.*)$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"method": "GET",
"url": "/eor/oasys/ap/rosh/D006296/ALLOW/9641348/OPEN",
"url": "/eor/oasys/ap/rosh/D006296/ALLOW/9641348/COMPLETE",
"headers": {
"Authorization": {
"matches": "^Bearer (.*)$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class AssessmentTimelineTest {
.andReturn().response.contentAsJson<OasysTimelineAssessment>()

assertThat(oasysTimelineAssessment.initiationDate)
.isEqualTo(ZonedDateTime.parse("2022-07-27T12:10:58+01:00").withZoneSameInstant(EuropeLondon))
.isEqualTo(ZonedDateTime.parse("2022-07-21T15:43:58+01:00").withZoneSameInstant(EuropeLondon))
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OasysAssessmentService(private var oasysClient: OasysClient) {
val ordsAssessmentTimeline = oasysClient.getAssessmentTimeline(crn)
val assessments =
ordsAssessmentTimeline.timeline.sortedByDescending { it.initiationDate }.stream().filter {
it.assessmentType == "LAYER3"
it.assessmentType == "LAYER3" && (it.status == "COMPLETE" || it.status == "LOCKED_INCOMPLETE")
}
return assessments.findFirst().orElseThrow {
NotFoundException("Latest layer 3 assessment not found for crn=$crn")
Expand Down

0 comments on commit a02cfc7

Please sign in to comment.