import Foundation

extension DPlan
{
    var origin:DPlanStop?
    {
        get
        {
            let stop:DPlanStop? = stops?.firstObject as? DPlanStop
            
            return stop
        }
    }
    
    var destination:DPlanStop?
    {
        get
        {
            let stop:DPlanStop? = stops?.lastObject as? DPlanStop
            
            return stop
        }
    }
}

import Foundation

extension DPlan
{
    
}

--- 
+++ 
@@ -2,5 +2,23 @@
 
 extension DPlan
 {
+    var origin:DPlanStop?
+    {
+        get
+        {
+            let stop:DPlanStop? = stops?.firstObject as? DPlanStop
+            
+            return stop
+        }
+    }
     
+    var destination:DPlanStop?
+    {
+        get
+        {
+            let stop:DPlanStop? = stops?.lastObject as? DPlanStop
+            
+            return stop
+        }
+    }
 }
Add origin and destination properties
