|
|
@@ -11,6 +11,7 @@ import se.citerus.dddsample.tracking.core.application.handling.HandlingEventServ
|
|
11
|
11
|
import se.citerus.dddsample.tracking.core.domain.model.cargo.TrackingId;
|
|
12
|
12
|
import se.citerus.dddsample.tracking.core.domain.model.handling.CannotCreateHandlingEventException;
|
|
13
|
13
|
import se.citerus.dddsample.tracking.core.domain.model.handling.HandlingEvent;
|
|
|
14
|
+import se.citerus.dddsample.tracking.core.domain.model.handling.OperatorCode;
|
|
14
|
15
|
import se.citerus.dddsample.tracking.core.domain.model.location.UnLocode;
|
|
15
|
16
|
import se.citerus.dddsample.tracking.core.domain.model.voyage.VoyageNumber;
|
|
16
|
17
|
import static se.citerus.dddsample.tracking.core.interfaces.handling.HandlingReportParser.*;
|
|
|
@@ -39,6 +40,7 @@ public class HandlingReportWebService implements HandlingReportService {
|
|
39
|
40
|
final VoyageNumber voyageNumber = parseVoyageNumber(handlingReport.getVoyageNumber(), validationErrors);
|
|
40
|
41
|
final HandlingEvent.Type type = parseEventType(handlingReport.getType(), validationErrors);
|
|
41
|
42
|
final UnLocode unLocode = parseUnLocode(handlingReport.getUnLocode(), validationErrors);
|
|
|
43
|
+ final OperatorCode operatorCode = parseOperatorCode();
|
|
42
|
44
|
|
|
43
|
45
|
final Map<String, String> allErrors = new HashMap<String, String>();
|
|
44
|
46
|
for (String trackingIdStr : handlingReport.getTrackingIds()) {
|
|
|
@@ -46,7 +48,7 @@ public class HandlingReportWebService implements HandlingReportService {
|
|
46
|
48
|
|
|
47
|
49
|
if (validationErrors.isEmpty()) {
|
|
48
|
50
|
try {
|
|
49
|
|
- handlingEventService.registerHandlingEvent(completionTime, trackingId, voyageNumber, unLocode, type);
|
|
|
51
|
+ handlingEventService.registerHandlingEvent(completionTime, trackingId, voyageNumber, unLocode, type, operatorCode);
|
|
50
|
52
|
} catch (CannotCreateHandlingEventException e) {
|
|
51
|
53
|
logger.error(e, e);
|
|
52
|
54
|
allErrors.put(trackingIdStr, e.getMessage());
|