Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Adopt policy rate structure from CDS #785

Open
jiffyclub opened this issue Sep 6, 2022 · 3 comments · Fixed by #817
Open

Proposal: Adopt policy rate structure from CDS #785

jiffyclub opened this issue Sep 6, 2022 · 3 comments · Fixed by #817
Labels
Policy Specific to the Policy API
Milestone

Comments

@jiffyclub
Copy link
Contributor

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

@schnuerle
Copy link
Member

This sounds reasonable for a few reasons! With 2.0 and our Policy work we have a chance to do it. Might be worth a PR.

The Policy Task Force is working on this. Looping in @jean-populus @S-eb for visibility, and @marie-x and @avatarneil for feedback.

@schnuerle schnuerle added the Policy Specific to the Policy API label Sep 8, 2022
@jean-populus jean-populus added this to the 2.0.0 milestone Oct 20, 2022
@schnuerle schnuerle modified the milestones: 2.0.0, Future Dec 1, 2022
@jiffyclub
Copy link
Contributor Author

If I was to make this PR, could it make it into MDS 2.0 at this point, or too late?

@schnuerle
Copy link
Member

It is too late to restart the review and approval process for MDS 2.0. But you could still make a PR for a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Policy Specific to the Policy API
Projects
None yet
3 participants