Skip to content

Commit

Permalink
Merge branch 'master' into feature/rina-cdm
Browse files Browse the repository at this point in the history
  • Loading branch information
MariamPervez committed Jun 7, 2024
2 parents 4740027 + db2c9d4 commit 16d93a5
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bygg_branch_og_publiser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
bygg_og_publiser:
name: 'Bygg branch og publiser image'
permissions:
contents: "write"
contents: "read"
id-token: "write"
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bygg_mainline_og_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
bygg_deploy_dev_publiser_tag:
name: 'Bygg, publiser, deploy DEV, tag og dispatch deploy til PROD'
permissions:
contents: "write"
contents: "read"
id-token: "write"
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ jobs:
- name: 'Deploy image'
run: echo "IMAGE=${{ steps.docker-push.outputs.image }}"

- name: 'Deploy to DEV Q1'
- name: 'Deploy to DEV Q2 med Q1 RINA'
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/dev-gcp-q1.yml
RESOURCE: nais/dev-gcp.yml
IMAGE: ${{ steps.docker-push.outputs.image }}

- name: 'Opprett git tag'
Expand Down
24 changes: 12 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
buildscript {

ext {
kotlinVersion = '1.9.23'
kotlinVersion = '1.9.24'
springBootVersion = '3.2.5'
springKafkaVersion = '3.1.4'
springfoxVersion = '3.0.0'
jacksonModuleKotlinVersion = '2.17.0'
jacksonModuleKotlinVersion = '2.17.1'
tokenSupportVersion = '4.1.4'
}
}
Expand Down Expand Up @@ -35,7 +35,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-actuator")

// Spring Framework BOM-fil overstyrer så vi får siste patch-versjon av Spring Framework
implementation(platform("org.springframework:spring-framework-bom:6.1.6"))
implementation(platform("org.springframework:spring-framework-bom:6.1.8"))

implementation("org.yaml:snakeyaml:2.2") // Pga https://security.snyk.io/package/maven/org.yaml:snakeyaml

