Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/bundler/doc/tech-docs/rexml-3.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-bcl authored May 21, 2024
2 parents e3f23cc + 52ab592 commit a3d4610
Show file tree
Hide file tree
Showing 60 changed files with 2,038 additions and 505 deletions.
2 changes: 1 addition & 1 deletion .github/actions/format-code/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ runs:
env:
mask: ${{ inputs.mask }}

- uses: planetscale/ghcommit-action@21a8cda29f55e5cc2cdae0cdbdd08e38dd148c25 # v0.2.9
- uses: planetscale/ghcommit-action@b662a9d7235a07e80d976152ed5afe41651c4973 # v0.2.9
with:
commit_message: ${{ inputs.commit_message }}
repo: ${{ github.repository }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ jobs:
- name: Deploy main
if: github.ref_name == 'main'
uses: JamesIves/github-pages-deploy-action@ec9c88baef04b842ca6f0a132fd61c762aa6c1b0 # v4.6.0
uses: JamesIves/github-pages-deploy-action@5c6e9e9f3672ce8fd37b9856193d2a537941e66c # v4.6.1
with:
folder: tech-docs
target-folder: tech-docs

- name: Deploy branch
if: github.ref_name != 'main'
uses: JamesIves/github-pages-deploy-action@ec9c88baef04b842ca6f0a132fd61c762aa6c1b0 # v4.6.0
uses: JamesIves/github-pages-deploy-action@5c6e9e9f3672ce8fd37b9856193d2a537941e66c # v4.6.1
with:
folder: tech-docs
target-folder: tech-docs-drafts/${{ github.ref_name }}
2 changes: 1 addition & 1 deletion .github/workflows/schema-spy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
DB_PASSWORD: ${{ secrets.SCHEMA_SPY_PASSWORD }}

- name: Publish HTML report
uses: JamesIves/github-pages-deploy-action@ec9c88baef04b842ca6f0a132fd61c762aa6c1b0 # v4.6.0
uses: JamesIves/github-pages-deploy-action@5c6e9e9f3672ce8fd37b9856193d2a537941e66c # v4.6.1
with:
folder: schema-spy-report
target-folder: schema-spy-report
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ database:
- nsi_manager
- approved_premises_referral
- approved_premises_residence
- approved_premises_preferred

sequences:
- ap_referral_id_seq
- ap_residence_id_seq
- ap_preferred_id_seq

audit:
username: ApprovedPremisesAndDelius
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,8 @@ import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.ApplicationListener
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Component
import uk.gov.justice.digital.hmpps.data.generator.AddressGenerator
import uk.gov.justice.digital.hmpps.data.generator.ApprovedPremisesGenerator
import uk.gov.justice.digital.hmpps.data.generator.CaseloadGenerator
import uk.gov.justice.digital.hmpps.data.generator.ContactOutcomeGenerator
import uk.gov.justice.digital.hmpps.data.generator.ContactTypeGenerator
import uk.gov.justice.digital.hmpps.data.generator.DatasetGenerator
import uk.gov.justice.digital.hmpps.data.generator.DocumentGenerator
import uk.gov.justice.digital.hmpps.data.generator.NsiStatusGenerator
import uk.gov.justice.digital.hmpps.data.generator.NsiTypeGenerator
import uk.gov.justice.digital.hmpps.data.generator.OfficeLocationGenerator
import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator
import uk.gov.justice.digital.hmpps.data.generator.*
import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator.ANOTHER_EVENT
import uk.gov.justice.digital.hmpps.data.generator.PersonManagerGenerator
import uk.gov.justice.digital.hmpps.data.generator.ProbationAreaGenerator
import uk.gov.justice.digital.hmpps.data.generator.ReferenceDataGenerator
import uk.gov.justice.digital.hmpps.data.generator.ReferralGenerator
import uk.gov.justice.digital.hmpps.data.generator.StaffGenerator
import uk.gov.justice.digital.hmpps.data.generator.TeamGenerator
import uk.gov.justice.digital.hmpps.data.generator.TransferReasonGenerator
import uk.gov.justice.digital.hmpps.data.generator.UserGenerator
import uk.gov.justice.digital.hmpps.integrations.delius.approvedpremises.ApprovedPremisesRepository
import uk.gov.justice.digital.hmpps.integrations.delius.approvedpremises.entity.Address
import uk.gov.justice.digital.hmpps.integrations.delius.approvedpremises.referral.entity.EventRepository
Expand All @@ -38,11 +20,7 @@ import uk.gov.justice.digital.hmpps.integrations.delius.contact.type.ContactType
import uk.gov.justice.digital.hmpps.integrations.delius.contact.type.ContactTypeRepository
import uk.gov.justice.digital.hmpps.integrations.delius.document.DocumentRepository
import uk.gov.justice.digital.hmpps.integrations.delius.location.OfficeLocationRepository
import uk.gov.justice.digital.hmpps.integrations.delius.nonstatutoryintervention.entity.NsiStatusCode
import uk.gov.justice.digital.hmpps.integrations.delius.nonstatutoryintervention.entity.NsiStatusRepository
import uk.gov.justice.digital.hmpps.integrations.delius.nonstatutoryintervention.entity.NsiTypeCode
import uk.gov.justice.digital.hmpps.integrations.delius.nonstatutoryintervention.entity.NsiTypeRepository
import uk.gov.justice.digital.hmpps.integrations.delius.nonstatutoryintervention.entity.TransferReasonRepository
import uk.gov.justice.digital.hmpps.integrations.delius.nonstatutoryintervention.entity.*
import uk.gov.justice.digital.hmpps.integrations.delius.person.PersonRepository
import uk.gov.justice.digital.hmpps.integrations.delius.person.address.PersonAddressRepository
import uk.gov.justice.digital.hmpps.integrations.delius.person.manager.probation.PersonManagerRepository
Expand Down Expand Up @@ -168,15 +146,28 @@ class DataLoader(
staffRepository.save(personManagerStaff)
val person = PersonGenerator.DEFAULT
personRepository.save(person)
personRepository.save(PersonGenerator.PERSON_INACTIVE_EVENT)
personManagerRepository.save(
PersonManagerGenerator.generate(
person,
staff = personManagerStaff,
team = TeamGenerator.NON_APPROVED_PREMISES_TEAM
)
)

personManagerRepository.save(
PersonManagerGenerator.generate(
PersonGenerator.PERSON_INACTIVE_EVENT,
staff = personManagerStaff,
team = TeamGenerator.NON_APPROVED_PREMISES_TEAM
)
)

AddressGenerator.PERSON_ADDRESS = personAddressRepository.save(AddressGenerator.PERSON_ADDRESS)
AddressGenerator.INACTIVE_PERSON_ADDRESS =
personAddressRepository.save(AddressGenerator.INACTIVE_PERSON_ADDRESS)
eventRepository.save(PersonGenerator.EVENT)
eventRepository.save(PersonGenerator.INACTIVE_EVENT)
registrationRepository.save(
PersonGenerator.generateRegistration(
person,
Expand All @@ -200,6 +191,25 @@ class DataLoader(
caseloadRepository.save(CaseloadGenerator.generate(person, TeamGenerator.APPROVED_PREMISES_TEAM))
caseloadRepository.save(CaseloadGenerator.generate(person, TeamGenerator.UNALLOCATED))

caseloadRepository.save(
CaseloadGenerator.generate(
PersonGenerator.PERSON_INACTIVE_EVENT,
TeamGenerator.NON_APPROVED_PREMISES_TEAM
)
)
caseloadRepository.save(
CaseloadGenerator.generate(
PersonGenerator.PERSON_INACTIVE_EVENT,
TeamGenerator.APPROVED_PREMISES_TEAM
)
)
caseloadRepository.save(
CaseloadGenerator.generate(
PersonGenerator.PERSON_INACTIVE_EVENT,
TeamGenerator.UNALLOCATED
)
)

eventRepository.save(ANOTHER_EVENT)
referralRepository.save(ReferralGenerator.EXISTING_REFERRAL)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ object AddressGenerator {
town = "Some Place",
postcode = "MB01 3TD"
)

var INACTIVE_PERSON_ADDRESS = generatePersonAddress(
personId = PersonGenerator.PERSON_INACTIVE_EVENT.id,
addressNumber = "12",
streetName = "Tulip Drive",
town = "Some Place",
postcode = "MB01 3TD"
)

val Q001 = generateAddress("", "1", "Promise Street", "", "Make Believe", "", "MB01 1PS", "01234567890")
val Q002 = generateAddress("", "2", "Future Street", "", "Make Believe", "", "MB02 2PS", "01234567891")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import java.time.ZonedDateTime

object PersonGenerator {
val DEFAULT = generate(crn = "A000001")
val PERSON_INACTIVE_EVENT = generate(crn = "A000002")
val EVENT = generateEvent("7", DEFAULT.id)
val ANOTHER_EVENT = generateEvent("8", DEFAULT.id)

val INACTIVE_EVENT = generateEvent("6", PERSON_INACTIVE_EVENT.id, active = false)
val PERSON_WITH_BOOKING = generate(crn = "B000001")

fun generate(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"eventType": "approved-premises.application.assessed",
"version": 1,
"description": "An Approved Premises application has been assessed",
"detailUrl": "http://localhost:{wiremock.port}/approved-premises-api/events/application-assessed/484b8b5e-6c3b-4400-b200-425bbe410713-inactive",
"occurredAt": "2022-12-04T10:42:43+00:00",
"additionalInformation": {
"applicationId": "484b8b5e-6c3b-4400-b200-425bbe410713"
},
"personReference": {
"identifiers": [
{
"type": "CRN",
"value": "A000002"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"eventType": "approved-premises.application.submitted",
"version": 1,
"description": "An Approved Premises application has been submitted",
"detailUrl": "http://localhost:{wiremock.port}/approved-premises-api/events/application-submitted/68df9f6c-3fcb-4ec6-8fcf-96551cd9b080-inactive",
"occurredAt": "2022-12-04T10:42:43+00:00",
"additionalInformation": {
"applicationId": "68df9f6c-3fcb-4ec6-8fcf-96551cd9b080"
},
"personReference": {
"identifiers": [
{
"type": "CRN",
"value": "A000002"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"eventType": "approved-premises.booking.made",
"version": 1,
"description": "An Approved Premises booking has been made",
"detailUrl": "http://localhost:{wiremock.port}/approved-premises-api/events/booking-made/364145f9-0af8-488e-9901-b4c46cd9ba37-inactive",
"occurredAt": "2022-12-04T10:42:43+00:00",
"additionalInformation": {
"applicationId": "364145f9-0af8-488e-9901-b4c46cd9ba37"
},
"personReference": {
"identifiers": [
{
"type": "CRN",
"value": "A000002"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"eventType": "approved-premises.person.arrived",
"version": 1,
"description": "A person arrived to the Approved Premises",
"detailUrl": "http://localhost:{wiremock.port}/approved-premises-api/events/person-arrived/364145f9-0af8-488e-9901-b4c46cd9ba37-inactive",
"occurredAt": "2022-12-04T10:42:43+00:00",
"additionalInformation": {
"applicationId": "364145f9-0af8-488e-9901-b4c46cd9ba37"
},
"personReference": {
"identifiers": [
{
"type": "CRN",
"value": "A000002"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"eventType": "approved-premises.person.departed",
"version": 1,
"description": "A person departed frm the Approved Premises",
"detailUrl": "http://localhost:{wiremock.port}/approved-premises-api/events/person-departed/364145f9-0af8-488e-9901-b4c46cd9ba37-inactive",
"occurredAt": "2022-12-04T10:42:43+00:00",
"additionalInformation": {
"applicationId": "364145f9-0af8-488e-9901-b4c46cd9ba37"
},
"personReference": {
"identifiers": [
{
"type": "CRN",
"value": "A000002"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": "364145f9-0af8-488e-9901-b4c46cd9ba37-inactive",
"timestamp": "2022-11-30T14:53:44",
"eventType": "approved-premises.application.assessed",
"eventDetails": {
"applicationId": "484b8b5e-6c3b-4400-b200-425bbe410713",
"applicationUrl": "https://approved-premises-dev.hmpps.service.justice.gov.uk/applications/484b8b5e-6c3b-4400-b200-425bbe410713",
"personReference": {
"crn": "A000002",
"noms": "A0002AA"
},
"deliusEventNumber": "6",
"assessedAt": "2022-11-30T14:51:30",
"assessedBy": {
"staffMember": {
"staffCode": "N54A001",
"forenames": "John",
"surname": "Smith",
"username": "JohnSmithNPS"
},
"probationArea": {
"code": "N54",
"name": "North East Region"
},
"cru": {
"code": "N02",
"name": "NPS North East"
}
},
"decision": "REJECTED",
"decisionRationale": "Risk too low"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"id": "364145f9-0af8-488e-9901-b4c46cd9ba37-inactive",
"timestamp": "2022-11-30T14:53:44",
"eventType": "approved-premises.application.submitted",
"eventDetails": {
"applicationId": "68df9f6c-3fcb-4ec6-8fcf-96551cd9b080",
"applicationUrl": "https://approved-premises-dev.hmpps.service.justice.gov.uk/application/68df9f6c-3fcb-4ec6-8fcf-96551cd9b080",
"personReference": {
"crn": "A000002",
"noms": "A0002AA"
},
"deliusEventNumber": "6",
"mappaCategories": "M2",
"sentenceLengthInMonths": 57,
"offenceDescription": "Wounding or inflicting grievous bodily harm (inflicting bodily injury with or without weapon) (S20) - 00801",
"releaseType": "Release on Temporary Licence (ROTL)",
"age": 43,
"gender": "Male",
"targetLocation": "LS2",
"submittedAt": "2022-11-30T14:51:30",
"submittedBy": {
"staffMember": {
"staffCode": "N54A001",
"forenames": "John",
"surname": "Smith",
"username": "JohnSmithNPS"
},
"probationArea": {
"code": "N54",
"name": "North East Region"
},
"cru": {
"code": "N02",
"name": "NPS North East"
},
"team": {
"code": "N54NGH",
"name": "Gateshead 1"
},
"ldu": {
"code": "N54PPU",
"name": "Public Protection NE"
},
"region": {
"code": "NE",
"name": "North East"
}
}
}
}
Loading

0 comments on commit a3d4610

Please sign in to comment.