worknenjoy / gitpay

Bounties for issues on demand. Be rewarded by learning, using Git workflow and continuous integration
http://gitpay.me
Other
181 stars 161 forks source link

Change conditions to validate issue as close when user claims a bounty #899

Closed alexanmtz closed 2 years ago

alexanmtz commented 2 years ago

When a user finished the PR and it is merged and the issue is closed, he can claim the bounty on Gitpay.

We need to make a better check to validate that the issue is closed

First, just by verifying that the issue on Gitpay is closed, it should be closed on Github. Add this verification to flag issue closed on Github

You should add the condition:

if (task.dataValues.status === 'closed') {
  isIssueClosed = true
}

And when a new Solution is created, if that user is not assigned, let's assign using the functions on the model directly to assign and approve before send the payment, this is will be done in this file: https://github.com/worknenjoy/gitpay/blob/master/modules/tasks/taskSolutionCreate.js#L24

Why

If a user that is not assigned want to claim the bounty, he should able to receive if the issue is closed on Gitpay, which gets information from Github

Level

Medium

Current behavior

One of the conditions to claim the bounty is check if the issue was closed, and add a verification to flag as closed if the task status is closed too

Expected behavior

It should verify if the issue is closed by simply verifying if is closed on Gitpay and assign the user if he's not assigned and send the transfer

Useful links

Screenshot attached

Screenshot 2022-06-10 at 12 30 14

How to reproduce the user scenario

Tips