def applyEvent()

in pekko-sample-persistence-dc-scala/src/main/scala/sample/persistence/res/auction/Auction.scala [202:220]


    def applyEvent(event: Event): AuctionState =
      event match {
        case BidRegistered(b) =>
          if (isHigherBid(b, highestBid))
            withNewHighestBid(b)
          else
            withTooLowBid(b)
        case AuctionFinished(atDc) =>
          phase match {
            case Running =>
              copy(phase = Closing(Set(atDc)))
            case Closing(alreadyFinishedDcs) =>
              copy(phase = Closing(alreadyFinishedDcs + atDc))
            case _ =>
              this
          }
        case _: WinnerDecided =>
          copy(phase = Closed)
      }