Skip to content

Commit

Permalink
Merge branch 'main' of github.com:island-is/island.is into j-s/court-…
Browse files Browse the repository at this point in the history
…abbr
  • Loading branch information
oddsson committed Dec 6, 2024
2 parents bed5993 + d1f95c5 commit 993bba8
Show file tree
Hide file tree
Showing 74 changed files with 1,542 additions and 686 deletions.
151 changes: 77 additions & 74 deletions apps/application-system/api/infra/application-system-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,80 +49,83 @@ export const GRAPHQL_API_URL_ENV_VAR_NAME = 'GRAPHQL_API_URL' // This property i

const namespace = 'application-system'
const serviceAccount = 'application-system-api'
export const workerSetup =
(): ServiceBuilder<'application-system-api-worker'> =>
service('application-system-api-worker')
.namespace(namespace)
.image('application-system-api')
.db()
.serviceAccount('application-system-api-worker')
.redis()
.codeOwner(CodeOwners.NordaApplications)
.env({
IDENTITY_SERVER_CLIENT_ID: '@island.is/clients/application-system',
IDENTITY_SERVER_ISSUER_URL: {
dev: 'https://identity-server.dev01.devland.is',
staging: 'https://identity-server.staging01.devland.is',
prod: 'https://innskra.island.is',
},
XROAD_CHARGE_FJS_V2_PATH: {
dev: 'IS-DEV/GOV/10021/FJS-Public/chargeFJS_v2',
staging: 'IS-TEST/GOV/10021/FJS-Public/chargeFJS_v2',
prod: 'IS/GOV/5402697509/FJS-Public/chargeFJS_v2',
},
APPLICATION_ATTACHMENT_BUCKET: {
dev: 'island-is-dev-storage-application-system',
staging: 'island-is-staging-storage-application-system',
prod: 'island-is-prod-storage-application-system',
},
FILE_SERVICE_PRESIGN_BUCKET: {
dev: 'island-is-dev-fs-presign-bucket',
staging: 'island-is-staging-fs-presign-bucket',
prod: 'island-is-prod-fs-presign-bucket',
},
FILE_STORAGE_UPLOAD_BUCKET: {
dev: 'island-is-dev-upload-api',
staging: 'island-is-staging-upload-api',
prod: 'island-is-prod-upload-api',
},
CLIENT_LOCATION_ORIGIN: {
dev: 'https://beta.dev01.devland.is/umsoknir',
staging: 'https://beta.staging01.devland.is/umsoknir',
prod: 'https://island.is/umsoknir',
local: 'http://localhost:4200/umsoknir',
},
})
.xroad(Base, Client, Payment, Inna, EHIC, WorkMachines)
.secrets({
IDENTITY_SERVER_CLIENT_SECRET:
'/k8s/application-system/api/IDENTITY_SERVER_CLIENT_SECRET',
SYSLUMENN_HOST: '/k8s/application-system-api/SYSLUMENN_HOST',
SYSLUMENN_USERNAME: '/k8s/application-system/api/SYSLUMENN_USERNAME',
SYSLUMENN_PASSWORD: '/k8s/application-system/api/SYSLUMENN_PASSWORD',
DRIVING_LICENSE_BOOK_XROAD_PATH:
'/k8s/application-system-api/DRIVING_LICENSE_BOOK_XROAD_PATH',
DRIVING_LICENSE_BOOK_USERNAME:
'/k8s/application-system-api/DRIVING_LICENSE_BOOK_USERNAME',
DRIVING_LICENSE_BOOK_PASSWORD:
'/k8s/application-system-api/DRIVING_LICENSE_BOOK_PASSWORD',
DOKOBIT_ACCESS_TOKEN:
'/k8s/application-system/api/DOKOBIT_ACCESS_TOKEN',
DOKOBIT_URL: '/k8s/application-system-api/DOKOBIT_URL',
ARK_BASE_URL: '/k8s/application-system-api/ARK_BASE_URL',
DOMSYSLA_PASSWORD: '/k8s/application-system-api/DOMSYSLA_PASSWORD',
DOMSYSLA_USERNAME: '/k8s/application-system-api/DOMSYSLA_USERNAME',
})
.args('main.js', '--job', 'worker')
.command('node')
.extraAttributes({
dev: { schedule: '*/30 * * * *' },
staging: { schedule: '*/30 * * * *' },
prod: { schedule: '*/30 * * * *' },
})
.resources({
limits: { cpu: '400m', memory: '768Mi' },
requests: { cpu: '150m', memory: '384Mi' },
})
export const workerSetup = (services: {
userNotificationService: ServiceBuilder<'services-user-notification'>
}): ServiceBuilder<'application-system-api-worker'> =>
service('application-system-api-worker')
.namespace(namespace)
.image('application-system-api')
.db()
.serviceAccount('application-system-api-worker')
.redis()
.codeOwner(CodeOwners.NordaApplications)
.env({
IDENTITY_SERVER_CLIENT_ID: '@island.is/clients/application-system',
IDENTITY_SERVER_ISSUER_URL: {
dev: 'https://identity-server.dev01.devland.is',
staging: 'https://identity-server.staging01.devland.is',
prod: 'https://innskra.island.is',
},
XROAD_CHARGE_FJS_V2_PATH: {
dev: 'IS-DEV/GOV/10021/FJS-Public/chargeFJS_v2',
staging: 'IS-TEST/GOV/10021/FJS-Public/chargeFJS_v2',
prod: 'IS/GOV/5402697509/FJS-Public/chargeFJS_v2',
},
APPLICATION_ATTACHMENT_BUCKET: {
dev: 'island-is-dev-storage-application-system',
staging: 'island-is-staging-storage-application-system',
prod: 'island-is-prod-storage-application-system',
},
FILE_SERVICE_PRESIGN_BUCKET: {
dev: 'island-is-dev-fs-presign-bucket',
staging: 'island-is-staging-fs-presign-bucket',
prod: 'island-is-prod-fs-presign-bucket',
},
FILE_STORAGE_UPLOAD_BUCKET: {
dev: 'island-is-dev-upload-api',
staging: 'island-is-staging-upload-api',
prod: 'island-is-prod-upload-api',
},
CLIENT_LOCATION_ORIGIN: {
dev: 'https://beta.dev01.devland.is/umsoknir',
staging: 'https://beta.staging01.devland.is/umsoknir',
prod: 'https://island.is/umsoknir',
local: 'http://localhost:4200/umsoknir',
},
USER_NOTIFICATION_API_URL: ref(
(h) => `http://${h.svc(services.userNotificationService)}`,
),
})
.xroad(Base, Client, Payment, Inna, EHIC, WorkMachines)
.secrets({
IDENTITY_SERVER_CLIENT_SECRET:
'/k8s/application-system/api/IDENTITY_SERVER_CLIENT_SECRET',
SYSLUMENN_HOST: '/k8s/application-system-api/SYSLUMENN_HOST',
SYSLUMENN_USERNAME: '/k8s/application-system/api/SYSLUMENN_USERNAME',
SYSLUMENN_PASSWORD: '/k8s/application-system/api/SYSLUMENN_PASSWORD',
DRIVING_LICENSE_BOOK_XROAD_PATH:
'/k8s/application-system-api/DRIVING_LICENSE_BOOK_XROAD_PATH',
DRIVING_LICENSE_BOOK_USERNAME:
'/k8s/application-system-api/DRIVING_LICENSE_BOOK_USERNAME',
DRIVING_LICENSE_BOOK_PASSWORD:
'/k8s/application-system-api/DRIVING_LICENSE_BOOK_PASSWORD',
DOKOBIT_ACCESS_TOKEN: '/k8s/application-system/api/DOKOBIT_ACCESS_TOKEN',
DOKOBIT_URL: '/k8s/application-system-api/DOKOBIT_URL',
ARK_BASE_URL: '/k8s/application-system-api/ARK_BASE_URL',
DOMSYSLA_PASSWORD: '/k8s/application-system-api/DOMSYSLA_PASSWORD',
DOMSYSLA_USERNAME: '/k8s/application-system-api/DOMSYSLA_USERNAME',
})
.args('main.js', '--job', 'worker')
.command('node')
.extraAttributes({
dev: { schedule: '*/30 * * * *' },
staging: { schedule: '*/30 * * * *' },
prod: { schedule: '*/30 * * * *' },
})
.resources({
limits: { cpu: '400m', memory: '768Mi' },
requests: { cpu: '150m', memory: '384Mi' },
})

