Skip to content

Commit

Permalink
feature: game api response createdOn field
Browse files Browse the repository at this point in the history
  • Loading branch information
kuoche1712003 committed Apr 7, 2024
1 parent e63c62f commit 129350a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ private fun GameRegistration.toGameRegistrationUpdatedEvent(): GameRegistrationU
maxPlayers,
frontEndUrl,
backEndUrl,
createdOn,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tw.waterballsa.gaas.events

import tw.waterballsa.gaas.domain.GameRegistration
import java.time.Instant

class GameRegistrationUpdatedEvent(
val id: GameRegistration.Id,
Expand All @@ -13,4 +14,5 @@ class GameRegistrationUpdatedEvent(
val maxPlayers: Int,
val frontEndUrl: String,
val backEndUrl: String,
val createdOn: Instant,
) : DomainEvent()
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class GetGameRegistrationPresenter : GetGameRegistrationsUsecase.Presenter {
name = displayName,
img = imageUrl,
minPlayers = minPlayers,
maxPlayers = maxPlayers
maxPlayers = maxPlayers,
createdOn = createdOn,
)

data class GetGamesViewModel(
Expand All @@ -138,5 +139,6 @@ class GetGameRegistrationPresenter : GetGameRegistrationsUsecase.Presenter {
val img: String,
val minPlayers: Int,
val maxPlayers: Int,
val createdOn: Instant,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class UpdateGameRegistrationPresenter : Presenter {
minPlayers,
maxPlayers,
frontEndUrl,
backEndUrl
backEndUrl,
createdOn,
)

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tw.waterballsa.gaas.spring.controllers.viewmodel

import tw.waterballsa.gaas.domain.GameRegistration
import java.time.Instant

data class UpdateGameRegistrationViewModel(
val id: GameRegistration.Id,
Expand All @@ -13,4 +14,5 @@ data class UpdateGameRegistrationViewModel(
val maxPlayers: Int,
val frontEndUrl: String,
val backEndUrl: String,
val createdOn: Instant,
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package tw.waterballsa.gaas.spring.it.controllers

import com.fasterxml.jackson.core.type.TypeReference
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.fail
import org.assertj.core.api.Assertions.*
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
Expand Down Expand Up @@ -260,6 +259,7 @@ class GameRegistrationControllerTest @Autowired constructor(
assertThat(it.imageUrl).isEqualTo(img)
assertThat(it.minPlayers).isEqualTo(minPlayers)
assertThat(it.maxPlayers).isEqualTo(maxPlayers)
assertThat(it.createdOn).isEqualTo(createdOn)
}
}

Expand Down

0 comments on commit 129350a

Please sign in to comment.