Skip to content

Commit

Permalink
Refined rolling and calendar rate_unit
Browse files Browse the repository at this point in the history
  • Loading branch information
schnuerle authored Feb 25, 2022
1 parent 6544b63 commit 89109ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion curbs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ A Rate defines the amount a user of the curb needs to pay when a given rule appl
| ------ | ------ | ------------------- | ------------- |
| `rate` | Integer | Required | The rate for this space in cents (or the smallest denomination of local currency) per `rate_unit`. |
| `rate_unit` | Enum | Required | The unit of time associated with the rate. One of "second", "minute", "hour", "day", "week", "month", "quarter", "year". |
| `rate_unit_period` | Enum | Optional | The period of time that the `rate_unit` covers. Is it from the start of the unit to the end of the unit (e.g. "calendar" from the 1st day of a month to the last day of the same month) or is it rolling based on a time from within the `rate_unit` (e.g. "rolling" from the 8th of a month to the 8th of the next month). One of "calendar", "rolling". Default if not specified is "calendar". |
| `rate_unit_period` | Enum | Optional | The period of time that the `rate_unit` covers. It is "rolling" by default based on the current time from within the `rate_unit` (e.g. from the 8th of a "month" to the 8th of the next month, or from 17 minutes past the "hour" to 17 minutes past the next hour), or "calendar" for the start to the end of the current `rate_unit` (e.g. from the 1st day of a month to the last day of the same month). Note "calendar" typically is applicable to a `rate_unit` duration of "week" or longer. One of "rolling", "calendar". **Default** if not specified is "rolling". |

This comment has been minimized.

Copy link
@zanebclark

zanebclark Feb 25, 2022

Collaborator

An exercise to validate my understanding. Am I on the right path? If the rate_unit_period hangs on the event, have we given the city the ability to define a month-long permit?

The period of time that the rate_unit covers. One of "rolling" or "calendar". If not specified, defaults to "rolling". When rolling, the rate_unit begins (inclusive) at the timestamp of the event and ends (exclusive) when one full rate_unit has elapsed. For example, with {"rate_unit": "month", "rate_unit_period": "rolling"} the rate_unit for an event starting at 2022-02-25 19:25:52 would be interpreted as ranging from the start of the event - 2022-02-25 19:25:52 (inclusive) - to the timestamp when one "month" has elapsed: 2022-03-25 19:25:52 (exclusive). When calendar, the rate_unit begins (inclusive) at the start of the rate_unit in question and ends (exclusive) when one full rate_unit has elapsed. For example, with {"rate_unit": "month", "rate_unit_period": "calendar"} the rate_unit for an event starting at 2022-02-25 19:25:52 would be interpreted as ranging from the start of the "month" - 2022-02-01 00:00:00 (inclusive) - to the end of the "month": 2022-03-01 00:00:00 (exclusive). The "week" rate_unit is defined as starting on Sunday.

This comment has been minimized.

Copy link
@schnuerle

schnuerle Feb 25, 2022

Author Member

Yes I think that is all right. Do you think most of your wording should replace what's there? In many ways it is better.

Not sure about defining the start of a week by a day, and maybe say instead it's based on your local standards. Or we should go with the ISO standard of Monday but that may be limiting/weird for US.

This comment has been minimized.

Copy link
@zanebclark

zanebclark Feb 26, 2022

Collaborator

Do you think most of your wording should replace what's there? In many ways it is better.

Totally up to you.

On weeks, I'm happy so long as it has a defined start.

This comment has been minimized.

Copy link
@schnuerle

schnuerle Feb 28, 2022

Author Member

I've updated the description using mostly your revised language, and specifying start of week on Monday per ISO.

| `increment_minutes` | Integer | Optional | If specified, this is the smallest amount of time a user can pay for (e.g., if `increment_minutes` is `15`, a user can pay for 15, 30, 45, etc. minutes). |
| `increment_amount` | Integer | Optional | If specified, the rate for this space is rounded up to the nearest increment of this amount, specified in the same units as `per_hour`. |
| `start_minutes` | Integer | Optional | The amount of time the vehicle must have already been present in the Curb Zone before this rate starts applying (_inclusive_, see [Range Boundaries](/general-information.md#range-boundaries)). If not specified, this rate starts when the vehicle arrives. |
Expand Down

0 comments on commit 89109ff

Please sign in to comment.