コード例 #1
0
 public Result <CustomerQueue> RevokeCustomer(CounterName counterName) =>
 AvailableCounters.GetMaybeServingTicket(counterName)
 .OnSuccess(maybeServingTicket => maybeServingTicket.Map(
                servingTicket => ApplyChange(new CustomerRevoked(Id, counterName, servingTicket.Id))))
 .ToTypedResult(this);
コード例 #2
0
 public Result <CustomerQueue> TakeNextCustomer(CounterName counterName) => AvailableCounters
 .GetMaybeServingTicket(counterName)
 .OnSuccess(maybeServingTicketId => ApplyCustomerServedIfTicketIsBeingServed(maybeServingTicketId, counterName))
 .OnSuccess(_ => ApplyCustomerTakenIfThereIsPendingTicketInTheQueue(counterName))
 .ToTypedResult(this);