-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Omdøping av all kode for bekreftelse-API
- Loading branch information
1 parent
1aabe24
commit 0d3e426
Showing
44 changed files
with
413 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
kotlin("jvm") | ||
id("org.openapi.generator") | ||
id("com.google.cloud.tools.jib") | ||
application | ||
} | ||
|
||
val jvmMajorVersion: String by project | ||
val baseImage: String by project | ||
val image: String? by project | ||
|
||
dependencies { | ||
// Project | ||
implementation(project(":lib:hoplite-config")) | ||
implementation(project(":lib:kafka-streams")) | ||
implementation(project(":lib:kafka-key-generator-client")) | ||
implementation(project(":domain:bekreftelse-interne-hendelser")) | ||
implementation(project(":domain:bekreftelsesmelding-schema")) | ||
|
||
// Server | ||
implementation(ktorServer.bundles.withNettyAndMicrometer) | ||
implementation(ktorServer.contentNegotiation) | ||
implementation(ktorServer.statusPages) | ||
implementation(ktorServer.cors) | ||
implementation(ktorServer.callId) | ||
implementation(ktorServer.auth) | ||
|
||
// Client | ||
implementation(ktorClient.core) | ||
implementation(ktorClient.cio) | ||
implementation(ktorClient.contentNegotiation) | ||
|
||
// Serialization | ||
implementation(ktor.serializationJackson) | ||
implementation(ktor.serializationJson) | ||
implementation(jackson.datatypeJsr310) | ||
|
||
// Authentication | ||
implementation(navSecurity.tokenValidationKtorV2) | ||
|
||
// Authorization | ||
implementation(poao.tilgangClient) | ||
|
||
// Documentation | ||
implementation(ktorServer.swagger) | ||
|
||
// Logging | ||
implementation(loggingLibs.logbackClassic) | ||
implementation(loggingLibs.logstashLogbackEncoder) | ||
implementation(navCommon.log) | ||
implementation(navCommon.auditLog) | ||
|
||
// Instrumentation | ||
implementation(micrometer.registryPrometheus) | ||
implementation(otel.api) | ||
implementation(otel.annotations) | ||
|
||
// Kafka | ||
implementation(orgApacheKafka.kafkaStreams) | ||
implementation(apacheAvro.kafkaStreamsAvroSerde) | ||
|
||
// Test | ||
testImplementation(ktorServer.testJvm) | ||
testImplementation(testLibs.bundles.withUnitTesting) | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(jvmMajorVersion)) | ||
} | ||
} | ||
|
||
application { | ||
mainClass.set("no.nav.paw.rapportering.api.ApplicationKt") | ||
} | ||
|
||
tasks.withType<Test>().configureEach { | ||
useJUnitPlatform() | ||
} | ||
|
||
tasks.withType<KotlinCompile>().configureEach { | ||
compilerOptions { | ||
freeCompilerArgs.add("-Xcontext-receivers") | ||
} | ||
} | ||
|
||
tasks.withType(Jar::class) { | ||
manifest { | ||
attributes["Implementation-Version"] = project.version | ||
attributes["Main-Class"] = application.mainClass.get() | ||
attributes["Implementation-Title"] = rootProject.name | ||
} | ||
} | ||
|
||
jib { | ||
from.image = "$baseImage:$jvmMajorVersion" | ||
to.image = "${image ?: project.name}:${project.version}" | ||
container { | ||
environment = mapOf( | ||
"IMAGE_WITH_VERSION" to "${image ?: project.name}:${project.version}" | ||
) | ||
jvmFlags = listOf("-XX:ActiveProcessorCount=4", "-XX:+UseZGC", "-XX:+ZGenerational") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...v/paw/rapportering/api/ApplicationInfo.kt → ...av/paw/bekreftelse/api/ApplicationInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lin/no/nav/paw/rapportering/api/Health.kt → ...tlin/no/nav/paw/bekreftelse/api/Health.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...api/domain/request/RapporteringRequest.kt → ...reftelse/api/domain/BekreftelseRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package no.nav.paw.rapportering.api.domain.request | ||
package no.nav.paw.bekreftelse.api.domain | ||
|
||
import java.util.* | ||
|
||
data class RapporteringRequest( | ||
data class BekreftelseRequest( | ||
// Identitetsnummer må sendes med hvis det er en veileder som rapporterer | ||
val identitetsnummer: String? = null, | ||
val rapporteringsId: UUID, | ||
val bekreftelseId: UUID, | ||
val harJobbetIDennePerioden: Boolean, | ||
val vilFortsetteSomArbeidssoeker: Boolean | ||
) |
5 changes: 5 additions & 0 deletions
5
...api/src/main/kotlin/no/nav/paw/bekreftelse/api/domain/TilgjengeligeBekreftelserRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package no.nav.paw.bekreftelse.api.domain | ||
|
||
data class TilgjengeligeBekreftelserRequest( | ||
val identitetsnummer: String? | ||
) |
24 changes: 24 additions & 0 deletions
24
...pi/src/main/kotlin/no/nav/paw/bekreftelse/api/domain/TilgjengeligeBekreftelserResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package no.nav.paw.bekreftelse.api.domain | ||
|
||
import java.time.Instant | ||
import java.util.* | ||
|
||
data class TilgjengeligBekreftelse( | ||
val periodeId: UUID, | ||
val bekreftelseId: UUID, | ||
val gjelderFra: Instant, | ||
val gjelderTil: Instant, | ||
) | ||
|
||
typealias TilgjengeligBekreftelserResponse = List<TilgjengeligBekreftelse> | ||
|
||
fun List<no.nav.paw.bekreftelse.internehendelser.BekreftelseTilgjengelig>.toResponse(): TilgjengeligBekreftelserResponse = | ||
this.map { | ||
TilgjengeligBekreftelse( | ||
periodeId = it.periodeId, | ||
bekreftelseId = it.bekreftelseId, | ||
gjelderFra = it.gjelderFra, | ||
gjelderTil = it.gjelderTil | ||
) | ||
} | ||
|
Oops, something went wrong.