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; }
/// <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); }
/// <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); }
/// <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; }
private void OnCargoAssignedToRoute(CargoAssignedToRouteEvent @event) { Itinerary = @event.NewItinerary; DeliveryStatus = @event.Delivery; }
private void OnCargoRegistered(CargoRegisteredEvent @event) { TrackingId = @event.TrackingId; RouteSpecification = @event.RouteSpecification; DeliveryStatus = @event.Delivery; }
private void OnCargoHandled(CargoHandledEvent @event) { DeliveryStatus = @event.Delivery; }
private void OnCargoDestinationChanged(CargoDestinationChangedEvent @event) { RouteSpecification = @event.NewSpecification; DeliveryStatus = @event.Delivery; }
/// <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; }