export const serviceSetup = (services: {
documentsService: ServiceBuilder<'services-documents'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,12 +776,16 @@ export class CaseService {
CaseFileCategory.CRIMINAL_RECORD,
CaseFileCategory.COST_BREAKDOWN,
CaseFileCategory.CASE_FILE,
CaseFileCategory.PROSECUTOR_CASE_FILE,
CaseFileCategory.DEFENDANT_CASE_FILE,
]
: [
CaseFileCategory.INDICTMENT,
CaseFileCategory.CRIMINAL_RECORD,
CaseFileCategory.COST_BREAKDOWN,
CaseFileCategory.CASE_FILE,
CaseFileCategory.PROSECUTOR_CASE_FILE,
CaseFileCategory.DEFENDANT_CASE_FILE,
]

const deliverCaseFileToCourtMessages =
Expand Down Expand Up @@ -928,12 +932,10 @@ export class CaseService {
(caseFile) =>
caseFile.state === CaseFileState.STORED_IN_RVG &&
caseFile.key &&
caseFile.category === CaseFileCategory.RULING &&
theCase.indictmentRulingDecision &&
[
CaseIndictmentRulingDecision.RULING,
CaseIndictmentRulingDecision.DISMISSAL,
].includes(theCase.indictmentRulingDecision),
caseFile.category &&
[CaseFileCategory.COURT_RECORD, CaseFileCategory.RULING].includes(
caseFile.category,
),
)
.map((caseFile) => ({
type: MessageType.DELIVERY_TO_COURT_CASE_FILE,
Expand Down
23 changes: 21 additions & 2 deletions apps/judicial-system/backend/src/app/modules/file/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ export class FileService {
courtDocumentFolder = CourtDocumentFolder.INDICTMENT_DOCUMENTS
break
case CaseFileCategory.COURT_RECORD:
courtDocumentFolder = CourtDocumentFolder.COURT_DOCUMENTS
break
case CaseFileCategory.RULING:
courtDocumentFolder = CourtDocumentFolder.COURT_DOCUMENTS
break
case CaseFileCategory.CASE_FILE:
case CaseFileCategory.PROSECUTOR_CASE_FILE:
case CaseFileCategory.DEFENDANT_CASE_FILE:
case undefined:
case null:
courtDocumentFolder = CourtDocumentFolder.CASE_DOCUMENTS
Expand Down Expand Up @@ -388,6 +388,25 @@ export class FileService {
},
])
}

if (
isIndictmentCase(theCase.type) &&
file.category &&
[
CaseFileCategory.PROSECUTOR_CASE_FILE,
CaseFileCategory.DEFENDANT_CASE_FILE,
].includes(file.category)
) {
await this.messageService.sendMessagesToQueue([
{
type: MessageType.DELIVERY_TO_COURT_CASE_FILE,
user,
caseId: theCase.id,
elementId: file.id,
},
])
}

return file
}

Expand Down
11 changes: 11 additions & 0 deletions apps/judicial-system/web/messages/Core/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,15 @@ export const tables = defineMessages({
defaultMessage: 'Sent',
description: 'Notaður sem titill fyrir sent dálk í lista yfir mál.',
},
fineTag: {
id: 'judicial.system.core:tables.fine_tag',
defaultMessage: 'Viðurlagaákvörðun',
description:
'Notaðir sem texti í tagg þegar mál endar sem viðurlagaákvörðun',
},
rulingTag: {
id: 'judicial.system.core:tables.ruling_tag',
defaultMessage: 'Dómur',
description: 'Notaðir sem texti í tagg þegar mál endar sem dómur',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ const SelectDefender: FC<Props> = ({ defendant }) => {
caseId,
defendantId: defendant.id,
defenderNationalId: defendantWaivesRightToCounsel
? ''
: defendant.defenderNationalId,
? null
: defendant.defenderNationalId || null,
defenderName: defendantWaivesRightToCounsel
? ''
? null
: defendant.defenderName,
defenderEmail: defendantWaivesRightToCounsel
? ''
? null
: defendant.defenderEmail,
defenderPhoneNumber: defendantWaivesRightToCounsel
? ''
? null
: defendant.defenderPhoneNumber,
defenderChoice:
defendantWaivesRightToCounsel === true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,28 @@ export const strings = defineMessages({
description:
'Notaður sem titill á Staðfesta takka á Samantektarskjá ákæru.',
},
completedCaseModalTitle: {
id: 'judicial.system.core:indictments.summary.completed_case_modal_title',
defaultMessage: 'Máli hefur verið lokið',
description: 'Notaður sem titill á staðfestingarglugga um að mál sé lokið.',
},
completedCaseModalBody: {
id: 'judicial.system.core:indictments.summary.completed_case_modal_body_v2',
defaultMessage: 'Gögn hafa verið send ákæranda og verjanda.',
description: 'Notaður sem texti í staðfestingarglugga um að mál sé lokið.',
completeCaseModalTitle: {
id: 'judicial.system.core:indictments.summary.complete_case_modal_title',
defaultMessage: 'Viltu ljúka máli?',
description:
'Notaður sem titill á staðfestingarglugga um að hvort eigi að ljúka máli.',
},
completeCaseModalBody: {
id: 'judicial.system.core:indictments.summary.complete_case_modal_body',
defaultMessage: 'Niðurstaða málsins verður send ákæranda og verjanda.',
description:
'Notaður sem texti í staðfestingarglugga um hvort eigi að ljúka máli.',
},
completeCaseModalPrimaryButton: {
id: 'judicial.system.core:indictments.summary.complete_case_modal_primary_button',
defaultMessage: 'Já, ljúka máli',
description:
'Notaður sem texti á aðalhnapp í staðfestingarglugga um hvort eigi að ljúka máli.',
},
completeCaseModalSecondaryButton: {
id: 'judicial.system.core:indictments.summary.complete_case_modal_secondary_button',
defaultMessage: 'Hætta við',
description:
'Notaður sem texti á aukahnapp í staðfestingarglugga um hvort eigi að ljúka máli.',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Summary: FC = () => {
return router.push(`${destination}/${workingCase.id}`)
}

const handleNextButtonClick = async () => {
const handleModalPrimaryButtonClick = async () => {
const transitionSuccess = await transitionCase(
workingCase.id,
CaseTransition.COMPLETE,
Expand All @@ -63,7 +63,7 @@ const Summary: FC = () => {
return
}

setModalVisible('CONFIRM_INDICTMENT')
router.push(`${constants.INDICTMENTS_COMPLETED_ROUTE}/${workingCase.id}`)
}

const [courtRecordFiles, rulingFiles] = (workingCase.caseFiles || []).reduce(
Expand Down Expand Up @@ -158,20 +158,24 @@ const Summary: FC = () => {
previousUrl={`${constants.INDICTMENTS_CONCLUSION_ROUTE}/${workingCase.id}`}
nextButtonIcon="checkmark"
nextButtonText={formatMessage(strings.nextButtonText)}
onNextButtonClick={async () => await handleNextButtonClick()}
nextIsDisabled={isTransitioningCase}
onNextButtonClick={() => setModalVisible('CONFIRM_INDICTMENT')}
/>
</FormContentContainer>
{modalVisible === 'CONFIRM_INDICTMENT' && (
<Modal
title={formatMessage(strings.completedCaseModalTitle)}
text={formatMessage(strings.completedCaseModalBody)}
primaryButtonText={formatMessage(core.closeModal)}
onPrimaryButtonClick={() =>
router.push(
`${constants.INDICTMENTS_COMPLETED_ROUTE}/${workingCase.id}`,
)
title={formatMessage(strings.completeCaseModalTitle)}
text={formatMessage(strings.completeCaseModalBody)}
primaryButtonText={formatMessage(
strings.completeCaseModalPrimaryButton,
)}
onPrimaryButtonClick={async () =>
await handleModalPrimaryButtonClick()
}
secondaryButtonText={formatMessage(
strings.completeCaseModalSecondaryButton,
)}
onSecondaryButtonClick={() => setModalVisible(undefined)}
isPrimaryButtonLoading={isTransitioningCase}
/>
)}
</PageLayout>
Expand Down
Loading

0 comments on commit 993bba8

Please sign in to comment.