Skip to content

Commit

Permalink
PI-1669 Create initial project for assessment-summary-and-delius (#2874)
Browse files Browse the repository at this point in the history
* PI-1669 Create initial project for assessment-summary-and-delius

* initial project setup

---------

Co-authored-by: Anthony Britton <[email protected]>
  • Loading branch information
1 parent dcb6e15 commit 58c7695
Show file tree
Hide file tree
Showing 44 changed files with 795 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ on:
- '["hdc-licences-and-delius"]'
- '["prisoner-profile-and-delius"]'
- '["prison-identifier-and-delius"]'
- '["assessment-summary-and-delius"]'
# ^ add new projects here
# GitHub Actions doesn't support dynamic choices, we must add each project here to enable manual deployments
# See https://github.com/community/community/discussions/11795
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
- hdc-licences-and-delius
- prisoner-profile-and-delius
- prison-identifier-and-delius
- assessment-summary-and-delius
# ^ add new projects here
# GitHub Actions doesn't support dynamic choices, we must add each project here to enable manual deployments
# See https://github.com/community/community/discussions/11795
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ on:
- '["hdc-licences-and-delius"]'
- '["prisoner-profile-and-delius"]'
- '["prison-identifier-and-delius"]'
- '["assessment-summary-and-delius"]'
# ^ add new projects here
# GitHub Actions doesn't support dynamic choices, we must add each project here to enable manual deployments
# See https://github.com/community/community/discussions/11795
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ on:
- '["hdc-licences-and-delius"]'
- '["prisoner-profile-and-delius"]'
- '["prison-identifier-and-delius"]'
- '["assessment-summary-and-delius"]'
# ^ add new projects here
# GitHub Actions doesn't support dynamic choices, we must add each project here to enable manual deployments
# See https://github.com/community/community/discussions/11795
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/messaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ on:
- opd-and-delius-queue
- cas3-and-delius-queue
- prison-identifier-and-delius-queue
- assessment-summary-and-delius-queue
# ^ add new queues here

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/suppress-trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ on:
- hdc-licences-and-delius
- prisoner-profile-and-delius
- prison-identifier-and-delius
- assessment-summary-and-delius
# ^ add new projects here
# GitHub Actions doesn't support dynamic choices, we must add each project here to enable manual deployments
# See https://github.com/community/community/discussions/11795
Expand Down
12 changes: 12 additions & 0 deletions .idea/runConfigurations/assessment_summary_and_delius.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions doc/tech-docs/source/services.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ weight: 20

* [Prisoner Profile And Delius](https://ministryofjustice.github.io/hmpps-probation-integration-services/tech-docs/projects/prisoner-profile-and-delius)
* [Prison Identifier And Delius](https://ministryofjustice.github.io/hmpps-probation-integration-services/tech-docs/projects/prison-identifier-and-delius)
* [Assessment Summary And Delius](https://ministryofjustice.github.io/hmpps-probation-integration-services/tech-docs/projects/assessment-summary-and-delius)
<li style="display: none">^ add new projects here</li>
Empty file.
3 changes: 3 additions & 0 deletions projects/assessment-summary-and-delius/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# assessment-summary-and-delius

// TODO Describe the service
62 changes: 62 additions & 0 deletions projects/assessment-summary-and-delius/applicationinsights.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"role": {
"name": "assessment-summary-and-delius"
},
"customDimensions": {
"service.version": "${VERSION}",
"service.team": "probation-integration"
},
"instrumentation": {
"logging": {
"level": "DEBUG"
},
"springScheduling": {
"enabled": false
}
},
"selfDiagnostics": {
"destination": "console"
},
"sampling": {
"percentage": 100
},
"preview": {
"sampling": {
"overrides": [
{
"telemetryType": "request",
"attributes": [
{
"key": "http.url",
"value": "https?://[^/]+/health/?.*",
"matchType": "regexp"
}
],
"percentage": 0
},
{
"telemetryType": "dependency",
"attributes": [
{
"key": "db.statement",
"value": ".*CLIENT_IDENTIFIER.*",
"matchType": "regexp"
}
],
"percentage": 0
},
{
"telemetryType": "dependency",
"attributes": [
{
"key": "db.operation",
"value": "SELECT",
"matchType": "strict"
}
],
"percentage": 10
}
]
}
}
}
36 changes: 36 additions & 0 deletions projects/assessment-summary-and-delius/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import uk.gov.justice.digital.hmpps.extensions.ClassPathExtension

apply(plugin = "com.google.cloud.tools.jib")

dependencies {
implementation(project(":libs:audit"))
implementation(project(":libs:commons"))
implementation(project(":libs:messaging"))
implementation(project(":libs:oauth-client"))

implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")

dev(project(":libs:dev-tools"))
dev("com.h2database:h2")
dev("org.testcontainers:oracle-xe")

runtimeOnly("com.oracle.database.jdbc:ojdbc11")

testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation(libs.bundles.mockito)
}

configure<ClassPathExtension> {
jacocoExclusions = listOf(
"**/config/**",
"**/entity/**",
"**/AppKt.class"
)
}
13 changes: 13 additions & 0 deletions projects/assessment-summary-and-delius/deploy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v2
appVersion: '1.0'
description: A Helm chart for Kubernetes
name: assessment-summary-and-delius
version: 1.0.0

dependencies:
- name: generic-service
version: "2.8"
repository: https://ministryofjustice.github.io/hmpps-helm-charts
- name: generic-prometheus-alerts
version: "1.3"
repository: https://ministryofjustice.github.io/hmpps-helm-charts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
database:
access:
username_key: /assessment-summary-and-delius/db-username
password_key: /assessment-summary-and-delius/db-password

audit:
username: AssessmentSummaryAndDelius
forename: Assessment Summary
surname: Service
17 changes: 17 additions & 0 deletions projects/assessment-summary-and-delius/deploy/values-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
enabled: false # TODO set this to true when you're ready to deploy your service

generic-service:
ingress:
host: assessment-summary-and-delius-dev.hmpps.service.justice.gov.uk

scheduledDowntime:
enabled: true

env:
SENTRY_ENVIRONMENT: dev
INTEGRATIONS_ORDS_URL: https://t2.oasys.service.justice.gov.uk/eor/oasys

LOGGING_LEVEL_UK_GOV_DIGITAL_JUSTICE_HMPPS: DEBUG

generic-prometheus-alerts:
businessHoursOnly: true
15 changes: 15 additions & 0 deletions projects/assessment-summary-and-delius/deploy/values-preprod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
enabled: false # TODO set this to true when you're ready to deploy your service

generic-service:
ingress:
host: assessment-summary-and-delius-preprod.hmpps.service.justice.gov.uk

scheduledDowntime:
enabled: true

env:
SENTRY_ENVIRONMENT: preprod
INTEGRATIONS_ORDS_URL: https://bridge-pp-oasys.az.justice.gov.uk/eor/oasys

generic-prometheus-alerts:
businessHoursOnly: true
9 changes: 9 additions & 0 deletions projects/assessment-summary-and-delius/deploy/values-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
enabled: false # TODO set this to true when you're ready to deploy your service

generic-service:
ingress:
host: assessment-summary-and-delius.hmpps.service.justice.gov.uk

env:
SENTRY_ENVIRONMENT: prod
INTEGRATIONS_ORDS_URL: https://bridge-oasys.az.justice.gov.uk/eor/oasys
28 changes: 28 additions & 0 deletions projects/assessment-summary-and-delius/deploy/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Common values
generic-service:
nameOverride: assessment-summary-and-delius
serviceAccountName: assessment-summary-and-delius

image:
repository: ghcr.io/ministryofjustice/hmpps-probation-integration-services/assessment-summary-and-delius

ingress:
tlsSecretName: assessment-summary-and-delius-cert

namespace_secrets:
common:
SPRING_DATASOURCE_URL: DB_URL
assessment-summary-and-delius-client-credentials:
INTEGRATIONS_ORDS_CLIENT-ID: ORDS_CLIENT_ID
INTEGRATIONS_ORDS_CLIENT-SECRET: ORDS_CLIENT_SECRET
assessment-summary-and-delius-database:
SPRING_DATASOURCE_USERNAME: DB_USERNAME
SPRING_DATASOURCE_PASSWORD: DB_PASSWORD
assessment-summary-and-delius-sentry:
SENTRY_DSN: SENTRY_DSN
assessment-summary-and-delius-queue:
MESSAGING_CONSUMER_QUEUE: QUEUE_NAME

generic-prometheus-alerts:
targetApplication: assessment-summary-and-delius

1 change: 1 addition & 0 deletions projects/assessment-summary-and-delius/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "assessment-summary-and-delius"
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package uk.gov.justice.digital.hmpps.data

import jakarta.annotation.PostConstruct
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.ApplicationListener
import org.springframework.stereotype.Component
import uk.gov.justice.digital.hmpps.data.generator.UserGenerator
import uk.gov.justice.digital.hmpps.user.AuditUserRepository

@Component
@ConditionalOnProperty("seed.database")
class DataLoader(
private val auditUserRepository: AuditUserRepository
) : ApplicationListener<ApplicationReadyEvent> {

@PostConstruct
fun saveAuditUser() {
auditUserRepository.save(UserGenerator.AUDIT_USER)
}

override fun onApplicationEvent(are: ApplicationReadyEvent) {
// Perform dev/test database setup here, using JPA repositories and generator classes...
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package uk.gov.justice.digital.hmpps.data.generator

import uk.gov.justice.digital.hmpps.message.HmppsDomainEvent
import uk.gov.justice.digital.hmpps.resourceloader.ResourceLoader

object MessageGenerator {
val EXAMPLE = ResourceLoader.message<HmppsDomainEvent>("example-message")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package uk.gov.justice.digital.hmpps.data.generator

import uk.gov.justice.digital.hmpps.user.AuditUser

object UserGenerator {
val AUDIT_USER = AuditUser(IdGenerator.getAndIncrement(), "AssessmentSummaryAndDelius")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"Type": "Notification",
"MessageId": "aa2c2828-167f-529b-8e19-73735a2fb85c",
"TopicArn": "arn:aws:sns:eu-west-2:000000000000:example",
"Message": "{\"eventType\":\"example\",\"version\":1,\"description\":\"Example event\",\"detailUrl\":\"http://localhost:{wiremock.port}/example/123\",\"occurredAt\":\"2022-07-27T15:22:08.452612281+01:00\",\"additionalInformation\":{\"exampleId\":\"123\"},\"personReference\":{\"identifiers\":[{\"type\":\"CRN\",\"value\":\"A000001\"}]}}",
"Timestamp": "2022-07-27T14:22:08.509Z",
"SignatureVersion": "1",
"Signature": "EXAMPLE",
"SigningCertURL": "https://sns.eu-west-2.amazonaws.com/EXAMPLE.pem",
"UnsubscribeURL": "https://sns.eu-west-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=EXAMPLE",
"MessageAttributes": {
"eventType": {
"Type": "String",
"Value": "example"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJwcm9iYXRpb24taW50ZWdyYXRpb24tZGV2IiwiZ3JhbnRfdHlwZSI6ImNsaWVudF9jcmVkZW50aWFscyIsInVzZXJfbmFtZSI6InByb2JhdGlvbi1pbnRlZ3JhdGlvbi1kZXYiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiYXV0aF9zb3VyY2UiOiJub25lIiwiaXNzIjoiaHR0cHM6Ly9zaWduLWluLWRldi5obXBwcy5zZXJ2aWNlLmp1c3RpY2UuZ292LnVrL2F1dGgvaXNzdWVyIiwiZXhwIjo5OTk5OTk5OTk5LCJhdXRob3JpdGllcyI6WyJST0xFX0VYQU1QTEUiLCJST0xFX1dPUktMT0FEX1JFQUQiLCJST0xFX0FMTE9DQVRJT05fQ09OVEVYVCJdLCJqdGkiOiIyNUR1Um4xLWh5SFpld0xjZEpKeHdWTDAzS1UiLCJjbGllbnRfaWQiOiJwcm9iYXRpb24taW50ZWdyYXRpb24tZGV2IiwiaWF0IjoxNjYzNzU3MzExfQ.5FTCUjA7QZMPxO_EMzkGNSM-IkPk2hfPXyzuNiAa7uuqYva_yCducrC5FdetAiC1W6XpUB7wfoMNDmbW2xepj5oRhcxDx18r92aLPYnKkxaA68hLQF90euMtTzfBzOPg-rKDTNIJKrUC-YoQlFKuCauw0Z5cw1XT6R9GIfi5Yx4",
"token_type": "bearer",
"expires_in": 9999999999,
"scope": "read write",
"sub": "probation-integration-dev",
"auth_source": "none",
"jti": "fN29JHJy1N7gcYvqe-8B_k5T0mA",
"iss": "https://sign-in-dev.hmpps.service.justice.gov.uk/auth/issuer"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"request": {
"method": "POST",
"urlPath": "/auth/oauth/token"
},
"response": {
"headers": {
"Content-Type": "application/json"
},
"status": 200,
"bodyFileName": "hmpps-auth-token-body.json"
}
}
Loading

0 comments on commit 58c7695

Please sign in to comment.