Skip to content

Commit 1dcab5b

Browse files
authored
Merge pull request #1799 from guardian/fix-crest-issue
Add team id to football content state
2 parents f3b0fd6 + afb41bc commit 1dcab5b

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

api-models/src/main/scala/com/gu/mobile.notifications.client/models/liveActitivites/BroadcastContentState.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ case class PenaltyShootoutState(
9999
)
100100

101101
case class TeamState(
102+
id: String,
102103
name: String,
103104
logoAssetName: Option[String] = None,
104105
teamUrl: Option[String] = None,

football/src/main/scala/com/gu/mobile/notifications/football/notificationbuilders/MatchStatusLiveActivityPayloadBuilder.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class MatchStatusLiveActivityPayloadBuilder {
3737
matchStatus = MatchStatus.fromString(matchInfo.matchStatus),
3838
kickOffTimestamp = matchInfo.date.toEpochSecond, // included date and time
3939
homeTeam = TeamState(
40+
id = matchInfo.homeTeam.id,
4041
name = transformTeamName(matchInfo.homeTeam.name),
4142
score = score.home,
4243
logoAssetName = None, // tbc
@@ -45,6 +46,7 @@ class MatchStatusLiveActivityPayloadBuilder {
4546
penaltyScore = PenaltyShootoutScore.toPenaltyShootoutState(penaltyShootoutScore, isHomeTeam = true)
4647
),
4748
awayTeam = TeamState(
49+
id = matchInfo.awayTeam.id,
4850
name = transformTeamName(matchInfo.awayTeam.name),
4951
score = score.away,
5052
logoAssetName = None, // tbc

liveactivities/src/test/scala/com/gu/liveactivities/BroadcastServiceSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class BroadcastServiceSpec(implicit ee: ExecutionEnv) extends Specification with
3232
val defaultContentState = FootballMatchContentState(
3333
matchStatus = FirstHalf,
3434
kickOffTimestamp = now.toEpochSecond - 1800, // 30min ago
35-
homeTeam = TeamState(name = "Arsenal", score = 1),
36-
awayTeam = TeamState(name = "Chelsea", score = 0),
35+
homeTeam = TeamState(id = "1", name = "Arsenal", score = 1),
36+
awayTeam = TeamState(id = "2", name = "Chelsea", score = 0),
3737
competition = Competition(id = "100", name = "Premier League", round = Some("League")),
3838
commentary = Some("Arsenal dominating."),
3939
currentMinute = Some(30),

liveactivities/src/test/scala/com/gu/liveactivities/models/BroadcastPayloadsSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class BroadcastPayloadsSpec extends Specification {
1010
trait BroadcastScope extends Scope {
1111
val now = System.currentTimeMillis() / 1000
1212

13-
val homeTeam = TeamState(name = "Arsenal", score = 1)
14-
val awayTeam = TeamState(name = "Chelsea", score = 0)
13+
val homeTeam = TeamState(id = "1", name = "Arsenal", score = 1)
14+
val awayTeam = TeamState(id = "2", name = "Chelsea", score = 0)
1515
val competition = Competition(id = "100", name = "Premier League", round = Some("League"))
1616

1717
val contentState = FootballMatchContentState(

0 commit comments

Comments
 (0)