feat: BAC-30 Implement Jackson Mapping via DTOs

This commit is contained in:
2025-12-06 10:15:59 +01:00
parent b9e60b5d4a
commit a8ccebb504
16 changed files with 240 additions and 70 deletions

View File

@@ -0,0 +1,18 @@
package dto.subDTO
import de.knockoutwhist.cards.Card
import de.knockoutwhist.cards.CardValue.Ace
case class RoundDTO(trumpSuit: CardDTO, firstRound: Boolean, tricklist: List[TrickDTO])
object RoundDTO {
def apply(round: de.knockoutwhist.rounds.Round): RoundDTO = {
RoundDTO(
trumpSuit = CardDTO(Card(Ace, round.trumpSuit)),
firstRound = round.firstRound,
tricklist = round.tricklist.map(trick => TrickDTO(trick))
)
}
}