fix: BAC-29 Implement Mappers for Common Classes

This commit is contained in:
2025-12-05 19:21:12 +01:00
parent d50a576e31
commit a0b0291c9a
12 changed files with 202 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
package dto
import de.knockoutwhist.player.AbstractPlayer
import play.api.libs.json.{Json, OFormat}
case class PlayerDTO(id: String, name: String, dogLife: Boolean)
object PlayerDTO {
implicit val playerFormat: OFormat[PlayerDTO] = Json.format[PlayerDTO]
def apply(player: AbstractPlayer): PlayerDTO = {
PlayerDTO(
id = player.id.toString,
name = player.name,
dogLife = player.isInDogLife
)
}
}