Skip to content

Commit

Permalink
Merge branch 'main' into dev/api-publish-med-key
Browse files Browse the repository at this point in the history
  • Loading branch information
bjerga committed Nov 21, 2024
2 parents 18aed4e + d877299 commit 10fdffe
Show file tree
Hide file tree
Showing 132 changed files with 329 additions and 332 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class HentArbeidsforholdRiver(
HentArbeidsforholdMelding(
eventName = Key.EVENT_NAME.les(EventName.serializer(), json),
behovType = Key.BEHOV.krev(BehovType.HENT_ARBEIDSFORHOLD, BehovType.serializer(), json),
transaksjonId = Key.UUID.les(UuidSerializer, json),
transaksjonId = Key.KONTEKST_ID.les(UuidSerializer, json),
data = data,
fnr = Key.FNR.les(Fnr.serializer(), data),
)
Expand All @@ -71,7 +71,7 @@ class HentArbeidsforholdRiver(

return mapOf(
Key.EVENT_NAME to eventName.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
data
.plus(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class HentArbeidsforholdRiverTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to innkommendeMelding.eventName.toJson(),
Key.UUID to innkommendeMelding.transaksjonId.toJson(),
Key.KONTEKST_ID to innkommendeMelding.transaksjonId.toJson(),
Key.DATA to
innkommendeMelding.data
.plus(Key.ARBEIDSFORHOLD to expectedArbeidsforhold.toJson(Arbeidsforhold.serializer()))
Expand Down Expand Up @@ -141,7 +141,7 @@ private object Mock {
mapOf(
Key.EVENT_NAME to eventName.toJson(),
Key.BEHOV to behovType.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to data.toJson(),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AktiveOrgnrService(

override fun lesSteg0(melding: Map<Key, JsonElement>): Steg0 =
Steg0(
transaksjonId = Key.UUID.les(UuidSerializer, melding),
transaksjonId = Key.KONTEKST_ID.les(UuidSerializer, melding),
sykmeldtFnr = Key.FNR.les(Fnr.serializer(), melding),
avsenderFnr = Key.ARBEIDSGIVER_FNR.les(Fnr.serializer(), melding),
)
Expand Down Expand Up @@ -98,7 +98,7 @@ class AktiveOrgnrService(
rapid.publish(
Key.EVENT_NAME to eventName.toJson(),
Key.BEHOV to BehovType.ARBEIDSGIVERE.toJson(),
Key.UUID to steg0.transaksjonId.toJson(),
Key.KONTEKST_ID to steg0.transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.ARBEIDSGIVER_FNR to steg0.avsenderFnr.toJson(),
Expand All @@ -108,7 +108,7 @@ class AktiveOrgnrService(
rapid.publish(
Key.EVENT_NAME to eventName.toJson(),
Key.BEHOV to BehovType.HENT_ARBEIDSFORHOLD.toJson(),
Key.UUID to steg0.transaksjonId.toJson(),
Key.KONTEKST_ID to steg0.transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FNR to steg0.sykmeldtFnr.toJson(),
Expand All @@ -118,7 +118,7 @@ class AktiveOrgnrService(
rapid.publish(
Key.EVENT_NAME to eventName.toJson(),
Key.BEHOV to BehovType.HENT_PERSONER.toJson(),
Key.UUID to steg0.transaksjonId.toJson(),
Key.KONTEKST_ID to steg0.transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FNR_LISTE to
Expand Down Expand Up @@ -146,7 +146,7 @@ class AktiveOrgnrService(
rapid.publish(
Key.EVENT_NAME to eventName.toJson(),
Key.BEHOV to BehovType.HENT_VIRKSOMHET_NAVN.toJson(),
Key.UUID to steg0.transaksjonId.toJson(),
Key.KONTEKST_ID to steg0.transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.ORGNR_UNDERENHETER to arbeidsgivere.toJson(String.serializer()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private object Mock {
fun startmelding(transaksjonId: UUID): Map<Key, JsonElement> =
mapOf(
Key.EVENT_NAME to EventName.AKTIVE_ORGNR_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FNR to sykmeldtFnr.toJson(),
Expand All @@ -253,7 +253,7 @@ private object Mock {
): Map<Key, JsonElement> =
mapOf(
Key.EVENT_NAME to EventName.AKTIVE_ORGNR_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.ARBEIDSFORHOLD to
Expand All @@ -279,7 +279,7 @@ private object Mock {
): Map<Key, JsonElement> =
mapOf(
Key.EVENT_NAME to EventName.AKTIVE_ORGNR_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.VIRKSOMHETER to mapOf(orgnr.verdi to ORG_NAVN).toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AltinnRiver(
Melding(
eventName = Key.EVENT_NAME.les(EventName.serializer(), json),
behovType = Key.BEHOV.krev(BehovType.ARBEIDSGIVERE, BehovType.serializer(), json),
transaksjonId = Key.UUID.les(UuidSerializer, json),
transaksjonId = Key.KONTEKST_ID.les(UuidSerializer, json),
data = data,
fnr = Key.ARBEIDSGIVER_FNR.les(Fnr.serializer(), data),
)
Expand All @@ -62,7 +62,7 @@ class AltinnRiver(

return mapOf(
Key.EVENT_NAME to eventName.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
data
.plus(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TilgangRiver(
TilgangMelding(
eventName = Key.EVENT_NAME.les(EventName.serializer(), json),
behovType = Key.BEHOV.krev(BehovType.TILGANGSKONTROLL, BehovType.serializer(), json),
transaksjonId = Key.UUID.les(UuidSerializer, json),
transaksjonId = Key.KONTEKST_ID.les(UuidSerializer, json),
data = data,
orgnr = Key.ORGNRUNDERENHET.les(Orgnr.serializer(), data),
fnr = Key.FNR.les(Fnr.serializer(), data),
Expand All @@ -63,7 +63,7 @@ class TilgangRiver(

return mapOf(
Key.EVENT_NAME to eventName.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
data
.plus(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AltinnRiverTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to innkommendeMelding.eventName.toJson(),
Key.UUID to innkommendeMelding.transaksjonId.toJson(),
Key.KONTEKST_ID to innkommendeMelding.transaksjonId.toJson(),
Key.DATA to
innkommendeMelding.data
.plus(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object Mock {
mapOf(
Key.EVENT_NAME to eventName.toJson(),
Key.BEHOV to behovType.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.ARBEIDSGIVER_FNR to fnr.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TilgangRiverTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to innkommendeMelding.eventName.toJson(),
Key.UUID to innkommendeMelding.transaksjonId.toJson(),
Key.KONTEKST_ID to innkommendeMelding.transaksjonId.toJson(),
Key.DATA to
innkommendeMelding.data
.plus(Key.TILGANG to forventetTilgang.toJson(Tilgang.serializer()))
Expand Down Expand Up @@ -145,7 +145,7 @@ private object MockTilgang {
mapOf(
Key.EVENT_NAME to eventName.toJson(),
Key.BEHOV to behovType.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to data.toJson(),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AktiveOrgnrProducer(
.publish(
key = arbeidstagerFnr,
Key.EVENT_NAME to EventName.AKTIVE_ORGNR_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FNR to arbeidstagerFnr.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TilgangProducer(
.publish(
key = fnr,
Key.EVENT_NAME to eventName.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FNR to fnr.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class HentForespoerselProducer(
.publish(
key = request.uuid,
Key.EVENT_NAME to EventName.TRENGER_REQUESTED.toJson(EventName.serializer()),
Key.UUID to transaksjonId.toString().toJson(),
Key.KONTEKST_ID to transaksjonId.toString().toJson(),
Key.DATA to
mapOf(
Key.FORESPOERSEL_ID to request.uuid.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HentForespoerslerProducer(
.publish(
key = UUID.randomUUID(),
Key.EVENT_NAME to EventName.FORESPOERSLER_REQUESTED.toJson(EventName.serializer()),
Key.UUID to transaksjonId.toString().toJson(),
Key.KONTEKST_ID to transaksjonId.toString().toJson(),
Key.DATA to
mapOf(
Key.VEDTAKSPERIODE_ID_LISTE to request.vedtaksperiodeIdListe.toJson(UuidSerializer),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class HentSelvbestemtImProducer(
.publish(
key = selvbestemtId,
Key.EVENT_NAME to EventName.SELVBESTEMT_IM_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.SELVBESTEMT_ID to selvbestemtId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class InnsendingProducer(
.publish(
key = skjemaInntektsmelding.forespoerselId,
Key.EVENT_NAME to EventName.INSENDING_STARTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.ARBEIDSGIVER_FNR to arbeidsgiverFnr.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class InntektProducer(
.publish(
key = request.forespoerselId,
Key.EVENT_NAME to EventName.INNTEKT_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FORESPOERSEL_ID to request.forespoerselId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class InntektSelvbestemtProducer(
.publish(
key = request.sykmeldtFnr,
Key.EVENT_NAME to EventName.INNTEKT_SELVBESTEMT_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FNR to request.sykmeldtFnr.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class KvitteringProducer(
.publish(
key = forespoerselId,
Key.EVENT_NAME to EventName.KVITTERING_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FORESPOERSEL_ID to forespoerselId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LagreSelvbestemtImProducer(
.publish(
key = skjema.sykmeldtFnr,
Key.EVENT_NAME to EventName.SELVBESTEMT_IM_MOTTATT.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.SKJEMA_INNTEKTSMELDING to skjema.toJson(SkjemaInntektsmeldingSelvbestemt.serializer()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class InnsendingProducerTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to EventName.INSENDING_STARTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.ARBEIDSGIVER_FNR to avsenderFnr.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AktiveOrgnrProducerTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to EventName.AKTIVE_ORGNR_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FNR to arbeidstagerFnr.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class HentForespoerselProducerTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to EventName.TRENGER_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FORESPOERSEL_ID to forespoerselId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class HentForespoerselIdListeProducerTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to EventName.FORESPOERSLER_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.VEDTAKSPERIODE_ID_LISTE to vedtaksperiodeIdListe.toJson(UuidSerializer),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class HentSelvbestemtImProducerTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to EventName.SELVBESTEMT_IM_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.SELVBESTEMT_ID to selvbestemtId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class InntektProducerTest :
publisert shouldContainExactly
mapOf(
Key.EVENT_NAME to EventName.INNTEKT_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FORESPOERSEL_ID to request.forespoerselId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class InntektSelvbestemtProducerTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to EventName.INNTEKT_SELVBESTEMT_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FNR to sykmeldtFnr.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class KvitteringProducerTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to EventName.KVITTERING_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.FORESPOERSEL_ID to forespoerselId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LagreSelvbestemtImProducerTest :
testRapid.firstMessage().toMap() shouldContainExactly
mapOf(
Key.EVENT_NAME to EventName.SELVBESTEMT_IM_MOTTATT.toJson(),
Key.UUID to transaksjonId.toJson(),
Key.KONTEKST_ID to transaksjonId.toJson(),
Key.DATA to
mapOf(
Key.SKJEMA_INNTEKTSMELDING to skjema.toJson(SkjemaInntektsmeldingSelvbestemt.serializer()),
Expand Down
Loading

0 comments on commit 10fdffe

Please sign in to comment.