diff --git a/module-server/src/main/kotlin/de/twomartens/wahlrecht/model/dto/v1/ElectedCandidates.kt b/module-server/src/main/kotlin/de/twomartens/wahlrecht/model/dto/v1/ElectedCandidates.kt index 7668ade..abb5eca 100644 --- a/module-server/src/main/kotlin/de/twomartens/wahlrecht/model/dto/v1/ElectedCandidates.kt +++ b/module-server/src/main/kotlin/de/twomartens/wahlrecht/model/dto/v1/ElectedCandidates.kt @@ -2,4 +2,5 @@ package de.twomartens.wahlrecht.model.dto.v1 data class ElectedCandidates(val overallResult: ElectedResult, val constituencyResults: Map, - val electionNumbersForSeatAllocation: List) + val electionNumbersForSeatAllocation: List, + val seatAllocation: Map) diff --git a/module-server/src/main/kotlin/de/twomartens/wahlrecht/model/internal/ElectedCandidates.kt b/module-server/src/main/kotlin/de/twomartens/wahlrecht/model/internal/ElectedCandidates.kt index 6744f62..d676dc0 100644 --- a/module-server/src/main/kotlin/de/twomartens/wahlrecht/model/internal/ElectedCandidates.kt +++ b/module-server/src/main/kotlin/de/twomartens/wahlrecht/model/internal/ElectedCandidates.kt @@ -2,4 +2,5 @@ package de.twomartens.wahlrecht.model.internal data class ElectedCandidates(val overallResult: ElectedResult, val constituencyResults: Map, - val electionNumbersForSeatAllocation: List) + val electionNumbersForSeatAllocation: List, + val seatAllocation: Map) diff --git a/module-server/src/main/kotlin/de/twomartens/wahlrecht/service/CalculationService.kt b/module-server/src/main/kotlin/de/twomartens/wahlrecht/service/CalculationService.kt index bedfbb5..c49f6d6 100644 --- a/module-server/src/main/kotlin/de/twomartens/wahlrecht/service/CalculationService.kt +++ b/module-server/src/main/kotlin/de/twomartens/wahlrecht/service/CalculationService.kt @@ -51,7 +51,10 @@ class CalculationService( return ElectedCandidates( overallResult = overallElectedCandidates, constituencyResults = constituencyResults, - electionNumbersForSeatAllocation = seatResult.usedElectionNumbers + electionNumbersForSeatAllocation = seatResult.usedElectionNumbers, + seatAllocation = seatResult.seatsPerNomination + .map { Pair(it.key.partyAbbreviation, it.value) } + .toMap() ) }