Skip to content

fix: additional payments #435

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

Merged
merged 2 commits into from
Jul 29, 2021
Merged

fix: additional payments #435

merged 2 commits into from
Jul 29, 2021

Conversation

narekcat
Copy link
Contributor

No description provided.

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

@narekcat sorry, I forgot to mention one more thing.

If we process a payment with days = 0 then amount is required to be provided and it must be more than 0. Otherwise, if I try to process a payment with days = 0 there would be an internal server error:

image

So if we are trying to create a payment with days = 0 we should validate that amount is provided and it's more than 0 otherwise return error: "amount" has to be provided when processing additional payment for 0 days. It's preferable to use Joi validation for this if possible https://github.com/topcoder-platform/taas-apis/blob/dev/src/services/ResourceBookingService.js#L358-L365.

Could you please add this validation? I would increase payment for the task to $30.

@narekcat
Copy link
Contributor Author

Hi @maxceem . Ok, I am already working on it.

@narekcat
Copy link
Contributor Author

@maxceem . I have fixed that issue, please check it again.

@narekcat narekcat requested a review from maxceem July 29, 2021 14:30
Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

@narekcat looks like it doesn't work:

image

Let me clarify.

If days and/or amount is not provided - it's calculated automatically. This was already implemented.

The only thing we are changing now, is that we allow providing days = 0 (before we didn't allow this). So now we only should allow providing days = 0, but if we provide days = 0 then we should require providing amount > 0 because when days =0 we cannot calculate amount automatically anymore.

@narekcat
Copy link
Contributor Author

@maxceem , I have fixed that.

@narekcat narekcat requested a review from maxceem July 29, 2021 15:10
Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

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

@narekcat thanks for the quick update, works well now.

@maxceem maxceem merged commit 23ac85f into topcoder-platform:dev Jul 29, 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.

2 participants