diff --git a/classes/tracker.py b/classes/tracker.py index 965c9c3..e7116e7 100644 --- a/classes/tracker.py +++ b/classes/tracker.py @@ -102,6 +102,7 @@ class Tracker: for event in events: if latest_known_event is None or event.event_time > latest_known_event.event_time: + event.shipment_id = shipment_id self.db.write_event(event) logging.info(f"New event for {tracking_number}: {event.event_description} - {event.event_time}") diff --git a/trackers/keydelivery.py b/trackers/keydelivery.py index d2cd9af..ce0bce9 100644 --- a/trackers/keydelivery.py +++ b/trackers/keydelivery.py @@ -24,7 +24,7 @@ class KeyDelivery(BaseTracker): for event in events: yield Event( - shipment_id = tracking_number, + shipment_id = 0, event_time = event["time"], event_description = event["context"], raw_event = json.dumps(event) diff --git a/trackers/postat.py b/trackers/postat.py index 12df5a1..f81e693 100644 --- a/trackers/postat.py +++ b/trackers/postat.py @@ -21,7 +21,7 @@ class PostAT(BaseTracker): py_timestamp = parse(timestamp) event_time = py_timestamp.strftime("%Y-%m-%d %H:%M:%S") yield Event( - shipment_id = tracking_number, + shipment_id = 0, event_time = event_time, event_description = event["text"], raw_event = json.dumps(event)