Skip to content

Commit

Permalink
feat(universities): add university clients (#14075)
Browse files Browse the repository at this point in the history
* feat: init

* feat: lhbi

* fix: remove lbhi

* feat: init

* feat: init

* feat: init

* feat: generate

* feat: generate

* feat: generate

* chore: prettier

* feat: generate

* feat: add service nad generate

* feat: move into

* feat: gen

* feat: rem and gen again

* fix: n again

* feat: gen

* feat: move

* feat: rem and gen

* feat: gen

* feat: gen

* feat: one client

* fix: compatibiliy

* chore: remove old

* chore: charts update dirty files

* feat: gen api domain

* feat: add to domain

* chore/update-codeowners

* feat: gql finagling

* fix: imports

* chore: codeowners

* fix: codeowenrs

* chore:lint

* fix: build

* fix: scope

* feat: change graphql model

* fix: enum

* fix: loading

* chore: clean up

* feat: detail works

* fix: organization mapping

* chore: nx format:write update dirty files

* chore: add xroad def to infra

* chore: charts update dirty files

* chore: fix env name

* feat: clean up intro headers

* fix: module imports

* fix: logos

* feat: logo fix

* feat: better mapping

* fix: type error

* chore: nx format:write update dirty files

* feat: add warning screen if no transcripts

* fix: remove logging import

* fix: remove logging

* fix: import

* fix: no match

* fix: update image url

* chore: clean up

---------

Co-authored-by: Þorkell Máni Þorkelsson <[email protected]>
Co-authored-by: andes-it <[email protected]>
  • Loading branch information
3 people authored May 7, 2024
1 parent e8f2a0a commit f7738d0
Show file tree
Hide file tree
Showing 114 changed files with 2,956 additions and 925 deletions.
7 changes: 3 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ codemagic.yaml
/libs/api/domains/user-profile/ @island-is/hugsmidjan @island-is/juni @island-is/aranja
/libs/api/domains/passport/ @island-is/hugsmidjan
/libs/api/domains/vehicles/ @island-is/hugsmidjan
/libs/api/domains/university-of-iceland/ @island-is/hugsmidjan
/libs/api/domains/university-careers/ @island-is/hugsmidjan
/libs/api/domains/regulations/ @island-is/hugsmidjan
/libs/api/domains/regulations-admin/ @island-is/hugsmidjan
/libs/api/domains/rights-portal @island-is/hugsmidjan
Expand Down Expand Up @@ -176,7 +176,7 @@ codemagic.yaml
/libs/clients/passports/ @island-is/hugsmidjan
/libs/clients/p-card/ @island-is/hugsmidjan
/libs/clients/assets/ @island-is/hugsmidjan
/libs/clients/university-of-iceland/ @island-is/hugsmidjan
/libs/clients/university-careers/ @island-is/hugsmidjan
/libs/clients/regulations-admin/ @island-is/hugsmidjan
/libs/clients/inna/ @island-is/hugsmidjan
/libs/clients/hms-loans/ @island-is/hugsmidjan
Expand All @@ -191,7 +191,6 @@ codemagic.yaml
/libs/portals/admin/air-discount-scheme @island-is/hugsmidjan
/libs/application/templates/official-journal-of-iceland/ @island-is/hugsmidjan
/libs/application/template-api-modules/src/lib/modules/templates/official-journal-of-iceland/ @island-is/hugsmidjan

/libs/application/templates/data-protection-complaint/ @island-is/norda
/libs/application/templates/institution-collaboration/ @island-is/norda @island-is/fuglar
/libs/application/templates/login-service/ @island-is/norda
Expand All @@ -213,7 +212,7 @@ codemagic.yaml
/libs/clients/rsk/company-registry @island-is/norda
/libs/clients/althingi-ombudsman/ @island-is/norda
/libs/api/domains/company-registry @island-is/norda
/libs/clients/icelandic-health-insurance/health-insurance/ @island-is/norda @island-is/norda
/libs/clients/icelandic-health-insurance/health-insurance/ @island-is/norda
/libs/clients/data-protection-complaint/ @island-is/norda
/libs/clients/fishing-license/ @island-is/norda
/libs/api/domains/fishing-license/ @island-is/norda
Expand Down
2 changes: 2 additions & 0 deletions apps/api/infra/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
SocialInsuranceAdministration,
IntellectualProperties,
Inna,
UniversityCareers,
OfficialJournalOfIceland,
} from '../../../infra/src/dsl/xroad'

