| 
					
				 | 
			
			
				@@ -5,17 +5,17 @@ using InABox.Core; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 namespace Comal.Classes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //public class DeliveryAssignments : CoreAggregate<Assignment, Delivery, Guid> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    public override Expression<Func<Delivery, Guid>> Aggregate => Delivery => Delivery.ID; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    //public Expression<Func<Delivery, Guid>> Link => x => x.Assignment.ID; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    public override AggregateCalculation Calculation => AggregateCalculation.Count; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//    public override Dictionary<Expression<Func<Delivery, object>>, Expression<Func<Assignment, object>>> Links => 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        new Dictionary<Expression<Func<Delivery, object>>, Expression<Func<Assignment, object>>> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            { Delivery => Delivery.Assignment.ID, x => x.ID } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //    public override Expression<Func<Delivery, Guid>> Aggregate => Delivery => Delivery.ID; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //    //public Expression<Func<Delivery, Guid>> Link => x => x.Assignment.ID; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //    public override AggregateCalculation Calculation => AggregateCalculation.Count; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //    public override Dictionary<Expression<Func<Delivery, object>>, Expression<Func<Assignment, object>>> Links => 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //        new Dictionary<Expression<Func<Delivery, object>>, Expression<Func<Assignment, object>>> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //            { Delivery => Delivery.Assignment.ID, x => x.ID } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //        }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     ///     An assignment represents an anticipated booking for an employee, much like a diary entry 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -47,20 +47,20 @@ namespace Comal.Classes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [MemoEditor] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EditorSequence(5)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public string Description { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EditorSequence(6)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public AssignmentActivityLink ActivityLink { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EditorSequence(7)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EntityRelationship(DeleteAction.SetNull)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public KanbanLink Task { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EditorSequence(8)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public JobLink JobLink { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EditorSequence(9)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public JobITPLink ITP { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [NullEditor] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [Obsolete("Replaced with Actual.Start", true)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public TimeSpan Start { get; set; } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -68,11 +68,11 @@ namespace Comal.Classes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [NullEditor] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [Obsolete("Replaced with Actual.Duration", true)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public TimeSpan Duration { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [NullEditor] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [Obsolete("Replaced with Actual.Finish", true)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public TimeSpan Finish { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EditorSequence(10)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [CoreTimeEditor] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public CoreTime Booked { get; set; } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -80,7 +80,7 @@ namespace Comal.Classes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EditorSequence(11)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [CoreTimeEditor] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public CoreTime Actual { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [TimestampEditor] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EditorSequence(12)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public DateTime Completed { get; set; } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -95,7 +95,7 @@ namespace Comal.Classes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [NullEditor] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public DeliveryLink Delivery { get; set; } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [NullEditor] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         [EntityRelationship(DeleteAction.SetNull)] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public InvoiceLink Invoice { get; set; } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -109,7 +109,7 @@ namespace Comal.Classes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         protected override void Init() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -125,5 +125,23 @@ namespace Comal.Classes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Booked = new CoreTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Actual = new CoreTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public DateTime EffectiveStart() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (Actual.Start.Ticks != 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return Date.Add(Actual.Start); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return Date.Add(Booked.Start); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public DateTime EffectiveFinish() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (Actual.Finish.Ticks != 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return Date.Add(Actual.Finish); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            else if (Actual.Start.Ticks != 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return Date.Add(Actual.Start).Add(Booked.Duration); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return Date.Add(Booked.Finish); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |