|
|
@@ -98,10 +98,16 @@ class Delivery extends ValueObjectSupport<Delivery> {
|
|
98
|
98
|
}
|
|
99
|
99
|
}
|
|
100
|
100
|
|
|
|
101
|
+ /**
|
|
|
102
|
+ * @return True if the cargo has been handled at least once since it was last routed
|
|
|
103
|
+ */
|
|
101
|
104
|
boolean hasBeenHandledAfterRouting() {
|
|
102
|
105
|
return hasBeenHandled() && !routedAfterHandling;
|
|
103
|
106
|
}
|
|
104
|
107
|
|
|
|
108
|
+ /**
|
|
|
109
|
+ * @return True if the cargo has been handled at least once
|
|
|
110
|
+ */
|
|
105
|
111
|
boolean hasBeenHandled() {
|
|
106
|
112
|
return mostRecentHandlingActivity != null;
|
|
107
|
113
|
}
|
|
|
@@ -116,7 +122,7 @@ class Delivery extends ValueObjectSupport<Delivery> {
|
|
116
|
122
|
* </ul>
|
|
117
|
123
|
*
|
|
118
|
124
|
* @param itinerary itinerary
|
|
119
|
|
- * @return <code>true</code> if the cargo has been misdirected,
|
|
|
125
|
+ * @return <code>true</code> if the cargo has been misdirected.
|
|
120
|
126
|
*/
|
|
121
|
127
|
boolean isMisdirected(final Itinerary itinerary) {
|
|
122
|
128
|
return hasBeenHandledAfterRouting() && !itinerary.isExpectedActivity(mostRecentPhysicalHandlingActivity);
|
|
|
@@ -157,9 +163,9 @@ class Delivery extends ValueObjectSupport<Delivery> {
|
|
157
|
163
|
}
|
|
158
|
164
|
|
|
159
|
165
|
/**
|
|
160
|
|
- * @return True if the cargo is routed and not misdirected @param itinerary
|
|
161
|
166
|
* @param itinerary itinerary
|
|
162
|
167
|
* @param routeSpecification route specification
|
|
|
168
|
+ * @return True if the cargo is routed and not misdirected
|
|
163
|
169
|
*/
|
|
164
|
170
|
boolean isOnRoute(final Itinerary itinerary, final RouteSpecification routeSpecification) {
|
|
165
|
171
|
return routingStatus(itinerary, routeSpecification) == ROUTED && !isMisdirected(itinerary);
|