Skip to content

Commit

Permalink
Merge branch 'main' into feature/mms-current-school-page
Browse files Browse the repository at this point in the history
  • Loading branch information
helgifr authored Jan 9, 2025
2 parents 976d6c9 + 1a3606f commit d84ceed
Show file tree
Hide file tree
Showing 330 changed files with 8,739 additions and 3,841 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
**/*.log
**/tmp/
**/temp/
**/.next/

# Outputs
**/dist/
Expand Down
9 changes: 7 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/libs/portals/admin/ @island-is/aranja
/libs/portals/core/ @island-is/aranja @island-is/hugsmidjan
/libs/shared/connected/ @island-is/stefna
/libs/shared/types/src/lib/api-cms-domain.ts @island-is/stefna

/* @island-is/core
/libs/api/domains/identity/ @island-is/core
Expand Down Expand Up @@ -132,6 +133,7 @@ codemagic.yaml
/apps/services/regulations-admin-backend/ @island-is/hugsmidjan
/apps/services/user-profile/ @island-is/hugsmidjan @island-is/juni @island-is/aranja
/apps/web/components/Grant/ @island-is/hugsmidjan
/apps/web/components/GrantCardsList/ @island-is/hugsmidjan
/apps/web/screens/Grants/ @island-is/hugsmidjan
/apps/web/screens/Regulations/ @island-is/hugsmidjan
/apps/web/components/Regulations/ @island-is/hugsmidjan
Expand Down Expand Up @@ -268,8 +270,6 @@ codemagic.yaml
/libs/api/domains/content-search/ @island-is/stefna @island-is/juni
/libs/api/domains/syslumenn/ @island-is/stefna
/libs/api/domains/email-signup/ @island-is/stefna
/libs/api/domains/electronic-registration-statistics/ @island-is/stefna
/libs/clients/electronic-registration-statistics/ @island-is/stefna
/libs/api/domains/fiskistofa/ @island-is/stefna
/libs/clients/fiskistofa/ @island-is/stefna
/libs/clients/syslumenn/ @island-is/stefna @island-is/juni
Expand Down Expand Up @@ -384,6 +384,11 @@ codemagic.yaml
/libs/application/templates/university/ @island-is/origo
/libs/application/template-api-modules/src/lib/modules/templates/university/ @island-is/origo

/libs/application/templates/secondary-school/ @island-is/origo
/libs/application/template-api-modules/src/lib/modules/templates/secondary-school/ @island-is/origo
/libs/api/domains/secondary-school/ @island-is/origo
/libs/clients/secondary-school/ @island-is/origo

# DevOps
/.github/ @island-is/devops
/.githooks/ @island-is/devops
Expand Down
7 changes: 2 additions & 5 deletions apps/api/infra/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
VehiclesMileage,
WorkAccidents,
WorkMachines,
SecondarySchool,
} from '../../../infra/src/dsl/xroad'

export const serviceSetup = (services: {
Expand Down Expand Up @@ -191,11 +192,6 @@ export const serviceSetup = (services: {
},
FINANCIAL_STATEMENTS_INAO_TOKEN_ENDPOINT:
'https://login.microsoftonline.com/05a20268-aaea-4bb5-bb78-960b0462185e/oauth2/v2.0/token',
ELECTRONIC_REGISTRATION_STATISTICS_API_URL: {
dev: 'https://api-staging.thinglysing.is/business/tolfraedi',
staging: 'https://api-staging.thinglysing.is/business/tolfraedi',
prod: 'https://api.thinglysing.is/business/tolfraedi',
},
FORM_SYSTEM_API_BASE_PATH: {
dev: 'https://profun.island.is/umsoknarkerfi',
staging: '',
Expand Down Expand Up @@ -447,6 +443,7 @@ export const serviceSetup = (services: {
HealthDirectorateOrganDonation,
HealthDirectorateVaccination,
WorkAccidents,
SecondarySchool,
)
.files({ filename: 'islyklar.p12', env: 'ISLYKILL_CERT' })
.ingress({
Expand Down
8 changes: 4 additions & 4 deletions apps/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { DrivingLicenseBookModule } from '@island.is/api/domains/driving-license
import { EducationModule } from '@island.is/api/domains/education'
import { EducationV2Module } from '@island.is/api/domains/education'
import { SocialInsuranceModule } from '@island.is/api/domains/social-insurance'
import { ElectronicRegistrationsModule } from '@island.is/api/domains/electronic-registration-statistics'
import {
EmailSignupModule,
ZenterSignupConfig,
Expand Down Expand Up @@ -90,7 +89,6 @@ import { ConsultationPortalClientConfig } from '@island.is/clients/consultation-
import { DisabilityLicenseClientConfig } from '@island.is/clients/disability-license'
import { DrivingLicenseApiConfig } from '@island.is/clients/driving-license'
import { DrivingLicenseBookClientConfig } from '@island.is/clients/driving-license-book'
import { ElectronicRegistrationsClientConfig } from '@island.is/clients/electronic-registration-statistics'
import { EnergyFundsClientConfig } from '@island.is/clients/energy-funds'
import { FinanceClientConfig } from '@island.is/clients/finance'
import { FinancialStatementsInaoClientConfig } from '@island.is/clients/financial-statements-inao'
Expand Down Expand Up @@ -204,6 +202,8 @@ import { UmbodsmadurSkuldaraModule } from '@island.is/api/domains/umbodsmadur-sk
import { UmbodsmadurSkuldaraClientConfig } from '@island.is/clients/ums-cost-of-living-calculator'
import { emailModuleConfig } from '@island.is/email-service'
import { ZendeskServiceConfig } from '@island.is/clients/zendesk'
import { SecondarySchoolClientConfig } from '@island.is/clients/secondary-school'
import { SecondarySchoolApiModule } from '@island.is/api/domains/secondary-school'

const environment = getConfig

Expand Down Expand Up @@ -292,7 +292,6 @@ const environment = getConfig
HealthDirectorateClientModule,
OfficialJournalOfIcelandClientModule,
DisabilityLicenseModule,
ElectronicRegistrationsModule,
FiskistofaModule,
WatsonAssistantChatModule,
IcelandicGovernmentInstitutionVacanciesModule,
Expand Down Expand Up @@ -342,6 +341,7 @@ const environment = getConfig
LawAndOrderModule,
UmbodsmadurSkuldaraModule,
HealthDirectorateModule,
SecondarySchoolApiModule,
ConfigModule.forRoot({
isGlobal: true,
load: [
Expand Down Expand Up @@ -382,7 +382,6 @@ const environment = getConfig
IdsClientConfig,
NationalRegistryClientConfig,
SyslumennClientConfig,
ElectronicRegistrationsClientConfig,
XRoadConfig,
MunicipalitiesFinancialAidConfig,
SocialInsuranceAdministrationClientConfig,
Expand Down Expand Up @@ -442,6 +441,7 @@ const environment = getConfig
WorkAccidentClientConfig,
ZendeskServiceConfig,
emailModuleConfig,
SecondarySchoolClientConfig,
],
}),
],
Expand Down
2 changes: 2 additions & 0 deletions apps/application-system/api/infra/application-system-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
HealthDirectorateOrganDonation,
WorkAccidents,
NationalRegistryB2C,
SecondarySchool,
} from '../../../../infra/src/dsl/xroad'

export const GRAPHQL_API_URL_ENV_VAR_NAME = 'GRAPHQL_API_URL' // This property is a part of a circular dependency that is treated specially in certain deployment types
Expand Down Expand Up @@ -312,6 +313,7 @@ export const serviceSetup = (services: {
HealthDirectorateVaccination,
HealthDirectorateOrganDonation,
WorkAccidents,
SecondarySchool,
)
.secrets({
NOVA_URL: '/k8s/application-system-api/NOVA_URL',
Expand Down
5 changes: 5 additions & 0 deletions apps/application-system/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
"glob": "*",
"input": "libs/application/template-api-modules/src/lib/modules/templates/aosh/transfer-of-machine-ownership/emailGenerators/assets",
"output": "./aosh-transfer-of-machine-ownership-assets"
},
{
"glob": "*",
"input": "libs/application/template-api-modules/src/lib/modules/templates/secondary-school/emailGenerators/assets",
"output": "./secondary-school-assets"
}
],
"webpackConfig": "apps/application-system/api/webpack.config.js",
Expand Down
2 changes: 2 additions & 0 deletions apps/application-system/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import { emailModuleConfig } from '@island.is/email-service'
import { sharedModuleConfig } from '@island.is/application/template-api-modules'
import { UserNotificationClientConfig } from '@island.is/clients/user-notification'
import { NationalRegistryV3ClientConfig } from '@island.is/clients/national-registry-v3'
import { SecondarySchoolClientConfig } from '@island.is/clients/secondary-school'

@Module({
imports: [
Expand Down Expand Up @@ -123,6 +124,7 @@ import { NationalRegistryV3ClientConfig } from '@island.is/clients/national-regi
sharedModuleConfig,
UserNotificationClientConfig,
NationalRegistryV3ClientConfig,
SecondarySchoolClientConfig,
],
}),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import { ApiScope } from '@island.is/auth/scopes'
import { FinanceClientService } from '@island.is/clients/finance'
import { AuditService } from '@island.is/nest/audit'
import {
Body,
Controller,
Header,
Param,
Post,
Res,
UseGuards,
Query,
} from '@nestjs/common'
import { ApiOkResponse } from '@nestjs/swagger'
import { Response } from 'express'
Expand All @@ -39,19 +39,20 @@ export class FinanceDocumentController {
@CurrentUser() user: User,
@Res() res: Response,
@Param('pdfId') pdfId: string,
@Body('annualDoc') annualDoc?: string,
@Query('action') action?: string,
) {
const documentResponse = annualDoc
? await this.financeService.getAnnualStatusDocument(
user.nationalId,
pdfId,
user,
)
: await this.financeService.getFinanceDocument(
user.nationalId,
pdfId,
user,
)
const documentResponse =
action === 'annualDoc'
? await this.financeService.getAnnualStatusDocument(
user.nationalId,
pdfId,
user,
)
: await this.financeService.getFinanceDocument(
user.nationalId,
pdfId,
user,
)

const documentBase64 = documentResponse?.docment?.document

Expand Down
2 changes: 2 additions & 0 deletions apps/judicial-system/backend/infra/judicial-system-backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export const serviceSetup = (): ServiceBuilder<'judicial-system-backend'> =>
PRISON_ADMIN_EMAIL: '/k8s/judicial-system/PRISON_ADMIN_EMAIL',
PRISON_ADMIN_INDICTMENT_EMAILS:
'/k8s/judicial-system/PRISON_ADMIN_INDICTMENT_EMAILS',
PUBLIC_PROSECUTOR_CRIMINAL_RECORDS_EMAIL:
'/k8s/judicial-system/PUBLIC_PROSECUTOR_CRIMINAL_RECORDS_EMAIL',
AUTH_JWT_SECRET: '/k8s/judicial-system/AUTH_JWT_SECRET',
ADMIN_USERS: '/k8s/judicial-system/ADMIN_USERS',
BACKEND_ACCESS_TOKEN: '/k8s/judicial-system/BACKEND_ACCESS_TOKEN',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ export const notifications = {
defaultMessage: 'Landsréttur',
description: 'Nafn á Landsrétti í tölvupóstum',
},
publicProsecutorCriminalRecords: {
id: 'judicial.system.backend:notifications.email_names.public_prosecutor_criminal_records',
defaultMessage: 'Ritari sakaskrár',
description: 'Nafn á ritara sakaskrá í tölvupóstum',
},
}),
COAJudgeAssigned: defineMessages({
subject: {
Expand Down Expand Up @@ -837,9 +842,9 @@ export const notifications = {
description: 'Fyrirsögn í pósti til dómstóls þegar ákæra er afturkölluð',
},
body: {
id: 'judicial.system.backend:notifications.court_revoked_indictment_email.body',
id: 'judicial.system.backend:notifications.court_revoked_indictment_email.body_v1',
defaultMessage:
'{prosecutorsOffice} hefur afturkallað ákæru {courtCaseNumber, select, NONE {í máli sem ekki hefur enn fengið málsnúmer} other {í máli {courtCaseNumber}}}.',
'{prosecutorsOffice} hefur afturkallað ákæru í máli {caseNumber}.',
description: 'Texti í pósti til dómstóls þegar ákæra er afturkölluð',
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,17 @@ export class CaseService {
type: MessageType.DELIVERY_TO_COURT_INDICTMENT_CANCELLATION_NOTICE,
user,
caseId: theCase.id,
// Upon case cancellation, we send the same notification type to:
// (1) relevant court emails
// (2) court system (via robot).
//
// When a case is revoked without a court case number, we send email (1).
// The court must then add the case number in the system, triggering notification (2) for full cancellation.
//
// The court system requires a case number before posting data via robot, so it must be added despite the cancellation.
// Notifications (1) and (2) must match, thus we use the flag below to ensure the same message is sent.
// Without the flag, email (2) would get notification including the court case number.
// For more context: https://github.com/island-is/island.is/pull/17385/files#r1904268032
body: { withCourtCaseNumber: false },
})
}
Expand Down Expand Up @@ -1069,7 +1080,7 @@ export class CaseService {
)
}

private addMessagesForRevokedIndictmentCaseToQueue(
private async addMessagesForRevokedIndictmentCaseToQueue(
theCase: Case,
user: TUser,
): Promise<void> {
Expand All @@ -1084,6 +1095,22 @@ export class CaseService {
})
}

// Commented out temporarily because police endpoint is not ready to receive revocation
// const subpoenasToRevoke = await this.subpoenaService.findByCaseId(
// theCase.id,
// )

// if (subpoenasToRevoke?.length > 0) {
// messages.push(
// ...subpoenasToRevoke.map((subpoena) => ({
// type: MessageType.DELIVERY_TO_POLICE_SUBPOENA_REVOCATION,
// user,
// caseId: theCase.id,
// elementId: [subpoena.defendantId, subpoena.id],
// })),
// )
// }

return this.messageService.sendMessagesToQueue(messages)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,23 +672,24 @@ export class InternalCaseService {
): Promise<DeliverResponse> {
await this.refreshFormatMessage()

const courtCaseNumber = withCourtCaseNumber && theCase.courtCaseNumber
const caseNumber = courtCaseNumber || theCase.policeCaseNumbers.join(', ')

return this.courtService
.updateIndictmentCaseWithCancellationNotice(
user,
theCase.id,
theCase.court?.name,
theCase.courtCaseNumber,
this.formatMessage(notifications.courtRevokedIndictmentEmail.subject, {
courtCaseNumber:
(withCourtCaseNumber && theCase.courtCaseNumber) || 'NONE',
courtCaseNumber: courtCaseNumber || 'NONE',
}),
stripHtmlTags(
`${this.formatMessage(
notifications.courtRevokedIndictmentEmail.body,
{
prosecutorsOffice: theCase.creatingProsecutor?.institution?.name,
courtCaseNumber:
(withCourtCaseNumber && theCase.courtCaseNumber) || 'NONE',
caseNumber,
},
)} ${this.formatMessage(notifications.emailTail)}`,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ describe('InternalCaseController - Deliver indictment cancellation notice to cou
const courtName = uuid()
const courtCaseNumber = uuid()
const prosecutorsOffice = uuid()
const policeCase1 = '007-2022-01'
const policeCase2 = '007-2022-02'

const policeCaseNumbers = [policeCase1, policeCase2]

const theCase = {
id: caseId,
type: CaseType.INDICTMENT,
creatingProsecutor: { institution: { name: prosecutorsOffice } },
court: { name: courtName },
courtCaseNumber,
policeCaseNumbers,
} as Case

let mockCourtService: CourtService
Expand Down Expand Up @@ -88,7 +93,7 @@ describe('InternalCaseController - Deliver indictment cancellation notice to cou
})
})

describe('deliver cancellation notice without court case number', () => {
describe('deliver cancellation notice with police case numbers', () => {
let then: Then

beforeAll(async () => {
Expand All @@ -104,7 +109,7 @@ describe('InternalCaseController - Deliver indictment cancellation notice to cou
courtName,
courtCaseNumber,
'Ákæra afturkölluð',
`${prosecutorsOffice} hefur afturkallað ákæru í máli sem ekki hefur enn fengið málsnúmer. Hægt er að nálgast yfirlitssíðu málsins á rettarvorslugatt.island.is.`,
`${prosecutorsOffice} hefur afturkallað ákæru í máli ${policeCase1}, ${policeCase2}. Hægt er að nálgast yfirlitssíðu málsins á rettarvorslugatt.island.is.`,
)

expect(then.result).toEqual({ delivered: true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export const notificationModuleConfig = defineConfig({
'PRISON_ADMIN_INDICTMENT_EMAILS',
'',
),
publicProsecutorCriminalRecordsEmail: env.required(
'PUBLIC_PROSECUTOR_CRIMINAL_RECORDS_EMAIL',
'',
),
courtsEmails: env.requiredJSON('COURTS_EMAILS', {}) as {
[key: string]: string
},
Expand Down
Loading

0 comments on commit d84ceed

Please sign in to comment.