You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: policy/README.md
+17-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -281,8 +281,9 @@ An individual `Rule` object is defined by the following fields:
281
281
|`inclusive_maximum`| boolean | Optional | Whether the rule `maximum` is considered in-bounds (default `true`) |
282
282
|`rate_amount`| integer | Optional | Amount of the rate (see [Rate Amounts](#rate-amounts)) |
283
283
|`rate_recurrence`| enum | Optional | Recurrence of the rate (see [Rate Recurrences](#rate-recurrences)) |
284
-
|`start_time`| ISO 8601 time `hh:mm:ss`| Optional | Beginning time-of-day when the rule is in effect (default 00:00:00). |
285
-
|`end_time`| ISO 8601 time `hh:mm:ss`| Optional | Ending time-of-day when the rule is in effect (default 23:59:59). |
284
+
|`rate_applies_when`| enum | Optional | Specifies when a rate is applied to a rule (see [Rate Applies When](#rate-applies-when)) (defaults to `out_of_bounds`) |
285
+
|`start_time`| ISO 8601 time `hh:mm:ss`| Optional | Beginning time-of-day when the rule is in effect (default 00:00:00). |
286
+
|`end_time`| ISO 8601 time `hh:mm:ss`| Optional | Ending time-of-day when the rule is in effect (default 23:59:59). |
286
287
|`days`| day[]| Optional | Days `["sun", "mon", "tue", "wed", "thu", "fri", "sat"]` when the rule is in effect (default all) |
287
288
|`messages`|`{ String:String }`| Optional | Message to rider user, if desired, in various languages, keyed by language tag (see [Messages](#messages)) |
288
289
|`value_url`| URL | Optional | URL to an API endpoint that can provide dynamic information for the measured value (see [Value URL](#value-url)) |
@@ -342,7 +343,7 @@ The amount of a rate applied when this rule applies, if applicable (default zero
342
343
343
344
#### Rate Recurrences
344
345
345
-
Rate recurrences specify when a rate is applied – either once, or periodically according to a `time_unit` specified using [Rule Units](#rule-units). A `time_unit` refers to a unit of time as measured in local time for the jurisdiction – a day begins at midnight local time, an hour begins at the top of the hour, etc.
346
+
Rate recurrences specify how a rate is applied – either once, or periodically according to a `time_unit` specified using [Rule Units](#rule-units). A `time_unit` refers to a unit of time as measured in local time for the jurisdiction – a day begins at midnight local time, an hour begins at the top of the hour, etc.
@@ -353,6 +354,19 @@ Rate recurrences specify when a rate is applied – either once, or periodicall
353
354
354
355
[Top][toc]
355
356
357
+
#### Rate Applies When
358
+
359
+
The `rate_applies_when` field specifies when a rate should be applied to an event or count,
360
+
e.g. is it when the event is within the Rule bounds or when it is outside?
361
+
It defaults to `out_of_bounds`.
362
+
363
+
The `rate_applies_when` field may take the following values:
364
+
365
+
| Name | Description |
366
+
| --------------- | ----------- |
367
+
|`in_bounds`| Rate applies when an event or count is within the rule `minimum` and `maximum`|
368
+
|`out_of_bounds`| Rate applies when an event or count is outside of the rule `minimum` and `maximum`|
369
+
356
370
### Messages
357
371
358
372
Some Policies as established by the Agency may benefit from rider communication. This optional field contains a map of languages to messages, to be shown to the user.
@@ -456,8 +456,19 @@ This policy states parking fees as such:
456
456
- Parking every hour onwards costs $10
457
457
458
458
For example, say a vehicle is parked for 6.5 hours. It will be charged `$2 (0-1hr) + $4 (1-2hr) + $10 (2-3hr) + $10 (3-4hr) + $10 (4-5hr) + $10 (5-6hr) + $10 (6-6.5hr) = $56`
459
+
460
+
This policy may be specified different ways using the `rate_applies_when` field.
461
+
Both examples are shown here.
462
+
463
+
### With default `rate_applies_when = "out_of_bounds"`
464
+
465
+
By default the `rate_applies_when` field has the value `out_of_bounds`,
466
+
meaning the rate should take effect when an event is outside the bounds
0 commit comments