Expand All @@ -59,36 +59,36 @@ dependencies {
implementation("no.nav.security:token-validation-spring:${tokenSupportVersion}")
implementation("no.nav.security:token-validation-jaxrs:${tokenSupportVersion}")

implementation ("no.nav.common:token-client:3.2024.04.10_12.03-fddb587e3a68")
implementation ("no.nav.common:token-client:3.2024.04.22_13.50-7815154a2573")
implementation("org.springframework.kafka:spring-kafka:${springKafkaVersion}")

//GCP
implementation("com.google.cloud:google-cloud-storage:2.37.0")
implementation("com.google.cloud:google-cloud-storage:2.38.0")

implementation("no.nav.eessi.pensjon:ep-metrics:2.0.62")
implementation("no.nav.eessi.pensjon:ep-logging:2.1.62")
implementation("no.nav.eessi.pensjon:ep-eux:2.2.39")
implementation("no.nav.eessi.pensjon:ep-kodeverk:4.0.136") {
implementation("no.nav.eessi.pensjon:ep-metrics:2.0.65")
implementation("no.nav.eessi.pensjon:ep-logging:2.1.64")
implementation("no.nav.eessi.pensjon:ep-eux:2.2.47")
implementation("no.nav.eessi.pensjon:ep-kodeverk:4.0.143") {
exclude module: 'ep-eux'
exclude module: 'ep-logging'
exclude module: 'ep-metrics'
}

implementation("no.nav.eessi.pensjon:ep-personoppslag:13.1.111") {
implementation("no.nav.eessi.pensjon:ep-personoppslag:13.1.125") {
exclude module: 'ep-eux'
exclude module: 'ep-logging'
exclude module: 'ep-metrics'
}

implementation("no.nav.eessi.pensjon:ep-pensjonsinformasjon:3.0.113") {
implementation("no.nav.eessi.pensjon:ep-pensjonsinformasjon:3.0.125") {
exclude module: 'ep-eux'
exclude module: 'ep-logging'
exclude module: 'ep-metrics'
}

implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation('org.glassfish.jaxb:jaxb-runtime:2.3.3')
implementation("no.nav.tjenestespesifikasjoner:pensjonsinformasjon-v1-tjenestespesifikasjon:2618.0448179")
implementation("no.nav.tjenestespesifikasjoner:pensjonsinformasjon-v1-tjenestespesifikasjon:2633.1685ed5")

testImplementation("no.nav.security:token-validation-spring-test:${tokenSupportVersion}")

Expand Down
10 changes: 5 additions & 5 deletions nais/dev-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ spec:
- host: saf-q2.dev-fss-pub.nais.io
- host: pdl-api.dev-fss-pub.nais.io
- host: kodeverk-api.nav.no
- host: eux-rina-api-q2.dev-fss-pub.nais.io
- host: rina-ss1-q.adeo.no
- host: eux-rina-api-q1.dev-fss-pub.nais.io
- host: rina-ss4-q.adeo.no
inbound:
rules:
- application: eessi-pensjon-frontend-ui-q2
Expand All @@ -72,11 +72,11 @@ spec:
- name: PENSJONSINFORMASJON_URL
value: https://eessi-pensjon-onprem-proxy-q2.dev-fss-pub.nais.io/pen/api/pensjonsinformasjon/v1
- name: EESSIPEN_EUX_RINA_URL
value: https://eux-rina-api-q2.dev-fss-pub.nais.io/cpi
value: https://eux-rina-api-q1.dev-fss-pub.nais.io/cpi
- name: EESSIPENSJON_PREFILL_GCP_URL
value: https://eessi-pensjon-prefill-q2.intern.dev.nav.no
- name: RINA_HOST_URL
value: rina-ss1-q.adeo.no
value: rina-ss4-q.adeo.no
- name: SAF_GRAPHQL_URL
value: https://saf-q2.dev-fss-pub.nais.io/graphql
- name: SAF_HENTDOKUMENT_URL
Expand All @@ -96,7 +96,7 @@ spec:
- name: AZURE_APP_PREFILL_CLIENT_ID
value: dev-gcp.eessipensjon.eessi-pensjon-prefill-q2
- name: AZURE_APP_EUX_CLIENT_ID
value: dev-fss.eessibasis.eux-rina-api-q2
value: dev-fss.eessibasis.eux-rina-api-q1
- name: AZURE_APP_PROXY_CLIENT_ID
value: dev-fss.eessipensjon.eessi-pensjon-onprem-proxy-q2
- name: AZURE_APP_KODEVERK_CLIENT_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class PrefillController(
return createBuc(buctype).also {
gcpStorageService.lagre(it.caseId, GjennySak(gjennySak?.sakId!!, gjennySak.sakType))
}

}

private fun addInstitution(request: ApiRequest, dataModel: PrefillDataModel, bucUtil: BucUtils) {
Expand All @@ -101,9 +100,6 @@ class PrefillController(
""".trimIndent())

if (x005docs.isEmpty()) {
if (request.gjenny){
request.euxCaseId?.let {gcpStorageService.lagre(request.euxCaseId, GjennySak(request.sakId!!, request.sakType!!)) }
}
euxPrefillService.checkAndAddInstitution(dataModel, bucUtil, emptyList(), nyeInstitusjoner)
} else if (x005docs.firstOrNull { it.status == "empty"} != null ) {
val x005Liste = nyeInstitusjoner.map { nyeInstitusjonerMap ->
Expand All @@ -128,8 +124,8 @@ class PrefillController(
"sedType: ${request.sed} " +
"aktoerId: ${request.aktoerId} " +
"sakId: ${request.sakId} " +
"vedtak: ${request.vedtakId}" +
"institusjoner: ${request.institutions}",
"vedtak: ${request.vedtakId} " +
"institusjoner: ${request.institutions} " +
"gjenny: ${request.gjenny}"
)

Expand All @@ -146,6 +142,10 @@ class PrefillController(
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Rina Buctype og request buctype må være samme")
}

if (request.gjenny){
request.euxCaseId?.let {gcpStorageService.lagre(request.euxCaseId, GjennySak(request.sakId!!, request.sakType!!)) }
}

logger.debug("bucUtil BucType: ${bucUtil.getBuc().processDefinitionName} apiRequest Buc: ${request.buc}")

//AddInstitution
Expand Down Expand Up @@ -196,7 +196,7 @@ class PrefillController(
logger.info("******* Hent BUC sjekk om svarSed kan opprettes *******")
BucUtils(euxInnhentingService.getBuc(dataModel.euxCaseID)).also { bucUtil ->
//sjekk for om deltakere alt er fjernet med x007 eller x100 sed
bucUtil.checkForParticipantsNoLongerActiveFromXSEDAsInstitusjonItem(dataModel.getInstitutionsList())
// bucUtil.checkForParticipantsNoLongerActiveFromXSEDAsInstitusjonItem(dataModel.getInstitutionsList())
//sjekk om en svarsed kan opprettes eller om den alt finnes
bucUtil.isChildDocumentByParentIdBeCreated(parentId, dataModel.sedType)
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/no/nav/eessi/pensjon/fagmodul/eux/BucUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class BucUtils(private val buc: Buc) {

fun getParticipants() = buc.participants ?: emptyList()

fun checkForParticipantsNoLongerActiveFromXSEDAsInstitusjonItem(list: List<InstitusjonItem>): Boolean {
/* fun checkForParticipantsNoLongerActiveFromXSEDAsInstitusjonItem(list: List<InstitusjonItem>): Boolean {
val result = try {
logger.debug("Sjekk på om newInstitusjonItem er dekativert ved mottatt x100")
val newlistId = list.map { it.institution }
Expand All @@ -318,7 +318,7 @@ class BucUtils(private val buc: Buc) {
}
return true
}

*/
fun getGyldigeOpprettSedAksjonList() : List<SedType> {
val action = getRinaAksjon()
return action.filter { it.operation == ActionOperation.Create }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import no.nav.eessi.pensjon.eux.model.InstitusjonDetalj
import no.nav.eessi.pensjon.eux.model.SedType
import no.nav.eessi.pensjon.eux.model.buc.*
import no.nav.eessi.pensjon.eux.model.document.P6000Dokument
import no.nav.eessi.pensjon.eux.model.sed.KravType
import no.nav.eessi.pensjon.eux.model.sed.Person
import no.nav.eessi.pensjon.eux.model.sed.SED
import no.nav.eessi.pensjon.eux.model.sed.X009
Expand Down Expand Up @@ -278,7 +279,7 @@ class EuxInnhentingService (@Value("\${ENV}") private val environment: String,
val annenperson = sed.nav?.annenperson?.person
val rolle = annenperson?.rolle
val type = sed.pensjon?.kravDato?.type
return if (type == "02" || rolle == "01") {
return if (type == KravType.GJENLEV || rolle == "01") {
filterPinGjenlevendePin(annenperson, sed.type, rinaidAvdod)
} else {
null
Expand Down Expand Up @@ -502,7 +503,7 @@ class EuxInnhentingService (@Value("\${ENV}") private val environment: String,
logger.info("******* Hent BUC sjekk om sed kan opprettes *******")
return BucUtils(getBuc(dataModel.euxCaseID)).also { bucUtil ->
//sjekk for om deltakere alt er fjernet med x007 eller x100 sed
bucUtil.checkForParticipantsNoLongerActiveFromXSEDAsInstitusjonItem(dataModel.getInstitutionsList())
// bucUtil.checkForParticipantsNoLongerActiveFromXSEDAsInstitusjonItem(dataModel.getInstitutionsList())
//gyldig sed kan opprettes
bucUtil.checkIfSedCanBeCreated(dataModel.sedType, dataModel.penSaksnummer)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ internal class PrefillControllerTest {
return X005(xnav = XNav(sak = Navsak(leggtilinstitusjon = Leggtilinstitusjon(institusjon = InstitusjonX005(id = newParticipants.institution, navn = newParticipants.name ?: "" ))))).toJson()
}

@Test
/* @Test
fun `call addInstutionAndDocument mock check on X007 will fail on matching newparticipants with exception`() {
val euxCaseId = "1234567890"
Expand Down Expand Up @@ -274,7 +274,7 @@ internal class PrefillControllerTest {
}
verify(exactly = 1 ) { mockEuxInnhentingService.getBuc(any()) }
}
}*/

@Test
fun `call addInstutionAndDocument add newInstitusjonItem on empty buc NAV is caseOwner`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class BucUtilsTest {
assertEquals(0, bucUtils.findNewParticipants(candidates).size)
}

@Test
/* @Test
fun `sjekk deltakere mot buc og om den er fjernet i x007`() {
val bucjson = getTestJsonFile("buc-4929378.json")
val buc = mapJsonToAny<Buc>(bucjson)
Expand All @@ -387,9 +387,9 @@ class BucUtilsTest {
FI_INSTITUSJON, "")))
assertEquals(true, result)
}
}*/

@Test
/* @Test
fun `sjekk for om x100 inneholder avsender ikke lenger i bruk`() {
val bucjson = getTestJsonFile("buc-3059699-x100.json")
val buc = mapJsonToAny<Buc>(bucjson)
Expand All @@ -403,7 +403,7 @@ class BucUtilsTest {
val result = bucUtils.checkForParticipantsNoLongerActiveFromXSEDAsInstitusjonItem(listOf(InstitusjonItem(FI, FI_INSTITUSJON, "")))
assertEquals(true, result)
}
}*/

@Test
fun findNewParticipantsMockwithExternalCaseOwnerResultExpectedToBeZero(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.CsvSource
import org.skyscreamer.jsonassert.JSONAssert
import org.skyscreamer.jsonassert.JSONCompareMode
import org.springframework.http.HttpStatus
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig
import org.springframework.web.client.HttpClientErrorException
Expand Down Expand Up @@ -364,11 +366,85 @@ internal class EuxInnhentingServiceTest {
every { euxKlient.getSedOnBucByDocumentIdNotAsSystemUser(any(), any(), any()) } returns x009Json

val json = euxInnhentingService.checkForX010AndAddX009(apiRequest, "20000000")
val payload = """
"{\n \"sed\" : \"X009\",\n \"nav\" : {\n \"sak\" : {\n \"kontekst\" : {\n \"bruker\" : {\n \"mor\" : null,\n \"far\" : null,\n \"person\" : {\n \"pin\" : null,\n \"pinland\" : null,\n \"statsborgerskap\" : null,\n \"etternavn\" : \"æøå\",\n \"etternavnvedfoedsel\" : null,\n \"fornavn\" : \"æøå\",\n \"fornavnvedfoedsel\" : null,\n \"tidligerefornavn\" : null,\n \"tidligereetternavn\" : null,\n \"kjoenn\" : \"M\",\n \"foedested\" : null,\n \"foedselsdato\" : \"æøå\",\n \"sivilstand\" : null,\n \"relasjontilavdod\" : null,\n \"rolle\" : null,\n \"kontakt\" : null\n },\n \"adresse\" : null,\n \"arbeidsforhold\" : null,\n \"bank\" : null\n },\n \"refusjonskrav\" : {\n \"antallkrav\" : \"æøå\",\n \"id\" : \"æøå\"\n },\n \"arbeidsgiver\" : {\n \"identifikator\" : [ {\n \"id\" : \"æøå\",\n \"type\" : \"registrering\"\n } ],\n \"adresse\" : {\n \"gate\" : \"æøå\",\n \"bygning\" : \"æøå\",\n \"by\" : \"æøå\",\n \"postnummer\" : \"æøå\",\n \"postkode\" : null,\n \"region\" : \"æøå\",\n \"land\" : \"NO\",\n \"kontaktpersonadresse\" : null,\n \"datoforadresseendring\" : null,\n \"postadresse\" : null,\n \"startdato\" : null,\n \"type\" : null,\n \"annen\" : null\n },\n \"navn\" : \"æøå\"\n }\n },\n \"leggtilinstitusjon\" : null,\n \"paaminnelse\" : {\n \"svar\" : null,\n \"sende\" : [ {\n \"type\" : \"dokument\",\n \"detaljer\" : \"æøå\"\n } ]\n }\n }\n },\n \"sedGVer\" : \"4\",\n \"sedVer\" : \"2\",\n \"pensjon\" : null\n}"
""".trimIndent()
JSONAssert.assertEquals(json.payload, payload(), JSONCompareMode.LENIENT)
}

assert(json.toJson().contains(payload))
private fun payload(): String {
val payload = """
{
"sed" : "X009",
"nav" : {
"sak" : {
"kontekst" : {
"bruker" : {
"mor" : null,
"far" : null,
"person" : {
"pin" : null,
"pinland" : null,
"statsborgerskap" : null,
"etternavn" : "æøå",
"etternavnvedfoedsel" : null,
"fornavn" : "æøå",
"fornavnvedfoedsel" : null,
"tidligerefornavn" : null,
"tidligereetternavn" : null,
"kjoenn" : "M",
"foedested" : null,
"foedselsdato" : "æøå",
"sivilstand" : null,
"relasjontilavdod" : null,
"rolle" : null,
"kontakt" : null,
"doedsdato" : null
},
"adresse" : null,
"arbeidsforhold" : null,
"bank" : null
},
"refusjonskrav" : {
"antallkrav" : "æøå",
"id" : "æøå"
},
"arbeidsgiver" : {
"identifikator" : [ {
"id" : "æøå",
"type" : "registrering"
} ],
"adresse" : {
"gate" : "æøå",
"bygning" : "æøå",
"by" : "æøå",
"postnummer" : "æøå",
"postkode" : null,
"region" : "æøå",
"land" : "NO",
"kontaktpersonadresse" : null,
"datoforadresseendring" : null,
"postadresse" : null,
"startdato" : null,
"type" : null,
"annen" : null
},
"navn" : "æøå"
}
},
"leggtilinstitusjon" : null,
"paaminnelse" : {
"svar" : null,
"sende" : [ {
"type" : "dokument",
"detaljer" : "æøå"
} ]
}
}
},
"sedGVer" : "4",
"sedVer" : "2",
"pensjon" : null
}
""".trimIndent()
return payload
}

@Test
Expand Down

0 comments on commit 16d93a5

Please sign in to comment.