Contract, Service and Access Hours
The dates and times that define valid periods in which a job may be booked fall into three categories, which usually are related to the contract that is in place with the customer.
Contract Hours
- Contract Hours represent a promised response window - for example, ‘an engineer should respond within 48 hours of a call being raised’.
- Contract Hours are a pair of dates and times that represent the time period when the job should be scheduled.
- If a job is scheduled so that its
ETA
(ETF
if it’s a call-to-fix job) is afterContractLatest
, it incurs an overdue cost proportional to the amount by which it’s late - but only during its service hours.
Service Hours
- Service Hours represent the hours of the day that a customer contract covers for entitlement - for example, ‘the customer is entitled to 8 am to 5 pm cover’.
- As such, Service Hours are the set of time periods during which a job’s overdue cost is applied. That is, the overdue cost is proportional to the amount of time during its Service Hours that a job’s
ETA
(or itsETF
if it’s a call-to-fix job) exceeds itsContractLatest
time. - A Service Hours pattern is a repeating sequence of Service Hours time periods that apply to a given day of the week.
- Each day of the week (
DotW
) has aStartTime
and anEndTime
. - Where the
EndTime
is before theStartTime
, then thenEndTime
is assumed to be on the next day. - A Service Hours time period can not be longer than 24 hours.
- There can be more than one Service Hours time period per day.
- The time not within the Service Hours defines a set of time periods during which a job’s out-of-Service-Hours cost is applied.
- There can be a ‘grace period’ (in minutes) after the end of each Service Hours time period before the out-of-Service-Hours cost is applied. The grace period does not vary by day of the week, and it must be supplied with a value between
0
and240.
- There are two types of Service Hours pattern: named (pre-defined) patterns and unnamed patterns:
- Named Service Hours patterns are pre-defined in ServiceOptimizer so that a job can be booked with just the name of that Service Hours pattern supplied as a parameter.
- Instead of having a pre-defined Service Hours pattern, a job can be booked with its own (unnamed) Service Hours pattern, i.e. one that is not pre-defined in ServiceOptimizer but is supplied with the job when it is booked.
- For this, a pattern of
DayAndTimePeriod
s must be supplied for each day of the week that the Service Hours should apply.
- For this, a pattern of
- Each job can have only one Service Hours pattern (pre-defined or unnamed), but it can optionally be assigned over one or more date ranges (
SP_DateRange
, below). - Jobs booked with no Service Hours pattern (i.e. both
ServHoursPatts
andServHoursPreDefPatts
in theJobBookRequest
structure supplied in a call to thesp:JobBookRequest
API method areNULL
) will use a default Service Hours pattern calledfru_default_shp
defined in the database. - When a job is booked, it is possible to specify closed dates (
ClosedDates
in theJobBookRequest
structure) during which the Service Hours won’t be applied, i.e. the job does not become any more overdue during these dates.ClosedDates
is defined as a set ofDateRanges
.
- As such, Service Hours are the set of time periods during which a job’s overdue cost is applied. That is, the overdue cost is proportional to the amount of time during its Service Hours that a job’s
Access Hours
- Access Hours represent the hours where the customer site is physically open to undertake the work - for example, ‘nobody is in the building before 9 am so possible to do the job before then because the engineer will not be able to gain access to do the job’.
- Access Hours are an optional set of time periods during which a job can be started (for example when the customer premises are open).
- There are no pre-defined Access Hours patterns, so each job’s Access Hours may only be supplied when it is booked.
- There are several ways in which Access Hours can be specified for a job, all of which, except for the first and fourth options below, can apply at the same time:
- As a weekly repeating open Access Hours pattern over one or more date ranges. An Access Hours pattern is a repeating set of Access Hours time periods that each apply to a day of the week. The actual Access Hours (
DayAndTimePeriodSeq
) must be the same in eachSP_AccHoursPatt
, though theDateRange
s can be different. - As a set of open Access Hours overrides.
- As a set of closed Access Hours overrides that are time periods during which the job must not be started (or finished for a
ETF
job). Closed Access Hours overrides can only be added to existing Access Hours; there is no replace option. Closed Access Hours overrides are also converted into open overrides before being stored and subsequently never appear as closed overrides. - As the same as the Service Hours (see
ServAsAccHours
). If the Service Hours are to also act as Access Hours the Access Hours end after the end of the grace period, if there is one, and it is an error to also supply an Access Hours pattern, though Access Hours overrides are allowed.
- As a weekly repeating open Access Hours pattern over one or more date ranges. An Access Hours pattern is a repeating set of Access Hours time periods that each apply to a day of the week. The actual Access Hours (
Any non-appointment Job must have either:
- A set of Access Hours specified by one of the above mechanisms
OR - Must have at least one open Access Hours override.
If it has an open Access Hours override then it does not have to have Access Hours at all.
Allocation Mechanism
The search for available capacity will be limited to the SLA Search Window (SSW) which is based on a combination of the job’s Contract Hours and Access Hours:
- The start time of the SSW is either:
- If "contract earliest" is being treated as a soft constraint:
{now}
- If "contract earliest" is being treated as a hard constraint:
- The later of the contract earliest time (if supplied) and
{now}
- The later of the contract earliest time (if supplied) and
- If "contract earliest" is being treated as a soft constraint:
- The end time of the SSW is:
- The end of the day containing:
- The later of (contract latest time and
{now}
) +abs_sla_days_after
- The later of (contract latest time and
- The end of the day containing: