Skip to content

Commit

Permalink
Merge branch 'main' into my-pages/vaccinations-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
disaerna authored Dec 9, 2024
2 parents 7d89a3c + 2e1b8a0 commit 4899173
Show file tree
Hide file tree
Showing 290 changed files with 3,731 additions and 2,336 deletions.
6 changes: 6 additions & 0 deletions apps/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ import {
IdsClientConfig,
XRoadConfig,
} from '@island.is/nest/config'
import { CodeOwnerInterceptor } from '@island.is/nest/core'
import { DataLoaderInterceptor } from '@island.is/nest/dataloader'
import { FeatureFlagConfig } from '@island.is/nest/feature-flags'
import { ProblemModule } from '@island.is/nest/problem'
Expand All @@ -175,6 +176,7 @@ import { FormSystemModule } from '@island.is/api/domains/form-system'
import { HealthDirectorateModule } from '@island.is/api/domains/health-directorate'

import { VehiclesMileageClientConfig } from '@island.is/clients/vehicles-mileage'

import { getConfig } from './environments'
import { GraphqlOptionsFactory } from './graphql-options.factory'
import { GraphQLConfig } from './graphql.config'
Expand Down Expand Up @@ -212,6 +214,10 @@ const environment = getConfig
provide: APP_INTERCEPTOR,
useClass: DataLoaderInterceptor,
},
{
provide: APP_INTERCEPTOR,
useClass: CodeOwnerInterceptor,
},
],
imports: [
GraphQLModule.forRootAsync({
Expand Down
158 changes: 84 additions & 74 deletions apps/application-system/api/infra/application-system-api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { ref, service, ServiceBuilder } from '../../../../infra/src/dsl/dsl'
import {
CodeOwners,
ref,
service,
ServiceBuilder,
} from '../../../../infra/src/dsl/dsl'
import {
Base,
ChargeFjsV2,
Expand Down Expand Up @@ -44,79 +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()
.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 All @@ -131,6 +140,7 @@ export const serviceSetup = (services: {
.serviceAccount(serviceAccount)
.command('node')
.redis()
.codeOwner(CodeOwners.NordaApplications)
.args('main.js')
.env({
EMAIL_REGION: 'eu-west-1',
Expand Down
3 changes: 2 additions & 1 deletion apps/auth-admin-web/infra/auth-admin-web.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { service, ServiceBuilder } from '../../../infra/src/dsl/dsl'
import { CodeOwners, service, ServiceBuilder } from '../../../infra/src/dsl/dsl'

const extraAnnotations = {
'nginx.ingress.kubernetes.io/proxy-buffer-size': '16k',
Expand All @@ -12,6 +12,7 @@ export const serviceSetup = (): ServiceBuilder<'auth-admin-web'> =>
service('auth-admin-web')
.namespace('identity-server-admin')
.image('auth-admin-web')
.codeOwner(CodeOwners.Aranja)
.env({
NEXT_PUBLIC_BACKEND_URL: '/backend',
IDENTITYSERVER_DOMAIN: {
Expand Down
9 changes: 8 additions & 1 deletion apps/consultation-portal/infra/samradsgatt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { ref, service, ServiceBuilder } from '../../../infra/src/dsl/dsl'
import {
CodeOwners,
ref,
service,
ServiceBuilder,
} from '../../../infra/src/dsl/dsl'

export const serviceSetup = (services: {
api: ServiceBuilder<'api'>
Expand All @@ -7,6 +12,7 @@ export const serviceSetup = (services: {
consultationService
.image('consultation-portal')
.namespace('consultation-portal')
.codeOwner(CodeOwners.Advania)
.liveness('/liveness')
.readiness('/liveness')
.replicaCount({
Expand All @@ -28,6 +34,7 @@ export const serviceSetup = (services: {
prod: 'innskra.island.is',
},
NEXTAUTH_URL: {
local: 'http://localhost:4200/samradsgatt/api/auth',
dev: 'https://beta.dev01.devland.is/samradsgatt/api/auth',
staging: 'https://beta.staging01.devland.is/samradsgatt/api/auth',
prod: 'https://island.is/samradsgatt/api/auth',
Expand Down
6 changes: 0 additions & 6 deletions apps/consultation-portal/proxy.config.json

This file was deleted.

8 changes: 8 additions & 0 deletions apps/consultation-portal/proxy.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const proxyConfig = {
'/api/graphql': {
target: process.env.API_URL ?? 'http://localhost:4444',
secure: false,
},
}

export default proxyConfig
3 changes: 2 additions & 1 deletion apps/consultation-portal/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { bootstrap } from '@island.is/infra-next-server'
import proxyConfig from './proxy.config.json'
import proxyConfig from './proxy.config'

bootstrap({
name: 'consultation-portal',
appDir: 'apps/consultation-portal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export class CaseListEntry {
@Field(() => String, { nullable: true })
readonly prosecutorPostponedAppealDate?: string

@Field(() => Institution, { nullable: true })
readonly court?: Institution

@Field(() => User, { nullable: true })
readonly creatingProsecutor?: User

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export class FileController {
} for defendant ${defendantId} of case ${id} as a pdf document`,
)

const subpoenaIdInjection = subpoenaId ? `/${subpoenaId}` : ''
const subpoenaIdInjection = subpoenaId ? `/${subpoenaId}/pdf` : ''
const queryInjection = arraignmentDate
? `?arraignmentDate=${arraignmentDate}&location=${location}&subpoenaType=${subpoenaType}`
: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ export const include: Includeable[] = [
]

export const caseListInclude: Includeable[] = [
{ model: Institution, as: 'court' },
{ model: Institution, as: 'prosecutorsOffice' },
{
model: Defendant,
Expand Down Expand Up @@ -775,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 @@ -927,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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class CaseListInterceptor implements NestInterceptor {
// WARNING: Be careful when adding to this list. No sensitive information should be returned.
// If you need to add sensitive information, then you should consider adding a new endpoint
// for defenders and other user roles that are not allowed to see sensitive information.

return {
id: theCase.id,
created: theCase.created,
Expand Down Expand Up @@ -65,6 +64,7 @@ export class CaseListInterceptor implements NestInterceptor {
indictmentRulingDecision: theCase.indictmentRulingDecision,
courtSessionType: theCase.courtSessionType,
eventLogs: theCase.eventLogs,
court: theCase.court,
}
}),
),
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
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class SubpoenaController {
districtCourtRegistrarRule,
districtCourtAssistantRule,
)
@Get(['', ':subpoenaId'])
@Get(['', ':subpoenaId/pdf'])
@UseGuards(SubpoenaExistsOptionalGuard)
@Header('Content-Type', 'application/pdf')
@ApiOkResponse({
Expand Down
Loading

0 comments on commit 4899173

Please sign in to comment.