Skip to content

Commit 8638afe

Browse files
Slimming down golden record
1 parent dc8e23a commit 8638afe

File tree

16 files changed

+26
-214
lines changed

16 files changed

+26
-214
lines changed

openapi.yml

-71
Original file line numberDiff line numberDiff line change
@@ -821,12 +821,6 @@ components:
821821
Hearing:
822822
type: object
823823
properties:
824-
id:
825-
type: number
826-
nullable: true
827-
locationId:
828-
type: number
829-
nullable: true
830824
dateTimeOfHearing:
831825
type: string
832826
format: date-time
@@ -836,15 +830,9 @@ components:
836830
nullable: true
837831
outcome:
838832
nullable: true
839-
agencyId:
840-
type: string
841-
nullable: true
842833
HearingOutcome:
843834
type: object
844835
properties:
845-
id:
846-
type: number
847-
nullable: true
848836
code:
849837
type: string
850838
nullable: true
@@ -951,21 +939,10 @@ components:
951939
IncidentDetails:
952940
type: object
953941
properties:
954-
locationId:
955-
type: number
956-
nullable: true
957942
dateTimeOfIncident:
958943
type: string
959944
format: date-time
960945
nullable: true
961-
dateTimeOfDiscovery:
962-
type: string
963-
format: date-time
964-
nullable: true
965-
handoverDeadline:
966-
type: string
967-
format: date-time
968-
nullable: true
969946
IncidentRole:
970947
type: object
971948
properties:
@@ -974,12 +951,6 @@ components:
974951
nullable: true
975952
offenceRule:
976953
nullable: true
977-
associatedPrisonersNumber:
978-
type: string
979-
nullable: true
980-
associatedPrisonersName:
981-
type: string
982-
nullable: true
983954
LatestSentenceKeyDatesAndAdjustments:
984955
type: object
985956
properties:
@@ -1051,15 +1022,6 @@ components:
10511022
nullable: true
10521023
offenceRule:
10531024
nullable: true
1054-
victimPrisonersNumber:
1055-
type: string
1056-
nullable: true
1057-
victimStaffUsername:
1058-
type: string
1059-
nullable: true
1060-
victimOtherPersonsName:
1061-
type: string
1062-
nullable: true
10631025
OffenceRuleDetails:
10641026
type: object
10651027
properties:
@@ -1072,9 +1034,6 @@ components:
10721034
Outcome:
10731035
type: object
10741036
properties:
1075-
id:
1076-
type: number
1077-
nullable: true
10781037
code:
10791038
type: string
10801039
nullable: true
@@ -1165,9 +1124,6 @@ components:
11651124
Punishment:
11661125
type: object
11671126
properties:
1168-
id:
1169-
type: number
1170-
nullable: true
11711127
type:
11721128
type: string
11731129
nullable: true
@@ -1177,44 +1133,17 @@ components:
11771133
otherPrivilege:
11781134
type: string
11791135
nullable: true
1180-
stoppagePercentage:
1181-
type: number
1182-
nullable: true
1183-
activatedBy:
1184-
type: string
1185-
nullable: true
1186-
activatedFrom:
1187-
type: string
1188-
nullable: true
11891136
schedule:
11901137
nullable: true
1191-
consecutiveChargeNumber:
1192-
type: string
1193-
nullable: true
1194-
consecutiveReportAvailable:
1195-
type: boolean
1196-
nullable: true
1197-
damagesOwedAmount:
1198-
type: number
1199-
nullable: true
1200-
canRemove:
1201-
type: boolean
1202-
nullable: true
12031138
PunishmentComment:
12041139
type: object
12051140
properties:
1206-
id:
1207-
type: number
1208-
nullable: true
12091141
comment:
12101142
type: string
12111143
nullable: true
12121144
reasonForChange:
12131145
type: string
12141146
nullable: true
1215-
createdByUserId:
1216-
type: string
1217-
nullable: true
12181147
dateTime:
12191148
type: string
12201149
format: date-time

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/adjudications/AdjudicationsIncidentRole.kt

-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.adjudications
33
data class AdjudicationsIncidentRole(
44
val roleCode: String? = null,
55
val offenceRule: AdjudicationsOffenceRuleDetails? = null,
6-
val associatedPrisonersNumber: String? = null,
7-
val associatedPrisonersName: String? = null,
86
)

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/adjudications/AdjudicationsPunishmentComment.kt

-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ class AdjudicationsPunishmentComment(
44
val id: Number? = null,
55
val comment: String? = null,
66
val reasonForChange: String? = null,
7-
val createdByUserId: String? = null,
87
val dateTime: String? = null,
98
)

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/adjudications/ReportedAdjudication.kt

