public void Confirm() { if (!_status.CanAdvance) { return; // or throw an exception } _status = ReservationStatus.Confirmed(); _reservedQuantity = _requestedQuantity; }
internal Reservation(ReservationMemento memento) { _id = memento.Id; _ticketId = memento.TicketId; _requestedQuantity = memento.RequestedQuantity; _reservedQuantity = memento.ReservedQuantity; var statusType = (ReservationStatus.StatusType)Enum.Parse(typeof(ReservationStatus.StatusType), memento.Status); _status = new ReservationStatus(statusType, memento.LastUpdated); }
private Reservation(int ticketId, int requestedQuantity) { _ticketId = ticketId; _requestedQuantity = requestedQuantity; _status = ReservationStatus.Open(); }