openmobilityfoundation / openmobilityfoundation/mobility-data-specification
Proposal: Adopt policy rate structure from CDS
A pull request for this has already been merged.
- #817 by @marie-x — merged
- Dominant language
- No language data
- Stars
- 746
- Forks
- 252
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 2
Description
Is your feature request related to a problem? Please describe.
In MDS at the moment, if you have a tiered parking fees policy (e.g. $10 / hour for the first hour, $5 / hour for hours 2 - 5, $3 / hour for hours 6 onward) you have to create multiple rules in your policy for each of those different time ranges (see examples). This has the weird of effect of making it so that different rules in the policy match the same time and space only for the purpose of describing what happens based on the duration of the event.
Describe the solution you'd like
I think it's more understandable to be able to have a single rule that matches an event and to be able to reference the monetary consequence for that from the one rule instead of it depending on aggregating monetary consequences from multiple other rules. Indeed, that's what CDS does, allowing a rule to contain an array of rates so that it's the different rate objects that apply to different parts of the event instead of different rules. When evaluating the policy you can find that an event (or portion of an event) matches the rule and directly reference the rate structure to find the monetary consequence of that match.
My proposal is that MDS adopt the Rate object from CDS and allow rules of any type to contain an array of Rates, the same way that CDS does. Even outside of my specific complaint about tiered pricing structures in MDS, I think it'd be best if MDS and CDS had the same structures around this to make it easier to evaluate policies in both MDS and CDS. (This also ties into #662, I think we should remove the "rate" rule type and allow attaching rates to any rule.)
Is this a breaking change
- Yes, breaking
Impacted Spec
policy
Describe alternatives you've considered
None
Additional context
None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the impacted policy specification and comparing its rule structure with the linked CDS rule and rate definitions. Check the discussion in #662 and the history of linked pull request #817; the work is done when the proposal's breaking-change implications and final policy schema direction are resolved.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100