diff --git a/api/ECNQueue.py b/api/ECNQueue.py index 6ba3a5b..b83fefa 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -52,7 +52,7 @@ def __init__(self, queue: str, number: int) -> None: self.building = self.__getMostRecentHeaderByType("Building") self.dateReceived = self.__getMostRecentHeaderByType("Date") - self.json = { + self.jsonData = { "lastUpdated": self.lastUpdated, "headers": self.headers, "content": self.content, @@ -260,6 +260,14 @@ def __getAssignedTo(self) -> str: assignedTo = self.__getMostRecentHeaderByType("Assigned-To") return assignedTo + def toJson(self) -> dict: + """Returns a JSON safe representation of the item. + + Returns: + dict: JSON safe representation of the item. + """ + return json.dumps(self.jsonData) + def __repr__(self) -> str: return self.queue + str(self.number)