private def footballMatchStatusPayload()

in notificationworkerlambda/src/main/scala/com/gu/notifications/worker/delivery/apns/models/payload/ApnsPayloadBuilder.scala [107:144]


  private def footballMatchStatusPayload(n: FootballMatchStatusNotification): ApnsPayload = {
    val payLoad = PushyPayload(
      alertTitle = n.title,
      alertBody = n.message,
      categoryName = Some("football-match"),
      mutableContent = true,
      sound = if (n.importance == Importance.Major) Some("default") else None,
      customProperties = Seq(
        CustomProperty(Keys.UniqueIdentifier -> n.id.toString),
        CustomProperty(Keys.Provider -> Provider.Guardian.value),
        CustomProperty(Keys.MessageType -> MessageTypes.FootballMatchStatus),
        CustomProperty(Keys.NotificationType -> FootballMatchStatus.value),
        CustomProperty(Keys.FootballMatch -> (
          Seq(
            CustomProperty(Keys.HomeTeamName -> n.homeTeamName),
            CustomProperty(Keys.HomeTeamId -> n.homeTeamId),
            CustomProperty(Keys.HomeTeamScore -> n.homeTeamScore),
            CustomProperty(Keys.HomeTeamText -> n.homeTeamMessage),
            CustomProperty(Keys.AwayTeamName -> n.awayTeamName),
            CustomProperty(Keys.AwayTeamId -> n.awayTeamId),
            CustomProperty(Keys.AwayTeamScore -> n.awayTeamScore),
            CustomProperty(Keys.AwayTeamText -> n.awayTeamMessage),
            CustomProperty(Keys.CurrentMinute -> ""),
            CustomProperty(Keys.MatchStatus -> n.matchStatus),
            CustomProperty(Keys.MatchId -> n.matchId),
            CustomProperty(Keys.MapiUrl -> n.matchInfoUri.toString),
            CustomProperty(Keys.MatchInfoUri -> n.matchInfoUri.toString),
            CustomProperty(Keys.Uri -> "")
          ) ++
            n.articleUri.map(u => CustomProperty(Keys.ArticleUri -> u.toString)).toSeq ++
            n.competitionName.map(c => CustomProperty(Keys.CompetitionName -> c)).toSeq ++
            n.venue.map(v => CustomProperty(Keys.Venue -> v)).toSeq
          )
        )
      )
    ).payload
    ApnsPayload(payLoad, Some(FootballMatchStatusTtl), Some(n.matchId), PushType.ALERT)
  }