Skip to content

Commit 417db32

Browse files
Add rate rule, rate rule type, rate rule units
1 parent 3e246c5 commit 417db32

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

policy/README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The goal of this specification is to enable Agencies to create, revise, and publ
3030
- Cap allowances (e.g. "Up to 500 additional scooters are permitted near train stations")
3131
- Speed-limit restrictions (e.g. "15 mph outside of downtown, 10 mph downtown")
3232
- Idle-time and disabled-time limitations (e.g. "5 days idle while rentable, 12 hours idle while unrentable, per device")
33+
- Trip surcharges and subsidies (e.g. "A $.25 cents applied when a trip ends downtown")
3334

3435
The machine-readable format allows Providers to obtain policies and compute compliance where it can be determined entirely by data obtained internally.
3536

@@ -203,6 +204,7 @@ An individual `Policy` object is defined by the following fields:
203204
| `policy_id` | UUID | Required | Unique ID of policy |
204205
| `provider_ids` | UUID[] | Optional | Providers for whom this policy is applicable; empty arrays and `null`/absent implies all Providers |
205206
| `description` | String | Required | Description of policy |
207+
| `currency` | String | Optional | An ISO 4217 Alphabetic Currency Code representing the [currency](../provider#costs--currencies) of all Rules of [type](#rule-types) `rate`.|
206208
| `start_date` | timestamp | Required | Beginning date/time of policy enforcement |
207209
| `end_date` | timestamp | Optional | End date/time of policy enforcement |
208210
| `published_date` | timestamp | Required | Timestamp that the policy was published |
@@ -225,6 +227,7 @@ An individual `Rule` object is defined by the following fields:
225227
| `propulsion_types` | `propulsion_type[]` | Optional | Applicable vehicle propulsion types, default "all". |
226228
| `minimum` | integer | Optional | Minimum value, if applicable (default 0) |
227229
| `maximum` | integer | Optional | Maximum value, if applicable (default unlimited) |
230+
| `rate_amount` | integer | Optional | The amount of a rate applied when this rule applies, if applicable (default zero). A positive integer rate amount represents a fee, while a negative integer represents a subsidy. Rate amounts are given in the `currency` defined in the [Policy](#policy). |
228231
| `start_time` | ISO 8601 time `hh:mm:ss` | Optional | Beginning time-of-day when the rule is in effect (default 00:00:00). |
229232
| `end_time` | ISO 8601 time `hh:mm:ss` | Optional | Ending time-of-day when the rule is in effect (default 23:59:59). |
230233
| `days` | day[] | Optional | Days `["sun", "mon", "tue", "wed", "thu", "fri", "sat"]` when the rule is in effect (default all) |
@@ -238,17 +241,22 @@ An individual `Rule` object is defined by the following fields:
238241
| `count` | Fleet counts based on regions. Rule `max`/`min` refers to number of devices. |
239242
| `time` | Individual limitations on time spent in one or more vehicle-states. Rule `max`/`min` refers to increments of time in [Rule Units](#rule-units). |
240243
| `speed` | Global or local speed limits. Rule `max`/`min` refers to speed in [Rule Units](#rule-units). |
244+
| `rate` | Fees or subsidies based on regions and time spent in one or more vehicle-states. Rule `rate_amount` refers to the rate in [Rule Units](#rule-units). |
241245
| `user` | Information for users, e.g. about helmet laws. Generally can't be enforced via events and telemetry. |
242246

243247
### Rule Units
248+
Note that all rate in the `currency` defined in the [Policy](#policy)
244249

245250
| Name | Description |
246251
| --------- | ------------------- |
247-
| `seconds` | Seconds |
248-
| `minutes` | Minutes |
249-
| `hours` | Hours |
250-
| `mph` | Miles per hour |
251-
| `kph` | Kilometers per hour |
252+
| `seconds` | Seconds |
253+
| `minutes` | Minutes |
254+
| `hours` | Hours |
255+
| `mph` | Miles per hour |
256+
| `kph` | Kilometers per hour |
257+
| `rate per event` | Rate applied once when the vehicle enters a matching status. |
258+
| `rate per minute` | Rate applied for each minute while the vehicle is in the matching status. |
259+
| `rate per day` | Rate applied once per day if the vehicle is in the matching status at any point. |
252260

253261
### Messages
254262

0 commit comments

Comments
 (0)