     weight
 
   getDestination: (shipment) ->
-    destination = shipment?['Destination']
-    return unless destination?
-    @presentAddress destination
+    @presentAddress 'PD', shipment?['TrackingEventHistory']?[0]
 
   requestOptions: ({trackingNumber}) ->
     method: 'GET'
-    uri: "http://www.lasership.com/track/#{trackingNumber}/json"
+    uri: "http://www.prestigedelivery.com/TrackingHandler.ashx?trackingNumbers=#{trackingNumber}"
 
 
 module.exports = {PrestigeClient}

    return cb(error: 'missing events') unless response['TrackingEventHistory']?
    cb null, response

  presentAddress: (address) ->
    city = address['City']
    stateCode = address['State']
    postalCode = address['PostalCode']
    countryCode = address['Country']
    @presentLocation {city, stateCode, countryCode, postalCode}

  STATUS_MAP =
    'Released': ShipperClient.STATUS_TYPES.DELIVERED
    'Delivered': ShipperClient.STATUS_TYPES.DELIVERED
    'OutForDelivery': ShipperClient.STATUS_TYPES.OUT_FOR_DELIVERY
    'Arrived': ShipperClient.STATUS_TYPES.EN_ROUTE
    'Received': ShipperClient.STATUS_TYPES.EN_ROUTE
    'OrderReceived': ShipperClient.STATUS_TYPES.SHIPPING
    'OrderCreated': ShipperClient.STATUS_TYPES.SHIPPING

  presentStatus: (eventType) ->
    STATUS_MAP[eventType] if eventType?

  getActivitiesAndStatus: (shipment) ->
    activities = []
    status = null
    rawActivities = shipment?['TrackingEventHistory']
    for rawActivity in rawActivities or []
      location = @presentAddress rawActivity
      dateTime = rawActivity?['DateTime']
      timestamp = moment("#{dateTime}Z").toDate() if dateTime?
      details = rawActivity?['EventShortText']
      if details? and location? and timestamp?
        activity = {timestamp, location, details}
        activities.push activity
      if !status
        status = @presentStatus rawActivity?['EventType']
    {activities, status}

  getEta: (shipment) ->
    return unless shipment?['EstimatedDeliveryDate']?
    moment("#{shipment['EstimatedDeliveryDate']}T00:00:00Z").toDate()

  getService: (shipment) ->


{reduce} = require 'underscore'
moment = require 'moment-timezone'
{titleCase} = require 'change-case'
{ShipperClient} = require './shipper'
