Skip to content

Instantly share code, notes, and snippets.

@mgryszko
Created September 21, 2013 09:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgryszko/6648823 to your computer and use it in GitHub Desktop.
Save mgryszko/6648823 to your computer and use it in GitHub Desktop.
DDD practice - shipping

Use cases

Book new cargo

Shipping agent provides origin, destination and arrival deadline. Origin and destination as UN locode 1.

System assigns a unique tracking id. Tracking id should be unique and generated by the system.

Cargo is initially unrouted.

Route new cargo

Shipping agent provides the tracking id.

System proposes some itineraries matching the cargo's route specification.

An itinerary consists of legs. Each leg is covered by voyage (ship), that has load and unload locations and times.

The agent accepts one of provided routes.

Our company has an algorithm for route calculation but we consider using an external specialized service.

Register a cargo event (expected/unexpected)

When a cargo arrives at a port, handling agent denotes this fact.

He enters tracking id, voyage number and what happened with the cargo (received, loaded or unloaded).

Track cargo

Shipping agent wants to know how is delivery going:

  • what happened with the cargo, when and where
  • if it's misdirected (in a wrong location)
  • what should happen next (e.g. if it was loaded in Mumbai, it should be unloaded in Dubai according to the itinerary)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment