Provide allocated seat numbers in result
This commit is contained in:
+2
-1
@@ -2,4 +2,5 @@ package de.twomartens.wahlrecht.model.dto.v1
|
|||||||
|
|
||||||
data class ElectedCandidates(val overallResult: ElectedResult,
|
data class ElectedCandidates(val overallResult: ElectedResult,
|
||||||
val constituencyResults: Map<Int, ElectedResult>,
|
val constituencyResults: Map<Int, ElectedResult>,
|
||||||
val electionNumbersForSeatAllocation: List<Double>)
|
val electionNumbersForSeatAllocation: List<Double>,
|
||||||
|
val seatAllocation: Map<String, Int>)
|
||||||
|
|||||||
+2
-1
@@ -2,4 +2,5 @@ package de.twomartens.wahlrecht.model.internal
|
|||||||
|
|
||||||
data class ElectedCandidates(val overallResult: ElectedResult,
|
data class ElectedCandidates(val overallResult: ElectedResult,
|
||||||
val constituencyResults: Map<Int, ElectedResult>,
|
val constituencyResults: Map<Int, ElectedResult>,
|
||||||
val electionNumbersForSeatAllocation: List<Double>)
|
val electionNumbersForSeatAllocation: List<Double>,
|
||||||
|
val seatAllocation: Map<String, Int>)
|
||||||
|
|||||||
@@ -51,7 +51,10 @@ class CalculationService(
|
|||||||
return ElectedCandidates(
|
return ElectedCandidates(
|
||||||
overallResult = overallElectedCandidates,
|
overallResult = overallElectedCandidates,
|
||||||
constituencyResults = constituencyResults,
|
constituencyResults = constituencyResults,
|
||||||
electionNumbersForSeatAllocation = seatResult.usedElectionNumbers
|
electionNumbersForSeatAllocation = seatResult.usedElectionNumbers,
|
||||||
|
seatAllocation = seatResult.seatsPerNomination
|
||||||
|
.map { Pair(it.key.partyAbbreviation, it.value) }
|
||||||
|
.toMap()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user