private void _initialiseCase() { switch (_currentCase?.Stage) { case AppealCaseState.Stage.SummonsEnqueued: case AppealCaseState.Stage.DecisionEnqueued: _currentCase.AdvanceState(); break; } switch (_currentCase?.Stage) { case AppealCaseState.Stage.SummonsStarted: _workCounter = HOURSPERSUMMONS; _currentWorkType = Work.WorkType.Summons; break; case AppealCaseState.Stage.DecisionStarted: _workCounter = HOURSPERDECISION; _currentWorkType = Work.WorkType.Decision; break; default: throw new InvalidOperationException("_currentCase is null or in a state that does not allow work."); } }
internal void Enqueue(AppealCase appealCase) { if (appealCase.Stage == AppealCaseState.Stage.New) { appealCase.AdvanceState(); } switch (appealCase.Stage) { case AppealCaseState.Stage.SummonsEnqueued: case AppealCaseState.Stage.SummonsStarted: case AppealCaseState.Stage.SummonsFinished: _summonsQueue.Enqueue(appealCase); break; case AppealCaseState.Stage.DecisionEnqueued: case AppealCaseState.Stage.DecisionStarted: case AppealCaseState.Stage.DecisionFinished: _decisionQueue.Enqueue(appealCase); break; default: throw new InvalidOperationException("Appeal is not in Summons or Decision stage."); } }
private void _processCirculatingCases() { while (_circulatingCases.Count > 0) { AppealCase appealCase = _circulatingCases.Dequeue(); Allocation allocation = _activeCases[appealCase]; Member nextWorker = allocation.Enqueue(appealCase); if (nextWorker == null) { appealCase.AdvanceState(); Hour opStartHour = _scheduleOP(appealCase); Hour opEndHour = opStartHour.Add(OPDURATION); allocation.NotifyOPSchedule(appealCase, opStartHour, opEndHour); } } }
internal Member Enqueue(AppealCase appealCase) { switch (appealCase.Stage) { case AppealCaseState.Stage.New: appealCase.AdvanceState(); break; case AppealCaseState.Stage.SummonsEnqueued: appealCase.AdvanceState(); break; case AppealCaseState.Stage.SummonsStarted: break; case AppealCaseState.Stage.SummonsFinished: break; case AppealCaseState.Stage.OPPending: break; case AppealCaseState.Stage.OPFinsished: break; case AppealCaseState.Stage.DecisionEnqueued: break; case AppealCaseState.Stage.DecisionStarted: break; case AppealCaseState.Stage.DecisionFinished: break; default: break; } if (_allocatedBoard.SummonsWorkerCount == 0) { return(null); } Member member = _allocatedBoard.DequeueSummonsWorker(); switch (_allocatedBoard.SummonsWorkerCount) { case 2: member.EnqueueRapporteurWork(appealCase); break; case 1: member.EnqueueOtherWork(appealCase); break; case 0: member.EnqueueChairWork(appealCase); break; default: throw new InvalidOperationException("Something is wrong with the number of summons workers."); } return(member); }