@@ -23,7 +23,7 @@ import scala.concurrent.Future
2323import com .gu .liveactivities .models .LiveActivityInvalidStateException
2424
2525// TODO - we should get the channel ID by looking up the match ID in the datastore
26- case class ChannelRequest (matchId : String , channelId : String , toCreate : Boolean )
26+ case class ChannelRequest (matchId : String , competitionId : Option [ String ], eventData : Option [ LiveActivityData ] , toCreate : Boolean )
2727
2828object ChannelRequest {
2929 implicit val jf : Format [ChannelRequest ] = Json .format[ChannelRequest ]
@@ -33,7 +33,7 @@ object ChannelManagerLambda extends RequestStreamHandler with Lambda with Loggin
3333
3434 val channelApiClient = new ChannelApiClient (authentication, config.bundleId, config.sendingToProdServer)
3535
36- def processCreateChannelRequest (matchId : String , eventData : Option [LiveActivityData ], competitionId : Option [String ]): Future [String ] = {
36+ def processCreateChannelRequest (matchId : String , competitionId : Option [String ], eventData : Option [LiveActivityData ]): Future [String ] = {
3737 logger.info(s " Received request to create channel for match ID ${matchId}" )
3838 return for {
3939 mappingExists <- repository.containMapping(matchId)
@@ -76,7 +76,7 @@ object ChannelManagerLambda extends RequestStreamHandler with Lambda with Loggin
7676 def processRequest (request : ChannelRequest , context : Context ): Unit = {
7777 val channelFuture =
7878 if (request.toCreate)
79- processCreateChannelRequest(request.matchId, None , None )
79+ processCreateChannelRequest(request.matchId, request.competitionId, request.eventData )
8080 else
8181 processCloseChannelRequest(request.matchId)
8282
0 commit comments