public CargoWasAssignedToRouteEvent(Cargo cargo, Itinerary oldItinerary, Itinerary newItinerary, Delivery delivery)
 {
    _cargo = cargo;
    _delivery = delivery;
    _newItinerary = newItinerary;
    _oldItinerary = oldItinerary;
 }
 public CargoDestinationChangedEvent(Cargo cargo, RouteSpecification oldSpecification, RouteSpecification newSpecification, Delivery delivery)
 {
    _cargo = cargo;
    _delivery = delivery;
    _newSpecification = newSpecification;
    _oldSpecification = oldSpecification;
 }
Exemple #3
0
 /// <summary>
 /// Assigns cargo to a provided route.
 /// </summary>
 /// <param name="itinerary">New itinerary</param>
 public virtual void AssignToRoute(Itinerary itinerary)
 {
     if (itinerary == null)
     {
         throw new ArgumentNullException("itinerary");
     }
     Itinerary = itinerary;
     Delivery = Delivery.UpdateOnRouting(RouteSpecification, Itinerary);
 }
Exemple #4
0
 /// <summary>
 /// Specifies a new route for this cargo.
 /// </summary>
 /// <param name="routeSpecification">Route specification.</param>
 public virtual void SpecifyNewRoute(RouteSpecification routeSpecification)
 {
     if (routeSpecification == null)
     {
         throw new ArgumentNullException("routeSpecification");
     }
     RouteSpecification = routeSpecification;
     Delivery = Delivery.UpdateOnRouting(RouteSpecification, Itinerary);
 }
Exemple #5
0
 /// <summary>
 /// Creates new <see cref="Cargo"/> object with provided tracking id and route specification.
 /// </summary>
 /// <param name="trackingId">Tracking id of this cargo.</param>
 /// <param name="routeSpecification">Route specification.</param>
 public Cargo(TrackingId trackingId, RouteSpecification routeSpecification)
 {
     if (trackingId == null)
     {
         throw new ArgumentNullException("trackingId");
     }
     if (routeSpecification == null)
     {
         throw new ArgumentNullException("routeSpecification");
     }
     TrackingId = trackingId;
     RouteSpecification = routeSpecification;
     Delivery = Delivery.DerivedFrom(RouteSpecification, Itinerary, null);
 }
 public CargoWasHandledEvent(Cargo cargo, Delivery delivery, HandlingEventType eventType)
 {
    _cargo = cargo;
    _eventType = eventType;
    _delivery = delivery;
 }
Exemple #7
0
 private void OnCargoAssignedToRoute(CargoAssignedToRouteEvent @event)
 {
    Itinerary = @event.NewItinerary;
    DeliveryStatus = @event.Delivery;
 }
Exemple #8
0
 private void OnCargoRegistered(CargoRegisteredEvent @event)
 {
    TrackingId = @event.TrackingId;
    RouteSpecification = @event.RouteSpecification;
    DeliveryStatus = @event.Delivery;
 }
Exemple #9
0
 private void OnCargoHandled(CargoHandledEvent @event)
 {
    DeliveryStatus = @event.Delivery;
 }
Exemple #10
0
 private void OnCargoDestinationChanged(CargoDestinationChangedEvent @event)
 {
    RouteSpecification = @event.NewSpecification;
    DeliveryStatus = @event.Delivery;
 }
Exemple #11
0
 /// <summary>
 /// Updates delivery progress information according to handling history.
 /// </summary>
 /// <param name="lastHandlingEvent">Most recent handling event.</param>
 public virtual void DeriveDeliveryProgress(HandlingEvent lastHandlingEvent)
 {
     Delivery = Delivery.DerivedFrom(RouteSpecification, Itinerary, lastHandlingEvent);
 }
 public CargoRegisteredEvent(Cargo cargo, RouteSpecification routeSpecification, Delivery delivery)
 {
    _cargo = cargo;
    _routeSpecification = routeSpecification;
    _delivery = delivery;         
 }
 public CargoRegisteredEvent(TrackingId trackingId, RouteSpecification routeSpecification, Delivery delivery)
 {
     _routeSpecification = routeSpecification;
     _trackingId         = trackingId;
     _delivery           = delivery;
 }
 public CargoHandledEvent(Delivery delivery)
 {
     Delivery = delivery;
 }