Last active
March 4, 2019 16:07
-
-
Save dcomartin/811774a2030ee4be8f835c9120b92e2a to your computer and use it in GitHub Desktop.
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 ShipmentCommand | |
{ | |
private DateTime? _delivery; | |
private string _proofOfDelivery; | |
public ShipmentCommand(Guid shipmentID) | |
{ | |
// Load current state | |
} | |
public void Deliver(DateTime delivery, string proofOfDelivery) | |
{ | |
if (_delivery != null) | |
{ | |
throw new InvalidOperationException("Already delivered."); | |
} | |
_delivery = delivery; | |
_proofOfDelivery = proofOfDelivery; | |
} | |
} | |
public class ShipmentQuery | |
{ | |
private DateTime? _delivery; | |
public ShipmentQuery(Guid shipmentID) | |
{ | |
// Load current state | |
} | |
public bool IsDelievered() | |
{ | |
return _delivery.HasValue; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment