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

[Policy API] support one-time fee after a buffer/duration #632

Closed
jean-populus opened this issue Mar 5, 2021 · 9 comments
Closed

[Policy API] support one-time fee after a buffer/duration #632

jean-populus opened this issue Mar 5, 2021 · 9 comments
Labels
Policy Specific to the Policy API

Comments

@jean-populus
Copy link
Collaborator

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

Cities would like to implement a fee if a parked vehicle isn't moved after for example 2 days. This is a one time fee but there's a buffer/duration before it applies.

Describe the solution you'd like

I'm not sure. We could add a new field for this buffer/duration before the rate is applicable?

Is this a breaking change

No, I don't think so as this concept doesn't currently exist.

Impacted Spec

For which spec is this feature being requested?

  • policy

Describe alternatives you've considered

Additional context

@marie-x
Copy link
Collaborator

marie-x commented Mar 5, 2021

That's easy with the current Policy. Two Rules. One for less-than-duration and one for more-than-duration.

@jean-populus
Copy link
Collaborator Author

I'm not sure I follow. Based on the examples, I thought for a one-time fee the variables would be

  • rule_type = rate
  • rule_units = amount
  • rate_amount = user entered
  • rate_recurrence = once
  • states = available, non-operational

Where does time come in? Should the rule_units = days with min = user entered buffer/duration?

@marie-x
Copy link
Collaborator

marie-x commented Mar 5, 2021

So the semantics of having a fee on Rule types other than rate is currently ambiguous but easily fixed. I believe we can simply document the way you can apply a rate_amount to a time rule. I am badly behind on making my concrete proposal to the working groups but it's on my to-do list.

In this case, let's assume a 20-minute buffer.

Rule 1: rule_type = time, rule_units = minutes, min_value = $BUFFER, rate_amount = $FEE, rate_recurrance = once, states = available etc.

Now that I think about it, I don't think you need a rule for the first $BUFFER minutes if the fee for less than that is 0.

@jean-populus
Copy link
Collaborator Author

Yeah, I think having a rule_type = rate is tripping me up. Why can't we just apply a rate_amount and rate_recurrence to all the rules instead of having a separate "rate" rule?

@jean-populus
Copy link
Collaborator Author

The solution you outlined above could then also be applied to my other issue #631 pretty easily.

@jean-populus
Copy link
Collaborator Author

thank you @Karcass

@schnuerle schnuerle added the Policy Specific to the Policy API label Mar 31, 2021
@marie-x
Copy link
Collaborator

marie-x commented Apr 1, 2021

Yeah, I think having a rule_type = rate is tripping me up. Why can't we just apply a rate_amount and rate_recurrence to all the rules instead of having a separate "rate" rule?

Yes, that is what I'm suggesting.

@marie-x
Copy link
Collaborator

marie-x commented Apr 1, 2021

Note that the main distinction between this ticket and #631 is the use of once for rate_recurrance

{
  "name": "Buffered One-Time Fee Example",
  "description": "First two days free, then one-time $4",
  "policy_id": "2801cd0a-7827-4114-9718-b9e5af29e9a1",
  "start_date": 1558389669540,
  "publish_date": 1558389669540,
  "end_date": null,
  "prev_policies": null,
  "provider_ids": [],
  "rate_recurrence": "once",
  "currency": "USD",
  "rules": [
    {
      "name": "$4 at the start of 2nd day",
      "rule_id": "9cd1768c-ab9e-484c-93f8-72a7078aa7b9",
      "rule_type": "time",
      "rule_units": "days",
      "geographies": ["0c77c813-bece-4e8a-84fd-f99af777d198"],
      "statuses": { "available": [], "non_operational": [] },
      "vehicle_types": ["bicycle", "scooter"],
      "maximum": 2,
      "rate_amount": 400
    }
  ]
}```

@jean-populus
Copy link
Collaborator Author

jean-populus commented Apr 5, 2021

can be supported with suggestions in #633 and #631. Closing to continue the convo in these other issues.

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
Development

No branches or pull requests

3 participants