def shipment_to_dict(shipment):
    """
    Convert an instance of the Shipment model to a dict.

    :param shipment:  An instance of the Shipment model.
    :return:      A dict representing the shipment.
    """
    return {
        'id': shipment.id,
        'status': shipment.status,
        'createdAt': shipment.createdAt,
        'updatedAt': shipment.updatedAt,
        'deliveredAt': shipment.deliveredAt,
        'estimatedTimeOfArrival': shipment.estimatedTimeOfArrival,
        'currentLocation': shipment.currentLocation,
        'fromId': shipment.fromId,
        'toId': shipment.toId
    }