Class: QueueCoverage::Slot
- Inherits:
-
Data
- Object
- Data
- QueueCoverage::Slot
- Defined in:
- app/services/queue_coverage.rb
Overview
One half-hour bucket.
Instance Attribute Summary collapse
-
#minute ⇒ Object
readonly
Returns the value of attribute minute.
-
#reps ⇒ Object
readonly
Returns the value of attribute reps.
Instance Method Summary collapse
-
#dedicated ⇒ Integer
Reps exclusive to this queue.
-
#headcount ⇒ Integer
Everyone on queue, dedicated or shared.
-
#shared ⇒ Integer
Reps also covering another queue.
-
#status ⇒ Symbol
Badge keys off dedicated cover only — see the class note on why a shared rep is not a whole rep of capacity.
Instance Attribute Details
#minute ⇒ Object (readonly)
Returns the value of attribute minute
112 113 114 |
# File 'app/services/queue_coverage.rb', line 112 def minute @minute end |
#reps ⇒ Object (readonly)
Returns the value of attribute reps
112 113 114 |
# File 'app/services/queue_coverage.rb', line 112 def reps @reps end |
Instance Method Details
#dedicated ⇒ Integer
Returns reps exclusive to this queue.
116 117 |
# File 'app/services/queue_coverage.rb', line 116 def dedicated = reps.count(&:dedicated?) # @return [Integer] reps also covering another queue |
#headcount ⇒ Integer
Returns everyone on queue, dedicated or shared.
114 115 |
# File 'app/services/queue_coverage.rb', line 114 def headcount = reps.size # @return [Integer] reps exclusive to this queue |
#shared ⇒ Integer
Returns reps also covering another queue.
118 |
# File 'app/services/queue_coverage.rb', line 118 def shared = reps.size - dedicated |
#status ⇒ Symbol
Badge keys off dedicated cover only — see the class note on why a shared
rep is not a whole rep of capacity.
+:shared_only+ is deliberately distinct from +:critical+. Half the queues
have no dedicated rep at all (Sales_Trade: five reps, none exclusive), and
labelling that CRITICAL every hour of every day trains people to ignore the
badge. It says "nobody owns this queue" — a standing structural fact — where
CRITICAL means "one person is holding it right now".
+:uncovered+ is its own state because staggered shifts can leave a hole in
the middle of the day that nobody is on for. Folding that into CRITICAL
would show the same badge for "one rep is holding this" and "the phone
rings out" — the two staffing signals furthest apart.
135 136 137 138 139 140 141 142 |
# File 'app/services/queue_coverage.rb', line 135 def status return :uncovered if reps.empty? return :shared_only if dedicated.zero? return :critical if dedicated == 1 return :thin if dedicated == 2 :peak end |