Procházet zdrojové kódy

Accidentally excluded from previous commit

peter_backlund před 18 roky
rodič
revize
ea5d6358ac

+ 26
- 27
dddsample/src/main/java/se/citerus/dddsample/service/CargoService.java Zobrazit soubor

@@ -1,10 +1,10 @@
1 1
 package se.citerus.dddsample.service;
2 2
 
3
+import se.citerus.dddsample.domain.Cargo;
4
+import se.citerus.dddsample.domain.Itinerary;
3 5
 import se.citerus.dddsample.domain.TrackingId;
4 6
 import se.citerus.dddsample.domain.UnLocode;
5
-import se.citerus.dddsample.service.dto.CargoRoutingDTO;
6 7
 import se.citerus.dddsample.service.dto.CargoTrackingDTO;
7
-import se.citerus.dddsample.service.dto.ItineraryCandidateDTO;
8 8
 
9 9
 import java.util.List;
10 10
 
@@ -14,26 +14,12 @@ import java.util.List;
14 14
 public interface CargoService {
15 15
 
16 16
   /**
17
-   * Registers a new cargo in the tracking system, not yet routed.
18
-   *
19
-   * @param origin      cargo origin
20
-   * @param destination cargo destination
21
-   * @return Cargo tracking id
22
-   */
23
-  TrackingId registerNew(UnLocode origin, UnLocode destination);
24
-
25
-  /**
26 17
    * @param trackingId tracking id
27 18
    * @return A cargo and its delivery history, or null if no cargo with given tracking id is found.
28 19
    */
29 20
   CargoTrackingDTO track(TrackingId trackingId);
30 21
 
31 22
   /**
32
-   * @return A list of all locations where the company ships cargo to.
33
-   */
34
-  List<UnLocode> shippingLocations();
35
-
36
-  /**
37 23
    * Send relevant notifications to interested parties,
38 24
    * for example if a cargo has been misdirected, or unloaded
39 25
    * at the final destination.
@@ -43,27 +29,40 @@ public interface CargoService {
43 29
   void notify(TrackingId trackingId);
44 30
 
45 31
   /**
46
-   * Loads a cargo for routing operations.
32
+   * @return A list of all locations where the company ships cargo to.
33
+   */
34
+  List<UnLocode> listShippingLocations();
35
+
36
+  /**
37
+   * Lists all cargos.
47 38
    *
48
-   * @param trackingId cargo tracking id
49
-   * @return A cargo with it's itinerary, or null if none found.
39
+   * @return All cargos.
50 40
    */
51
-  CargoRoutingDTO loadForRouting(TrackingId trackingId);
41
+  List<Cargo> listAllCargos();
52 42
 
53 43
   /**
54
-   * Loads all cargos for routing operations.
44
+   * Registers a new cargo in the tracking system, not yet routed.
55 45
    *
56
-   * @return All cargos with their itineraries.
46
+   * @param origin      cargo origin
47
+   * @param destination cargo destination
48
+   * @return Cargo tracking id
49
+   */
50
+  TrackingId registerNewCargo(UnLocode origin, UnLocode destination);
51
+
52
+  /**
53
+   * Loads a cargo for routing operations.
54
+   *
55
+   * @param trackingId cargo tracking id
56
+   * @return A cargo with it's itinerary, or null if none found.
57 57
    */
58
-  List<CargoRoutingDTO> loadAllForRouting();
58
+  Cargo loadCargoForRouting(TrackingId trackingId);
59 59
 
60 60
   /**
61
-   * Assigns a new itinerary to a cargo,
62
-   * based on this list of legs.
61
+   * Assigns a cargo to route.
63 62
    *
64 63
    * @param trackingId cargo tracking id
65
-   * @param itinerary  the new itinerary, from a selection
64
+   * @param itinerary  the new itinerary describing the route
66 65
    */
67
-  void assignItinerary(TrackingId trackingId, ItineraryCandidateDTO itinerary);
66
+  void assignCargoToRoute(TrackingId trackingId, Itinerary itinerary);
68 67
 
69 68
 }