Skip to content

Commit

Permalink
Merge branch 'ci/improve-schedules' of github.com:island-is/island.is…
Browse files Browse the repository at this point in the history
… into ci/improve-schedules
  • Loading branch information
busla committed Nov 12, 2024
2 parents d079117 + 0708730 commit 6f5e58e
Show file tree
Hide file tree
Showing 284 changed files with 8,724 additions and 6,564 deletions.
7 changes: 7 additions & 0 deletions apps/api/infra/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
Vehicles,
VehicleServiceFjsV1,
VehiclesMileage,
WorkAccidents,
WorkMachines,
} from '../../../infra/src/dsl/xroad'

Expand Down Expand Up @@ -277,6 +278,11 @@ export const serviceSetup = (services: {
UNIVERSITY_GATEWAY_API_URL: ref(
(h) => `http://${h.svc(services.universityGatewayApi)}`,
),
WATSON_ASSISTANT_CHAT_FEEDBACK_DB_NAME: {
dev: 'island-is-assistant-feedback',
staging: 'island-is-assistant-feedback',
prod: 'island-is-assistant-feedback',
},
})

.secrets({
Expand Down Expand Up @@ -440,6 +446,7 @@ export const serviceSetup = (services: {
Frigg,
HealthDirectorateOrganDonation,
HealthDirectorateVaccination,
WorkAccidents,
)
.files({ filename: 'islyklar.p12', env: 'ISLYKILL_CERT' })
.ingress({
Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ import { CmsTranslationsModule } from '@island.is/cms-translations'
import { FileStorageConfig } from '@island.is/file-storage'
import { AuditModule } from '@island.is/nest/audit'
import { DocumentsClientV2Config } from '@island.is/clients/documents-v2'
import { WorkAccidentClientConfig } from '@island.is/clients/work-accident-ver'

import {
ConfigModule,
Expand Down Expand Up @@ -432,6 +433,7 @@ const environment = getConfig
CriminalRecordClientConfig,
HealthInsuranceV2ClientConfig,
UmbodsmadurSkuldaraClientConfig,
WorkAccidentClientConfig,
ZendeskServiceConfig,
emailModuleConfig,
],
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 @@ -36,6 +36,7 @@ import {
Frigg,
HealthDirectorateVaccination,
HealthDirectorateOrganDonation,
WorkAccidents,
NationalRegistryB2C,
} from '../../../../infra/src/dsl/xroad'

Expand Down Expand Up @@ -300,6 +301,7 @@ export const serviceSetup = (services: {
Frigg,
HealthDirectorateVaccination,
HealthDirectorateOrganDonation,
WorkAccidents,
)
.secrets({
NOVA_URL: '/k8s/application-system-api/NOVA_URL',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
FormValue,
ExternalData,
TemplateApi,
PdfTypes,
ApplicationStatus,
ApplicationTemplate,
ApplicationContext,
Expand Down Expand Up @@ -69,17 +68,12 @@ import { CreateApplicationDto } from './dto/createApplication.dto'
import { UpdateApplicationDto } from './dto/updateApplication.dto'
import { AddAttachmentDto } from './dto/addAttachment.dto'
import { DeleteAttachmentDto } from './dto/deleteAttachment.dto'
import { GeneratePdfDto } from './dto/generatePdf.dto'
import { PopulateExternalDataDto } from './dto/populateExternalData.dto'
import { RequestFileSignatureDto } from './dto/requestFileSignature.dto'
import { UploadSignedFileDto } from './dto/uploadSignedFile.dto'
import { ApplicationValidationService } from './tools/applicationTemplateValidation.service'
import { ApplicationSerializer } from './tools/application.serializer'
import { UpdateApplicationStateDto } from './dto/updateApplicationState.dto'
import { ApplicationResponseDto } from './dto/application.response.dto'
import { PresignedUrlResponseDto } from './dto/presignedUrl.response.dto'
import { RequestFileSignatureResponseDto } from './dto/requestFileSignature.response.dto'
import { UploadSignedFileResponseDto } from './dto/uploadSignedFile.response.dto'
import { AssignApplicationDto } from './dto/assignApplication.dto'
import { verifyToken } from './utils/tokenUtils'
import { getApplicationLifecycle } from './utils/application'
Expand Down Expand Up @@ -891,140 +885,6 @@ export class ApplicationController {
return updatedApplication
}

@Scopes(ApplicationScope.write)
@Put('applications/:id/generatePdf')
@ApiParam({
name: 'id',
type: String,
required: true,
description: 'The id of the application to create a pdf for',
allowEmptyValue: false,
})
@ApiOkResponse({ type: PresignedUrlResponseDto })
async generatePdf(
@Param('id', new ParseUUIDPipe()) id: string,
@Body() input: GeneratePdfDto,
@CurrentUser() user: User,
): Promise<PresignedUrlResponseDto> {
const existingApplication =
await this.applicationAccessService.findOneByIdAndNationalId(id, user)
const url = await this.fileService.generatePdf(
existingApplication,
input.type,
)

this.auditService.audit({
auth: user,
action: 'generatePdf',
resources: existingApplication.id,
meta: { type: input.type },
})

return { url }
}

@Scopes(ApplicationScope.write)
@Put('applications/:id/requestFileSignature')
@ApiParam({
name: 'id',
type: String,
required: true,
description:
'The id of the application which the file signature is requested for.',
allowEmptyValue: false,
})
@ApiOkResponse({ type: RequestFileSignatureResponseDto })
async requestFileSignature(
@Param('id', new ParseUUIDPipe()) id: string,
@Body() input: RequestFileSignatureDto,
@CurrentUser() user: User,
): Promise<RequestFileSignatureResponseDto> {
const existingApplication =
await this.applicationAccessService.findOneByIdAndNationalId(id, user)
const { controlCode, documentToken } =
await this.fileService.requestFileSignature(
existingApplication,
input.type,
)

this.auditService.audit({
auth: user,
action: 'requestFileSignature',
resources: existingApplication.id,
meta: { type: input.type },
})

return { controlCode, documentToken }
}

@Scopes(ApplicationScope.write)
@Put('applications/:id/uploadSignedFile')
@ApiParam({
name: 'id',
type: String,
required: true,
description: 'The id of the application which the file was created for.',
allowEmptyValue: false,
})
@ApiOkResponse({ type: UploadSignedFileResponseDto })
async uploadSignedFile(
@Param('id', new ParseUUIDPipe()) id: string,
@Body() input: UploadSignedFileDto,
@CurrentUser() user: User,
): Promise<UploadSignedFileResponseDto> {
const existingApplication =
await this.applicationAccessService.findOneByIdAndNationalId(id, user)

await this.fileService.uploadSignedFile(
existingApplication,
input.documentToken,
input.type,
)

this.auditService.audit({
auth: user,
action: 'uploadSignedFile',
resources: existingApplication.id,
meta: { type: input.type },
})

return {
documentSigned: true,
}
}

@Scopes(ApplicationScope.read)
@Get('applications/:id/:pdfType/presignedUrl')
@ApiParam({
name: 'id',
type: String,
required: true,
description: 'The id of the application which the file was created for.',
allowEmptyValue: false,
})
@ApiOkResponse({ type: PresignedUrlResponseDto })
async getPresignedUrl(
@Param('id', new ParseUUIDPipe()) id: string,
@Param('pdfType') type: PdfTypes,
@CurrentUser() user: User,
): Promise<PresignedUrlResponseDto> {
const existingApplication =
await this.applicationAccessService.findOneByIdAndNationalId(id, user)
const url = await this.fileService.getPresignedUrl(
existingApplication,
type,
)

this.auditService.audit({
auth: user,
action: 'getPresignedUrl',
resources: existingApplication.id,
meta: { type },
})

return { url }
}

@Get('applications/:id/attachments/:attachmentKey/presigned-url')
@Scopes(ApplicationScope.read)
@Documentation({
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6f5e58e

Please sign in to comment.