Decouple per_hour from hour increments #54
zanebclark
started this conversation in
Data Specification
Replies: 1 comment 1 reply
-
Agree with this change. And it's like we do it in Rules in MDS. Updated to your suggestion here. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Define
per_hour
to support different units of timeIn the current Rate spec, the "rate" part of the
Rate
object (per_hour
) is defined as an integer. If a municipality were to define rates by day, the conversion of such a rate to an hourly rate would yield a float (e.g. $100 / day = $4.16666666667 / hour). For measurements smaller than an hour, there's no potential that scaling the rate would result in a float. A per-minute integer rate (e.g. 6 cents per minute) converted to a per-hour rate would continue to be an integer (360 cents per hour), as multiplying an integer by an integer yields an integer. The same logic applies to second and sub-second rates. Still, an additional step would be required to convert CDS-served policies (360 cents per hour) back to the original rate definition (6 cents per minute).Proposal: Define the "rate" part of the
Rate
object withrate
andrate_unit
instead ofper_hour
.per_hourIntegerRequiredThe rate per hour for this space in cents (or the smallest denomination of local currency).Some example Rates:
2 cents per second
$100 per day
30 cents per 15 minute interval
Beta Was this translation helpful? Give feedback.
All reactions