Skip to content

Commit

Permalink
Merge pull request #285 from statisticsnorway/Bugfix_kvartal_2023Q3
Browse files Browse the repository at this point in the history
Update KvartalKostraMain.kt
  • Loading branch information
jonolehagemo authored Oct 10, 2023
2 parents 7d368a3 + 88f0810 commit 4a75a34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ abstract class RegnskapValidator(
Rule001RecordLength(RegnskapFieldDefinitions.fieldLength)
)

protected val fieldFunksjonKapittelLength = RegnskapFieldDefinitions.fieldDefinitionsByName[RegnskapConstants.FIELD_FUNKSJON_KAPITTEL]?.size ?: 4
protected val fieldArtSektorLength = RegnskapFieldDefinitions.fieldDefinitionsByName[RegnskapConstants.FIELD_ART_SEKTOR]?.size ?: 3

abstract val funksjonList: List<String>
abstract val kapittelList: List<String>
abstract val artList: List<String>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class KvartalKostraMain(
result.addAll(fylkeskommunaleFunksjoner)
}

result.map { it.padEnd(4, ' ') }.distinct().sorted()
result.map { it.padEnd(fieldFunksjonKapittelLength, ' ') }.distinct().sorted()
} else
emptyList()

Expand All @@ -86,7 +86,7 @@ class KvartalKostraMain(
// @formatter:on
)

result.map { it.padEnd(4, ' ') }.sorted()
result.map { it.padEnd(fieldFunksjonKapittelLength, ' ') }.distinct().sorted()
} else
emptyList()

Expand Down Expand Up @@ -123,7 +123,7 @@ class KvartalKostraMain(
if (arguments.region in osloKommuner) {
result.addAll(osloArter)
}
result.sorted()
result.map { it.padEnd(fieldArtSektorLength, ' ') }.distinct().sorted()
} else
emptyList()

Expand All @@ -144,7 +144,7 @@ class KvartalKostraMain(
"900",
"Z", "z", "~"
// @formatter:on
)
).map { it.padEnd(fieldArtSektorLength, ' ') }.distinct().sorted()
else
emptyList()

Expand Down

0 comments on commit 4a75a34

Please sign in to comment.