profile = "delivery-tracking/shipment-info@1.1"
provider = "mock"

map ShipmentInfo {

  trackingNumber = input.trackingNumber
  transitStatus = 'transit'
  preTransitStatus = 'pre_transit'

  shipments = [{
    carrier: 'Mocked carrier',
    trackingNumber: trackingNumber,
    origin: {
      address: {
        countryCode: 'US',
        postalCode: '94103',
        addressLocality: 'San Francisco'
      }
    },
    destination: {
      address: {
        countryCode: 'US',
        postalCode: '60611',
        addressLocality: 'Chicago'
      }
    },
    status: {
      timestamp: '2021-05-04T22:49:23.204Z',
      statusCode: transitStatus,
      statusText: 'Your shipment has departed from the origin.',
      location: {
        address: {
          countryCode: 'US',
          postalCode: '94103',
          addressLocality: 'San Francisco'
        }
      }
    },
    events: [
      {
        timestamp: '2021-05-04T22:49:23.204Z',
        statusCode: transitStatus,
        statusText: 'Your shipment has departed from the origin.',
        location: {
          address: {
            countryCode: 'US',
            postalCode: '94103',
            addressLocality: 'San Francisco'
          }
        }
      },
      {
        timestamp: '2021-05-03T18:49:23.204Z',
        statusCode: preTransitStatus,
        statusText: 'The carrier has received the electronic shipment information.'
      }
    ],
    estimatedDeliveryDate: '2021-05-11T05:44:01.431Z'
  }]

  map result shipments
}