Skip to content

Commit

Permalink
PIC-2409 dev preprod bug (#116)
Browse files Browse the repository at this point in the history
* 馃攪 Remove temp logging

* 馃敡 Correct Community API URL

* 鈾伙笍 Refactor to align with NDelius

* Support change to `eventNumber`


Signed-off-by: theDustRoom <paul.massey@digital.justice.gov.uk>
  • Loading branch information
theDustRoom committed Sep 5, 2022
1 parent 8f08c71 commit a177515
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion helm_deploy/values-preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ generic-service:
env:
INGRESS_URL: "https://pre-sentence-service-preprod.hmpps.service.justice.gov.uk"
HMPPS_AUTH_URL: "https://sign-in-preprod.hmpps.service.justice.gov.uk/auth"
COMMUNITY_API_URL: "https://community-api-secure.test.delius.probation.hmpps.dsd.io"
COMMUNITY_API_URL: "https://community-api-secure.pre-prod.delius.probation.hmpps.dsd.io"
TOKEN_VERIFICATION_API_URL: "https://token-verification-api-preprod.prison.service.justice.gov.uk"
GOTENBERG_API_URL: "http://pre-sentence-service-gotenberg"
PRE_SENTENCE_URL: "http://pre-sentence-service"
Expand Down
5 changes: 3 additions & 2 deletions server/controllers/api/apiController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,15 @@ export default class ApiController {
}
const report = await this.reportService.createReport({
...req.body,
entityId: req.body.eventNumber.toString(),
reportDefinitionId: reportDefinition.id,
})
const offenderInformationFields = await this.getOffenderInformationFields(report, reportDefinition, req.body.crn)
const additionalInformationFields = await this.getAdditionalInformationFields(
report,
reportDefinition,
req.body.crn,
req.body.entityId
req.body.eventNumber.toString()
)
const fieldValues: Array<IFieldValue> = [
this.configureFieldValue(report, reportDefinition, 'crn', req.body.crn.toUpperCase()),
Expand All @@ -159,7 +160,7 @@ export default class ApiController {
await this.reportService.updateFieldValues(fieldValues)
await this.eventService.sendReportEvent({
reportId: report.id,
entityId: req.body.entityId,
entityId: req.body.eventNumber.toString(),
crn: req.body.crn.toUpperCase(),
reportStatus: 'started',
})
Expand Down
8 changes: 4 additions & 4 deletions server/controllers/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"createReport": {
"type": "object",
"properties": {
"entityId": {
"eventNumber": {
"type": "string",
"example": "300",
"description": "External unique identifier reference"
Expand All @@ -128,7 +128,7 @@
}
},
"example": {
"entityId": "300",
"eventNumber": "300",
"crn": "DX12340A"
}
},
Expand All @@ -139,7 +139,7 @@
"type": "integer",
"example": 1
},
"entityId": {
"eventNumber": {
"type": "string",
"example": "300"
},
Expand Down Expand Up @@ -176,7 +176,7 @@
"type": "integer",
"example": 1
},
"entityId": {
"eventNumber": {
"type": "string",
"example": "42"
},
Expand Down

0 comments on commit a177515

Please sign in to comment.