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

pi: Allow for billing status error correction. #1528

Merged
merged 14 commits into from
Oct 8, 2021

Conversation

amass01
Copy link
Member

@amass01 amass01 commented Oct 6, 2021

Background:

Let's say an admin makes a mistake and sets the billing status to
completed when they actually meant to set it to closed. There should be
a way for them to correct this mistake.

We would like to enable error correction by adding a plugin setting
which limits the number of the allowed billing status changes. It
defaults to 1 and can be increased by a sysadmin in rare cases where a
billing status error correction is needed.

Implementation:

  • Adds allowedbillingstatuschanges pi plugin setting which defaults
    to 1 and can be increased if a billing status error correction is
    needed.

  • Adds in billing status validation that allows for the following state
    transitions:

    • active can only be set to closed or completed.
    • closed and completed can be set to any other billing status
      when the plugin setting allows for it.
  • Adds active status to the pictl proposalsetbillingstatus command.


Closes #1525.

@amass01 amass01 marked this pull request as ready for review October 6, 2021 20:41
@amass01 amass01 changed the title [wip] pi: Allow for billing status error correction. pi: Allow for billing status error correction. Oct 6, 2021
politeiad/plugins/pi/pi.go Outdated Show resolved Hide resolved
@amass01
Copy link
Member Author

amass01 commented Oct 6, 2021

@lukebp updated 💯

politeiad/backendv2/tstorebe/plugins/pi/cmds.go Outdated Show resolved Hide resolved
politeiad/backendv2/tstorebe/plugins/pi/cmds.go Outdated Show resolved Hide resolved
politeiad/backendv2/tstorebe/plugins/pi/pi.go Outdated Show resolved Hide resolved
politeiad/backendv2/tstorebe/plugins/pi/cmds.go Outdated Show resolved Hide resolved
Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting a pi summary 500 if I've updated the billing status more than once.

2021-10-07 10:50:41.375 [ERR] POLI: 127.0.0.1:34688 POST /v2/pluginreads HTTP/1.1 Internal error 1633621841: PluginRead pi summary : couldn't determine proposal status of an approved propsoal: billingStatus: 1

Fix the propsoal typo in the error message too.

@amass01
Copy link
Member Author

amass01 commented Oct 7, 2021

@lukebp

Fixed by introducing:
func proposalBillingStatus(vs ticketvote.VoteStatusT, bscs []pi.BillingStatusChange) pi.BillingStatusT { }
Which determines the billing status of a proposal.

Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

Just need to fix the formatting nit.

Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

@lukebp lukebp merged commit dcc2d60 into decred:master Oct 8, 2021
@amass01 amass01 deleted the billingstatuscorrection branch October 8, 2021 21:00
@lukebp lukebp mentioned this pull request Nov 16, 2021
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.

pi: Allow for billing status error correction.
2 participants