Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADJUST1-164 intercept logic. #61

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import tokenVerification from './integration_tests/mockApis/tokenVerification'
import prisonApi from './integration_tests/mockApis/prisonApi'
import adjustmentsApi from './integration_tests/mockApis/adjustmentsApi'
import identifyRemandApi from './integration_tests/mockApis/identifyRemandApi'
import adjudicationsApi from './integration_tests/mockApis/adjudicationsApi'

export default defineConfig({
chromeWebSecurity: false,
Expand All @@ -28,6 +29,7 @@ export default defineConfig({
...prisonApi,
...adjustmentsApi,
...identifyRemandApi,
...adjudicationsApi,
})
},
baseUrl: 'http://localhost:3007',
Expand Down
3 changes: 2 additions & 1 deletion feature.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ DIGITAL_PRISON_SERVICES_URL=http://localhost:9091/dps
CALCULATE_RELEASE_DATES_URL=http://localhost:9091/crd
IDENTIFY_REMAND_PERIODS_URL=http://localhost:9091/identify-remand
IDENTIFY_REMAND_PERIODS_API_URL=http://localhost:9091/identify-remand-api
ADJUSTMENTS_API_URL=http://localhost:9091/adjustments-api
ADJUSTMENTS_API_URL=http://localhost:9091/adjustments-api
ADJUDICATIONS_API_URL=http://localhost:9091/adjudications-api
3 changes: 3 additions & 0 deletions integration_tests/e2e/rada.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ context('Enter a RADA', () => {
cy.task('stubUpdateAdjustment')
cy.task('stubRemoveAdjustment')
cy.task('stubGetRemandDecision')
cy.task('stubSearchAdjudications')
cy.task('stubIndividualAdjudications')
cy.task('stubGetSentencesAndOffences')
})

it('Add a RADA', () => {
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/e2e/remand.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ context('Enter a RADA', () => {
cy.task('stubGetAdjustments')
cy.task('stubGetRelevantRemand')
cy.task('stubGetRemandDecision')
cy.task('stubSearchAdjudications')
cy.task('stubIndividualAdjudications')
cy.task('stubGetSentencesAndOffences')
})

it('Enter a RADA', () => {
Expand Down
325 changes: 325 additions & 0 deletions integration_tests/mockApis/adjudications.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,325 @@
const adjudications = [
{
adjudicationNumber: 1296861,
incidentTime: '2016-04-15T15:45:00',
establishment: 'Haverigg (HMP)',
interiorLocation: 'Fairfield Wing',
incidentDetails:
'WauNpDdByswUvzOnDbnUhmrcpGIVMGKvDgtCTRJRuhYzfIJfGbZhGEhLgCiCKowBZpWORYFyWauNpDdByswUvzOnDbnUhmrcpGIVMGKvDgtCTRJRuhYzfIJfGbZhGEhLgCiCKowBZpWORYF',
reportNumber: 1278212,
reportType: "Governor's Report",
reporterFirstName: 'YDFISOOPHER',
reporterLastName: 'FATALIE',
reportTime: '2016-04-16T13:21:00',
hearings: [
{
oicHearingId: 1697175,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-04-30T14:56:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
otherRepresentatives: 'zvWAzvW',
comment: 'WW',
results: [],
},
{
oicHearingId: 1685096,
hearingType: "Governor's Hearing Adult",
hearingTime: '2016-04-18T09:00:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
heardByFirstName: 'BESSEYNU',
heardByLastName: 'YASMEXIA',
comment: 'JIJJIJ',
results: [],
},
{
oicHearingId: 1703902,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-05-12T09:03:00',
establishment: 'Haverigg (HMP)',
location: 'Scafell Wing',
otherRepresentatives: 'ASUzASU',
results: [
{
oicOffenceCode: '51:1',
offenceType: 'Prison Rule 51',
offenceDescription: 'Commits any assault',
plea: 'Guilty',
finding: 'Charge Proved',
sanctions: [
{
sanctionType: 'Additional Days Added',
sanctionDays: 26,
effectiveDate: '2016-05-12T00:00:00',
status: 'Immediate',
statusDate: '2016-05-12T00:00:00',
comment: 'zBgdbgawxpEfaQloXDBjlTzBgdbgawxpEfaQloXDBjl',
sanctionSeq: 3,
},
],
},
],
},
],
},
{
adjudicationNumber: 1296857,
incidentTime: '2016-04-15T15:45:00',
establishment: 'Haverigg (HMP)',
interiorLocation: 'Fairfield Wing',
incidentDetails:
'bpELIrswJXbUHQGgLFUBqiQBsWAKRCUsuFZdlfNPoITBlEDfuVceoFATMEbpELIrswJXbUHQGgLFUBqiQBsWAKRCUsuFZdlfNPoITBlEDfuVceoFATME',
reportNumber: 1278208,
reportType: "Governor's Report",
reporterFirstName: 'YDFISOOPHER',
reporterLastName: 'FATALIE',
reportTime: '2016-04-16T13:13:00',
hearings: [
{
oicHearingId: 1697174,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-04-22T14:55:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
otherRepresentatives: 'KXIAKXI',
comment: 'ZZ',
results: [],
},
{
oicHearingId: 1685088,
hearingType: "Governor's Hearing Adult",
hearingTime: '2016-04-18T09:00:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
heardByFirstName: 'BESSEYNU',
heardByLastName: 'YASMEXIA',
comment: 'BXABXA',
results: [],
},
{
oicHearingId: 1703903,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-05-12T09:30:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
otherRepresentatives: 'mOKxmOK',
results: [
{
oicOffenceCode: '51:22',
offenceType: 'Prison Rule 51',
offenceDescription: 'Disobeys any lawful order',
plea: 'Guilty',
finding: 'Charge Proved',
sanctions: [
{
sanctionType: 'Additional Days Added',
sanctionDays: 14,
effectiveDate: '2016-05-12T00:00:00',
status: 'Immediate',
statusDate: '2016-05-12T00:00:00',
comment: 'JBweLvAMNKvOVIPBqsxnNWVRJBweLvAMNKvOVIPBqsxnNWV',
sanctionSeq: 4,
consecutiveSanctionSeq: 5,
},
],
},
],
},
],
},
{
adjudicationNumber: 1296839,
incidentTime: '2016-04-15T15:45:00',
establishment: 'Haverigg (HMP)',
interiorLocation: 'Fairfield Wing',
incidentDetails: 'cFlxuiADszvlyKvbInisOxGtZHIUPMCaJpJqbXgGEgPZdcFlxuiADszvlyKvbInisOxGtZHIUPMCaJpJqbXgGEgPZd',
reportNumber: 1278189,
reportType: "Governor's Report",
reporterFirstName: 'DILBNELIWA',
reporterLastName: 'LINDAYLA',
reportTime: '2016-04-16T12:40:00',
hearings: [
{
oicHearingId: 1697167,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-04-22T14:52:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
otherRepresentatives: 'WrfyWrf',
comment: 'UU',
results: [],
},
{
oicHearingId: 1685041,
hearingType: "Governor's Hearing Adult",
hearingTime: '2016-04-18T09:00:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
heardByFirstName: 'BESSEYNU',
heardByLastName: 'YASMEXIA',
comment: 'jiZjiZ',
results: [],
},
{
oicHearingId: 1703908,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-05-12T09:03:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
otherRepresentatives: 'BnmLBnm',
results: [
{
oicOffenceCode: '51:5',
offenceType: 'Prison Rule 51',
offenceDescription:
'Intentionally endangers the health or personal safety of others or, by his conduct, is reckless whether such health or personal safety is endangered',
plea: 'Guilty',
finding: 'Charge Proved',
sanctions: [
{
sanctionType: 'Additional Days Added',
sanctionDays: 26,
effectiveDate: '2016-05-12T00:00:00',
status: 'Immediate',
statusDate: '2016-05-12T00:00:00',
comment: 'spqtPUUngnAHwTgoGHyKtirhspqtPUUngnAHwTgoGHyKtirh',
sanctionSeq: 1,
},
],
},
],
},
],
},
{
adjudicationNumber: 1296855,
incidentTime: '2016-04-15T15:45:00',
establishment: 'Haverigg (HMP)',
interiorLocation: 'Fairfield Wing',
incidentDetails:
'rzLlfWjHMTnVxqcxOGazFXZgdwHmpHFqRDsjYYXPPkAuSyhqHwZQfTRVvSYUdpxeXgFVOANeqauYVGWktgDUaWLNVQEBNUtmQFQhyuUxXUoBanGozrzLlfWjHMTnVxqcxOGazFXZgdwHmpHFqRDsjYYXPPkAuSyhqHwZQfTRVvSYUdpxeXgFVOANeqauYVGWktgDUaWLNVQEBNUtmQFQhyuUxXUoBanGoz',
reportNumber: 1278206,
reportType: "Governor's Report",
reporterFirstName: 'AJNNECE',
reporterLastName: 'CAROLD',
reportTime: '2016-04-16T13:01:00',
hearings: [
{
oicHearingId: 1697173,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-04-22T14:54:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
otherRepresentatives: 'RwRdRwR',
comment: 'ee',
results: [],
},
{
oicHearingId: 1685081,
hearingType: "Governor's Hearing Adult",
hearingTime: '2016-04-18T09:00:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
heardByFirstName: 'BESSEYNU',
heardByLastName: 'YASMEXIA',
comment: 'QVcQVc',
results: [],
},
{
oicHearingId: 1703904,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-05-12T09:30:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
otherRepresentatives: 'qZhbqZh',
results: [
{
oicOffenceCode: '51:1',
offenceType: 'Prison Rule 51',
offenceDescription: 'Commits any assault',
plea: 'Guilty',
finding: 'Charge Proved',
sanctions: [
{
sanctionType: 'Additional Days Added',
sanctionDays: 26,
effectiveDate: '2016-05-12T00:00:00',
status: 'Immediate',
statusDate: '2016-05-12T00:00:00',
comment: 'ibuvIjhvEfItAKeHtEPibuvIjhvEfItAKeHtEP',
sanctionSeq: 2,
},
],
},
],
},
],
},
{
adjudicationNumber: 1296846,
incidentTime: '2016-04-15T15:45:00',
establishment: 'Haverigg (HMP)',
interiorLocation: 'Fairfield Wing',
incidentDetails:
'JxIPJubhRvBMuSKvCdBpEcZhchNUySsGECoQDvwexcVkbAWZKItlJxIPJubhRvBMuSKvCdBpEcZhchNUySsGECoQDvwexcVkbAWZKItl',
reportNumber: 1278197,
reportType: "Governor's Report",
reporterFirstName: 'DILBNELIWA',
reporterLastName: 'LINDAYLA',
reportTime: '2016-04-16T12:50:00',
hearings: [
{
oicHearingId: 1697172,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-04-22T14:54:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
otherRepresentatives: 'gwdugwd',
comment: 'KK',
results: [],
},
{
oicHearingId: 1685061,
hearingType: "Governor's Hearing Adult",
hearingTime: '2016-04-18T09:00:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
heardByFirstName: 'BESSEYNU',
heardByLastName: 'YASMEXIA',
comment: 'ffbffb',
results: [],
},
{
oicHearingId: 1703906,
hearingType: 'Independent Adjudicator Hearing Adult',
hearingTime: '2016-05-12T09:30:00',
establishment: 'Haverigg (HMP)',
location: 'Adjudication Room',
otherRepresentatives: 'UZCCUZC',
results: [
{
oicOffenceCode: '51:1',
offenceType: 'Prison Rule 51',
offenceDescription: 'Commits any assault',
plea: 'Guilty',
finding: 'Charge Proved',
sanctions: [
{
sanctionType: 'Additional Days Added',
sanctionDays: 26,
effectiveDate: '2016-05-12T00:00:00',
status: 'Immediate',
statusDate: '2016-05-12T00:00:00',
comment: 'xREMNsMOQvgrZbsnGtEZoxREMNsMOQvgrZbsnGtEZo',
sanctionSeq: 5,
},
],
},
],
},
],
},
]

export default adjudications
Loading