Rule Parameters
Rule Parameter
Parameters are used to configure the properties of specific rules. These can be used to create a variety of unique rule combinations. The following parameters are used for the various types of Rules in the system. Parameters are entered as key-value pairs using the parameter name as the key in the Rule configuration.
available
Type: Boolean
Default: False
Used for Schedule Rules. By default, the system will loop through all unavailable schedules relevant to the reservation, and check for overlapping events. By setting available to true the system will ensure that the reservation is contained within a defined event of an available type schedule.
cap
Type: String
The cap parameter is an interval and accepts the same values as the Interval parameter.
delay
Type: String
If a delay is set, the system will not enforce the rule on reservations that are made within the delay period. For example, if user attempts to book a tool at 11:50 for 12:00, and there is a delay of 15 minutes, the rule will not be applied.
When specifying a delay, you may use all the modifiers available to the interval parameters.
endBuffer
Type: String
Used to set a buffer to be applied for overlapping or schedule event rules. If set, the system will ensure the specified interval is maintained at the end of a reservation. The parameter accepts all the available interval modifiers.
excludeTeams
Type: String
Used to exclude specific Teams from the application of a Billing Rule. The given rule will not be applied to any Projects of the specified Teams. The parameter will accept either a single Group, or list of Teams. Teams must be specified by their slug. You can find the slug in the administrative detail panel for the Group. In the rare case where a Group is listed in both the excludeTeams, and includeTeams parameters of a Rule, excludeTeams will take precedence and the Group will be excluded.
excludeProjects
Type: String
Used to exclude specific Projects from the application of a Billing Rule. The given rule will not be applied to any of the specified Projects. The parameter will accept either a single Project, or list of Projects. Projects must be specified by their slug. You can find the slug in the administrative detail panel for the Project. In the rare case where a Project is listed in both the excludeProjects, and includeProjects parameters of a Rule, excludeProjects will take precedence and the Project will be excluded.
excludeProjectTypes
Type: String
Used to exclude specific Project Types from the application of a Billing Rule. The given rule will not be applied to any Projects of the specified Types. The parameter will accept either a single Project Type, or list of Project Types. Type must be specified by their slug. You can find the slug in the administrative detail panel for the Project Type. In the rare case where a Project is listed in both the excludeProjectTypes, and includeProjectTypes parameters of a Rule, excludeProjectTypes will take precedence and the Project Type will be excluded.
excludeRoles
Type: String
Used to exclude application of an Access Rule to users with a given role on the associated Resource. In short - if a user has any one of the specified roles, the rule will not be applied. A user is determined to have the role, if they have a valid Training Record for a Training that provides the Role. The parameter will accept either a single role, or list of roles. If the rare case where a user has roles which are both excluded and included, excludedRoles take precedence over includedRoles.
factor
Type: Float
Used to specify a scaling factor for Rule applications. Negative numbers will be converted to absolute values.
grace
Type: String
The grace parameter is an interval and accepts the same values as the Interval parameter.
includeTeams
Type: String
Used to include specific Teams in the application of a Billing Rule. The given rule will only be applied to Projects of the specified Teams. The parameter will accept either a single Group, or list of Teams. Teams must be specified by their slug. You can find the slug in the administrative detail panel for the Group. In the rare case where a Group is listed in both the includeTeams, and includeTeams parameters of a Rule, excludeTeams will take precedence and the Group will be excluded.
includeProjects
Type: String
Used to include specific Projects in the application of a Billing Rule. The given rule will only be applied to the specified Projects. The parameter will accept either a single Project, or list of Projects. Projects must be specified by their slug. You can find the slug in the administrative detail panel for the Project. In the rare case where a Project is listed in both the includeProjects, and includeProjects parameters of a Rule, excludeProjects will take precedence and the Project will be excluded.
includeProjectTypes
Type: String
Used to include specific Project Types in the application of a Billing Rule. The given rule will only be applied to Projects of the specified Types. The parameter will accept either a single Project Type, or list of Project Types. Type must be specified by their slug. You can find the slug in the administrative detail panel for the Project Type. In the rare case where a Project is listed in both the includeProjectTypes, and includeProjectTypes parameters of a Rule, the excludeProjectTypes will take precedence and the Project Type will be excluded.
includeRoles
Type: String
Used to limit application of an Access Rule to only those users with a given role on the associated Resource. In short - the rule will only be applied if the user has any of the specified roles. A user is determined to have the role, if they have a valid Training Record for a Training that provides the Role. The parameter will accept either a single role, or list of roles. If the rare case where a user has roles which are both excluded and included, excludedRoles take precedence over includedRoles
interval
Type: String
The interval parameter is used to specify a time interval and is created by attempting to parse a human friendly string. It is generally recommended to use natual language strings such as 1 week, 2 days, 4 hours etc. to create intervals that are easy to read and understand.
You may also specify delays using PHP's date interval syntax, or use the modifiers listed in the table below:
| Valid Modifier | Example | PHP Interval Format Example |
|---|---|---|
| year, years, y | 1 year | P1Y |
| quarter, quarters | 1 quarter | P3M |
| month, months, mo | 2 mo | P2M |
| week, weeks, w | 1 week | P1W |
| day, days, d | 4 days | P4D |
| hour, hours, h | 4 hours | PT4H |
| minute, minutes, m | 45 m | PT45M |
| second, seconds, s | 55 seconds | PT55S |
| millisecond, milliseconds, ms | milliseconds | N/A |
Multiple modifiers may be chained together to create exact intervals. For example 1w 3d 4h 32m 23s is converted to 10 days 4 hours 32 minutes and 23 seconds.
NB:
To be thorough, you may also use millennia, centuries and microseconds as well should you wish.
maximum
Type: Integer
This value is used to set the number of maximum items for a rule application. Setting a value of null indicates no limit.
minimum
Type: Mixed
This value is used to set the number of minimum items for a rule application. Depending on the rule, the value should be either an Integer or a valid Interval format.
offset
Type: String
Allows for an additional offset provided to a Horizon Booking rule. This will be applied to the end of the attempted reservation period before checking if the event falls within the specified interval. The system will attempt to create this using Carbon's magic date parser. All comparisons are made using UTC.
round
Type: String
Default: seconds
Specifies the rounding unit (precision) for Horizon reservation rules. This can be used to avoid arms races to capture rolling reservation horizons. For example, if set to days, it will not matter what time of day a reservation is attempted on the last day approaching the horizon, the system will round to full days.
Click to expand valid rounding modifiers
'y' => 'years',
'yr' => 'years',
'yrs' => 'years',
'year' => 'years',
'years' => 'years',
'm' => 'months',
'mon' => 'months',
'month' => 'months',
'months' => 'months',
'd' => 'days',
'day' => 'days',
'days' => 'days',
'h' => 'hours',
'hr' => 'hours',
'hrs' => 'hours',
'hour' => 'hours',
'hours' => 'hours',
'i' => 'minutes',
'min' => 'minutes',
'mins' => 'minutes',
'minute' => 'minutes',
'minutes' => 'minutes',
's' => 'seconds',
'sec' => 'seconds',
'secs' => 'seconds',
'second' => 'seconds',
'seconds' => 'seconds',startBuffer
Type: String
Used to set a buffer to be applied for overlapping or schedule event rules. If set, the system will ensure the specified interval is maintained at the start of a reservation. The parameter accepts all the available interval modifiers
strict
Type: Boolean
Default: False
If set to True, any Infrastructure components that are unavailable will cause the validation rule to fail. By default, only required infrastructure components will cause a failure.
threshold
Type: Float
Used to set a threshold value for numeric based rules. The value can be positive or negative and is generally used provide a tolerance for rules that may be affected by small fluctuations.
quota
Type: String
Used to set the total quota for a given interval. If set, the system check the total duration of all reservations in the supplied interval and reject the reservation if the new duration would cause the quota to be exceeded. This can be applied to a User or Project. The parameter accepts all the available interval modifiers