import datetime
from enum import Enum

# This is just a DataType to store the package info
class DeliveryObject:
    def __init__(self, id: str, address: str, city: str, state: str, zip: str, deadline: str, weight: float, specialNotes=""):
        self.id: str = id
        self.truckId = -1
        self.deliveryNumber = 0
        self.address: str = address
        self.city: str = city
        self.state: str = state
        self.zipCode: str = zip
        self.packageWeight: float = weight
        self.notes = specialNotes
        self.status: deliveryStatus = deliveryStatus.NO_STATUS
        self.deadline: datetime.time = deadline
        self.timeStart: datetime.time = None
        self.timeEnd: datetime.time = None
        if deadline != "EOD":
            parts = deadline.replace(':', ' ').split()
            self.deadline = datetime.time(int(parts[0]), int(parts[1]))
        else:
            self.deadline = datetime.time(23,59)


class deliveryStatus(Enum):
    NO_STATUS = 0
    IN_ROUTE_TO_HUB = 1
    AT_THE_HUB = 2
    IN_ROUTE = 3
    DELIVERED = 4