public bool IsRangeOverlapping(ReservationDateTime other)
        {
            Assertion.ArgumentNotNull(other, nameof(other));
            var compareResultStart = Start.CompareTo(other.Start);
            var compareResultEnd   = End.CompareTo(other.End);

            return(Start.CompareTo(other.End) < 0 && other.Start.CompareTo(End) < 0);
        }
 public bool IsDupulicated(Reservation other)
 {
     Assertion.ArgumentNotNull(other, nameof(other));
     if (!EquipmentId.Equals(other.EquipmentId))
     {
         return(false);
     }
     if (!ReservationDateTime.IsRangeOverlapping(other.ReservationDateTime))
     {
         return(false);
     }
     return(true);
 }
 public Reservation(
     ReservationId id,
     AccountId accountId,
     EquipmentId equipmentId,
     ReservationDateTime reservationDateTime,
     PurposeOfUse purposeOfUse,
     ReservationStatus reservationStatus)
 {
     Id                  = id;
     AccountId           = accountId;
     EquipmentId         = equipmentId;
     ReservationDateTime = reservationDateTime;
     ReservationStatus   = ReservationStatus.Reserved;
     PurposeOfUse        = purposeOfUse;
     ReservationStatus   = reservationStatus;
 }
 public void ChangeReservationDateTime(ReservationDateTime reservationDateTime)
 {
     ReservationDateTime = reservationDateTime;
 }