public List <TransitLocation> GetTransitLocations(int orderId)
 {
     return(new List <TransitLocation>
     {
         TransitLocation.Create(
             name: "loc1",
             date: DateTime.UtcNow,
             Address.Create(
                 addressLine1: "addressLine1",
                 addressLine2: "addressLine2",
                 country: "country")),
         TransitLocation.Create(
             name: "loc2",
             date: DateTime.UtcNow,
             Address.Create(
                 addressLine1: "addressLine1",
                 addressLine2: "addressLine2",
                 country: "country")),
     });
 }
Example #2
0
        public List <TransitLocation> GetOrderTrackingInfo(int orderId)
        {
            //Load order from the repository
            var domainOrder = _orderRepository.Load(orderId);

            if (domainOrder == null)
            {
                return(new List <TransitLocation>());
            }

            //Load the transit locations
            domainOrder.WithOrderTrackingRepository(_orderTrackingRepository);
            domainOrder.LoadTransitLocations();

            //Convert to output contracts and return
            return(domainOrder.TransitLocations.Select(location =>
                                                       TransitLocation.Create(
                                                           location.Name,
                                                           location.Date,
                                                           Address.Create(domainOrder.BillingAddress.AddressLine1,
                                                                          domainOrder.BillingAddress.AddressLine2,
                                                                          domainOrder.BillingAddress.Country)
                                                           )).ToList());
        }