Expand Down Expand Up @@ -412,6 +413,7 @@ export const serviceSetup = (services: {
ChargeFjsV2,
EnergyFunds,
UniversityOfIceland,
UniversityCareers,
WorkMachines,
IcelandicGovernmentInstitutionVacancies,
RskProcuring,
Expand Down
21 changes: 16 additions & 5 deletions apps/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import { StatisticsModule } from '@island.is/api/domains/statistics'
import { SyslumennModule } from '@island.is/api/domains/syslumenn'
import { TransportAuthorityApiModule } from '@island.is/api/domains/transport-authority'
import { UniversityGatewayApiModule } from '@island.is/api/domains/university-gateway'
import { UniversityOfIcelandModule } from '@island.is/api/domains/university-of-iceland'
import { UserProfileModule } from '@island.is/api/domains/user-profile'
import { VehiclesModule } from '@island.is/api/domains/vehicles'
import {
Expand Down Expand Up @@ -96,6 +95,7 @@ import { FirearmLicenseClientConfig } from '@island.is/clients/firearm-license'
import { FishingLicenseClientConfig } from '@island.is/clients/fishing-license'
import { FiskistofaClientConfig } from '@island.is/clients/fiskistofa'
import { AircraftRegistryClientConfig } from '@island.is/clients/aircraft-registry'
import { UniversityCareersModule } from '@island.is/api/domains/university-careers'
import { UserNotificationClientConfig } from '@island.is/clients/user-notification'
import {
HealthDirectorateClientConfig,
Expand Down Expand Up @@ -134,14 +134,14 @@ import { ShipRegistryClientConfig } from '@island.is/clients/ship-registry'
import { SignatureCollectionClientConfig } from '@island.is/clients/signature-collection'
import { SyslumennClientConfig } from '@island.is/clients/syslumenn'
import { HuntingLicenseClientConfig } from '@island.is/clients/hunting-license'
import { UniversityOfIcelandClientConfig } from '@island.is/clients/university-of-iceland'
import { DocumentsClientV2Config } from '@island.is/clients/documents-v2'
import { VehiclesClientConfig } from '@island.is/clients/vehicles'
import { WorkMachinesClientConfig } from '@island.is/clients/work-machines'
import { CmsModule, PowerBiConfig } from '@island.is/cms'
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 {
ConfigModule,
DownloadServiceConfig,
Expand Down Expand Up @@ -170,6 +170,13 @@ import { GraphqlOptionsFactory } from './graphql-options.factory'
import { GraphQLConfig } from './graphql.config'
import { HealthController } from './health.controller'
import { DocumentClientConfig } from '@island.is/clients/documents'
import {
AgriculturalUniversityOfIcelandCareerClientConfig,
UniversityOfIcelandCareerClientConfig,
UniversityOfAkureyriCareerClientConfig,
HolarUniversityCareerClientConfig,
BifrostUniversityCareerClientConfig,
} from '@island.is/clients/university-careers'
import { HousingBenefitsConfig } from '@island.is/clients/hms-housing-benefits'
import { UserProfileClientConfig } from '@island.is/clients/user-profile'

Expand Down Expand Up @@ -270,6 +277,7 @@ const environment = getConfig
ShipRegistryModule,
IntellectualPropertiesModule,
StatisticsModule,
UniversityCareersModule,
OfficialJournalOfIcelandModule,
CompanyRegistryModule,
IcelandicNamesModule.register({
Expand Down Expand Up @@ -306,7 +314,6 @@ const environment = getConfig
MortgageCertificateModule,
TransportAuthorityApiModule,
EnergyFundsServiceModule,
UniversityOfIcelandModule,
WorkMachinesModule,
AdministrationOfOccupationalSafetyAndHealthModule,
UniversityGatewayApiModule,
Expand Down Expand Up @@ -376,7 +383,6 @@ const environment = getConfig
CommunicationsConfig,
HealthDirectorateClientConfig,
OfficialJournalOfIcelandClientConfig,
UniversityOfIcelandClientConfig,
InnaClientConfig,
SessionsApiClientConfig,
AuthAdminApiClientConfig,
Expand All @@ -389,6 +395,11 @@ const environment = getConfig
ShipRegistryClientConfig,
HousingBenefitCalculatorClientConfig,
MMSClientConfig,
AgriculturalUniversityOfIcelandCareerClientConfig,
UniversityOfIcelandCareerClientConfig,
UniversityOfAkureyriCareerClientConfig,
HolarUniversityCareerClientConfig,
BifrostUniversityCareerClientConfig,
StatisticsClientConfig,
SignatureCollectionClientConfig,
UniversityGatewayApiClientConfig,
Expand Down
2 changes: 2 additions & 0 deletions apps/download-service/infra/download-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Education,
Finance,
HealthInsurance,
UniversityCareers,
UniversityOfIceland,
Vehicles,
WorkMachines,
Expand Down Expand Up @@ -49,6 +50,7 @@ export const serviceSetup = (services: {
HealthInsurance,
Vehicles,
UniversityOfIceland,
UniversityCareers,
WorkMachines,
Education,
)
Expand Down
18 changes: 13 additions & 5 deletions apps/download-service/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ import {
VehiclesClientModule,
} from '@island.is/clients/vehicles'
import {
UniversityOfIcelandClientConfig,
UniversityOfIcelandClientModule,
} from '@island.is/clients/university-of-iceland'
AgriculturalUniversityOfIcelandCareerClientConfig,
BifrostUniversityCareerClientConfig,
HolarUniversityCareerClientConfig,
UniversityCareersClientModule,
UniversityOfAkureyriCareerClientConfig,
UniversityOfIcelandCareerClientConfig,
} from '@island.is/clients/university-careers'
import {
RegulationsClientConfig,
RegulationsClientModule,
Expand Down Expand Up @@ -73,11 +77,11 @@ import {
DocumentsClientModule,
FinanceClientModule,
VehiclesClientModule,
UniversityOfIcelandClientModule,
RegulationsAdminClientModule,
RegulationsClientModule,
WorkMachinesClientModule,
DistrictCommissionersLicensesClientModule,
UniversityCareersClientModule,
MMSClientModule,
RightsPortalClientModule,
ConfigModule.forRoot({
Expand All @@ -87,7 +91,11 @@ import {
IdsClientConfig,
XRoadConfig,
VehiclesClientConfig,
UniversityOfIcelandClientConfig,
UniversityOfIcelandCareerClientConfig,
AgriculturalUniversityOfIcelandCareerClientConfig,
UniversityOfAkureyriCareerClientConfig,
HolarUniversityCareerClientConfig,
BifrostUniversityCareerClientConfig,
RegulationsAdminClientConfig,
RegulationsClientConfig,
WorkMachinesClientConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import { ApiOkResponse } from '@nestjs/swagger'
import { Response } from 'express'
import { ApiScope } from '@island.is/auth/scopes'
import type { User } from '@island.is/auth-nest-tools'
import {
NemandiFerillFerillFileTranscriptGetLocaleEnum,
UniversityOfIcelandService,
} from '@island.is/clients/university-of-iceland'
import {
CurrentUser,
IdsUserGuard,
Expand All @@ -23,17 +19,23 @@ import {
} from '@island.is/auth-nest-tools'
import { AuditService } from '@island.is/nest/audit'
import { GetEducationGraduationDocumentDto } from './dto/getEducationGraduationDocument'
import {
UniversityCareersClientService,
UniversityIdShort,
} from '@island.is/clients/university-careers'
import { Locale } from '@island.is/shared/types'
import { UniversityShortIdMap } from '@island.is/clients/university-careers'

@UseGuards(IdsUserGuard, ScopesGuard)
@Scopes(ApiScope.education)
@Controller('education')
export class EducationController {
constructor(
private readonly universityOfIcelandApi: UniversityOfIcelandService,
private readonly universitiesApi: UniversityCareersClientService,
private readonly auditService: AuditService,
) {}

@Post('/graduation/:lang/:trackNumber')
@Post('/graduation/:lang/:university/:trackNumber')
@Header('Content-Type', 'application/pdf')
@ApiOkResponse({
content: { 'application/pdf': {} },
Expand All @@ -43,7 +45,9 @@ export class EducationController {
async getEducationGraduationPDF(
@Param('trackNumber') trackNumber: string,
@Param('lang') lang: string,
@CurrentUser() user: User,
@Param('university') uni: UniversityIdShort,
@CurrentUser()
user: User,
@Body() resource: GetEducationGraduationDocumentDto,
@Res() res: Response,
) {
Expand All @@ -52,17 +56,18 @@ export class EducationController {
authorization: `Bearer ${resource.__accessToken}`,
}

const documentResponse = await this.universityOfIcelandApi.studentCareerPDF(
const documentResponse = await this.universitiesApi.getStudentTrackPdf(
authUser,
parseInt(trackNumber),
lang as NemandiFerillFerillFileTranscriptGetLocaleEnum,
UniversityShortIdMap[uni],
lang as Locale,
)

if (documentResponse) {
this.auditService.audit({
action: 'getVehicleHistoryPdf',
action: 'getStudentTrackEducationGraduationPdf',
auth: user,
resources: trackNumber,
resources: `${trackNumber}/${lang}/${uni}`,
})

const contentArrayBuffer = await documentResponse.arrayBuffer()
Expand All @@ -71,7 +76,7 @@ export class EducationController {
res.header('Content-length', buffer.length.toString())
res.header(
'Content-Disposition',
`inline; filename=${user.nationalId}-brautskraning-${trackNumber}.pdf`,
`inline; filename=${user.nationalId}-skoli-${UniversityShortIdMap[uni]}-brautskraning-${trackNumber}.pdf`,
)
res.header('Content-Type: application/pdf')
res.header('Pragma: no-cache')
Expand Down
8 changes: 8 additions & 0 deletions charts/islandis/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,11 @@ api:
USER_NOTIFICATION_API_URL: 'http://web-user-notification.user-notification.svc.cluster.local'
USER_PROFILE_CLIENT_URL: 'http://web-service-portal-api.service-portal.svc.cluster.local'
XROAD_ADR_MACHINE_LICENSE_PATH: 'IS-DEV/GOV/10013/Vinnueftirlitid-Protected/rettindi-token-v1'
XROAD_AGRICULTURAL_UNIVERSITY_OF_ICELAND_PATH: 'IS-DEV/EDU/10056/LBHI-Protected/brautskraning-v1'
XROAD_AIRCRAFT_REGISTRY_PATH: 'IS-DEV/GOV/10017/Samgongustofa-Protected/Loftfaraskra-V1'
XROAD_BASE_PATH: 'http://securityserver.dev01.devland.is'
XROAD_BASE_PATH_WITH_ENV: 'http://securityserver.dev01.devland.is/r1/IS-DEV'
XROAD_BIFROST_UNIVERSITY_PATH: 'IS-DEV/EDU/10057/Bifrost-Protected/brautskraning-v1'
XROAD_CHARGE_FJS_V2_PATH: 'IS-DEV/GOV/10021/FJS-Public/chargeFJS_v2'
XROAD_CHARGE_FJS_V2_TIMEOUT: '20000'
XROAD_CLIENT_ID: 'IS-DEV/GOV/10000/island-is-client'
Expand All @@ -355,6 +357,7 @@ api:
XROAD_HEALTH_INSURANCE_WSDLURL: 'https://test-huld.sjukra.is/islandrg?wsdl'
XROAD_HMS_HOUSING_BENEFITS_PATH: 'IS-DEV/GOV/10033/HMS-Protected/husbot-v1'
XROAD_HMS_LOANS_PATH: 'IS-DEV/GOV/10033/HMS-Protected/libra-v1'
XROAD_HOLAR_UNIVERSITY_PATH: 'IS-DEV/EDU/10055/Holar-Protected/brautskraning-v1'
XROAD_HOUSING_BENEFIT_CALCULATOR_PATH: 'IS-DEV/GOV/10033/HMS-Protected/calc-v1'
XROAD_HUNTING_LICENSE_PATH: 'IS-DEV/GOV/10009/Umhverfisstofnun-Protected/api'
XROAD_ICELANDIC_GOVERNMENT_INSTITUTION_VACANCIES_PATH: 'IS-DEV/GOV/10021/FJS-Protected/recruitment-v1'
Expand Down Expand Up @@ -383,6 +386,7 @@ api:
XROAD_TLS_BASE_PATH: 'https://securityserver.dev01.devland.is'
XROAD_TLS_BASE_PATH_WITH_ENV: 'https://securityserver.dev01.devland.is/r1/IS-DEV'
XROAD_TR_PATH: 'IS-DEV/GOV/10008/TR-Protected/external-v1'
XROAD_UNIVERSITY_OF_AKUREYRI_PATH: 'IS-DEV/EDU/10054/UNAK-Protected/brautskraning-v1'
XROAD_UNIVERSITY_OF_ICELAND_PATH: 'IS-DEV/EDU/10010/HI-Protected/brautskraning-v1'
XROAD_VEHICLES_MILEAGE_PATH: 'IS-DEV/GOV/10017/Samgongustofa-Protected/Vehicle-Mileagereading-V1'
XROAD_VEHICLES_PATH: 'IS-DEV/GOV/10017/Samgongustofa-Protected/Mitt-Svaedi-V1'
Expand Down Expand Up @@ -1164,8 +1168,10 @@ download-service:
NODE_OPTIONS: '--max-old-space-size=460'
REGULATIONS_ADMIN_URL: 'http://web-regulations-admin-backend.regulations-admin.svc.cluster.local'
SERVERSIDE_FEATURES_ON: ''
XROAD_AGRICULTURAL_UNIVERSITY_OF_ICELAND_PATH: 'IS-DEV/EDU/10056/LBHI-Protected/brautskraning-v1'
XROAD_BASE_PATH: 'http://securityserver.dev01.devland.is'
XROAD_BASE_PATH_WITH_ENV: 'http://securityserver.dev01.devland.is/r1/IS-DEV'
XROAD_BIFROST_UNIVERSITY_PATH: 'IS-DEV/EDU/10057/Bifrost-Protected/brautskraning-v1'
XROAD_CLIENT_ID: 'IS-DEV/GOV/10000/island-is-client'
XROAD_FINANCES_PATH: 'IS-DEV/GOV/10021/FJS-Public/financeIsland'
XROAD_FINANCES_V2_PATH: 'IS-DEV/GOV/10021/FJS-Public/financeServicesFJS_v2'
Expand All @@ -1174,10 +1180,12 @@ download-service:
XROAD_HEALTH_INSURANCE_WSDLURL: 'https://test-huld.sjukra.is/islandrg?wsdl'
XROAD_HMS_HOUSING_BENEFITS_PATH: 'IS-DEV/GOV/10033/HMS-Protected/husbot-v1'
XROAD_HMS_LOANS_PATH: 'IS-DEV/GOV/10033/HMS-Protected/libra-v1'
XROAD_HOLAR_UNIVERSITY_PATH: 'IS-DEV/EDU/10055/Holar-Protected/brautskraning-v1'
XROAD_MMS_GRADE_SERVICE_ID: 'IS-DEV/EDU/10020/MMS-Protected/grade-api-v1'
XROAD_MMS_LICENSE_SERVICE_ID: 'IS-DEV/EDU/10020/MMS-Protected/license-api-v1'
XROAD_TLS_BASE_PATH: 'https://securityserver.dev01.devland.is'
XROAD_TLS_BASE_PATH_WITH_ENV: 'https://securityserver.dev01.devland.is/r1/IS-DEV'
XROAD_UNIVERSITY_OF_AKUREYRI_PATH: 'IS-DEV/EDU/10054/UNAK-Protected/brautskraning-v1'
XROAD_UNIVERSITY_OF_ICELAND_PATH: 'IS-DEV/EDU/10010/HI-Protected/brautskraning-v1'
XROAD_VEHICLES_PATH: 'IS-DEV/GOV/10017/Samgongustofa-Protected/Mitt-Svaedi-V1'
XROAD_WORK_MACHINE_LICENSE_PATH: 'IS-DEV/GOV/10013/Vinnueftirlitid-Protected/vinnuvelar-token'
Expand Down
Loading

0 comments on commit f7738d0

Please sign in to comment.