+6-33
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ data class ReportedAdjudication(
2020
val isYouthOffender: Boolean,
2121
val incidentRole: AdjudicationsIncidentRole? = null,
2222
val offenceDetails: AdjudicationsOffenceDetails? = null,
23+
val status: String? = null,
24+
val statusReason: String? = null,
25+
val statusDetails: String? = null,
2326
val hearings: List<AdjudicationsHearing?> = emptyList(),
2427
val outcomes: List<AdjudicationsOutcomeHistory> = emptyList(),
2528
val punishments: List<AdjudicationsPunishment> = emptyList(),
@@ -28,10 +31,7 @@ data class ReportedAdjudication(
2831
fun toAdjudication(): Adjudication =
2932
Adjudication(
3033
incidentDetails = IncidentDetailsDto(
31-
locationId = this.incidentDetails.locationId,
3234
dateTimeOfIncident = this.incidentDetails.dateTimeOfIncident,
33-
dateTimeOfDiscovery = this.incidentDetails.dateTimeOfDiscovery,
34-
handoverDeadline = this.incidentDetails.handoverDeadline,
3535
),
3636
isYouthOffender = this.isYouthOffender,
3737
incidentRole = IncidentRoleDto(
@@ -40,67 +40,50 @@ data class ReportedAdjudication(
4040
paragraphNumber = this.incidentRole?.offenceRule?.paragraphNumber,
4141
paragraphDescription = this.incidentRole?.offenceRule?.paragraphDescription,
4242
),
43-
associatedPrisonersNumber = this.incidentRole?.associatedPrisonersNumber,
44-
associatedPrisonersName = this.incidentRole?.associatedPrisonersName,
4543
),
4644
offenceDetails = OffenceDto(
4745
offenceCode = this.offenceDetails?.offenceCode,
4846
offenceRule = OffenceRuleDto(
4947
paragraphNumber = this.offenceDetails?.offenceRule?.paragraphNumber,
5048
paragraphDescription = this.offenceDetails?.offenceRule?.paragraphDescription,
51-
nomisCode = this.offenceDetails?.offenceRule?.nomisCode,
52-
withOthersNomisCode = this.offenceDetails?.offenceRule?.withOthersNomisCode,
53-
5449
),
55-
victimPrisonersNumber = this.offenceDetails?.victimPrisonersNumber,
56-
victimStaffUsername = this.offenceDetails?.victimStaffUsername,
57-
victimOtherPersonsName = this.offenceDetails?.victimOtherPersonsName,
5850
),
51+
status = this.status,
52+
statusReason = this.statusReason,
53+
statusDetails = this.statusDetails,
5954
hearings = this.hearings.map {
6055
HearingDto(
61-
id = it?.id,
62-
locationId = it?.locationId,
6356
dateTimeOfHearing = it?.dateTimeOfHearing,
6457
oicHearingType = it?.oicHearingType,
6558
outcome = HearingOutcomeDto(
66-
id = it?.outcome?.id,
67-
adjudicator = it?.outcome?.adjudicator,
6859
code = it?.outcome?.code,
6960
reason = it?.outcome?.reason,
7061
details = it?.outcome?.details,
7162
plea = it?.outcome?.plea,
7263
),
73-
agencyId = it?.agencyId,
7464
)
7565
},
7666
outcomes = this.outcomes.map {
7767
OutcomeHistoryDto(
7868
hearing = HearingDto(
79-
id = it.hearing?.id,
80-
locationId = it.hearing?.locationId,
8169
dateTimeOfHearing = it.hearing?.dateTimeOfHearing,
8270
oicHearingType = it.hearing?.oicHearingType,
8371
outcome = HearingOutcomeDto(
84-
id = it.hearing?.outcome?.id,
85-
adjudicator = it.hearing?.outcome?.adjudicator,
8672
code = it.hearing?.outcome?.code,
8773
reason = it.hearing?.outcome?.reason,
8874
details = it.hearing?.outcome?.details,
8975
plea = it.hearing?.outcome?.plea,
9076
),
91-
agencyId = it.hearing?.agencyId,
9277
),
9378
outcome = CombinedOutcomeDto(
9479
outcome = OutcomeDto(
95-
id = it.outcome?.outcome?.id,
9680
code = it.outcome?.outcome?.code,
9781
details = it.outcome?.outcome?.details,
9882
reason = it.outcome?.outcome?.reason,
9983
quashedReason = it.outcome?.outcome?.quashedReason,
10084
canRemove = it.outcome?.outcome?.canRemove,
10185
),
10286
referralOutcome = OutcomeDto(
103-
id = it.outcome?.referralOutcome?.id,
10487
code = it.outcome?.referralOutcome?.code,
10588
details = it.outcome?.referralOutcome?.details,
10689
reason = it.outcome?.referralOutcome?.reason,
@@ -112,31 +95,21 @@ data class ReportedAdjudication(
11295
},
11396
punishments = this.punishments.map {
11497
PunishmentDto(
115-
id = it.id,
11698
type = it.type,
11799
privilegeType = it.privilegeType,
118100
otherPrivilege = it.otherPrivilege,
119-
stoppagePercentage = it.stoppagePercentage,
120-
activatedBy = it.activatedBy,
121-
activatedFrom = it.activatedFrom,
122101
schedule = PunishmentScheduleDto(
123102
days = it.schedule?.days,
124103
startDate = it.schedule?.startDate,
125104
endDate = it.schedule?.endDate,
126105
suspendedUntil = it.schedule?.suspendedUntil,
127106
),
128-
consecutiveChargeNumber = it.consecutiveChargeNumber,
129-
consecutiveReportAvailable = it.consecutiveReportAvailable,
130-
damagesOwedAmount = it.damagesOwedAmount,
131-
canRemove = it.canRemove,
132107
)
133108
},
134109
punishmentComments = this.punishmentComments.map {
135110
PunishmentCommentDto(
136-
id = it.id,
137111
comment = it.comment,
138112
reasonForChange = it.reasonForChange,
139-
createdByUserId = it.createdByUserId,
140113
dateTime = it.dateTime,
141114
)
142115
},

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/Adjudication.kt

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ data class Adjudication(
55
val isYouthOffender: Boolean? = null,
66
val incidentRole: IncidentRoleDto? = null,
77
val offenceDetails: OffenceDto? = null,
8+
val status: String? = null,
9+
val statusReason: String? = null,
10+
val statusDetails: String? = null,
811
val hearings: List<HearingDto>? = null,
912
val outcomes: List<OutcomeHistoryDto>? = null,
1013
val punishments: List<PunishmentDto>? = null,
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
22

33
data class HearingDto(
4-
val id: Number? = null,
5-
val locationId: Number? = null,
64
val dateTimeOfHearing: String? = null,
75
val oicHearingType: String? = null,
86
val outcome: HearingOutcomeDto? = null,
9-
val agencyId: String? = null,
107
)

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/HearingOutcomeDto.kt

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
22

33
data class HearingOutcomeDto(
4-
val id: Number? = null,
5-
val adjudicator: String? = null,
64
val code: String? = null,
75
val reason: String? = null,
86
val details: String? = null,
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
22

33
data class IncidentDetailsDto(
4-
val locationId: Number? = null,
54
val dateTimeOfIncident: String? = null,
6-
val dateTimeOfDiscovery: String? = null,
7-
val handoverDeadline: String? = null,
85
)

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/IncidentRoleDto.kt

-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
33
data class IncidentRoleDto(
44
val roleCode: String? = null,
55
val offenceRule: OffenceRuleDetailsDto? = null,
6-
val associatedPrisonersNumber: String? = null,
7-
val associatedPrisonersName: String? = null,
86
)

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/OffenceDto.kt

-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
33
data class OffenceDto(
44
val offenceCode: Number? = null,
55
val offenceRule: OffenceRuleDto? = null,
6-
val victimPrisonersNumber: String? = null,
7-
val victimStaffUsername: String? = null,
8-
val victimOtherPersonsName: String? = null,
96
)

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/OffenceRuleDto.kt

-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
33
data class OffenceRuleDto(
44
val paragraphNumber: String? = null,
55
val paragraphDescription: String? = null,
6-
val nomisCode: String? = null,
7-
val withOthersNomisCode: String? = null,
86
)

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/OutcomeDto.kt

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
22

33
data class OutcomeDto(
4-
val id: Number? = null,
54
val code: String? = null,
65
val details: String? = null,
76
val reason: String? = null,
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
22

33
data class PunishmentCommentDto(
4-
val id: Number? = null,
54
val comment: String? = null,
65
val reasonForChange: String? = null,
7-
val createdByUserId: String? = null,
86
val dateTime: String? = null,
97
)
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
22

33
data class PunishmentDto(
4-
val id: Number? = null,
54
val type: String? = null,
65
val privilegeType: String? = null,
76
val otherPrivilege: String? = null,
8-
val stoppagePercentage: Number? = null,
9-
val activatedBy: String? = null,
10-
val activatedFrom: String? = null,
117
val schedule: PunishmentScheduleDto? = null,
12-
val consecutiveChargeNumber: String? = null,
13-
val consecutiveReportAvailable: Boolean? = null,
14-
val damagesOwedAmount: Number? = null,
15-
val canRemove: Boolean? = null,
168
)

0 commit comments

Comments
 (0)