Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oppdatere beregn forskudd api #100

Merged
merged 36 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d5e0413
BD-1764: Oppdatere grensensitt mot bidrag-beregn-forskudd-rest
s148719 Nov 9, 2023
6a2b4b9
Update feature.yaml
s148719 Nov 9, 2023
0583733
Legge til enhetstest for beregning av forskudd
s148719 Nov 10, 2023
82bd2a5
ktlint
s148719 Nov 10, 2023
8e21ded
Oppdatere grenesnitt mot bidrag-beregn-forskudd
s148719 Nov 13, 2023
99af4b0
Legge til navn på roller
s148719 Nov 14, 2023
0b1db13
Fikse og opprette tester
s148719 Nov 15, 2023
ff645ef
Søknadsbarnreferanse
s148719 Nov 17, 2023
2d8d504
Legge til kilde i Sivilstand
s148719 Nov 17, 2023
9865e05
formattering
s148719 Nov 17, 2023
1c7b7e5
Legge inn kilde for Sivilstand
s148719 Nov 17, 2023
adc4069
Oppdatere kilde
s148719 Nov 20, 2023
45881fa
fikse migreringsskript
s148719 Nov 20, 2023
9700829
Merge branch 'main' into oppdatere-beregn-forskudd-api
s148719 Nov 24, 2023
2fe80b5
Merge
s148719 Nov 24, 2023
4710495
Oppdatere bidrag-transport og commons
s148719 Nov 24, 2023
2d3b473
BD-1764: Endre datamodell. Beregne forskudd.
s148719 Dec 6, 2023
3c6dee0
Flytte db-migreringsskript for å klargjøre for main rebase
s148719 Dec 6, 2023
9ed7977
Merge branch 'main' into oppdatere-beregn-forskudd-api
s148719 Dec 6, 2023
d4a5f0d
Merge med main
s148719 Dec 6, 2023
c271d9e
Refaktorisere
s148719 Dec 6, 2023
55b10f1
Update and rename HusstandsBarnPeriode.kt to HusstandsBarnPeriodeViss…
s148719 Dec 6, 2023
090957c
Rename HusstandsBarn.kt to HusstandsBarnVissvass.kt
s148719 Dec 6, 2023
9d59dcd
Vissvass
s148719 Dec 6, 2023
49b76e7
Fjerne vissvass
s148719 Dec 6, 2023
a79f6ac
Korrigere db-migreringsskript++
s148719 Dec 6, 2023
ecaf244
Update V1.0.44__alter_table_behandling.sql
s148719 Dec 6, 2023
3786187
Fikse reverseringskript
s148719 Dec 7, 2023
13a89b2
Fjerne mergefiler
s148719 Dec 7, 2023
fd68e2d
API-versjonering
s148719 Dec 8, 2023
1475564
Update V1.0.45__alter_table_barn_i_husstand.sql
s148719 Dec 8, 2023
978495e
Merge branch 'main' into oppdatere-beregn-forskudd-api
s148719 Dec 8, 2023
f415772
Fikse mergekonflikt
s148719 Dec 8, 2023
e83f648
Slette husstandsbarn som mangler fødselsdato. Legge på null-begrensni…
s148719 Dec 8, 2023
71863be
Fikse deprekert boforhold-api
s148719 Dec 8, 2023
c159302
Fikse bakoverkompatibilitet husstandsmedlemmer
s148719 Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ target/
.mvn/wrapper/**
mvnw
mvnw.cmd
*.orig

### STS ###
.apt_generated
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<java.version>21</java.version>
<kotlin.version>1.9.21</kotlin.version>
<bidrag-commons.version>20231201131246_f719b2b</bidrag-commons.version>
<bidrag-transport.version>20231129081122_595a8a8</bidrag-transport.version>
<bidrag-transport.version>20231206085150_493c399</bidrag-transport.version>
<logback-encoder.version>7.4</logback-encoder.version>
<token-support.version>3.1.9</token-support.version>
<springdoc.version>2.3.0</springdoc.version>
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/no/nav/bidrag/behandling/Exceptions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ fun fantIkkeFødselsdatoTilSøknadsbarn(behandlingsid: Long): Nothing =
HttpStatus.INTERNAL_SERVER_ERROR,
"Fant ikke fødselsdato til søknadsbarn i behandling med id $behandlingsid",
)

fun valideringAvBehandlingFeilet(valideringsfeil: List<String>): Nothing =
throw HttpClientErrorException(HttpStatus.BAD_REQUEST, valideringsfeil.toString())
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package no.nav.bidrag.behandling.controller
package no.nav.bidrag.behandling.aop

import com.fasterxml.jackson.databind.JsonMappingException
import com.fasterxml.jackson.databind.exc.InvalidFormatException
Expand Down Expand Up @@ -39,8 +39,7 @@ class ExceptionHandler {
validationError?.fieldErrors?.joinToString(", ") { "${it.field}: ${it.message}" }
?: "ukjent feil"

return ResponseEntity
.status(HttpStatus.BAD_REQUEST)
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.header(
HttpHeaders.WARNING,
"Forespørselen inneholder ugyldig verdi: $errorMessage",
Expand All @@ -52,15 +51,18 @@ class ExceptionHandler {
@ExceptionHandler(HttpStatusCodeException::class)
fun handleHttpClientErrorException(exception: HttpStatusCodeException): ResponseEntity<*> {
val errorMessage = getErrorMessage(exception)
return ResponseEntity
.status(exception.statusCode)
return ResponseEntity.status(exception.statusCode)
.header(HttpHeaders.WARNING, errorMessage)
.build<Any>()
}

private fun getErrorMessage(exception: HttpStatusCodeException): String {
val errorMessage = StringBuilder()
errorMessage.append("Det skjedde en feil ved kall mot ekstern tjeneste: ")
if (exception.statusText == null) {
errorMessage.append("Det skjedde en feil ved kall mot ekstern tjeneste: ")
} else {
errorMessage.append("Validering feilet")
}
exception.responseHeaders?.get(HttpHeaders.WARNING)?.firstOrNull()?.let { errorMessage.append(it) }
if (exception.statusText.isNotEmpty()) {
errorMessage.append(" - ")
Expand Down

This file was deleted.

Loading