Skip to content

Commit

Permalink
Legge på at behovssvar krever '@Final=true' for å spille sammen med d…
Browse files Browse the repository at this point in the history
…p-behovsakkumulator
  • Loading branch information
geiralund committed Apr 17, 2024
1 parent 3951a0d commit 38b44b1
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal object PostgresDataSourceBuilder {
const val DB_HOST_KEY = "DB_HOST"
const val DB_PORT_KEY = "DB_PORT"

private fun getOrThrow(key: String): String = OptionHelper.getEnv(key) ?: OptionHelper.getSystemProperty(key)
private fun getOrThrow(key: String): String = OptionHelper.getEnv(key) ?: OptionHelper.getSystemProperty(key) ?: throw IllegalArgumentException("Missing required environment variable $key")

val dataSource by lazy {
HikariDataSource().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ internal class EksisterendeSakerMottak(
init {
River(rapidsConnection).apply {
validate { it.requireValue("@event_name", "behov") }
validate { it.requireValue("@final", true) }
validate { it.require("@opprettet", JsonNode::asLocalDateTime) }
validate { it.requireKey(løsning) }
validate { it.requireKey("journalpostId") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal class GosysOppgaveOpprettetMottak(
init {
River(rapidsConnection).apply {
validate { it.requireValue("@event_name", "behov") }
validate { it.requireValue("@final", true) }
validate { it.require("@opprettet", JsonNode::asLocalDateTime) }
validate { it.requireKey(løsning) }
validate { it.requireKey("journalpostId") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal class JournalpostFerdigstiltMottak(
init {
River(rapidsConnection).apply {
validate { it.requireValue("@event_name", "behov") }
validate { it.requireValue("@final", true) }
validate { it.require("@opprettet", JsonNode::asLocalDateTime) }
validate { it.requireKey(løsning) }
validate { it.requireKey("journalpostId") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ internal class JournalpostMottak(
init {
River(rapidsConnection).apply {
validate { it.requireValue("@event_name", "behov") }
validate { it.requireValue("@final", true) }
validate { it.require("@opprettet", JsonNode::asLocalDateTime) }
validate { it.requireKey(løsning) }
validate { it.requireKey("journalpostId") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal class JournalpostOppdatertMottak(
init {
River(rapidsConnection).apply {
validate { it.requireValue("@event_name", "behov") }
validate { it.requireValue("@final", true) }
validate { it.require("@opprettet", JsonNode::asLocalDateTime) }
validate { it.requireKey(løsning) }
validate { it.requireKey("journalpostId") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ internal class MinsteinntektVurderingMottak(
init {
River(rapidsConnection).apply {
validate { it.requireValue("@event_name", "behov") }
validate { it.requireValue("@final", true) }
validate { it.require("@opprettet", JsonNode::asLocalDateTime) }
validate { it.requireKey(løsning) }
validate { it.requireKey("journalpostId") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal class OpprettArenaOppgaveMottak(
init {
River(rapidsConnection).apply {
validate { it.requireValue("@event_name", "behov") }
validate { it.requireValue("@final", true) }
validate { it.require("@opprettet", JsonNode::asLocalDateTime) }
validate {
it.demandAllOrAny(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ internal class PersondataMottak(
init {
River(rapidsConnection).apply {
validate { it.requireValue("@event_name", "behov") }
validate { it.requireValue("@final", true) }
validate { it.require("@opprettet", JsonNode::asLocalDateTime) }
validate { it.require(key = løsning, parser = {}) }
validate { it.requireKey("journalpostId") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ internal class SøknadsdataMottak(
init {
River(rapidsConnection).apply {
validate { it.requireValue("@event_name", "behov") }
validate { it.requireValue("@final", true) }
validate { it.require("@opprettet", JsonNode::asLocalDateTime) }
validate { it.requireKey(løsning) }
validate { it.requireKey("journalpostId") }
Expand Down
Loading

0 comments on commit 38b44b1

Please sign in to comment.