openmobilityfoundation / curb-data-specification

A data specification to help cities manage their curb zone programs and surrounding areas, and measure the utilization and impact.
https://www.openmobilityfoundation.org/about-cds/
Other
47 stars 18 forks source link

Representing maximum fee in Rate #116

Closed josh-p-thompson closed 6 months ago

josh-p-thompson commented 1 year ago

Is your feature request related to a problem? Please describe.

We cannot accurately represent rates that have a maximum fee amount under the current Policy.Rate spec.

Describe the solution you'd like

We would like to to add a new field to Rate called maximum_fee that represents the maximum amount a user of a curb can pay for a particular parking event.

Is this a breaking change

A breaking change would require consumers or implementors of an API to modify their code for it to continue to function (ex: renaming of a required field or the change in data type of an existing field). A non-breaking change would allow existing code to continue to function (ex: addition of an optional field or the creation of a new optional endpoint).

Impacted Spec

For which spec is this feature being requested?

Describe alternatives you've considered

Example: "$1 per hour with a maximum fee of $7.50".

We can't represent this rate in "rate_unit": "hour" because the rate end_duration needs to be 7.5 but start_duration/end_duration must be an integer.

We can't represent this rate in "rate_unit": "minute" because "$1 per hour" would translate to "$.0166666 per minute" or rate=1.67 but rate must be an integer. We would also lose precision.

Allowing floats for durations or defining increment_duration differently (see: #113) would allow us to translate this rate accurately, but the max would become implicit and potentially more complicated if rates/durations do not divide evenly. Therefore, we prefer an explicit maximum_fee value in the rate.

Additional context

schnuerle commented 1 year ago

Adding a new field called maximum_fee seems like a good way to solve this and fill the current gap.

schnuerle commented 1 year ago

We will be talking about this at next week's Working Group meeting for inclusion in a forthcoming CDS 1.0.1 patch release, so please attend if you can.

schnuerle commented 1 year ago

Seems valuable to add this sooner than later for cities using CDS for their SMART grant work. Could go into this patch release, though would like to see if anyone objects and would rather see this in a minor release like 1.1.0.

schnuerle commented 9 months ago

This will be going into a patch release 1.0.1 soon. Leave comments here. Feel free to make a PR to speed it along.

schnuerle commented 7 months ago

If anyone wants to do a PR for this, that would be welcome and you and your org will be recognized in the acknowledgements for 1.0.1. Otherwise the OMF staff will make a PR soon.

schnuerle commented 6 months ago

Current PR #135 add this new field:

Name Type Required/Optional Description
maximum_fee Integer Optional The maximum amount a user of a curb can pay for a particular parking event.

Look ok to you @josh-p-thompson ?

josh-p-thompson commented 6 months ago

@schnuerle I no longer work at Populus and it's been long enough that I don't remember the exact use case. Probably best to confirm with someone from there - Matt Davis? @jiffyclub

schnuerle commented 6 months ago

Closed with #135