+ self.prev = prev_booking
+ if self.prev:
+ self.prev.next = self
+ self.next: Optional[Self] = None
+
+ def can_move(self, up: bool) -> bool:
+ """Whether movement rules would allow self to move up or down."""
+ if (up and ((not self.prev)
+ or self.prev.intro.date != self.intro.date)):
+ return False
+ if ((not up) and ((not self.next)
+ or self.next.intro.date != self.intro.date)):
+ return False
+ return True