package Ġuk . gov . just ice . digital . h mp ps . cour t list splitter . service Ċ Ċ import Ġcom . microsoft . application insights . Telemetry Client Ċ import Ġorg . springframework . stereotype . Service Ċ import Ġuk . gov . just ice . digital . h mp ps . cour t list splitter . model . external document request . Case Ċ import Ġuk . gov . just ice . digital . h mp ps . cour t list splitter . model . external document request . Info Ċ Ċ @ Service Ċ class ĠTe lemetry Service ( private Ġval Ġtelemetry Client : ĠTe lemetry Client ) Ġ{ ĊĊĠ Ġfun Ġtrack Event ( eventType : ĠTe lemetry EventType ) Ġ{ ĊĠĠĠ Ġtelemetry Client . track Event ( eventType . eventName ) ĊĠ Ġ} ĊĊĠ Ġfun Ġtrack Cour t List Event ( info : ĠInfo , ĠmessageId : ĠString ) Ġ{ ĊĠĠĠ Ġval Ġproperties Ġ= Ġmap Of ( CO UR T _ CODE _ KEY Ġto Ġinfo . ou Code , ĠHE AR ING _ DATE _ KEY Ġto Ġinfo . date Of He aring . toString (), ĠS QS _ MESSAGE _ ID _ KEY Ġto ĠmessageId ) ĊĊĠĠĠ Ġtelemetry Client . track Event ( Telemetry EventType . CO UR T _ LIST _ RECE IVED . eventName , Ġproperties , Ġempty Map ()) ĊĠ Ġ} ĊĊĠ Ġfun Ġtrack Cour t Case Split Event ( case : ĠCase , ĠmessageId : ĠString ) Ġ{ ĊĊĠĠĠ Ġval Ġsession Ġ= Ġcase . block . session ĊĠĠĠ Ġval Ġproperties Ġ= Ġmap Of ( ĊĠĠĠĠĠ ĠCO UR T _ CODE _ KEY Ġto Ġsession . cour t Code , ĊĠĠĠĠĠ ĠCO UR T _ ROOM _ KEY Ġto Ġsession . cour t Room , ĊĠĠĠĠĠ ĠHE AR ING _ DATE _ KEY Ġto Ġsession . date Of He aring . toString (), ĊĠĠĠĠĠ ĠCASE _ NO _ KEY Ġto Ġcase . case No , ĊĠĠĠĠĠ ĠS QS _ MESSAGE _ ID _ KEY Ġto ĠmessageId ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġtelemetry Client . track Event ( Telemetry EventType . CO UR T _ CASE _ SPLIT . eventName , Ġproperties , Ġempty Map ()) ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġconst Ġval ĠCO UR T _ CODE _ KEY Ġ= Ġ" cour t Code " ĊĠĠĠ Ġconst Ġval ĠCO UR T _ ROOM _ KEY Ġ= Ġ" cour t Room " ĊĠĠĠ Ġconst Ġval ĠCASE _ NO _ KEY Ġ= Ġ" case No " ĊĠĠĠ Ġconst Ġval ĠHE AR ING _ DATE _ KEY Ġ= Ġ" he aring Date " ĊĠĠĠ Ġconst Ġval ĠS QS _ MESSAGE _ ID _ KEY Ġ= Ġ" sqs MessageId " ĊĠ Ġ} Ċ } Ċ