from consts.notification_type import NotificationType
from helpers.model_to_dict import ModelToDict
from notifications.base_notification import BaseNotification


class MatchScoreNotification(BaseNotification):

    def __init__(self, match):
        self.match = match
        self.event = match.event.get()
        self._event_feed = self.event.key_name
        self._district_feed = self.event.event_district_enum

    @property
    def _type(self):
        return NotificationType.MATCH_SCORE

    def _build_dict(self):
        data = {}
        data['message_type'] = NotificationType.type_names[self._type]
        data['message_data'] = {}
        data['message_data']['event_name'] = self.event.name
        data['message_data']['match'] = ModelToDict.matchConverter(self.match)
        return data

from consts.notification_type import NotificationType
from helpers.model_to_dict import ModelToDict
from notifications.base_notification import BaseNotification


class MatchScoreNotification(BaseNotification):

    def __init__(self, match):
        self.match = match
        self.event = match.event.get()
        self._event_feed = self.event.key_name
        self._district_feed = self.event.event_district_enum

    @property
    def _type(self):
        return NotificationType.MATCH_SCORE

    def _build_dict(self):
        data = {}
        data['message_type'] = NotificationType.type_names[self._type]
        data['message_data'] = {}
        data['message_data']['event_name'] = self.event.name
        data['message_data']['event_key'] = self.event.key_name
        data['message_data']['match'] = ModelToDict.matchConverter(self.match)
        return data

Add event key to match score notification
Add event key to match score notification
  from consts.notification_type import NotificationType
  from helpers.model_to_dict import ModelToDict
  from notifications.base_notification import BaseNotification
  
  
  class MatchScoreNotification(BaseNotification):
  
      def __init__(self, match):
          self.match = match
          self.event = match.event.get()
          self._event_feed = self.event.key_name
          self._district_feed = self.event.event_district_enum
  
      @property
      def _type(self):
          return NotificationType.MATCH_SCORE
  
      def _build_dict(self):
          data = {}
          data['message_type'] = NotificationType.type_names[self._type]
          data['message_data'] = {}
          data['message_data']['event_name'] = self.event.name
+         data['message_data']['event_key'] = self.event.key_name
          data['message_data']['match'] = ModelToDict.matchConverter(self.match)
          return data
  
Add event key to match score notification
## Code Before:
from consts.notification_type import NotificationType
from helpers.model_to_dict import ModelToDict
from notifications.base_notification import BaseNotification


class MatchScoreNotification(BaseNotification):

    def __init__(self, match):
        self.match = match
        self.event = match.event.get()
        self._event_feed = self.event.key_name
        self._district_feed = self.event.event_district_enum

    @property
    def _type(self):
        return NotificationType.MATCH_SCORE

    def _build_dict(self):
        data = {}
        data['message_type'] = NotificationType.type_names[self._type]
        data['message_data'] = {}
        data['message_data']['event_name'] = self.event.name
        data['message_data']['match'] = ModelToDict.matchConverter(self.match)
        return data

## Instruction:
Add event key to match score notification
## Code After:
from consts.notification_type import NotificationType
from helpers.model_to_dict import ModelToDict
from notifications.base_notification import BaseNotification


class MatchScoreNotification(BaseNotification):

    def __init__(self, match):
        self.match = match
        self.event = match.event.get()
        self._event_feed = self.event.key_name
        self._district_feed = self.event.event_district_enum

    @property
    def _type(self):
        return NotificationType.MATCH_SCORE

    def _build_dict(self):
        data = {}
        data['message_type'] = NotificationType.type_names[self._type]
        data['message_data'] = {}
        data['message_data']['event_name'] = self.event.name
        data['message_data']['event_key'] = self.event.key_name
        data['message_data']['match'] = ModelToDict.matchConverter(self.match)
        return data
