Class: QueueCoverage::Slot

Inherits:
Data
  • Object
show all
Defined in:
app/services/queue_coverage.rb

Overview

One half-hour bucket.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#minuteObject (readonly)

Returns the value of attribute minute

Returns:

  • (Object)

    the current value of minute



112
113
114
# File 'app/services/queue_coverage.rb', line 112

def minute
  @minute
end

#repsObject (readonly)

Returns the value of attribute reps

Returns:

  • (Object)

    the current value of reps



112
113
114
# File 'app/services/queue_coverage.rb', line 112

def reps
  @reps
end

Instance Method Details

#dedicatedInteger

Returns reps exclusive to this queue.

Returns:

  • (Integer)

    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

#headcountInteger

Returns everyone on queue, dedicated or shared.

Returns:

  • (Integer)

    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

#sharedInteger

Returns reps also covering another queue.

Returns:

  • (Integer)

    reps also covering another queue



118
# File 'app/services/queue_coverage.rb', line 118

def shared = reps.size - dedicated

#statusSymbol

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.

Returns:

  • (Symbol)

    :peak, :thin, :critical, :shared_only or :uncovered



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