This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Shipment | |
{ | |
public int ShipmentId { get; set; } | |
public List<Stop> Stops { get; set; } | |
public Stop GetStop(int stopId) | |
{ | |
return Stops.Single(x => x.StopId == stopId); | |
} | |
public List<Stop> GetAllStops() | |
{ | |
return Stops; | |
} | |
} | |
public class Stop | |
{ | |
public int ShipmentId { get; set; } | |
public int StopId { get; set; } | |
public StopStatus Status { get; set; } = StopStatus.InTransit; | |
public DateTime Arrived { get; set; } | |
public DateTime? Departed { get; set; } | |
public void SetStatus(StopStatus status) | |
{ | |
Status = status; | |
} | |
public void SetArrivedDateTime(DateTime dateTime) | |
{ | |
Arrived = dateTime; | |
} | |
public void SetDepartedDateTime(DateTime dateTime) | |
{ | |
Departed = dateTime; | |
} | |
} | |
public enum StopStatus | |
{ | |
InTransit, | |
Arrived, | |
Departed | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment