Skip to content

Commit

Permalink
Oppdaterer til ktlint 0.48.2
Browse files Browse the repository at this point in the history
  • Loading branch information
blommish committed Feb 15, 2023
1 parent f48e37f commit 3d9bec5
Show file tree
Hide file tree
Showing 612 changed files with 4,686 additions and 4,669 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -377,7 +377,7 @@
<dependency>
<groupId>com.pinterest</groupId>
<artifactId>ktlint</artifactId>
<version>0.47.1</version>
<version>0.48.2</version>
</dependency>
<!-- additional 3rd party ruleset(s) can be specified here -->
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/no/nav/familie/ef/sak/AuditLogger.kt
Expand Up @@ -22,14 +22,14 @@ data class Sporingsdata(
val tilgang: Tilgang,
val custom1: CustomKeyValue? = null,
val custom2: CustomKeyValue? = null,
val custom3: CustomKeyValue? = null
val custom3: CustomKeyValue? = null,
)

enum class AuditLoggerEvent(val type: String) {
CREATE("create"),
UPDATE("update"),
DELETE("delete"),
ACCESS("access")
ACCESS("access"),
}

data class CustomKeyValue(val key: String, val value: String)
Expand Down Expand Up @@ -89,7 +89,7 @@ class AuditLogger(@Value("\${NAIS_APP_NAME}") private val applicationName: Strin
return listOfNotNull(
data.custom1?.let { "cs3Label=${it.key} cs3=${it.value}" },
data.custom2?.let { "cs5Label=${it.key} cs5=${it.value}" },
data.custom3?.let { "cs6Label=${it.key} cs6=${it.value}" }
data.custom3?.let { "cs6Label=${it.key} cs6=${it.value}" },
)
.joinToString(" ")
}
Expand Down
Expand Up @@ -5,18 +5,18 @@ import java.time.YearMonth

data class AMeldingInntektDto(
val inntektPerVirksomhet: List<InntektForVirksomhetDto>,
val avvik: List<String>
val avvik: List<String>,
)

data class InntektForVirksomhetDto(
val identifikator: String,
val navn: String,
val inntektPerMåned: Map<YearMonth, InntektPerMånedDto>
val inntektPerMåned: Map<YearMonth, InntektPerMånedDto>,
)

data class InntektPerMånedDto(
val totalbeløp: Int,
val inntekt: List<InntektDto>
val inntekt: List<InntektDto>,
)

/**
Expand All @@ -37,20 +37,21 @@ data class InntektDto(
val kategori: String?,
val opptjeningsland: String? = null,
val opptjeningsperiodeFom: LocalDate? = null,
val opptjeningsperiodeTom: LocalDate? = null
val opptjeningsperiodeTom: LocalDate? = null,
)

enum class InntektType {
LØNNSINNTEKT,
NÆRINGSINNTEKT,
PENSJON_ELLER_TRYGD,
YTELSE_FRA_OFFENTLIGE
YTELSE_FRA_OFFENTLIGE,
}

enum class Fordel(val verdi: String) {
KONTANTYTELSE("kontantytelse"),
NATURALYTELSE("naturalytelse"),
UTGIFTSGODTGJØRELSE("utgiftsgodtgjoerelse");
UTGIFTSGODTGJØRELSE("utgiftsgodtgjoerelse"),
;

companion object {

Expand Down
Expand Up @@ -20,20 +20,20 @@ import java.util.UUID
@Validated
class InntektController(
private val tilgangService: TilgangService,
private val inntektService: InntektService
private val inntektService: InntektService,
) {

@GetMapping("fagsak/{fagsakId}")
fun hentInntekt(
@PathVariable("fagsakId") fagsakId: UUID,
@RequestParam fom: YearMonth?,
@RequestParam tom: YearMonth?
@RequestParam tom: YearMonth?,
): Ressurs<AMeldingInntektDto> {
tilgangService.validerTilgangTilFagsak(fagsakId, AuditLoggerEvent.ACCESS)
val inntekt = inntektService.hentInntekt(
fagsakId = fagsakId,
fom = fom ?: YearMonth.now().minusMonths(2),
tom = tom ?: YearMonth.now()
tom = tom ?: YearMonth.now(),
)
return success(inntekt)
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/no/nav/familie/ef/sak/amelding/InntektMapper.kt
Expand Up @@ -14,13 +14,13 @@ import no.nav.familie.ef.sak.amelding.ekstern.InntektType as EksternInntektType
@Component
class InntektMapper(
private val kodeverkService: CachedKodeverkService,
private val eregService: EregService
private val eregService: EregService,
) {

fun mapInntekt(response: HentInntektListeResponse): AMeldingInntektDto {
return AMeldingInntektDto(
inntektPerVirksomhet = mapOrganisasjoner(response),
avvik = mapAvvik(response)
avvik = mapAvvik(response),
)
}

Expand All @@ -35,9 +35,9 @@ class InntektMapper(
inntektPerMåned = entry.value.entries.associate { inntektEntry ->
inntektEntry.key to InntektPerMånedDto(
totalbeløp = inntektEntry.value.sumOf { it.beløp },
inntekt = mapInntekt(inntektEntry.value)
inntekt = mapInntekt(inntektEntry.value),
)
}
},
)
}
}
Expand Down Expand Up @@ -73,7 +73,7 @@ class InntektMapper(
},
opptjeningsland = inntekt.opptjeningsland,
opptjeningsperiodeFom = inntekt.opptjeningsperiodeFom,
opptjeningsperiodeTom = inntekt.opptjeningsperiodeTom
opptjeningsperiodeTom = inntekt.opptjeningsperiodeTom,
)
}

Expand Down
Expand Up @@ -12,7 +12,7 @@ class InntektService(
private val aMeldingInntektClient: AMeldingInntektClient,
private val fagsakService: FagsakService,
private val fagsakPersonService: FagsakPersonService,
private val inntektMapper: InntektMapper
private val inntektMapper: InntektMapper,
) {

fun hentInntekt(fagsakId: UUID, fom: YearMonth, tom: YearMonth): AMeldingInntektDto {
Expand Down
Expand Up @@ -15,7 +15,7 @@ import java.time.YearMonth
@Component
class AMeldingInntektClient(
@Value("\${FAMILIE_EF_PROXY_URL}") private val uri: URI,
@Qualifier("azure") restOperations: RestOperations
@Qualifier("azure") restOperations: RestOperations,
) : AbstractRestClient(restOperations, "inntekt") {

private fun lagInntektUri(fom: YearMonth, tom: YearMonth) =
Expand All @@ -36,7 +36,7 @@ class AMeldingInntektClient(
PersonIdent(personIdent),
HttpHeaders().apply {
accept = listOf(MediaType.TEXT_PLAIN)
}
},
)
}
}
Expand Up @@ -7,33 +7,33 @@ import java.time.YearMonth
data class HentInntektListeResponse(
@JsonProperty("arbeidsInntektMaaned")
val arbeidsinntektMåned: List<ArbeidsinntektMåned>?,
val ident: Aktør
val ident: Aktør,
)

data class ArbeidsinntektMåned(
@JsonProperty("aarMaaned")
val årMåned: YearMonth,
// rapportert for den måneden
val avvikListe: List<Avvik>?,
val arbeidsInntektInformasjon: ArbeidsInntektInformasjon?
val arbeidsInntektInformasjon: ArbeidsInntektInformasjon?,
)

data class Aktør(
val identifikator: String,
@JsonProperty("aktoerType")
val aktørType: AktørType
val aktørType: AktørType,
)

data class Avvik(
val ident: Aktør? = null,
val opplysningspliktig: Aktør? = null,
val virksomhet: Aktør,
val avvikPeriode: YearMonth? = null,
val tekst: String? = null
val tekst: String? = null,
)

data class ArbeidsInntektInformasjon(
val inntektListe: List<AMeldingInntekt>?
val inntektListe: List<AMeldingInntekt>?,
)

data class AMeldingInntekt(
Expand All @@ -47,22 +47,22 @@ data class AMeldingInntekt(
val skattemessigBosattLand: String? = null,
val virksomhet: Aktør, // ? = null,
val tilleggsinformasjon: Tilleggsinformasjon? = null,
val beskrivelse: String? = null // hentes fra kodeverk
val beskrivelse: String? = null, // hentes fra kodeverk
)

data class Tilleggsinformasjon(
val kategori: String? = null // Kodeverk -> EDAGTilleggsinfoKategorier
val kategori: String? = null, // Kodeverk -> EDAGTilleggsinfoKategorier
)

enum class AktørType {
AKTOER_ID,
NATURLIG_IDENT,
ORGANISASJON
ORGANISASJON,
}

enum class InntektType {
LOENNSINNTEKT,
NAERINGSINNTEKT,
PENSJON_ELLER_TRYGD,
YTELSE_FRA_OFFENTLIGE
YTELSE_FRA_OFFENTLIGE,
}
Expand Up @@ -10,7 +10,7 @@ import org.springframework.stereotype.Component
class ArbeidsfordelingService(
private val personopplysningerIntegrasjonerClient: PersonopplysningerIntegrasjonerClient,
@Qualifier("shortCache")
private val cacheManager: CacheManager
private val cacheManager: CacheManager,
) {

companion object {
Expand Down
Expand Up @@ -4,5 +4,5 @@ import no.nav.familie.ef.sak.opplysninger.personopplysninger.pdl.Adressebeskytte

data class IdentMedAdressebeskyttelse(
val ident: String,
val adressebeskyttelsegradering: AdressebeskyttelseGradering?
val adressebeskyttelsegradering: AdressebeskyttelseGradering?,
)
Expand Up @@ -21,15 +21,15 @@ import java.util.UUID
@Validated
class ArbeidsforholdController(
private val tilgangService: TilgangService,
private val arbeidsforholdService: ArbeidsforholdService
private val arbeidsforholdService: ArbeidsforholdService,
) {

@GetMapping("fagsak/{fagsakId}")
fun hentArbeidsforhold(
@PathVariable("fagsakId") fagsakId: UUID,
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
@RequestParam
ansettelsesperiodeFom: LocalDate
ansettelsesperiodeFom: LocalDate,
): Ressurs<List<ArbeidsforholdDto>> {
tilgangService.validerTilgangTilFagsak(fagsakId, AuditLoggerEvent.ACCESS)
val arbeidsforhold = arbeidsforholdService.hentArbeidsforhold(fagsakId, ansettelsesperiodeFom)
Expand Down
Expand Up @@ -10,24 +10,24 @@ class ArbeidsforholdDto(
val arbeidsgiver: ArbeidsgiverDto? = null,
val type: String? = null,
val ansettelsesperiode: AnsettelsesperiodeDto? = null,
val arbeidsavtaler: List<ArbeidsavtaleDto>? = null
val arbeidsavtaler: List<ArbeidsavtaleDto>? = null,
)

class ArbeidstakerDto(
val type: String? = null,
val offentligIdent: String? = null,
val aktoerId: String? = null
val aktoerId: String? = null,
)

class ArbeidsgiverDto(
val type: ArbeidsgiverType? = null,
val organisasjonsnummer: String? = null,
val offentligIdent: String? = null
val offentligIdent: String? = null,
)

class AnsettelsesperiodeDto(
val periode: Periode? = null,
val bruksperiode: Periode? = null
val bruksperiode: Periode? = null,
)

class ArbeidsavtaleDto(
Expand All @@ -37,5 +37,5 @@ class ArbeidsavtaleDto(
val antallTimerPrUke: Double? = null,
val beregnetAntallTimerPrUke: Double? = null,
val bruksperiode: Periode? = null,
val gyldighetsperiode: Periode? = null
val gyldighetsperiode: Periode? = null,
)
Expand Up @@ -9,17 +9,17 @@ fun List<Arbeidsforhold>.tilDto() = this.map {
arbeidstaker = ArbeidstakerDto(
it.arbeidstaker?.type,
it.arbeidstaker?.offentligIdent,
it.arbeidstaker?.aktoerId
it.arbeidstaker?.aktoerId,
),
arbeidsgiver = ArbeidsgiverDto(
it.arbeidsgiver?.type,
it.arbeidsgiver?.organisasjonsnummer,
it.arbeidsgiver?.offentligIdent
it.arbeidsgiver?.offentligIdent,
),
type = it.type,
ansettelsesperiode = AnsettelsesperiodeDto(
it.ansettelsesperiode?.periode,
it.ansettelsesperiode?.bruksperiode
it.ansettelsesperiode?.bruksperiode,
),
arbeidsavtaler = it.arbeidsavtaler?.map { arbeidsavtale ->
ArbeidsavtaleDto(
Expand All @@ -29,8 +29,8 @@ fun List<Arbeidsforhold>.tilDto() = this.map {
antallTimerPrUke = arbeidsavtale.antallTimerPrUke,
beregnetAntallTimerPrUke = arbeidsavtale.beregnetAntallTimerPrUke,
bruksperiode = arbeidsavtale.bruksperiode,
gyldighetsperiode = arbeidsavtale.gyldighetsperiode
gyldighetsperiode = arbeidsavtale.gyldighetsperiode,
)
}
},
)
}
Expand Up @@ -10,7 +10,7 @@ import java.util.UUID
@Service
class ArbeidsforholdService(
private val fagsakService: FagsakService,
private val arbeidsforholdClient: ArbeidsforholdClient
private val arbeidsforholdClient: ArbeidsforholdClient,
) {

fun hentArbeidsforhold(fagsakId: UUID, ansettelsesperiodeFom: LocalDate): List<ArbeidsforholdDto> {
Expand Down
Expand Up @@ -14,7 +14,7 @@ import java.time.LocalDate
@Component
class ArbeidsforholdClient(
@Value("\${FAMILIE_INTEGRASJONER_URL}") private val uri: URI,
@Qualifier("azure") restOperations: RestOperations
@Qualifier("azure") restOperations: RestOperations,
) : AbstractRestClient(restOperations, "arbeidsforhold") {

private fun lagArbeidsforholdUri() =
Expand All @@ -27,5 +27,5 @@ class ArbeidsforholdClient(

class ArbeidsforholdRequest(
val personIdent: String,
val ansettelsesperiodeFom: LocalDate
val ansettelsesperiodeFom: LocalDate,
)
Expand Up @@ -14,7 +14,7 @@ import java.util.UUID
@Service
class AvstemmingService(
private val iverksettClient: IverksettClient,
private val tilkjentYtelseService: TilkjentYtelseService
private val tilkjentYtelseService: TilkjentYtelseService,
) {

private val logger = LoggerFactory.getLogger(javaClass)
Expand All @@ -39,12 +39,12 @@ class AvstemmingService(
stønadstype: StønadType,
konsistensavstemming: List<KonsistensavstemmingTilkjentYtelseDto>,
transaksjon: UUID,
chunks: Int
chunks: Int,
) {
val beløp = konsistensavstemming.sumOf { it.andelerTilkjentYtelse.sumOf(AndelTilkjentYtelseDto::beløp) }
logger.info(
"Konsistensavstemming stønad=$stønadstype transaksjon=$transaksjon antall=${konsistensavstemming.size} " +
"beløp=$beløp chunks=$chunks"
"beløp=$beløp chunks=$chunks",
)
}
}

0 comments on commit 3d9bec5

Please sign in to comment.