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

Add commands /pay2extend & /pay2skip to the transactions app #1289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jirislav
Copy link

@jirislav jirislav commented Oct 13, 2023

Motivation or cause

See #1290

Change description

I'm adding two commands to the transactions app:

  • /pay2extend
  • /pay2skip

The skip has a fairly simple configuration, allowing to enable/disable the feature and to set the planets cost of a skip.

The extension has tight integration with the voting app in order to have the extend_current_count on one place so we can respect the already existing extend_max_amount setting.

It also supports to define the multiplier that will be applied to the base cost in case of multiple extensions of a single map (each successive extension gets more expensive). But this is optional and the multiplier can be set to 1 (effectively disabling this multiplying feature), or even to something lower, such as 0.5, to make the extensions cheaper, if someone wanted to do so.

Since the transactions take some time to process, it might occasionally happen, that the user, who paid for track extension, might receive a feedback of a successful transaction in various scenarios:
a) Transaction succeeded on the same map he requested to be extended - before podium.

  • everything is great an expected, the time extends according to the extension settings
    b) Transaction succeeded on the same map he requested to be extended - on podium.
  • that's not so great, because we can't extend the time anymore, the time is up already
  • so we immediately restart the track in this case
    c) Transaction succeeded on any other map than the one he requested to be extended.
  • we issue a refund and inform the user about it

Checklist of pull request

Make sure that your pull request follow the following 'rules':

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • All new and existing tests passed, except in few situations.
  • My change requires a change to the documentation.

Please leave a comment here if your pull need any updates for the docs or tests.

Additional Comments (optional)

Yes, this needs an update of a documentation, but I've prepared it already, as you can see within the commit.

@jirislav jirislav marked this pull request as ready for review October 14, 2023 21:40
@jirislav jirislav changed the title feat: impl /pay2extend feature Add commands /pay2extend & /pay2skip to the transactions app Oct 14, 2023
@jirislav jirislav force-pushed the pay2extend branch 4 times, most recently from ace1e11 to 6d80162 Compare October 26, 2023 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant