Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

[$45] Edit payments #80

Closed
maxceem opened this issue Jul 27, 2021 · 13 comments
Closed

[$45] Edit payments #80

maxceem opened this issue Jul 27, 2021 · 13 comments

Comments

@maxceem
Copy link
Contributor

maxceem commented Jul 27, 2021

Background

At the moment we can only create new payments and cancel whole payments if we need to. But sometimes managers would like to change the amount of payment.

Task

  • We already can show the list of all the payments:

    image

  • Replace Cancel button in this list with Actions dropdown menu with 2 options:

    image

  • For modal, use the same design as for adding payment: [$80] Additional Payments #82

  • We have 2 kind of payments:

    • payment for days which user worked (we pay per day as per member rate)
      • all the payments for days have days greater than 0
    • additional payment - any amount which is additional to the payment for days, and is not counted for days
      • all the additional payments have days === 0
  • Edit Payment for days

    image

    Inside payment for days we should NOT allow editing Amount we can only edit Days
    - reuse the same field which we use for Working Days
    - the minimal value of days is 1 (disable - button if the value is 1 and show tooltip saying: The payment cannot be done for less than 1 day)

  • Edit Additional Payment

    image

    For additional payment days === 0 and we cannot edit that. We can only edit the amount. It should float number greater than 0. And less than 100 000. If we enter wrong amount show a red validation error under the field like saying: Amount should be greater than 0 and less than 100 000. It should look like this https://monosnap.com/file/J4f0foiyUi7FvQPCIZEdFFcfIS4hHi try removing job title here https://platform.topcoder-dev.com/taas/myteams/16873/positions/ecaf2c7f-2b43-4397-bcf5-0ddf38c7f6a6/edit

  • If we click Cancel or X just close the modal.

  • if we click Update show a loading indicator inside the modal OR just disable the fields and all the buttons while sending request to the server.

    • if the request was successful, show a successful green toastr and close the modal which says, Payment was successfully updated:
      image
    • in case of error show error red toastr with error message from the server, but keep the modal open so user can try updating payment again

API

@sandhiyakavi
Copy link
Collaborator

@maxceem

  1. In the modal, if we enter floating values (even though less than 100,000) with six digits, it is showing wrong error message "Amount should be greater than 0 and less than 100,000."
    image

  2. Can we disable Edit payment for Failed status, as it is of no use in editing it right?
    image

  3. Sometimes if days cannot be increased/decreased because of working days limit, can we disable update button?
    image

Other than that, it is working fine as expected

@maxceem
Copy link
Contributor Author

maxceem commented Aug 12, 2021

Sum up:

  1. Need to fix.

  2. Let's disable "edit" button for "failed" and for "cancelled" payments.
    Note, that for "cancel" button should be only disabled for "cancelled" payments, but still enabled for "failed".

  3. Let's disable "update" button if we didn't change anything inside "edit payment" model (days or amount).

@MadOPcode feel free to pick up this issue as per this comment.

@maxceem maxceem changed the title Edit payments [$45] Edit payments Aug 12, 2021
@maxceem maxceem added the CF Issues for Community Fixes label Aug 12, 2021
@MadOPcode
Copy link
Contributor

@maxceem regarding clause 1. Since there's no point in paying amounts with less than 1 cent precision shouldn't the validation error message be changed instead of validation method? E.g. to "The amount should contain at most 2 digits after floating point and should be greater than 0 and less than 100,000."

@maxceem
Copy link
Contributor Author

maxceem commented Aug 12, 2021

@MadOPcode is it hard to not allow entering more than 2 digits after point?

@MadOPcode
Copy link
Contributor

@maxceem no, there just seems to be no meaning in this.

@maxceem
Copy link
Contributor Author

maxceem commented Aug 12, 2021

@MadOPcode the idea is to make it easy to follow our requirement for the entering amount. It feels natural to not allow entering more than 2 points. Also, we would keep validation not so complex.

@MadOPcode
Copy link
Contributor

@maxceem after re-reading your comments I think I've misunderstood you. I somehow thought that you're talking about allowing to enter more than 2 digits.
Of course there's a meaning in not allowing to enter more than 2 digits.

@maxceem
Copy link
Contributor Author

maxceem commented Aug 12, 2021

right, just not allow entering more than 2 digits after the point.

MadOPcode added a commit to MadOPcode/micro-frontends-taas-admin-app that referenced this issue Aug 14, 2021
…opcoder-archive#94, topcoder-archive#95.

- Adds fixes for adding and editing payments (topcoder-archive#80, topcoder-archive#82)
- Adds working period data reloading after adding and editing payments (topcoder-archive#94)
- Makes toastr messages always stay withing the viewport (topcoder-archive#95)
@sandhiyakavi
Copy link
Collaborator

Verified in Dev Env.

  1. Not able to enter more than 2 numbers after the decimal points.
    image

  2. Edit payment is disabled for Failed/Cancelled status.
    image
    image

  3. Update button disabled if there is no change in days.
    image

Below scenarios are also verified and working fine.

  1. Verify whether Action dropdown with two options Edit payment and cancel payment is available in Total paid pop up.
  2. Verify whether Edit payment option is disabled if the status is in-progress.
  3. Verify whether Edit Additional Payment for days modal opens if user tried to Edit the additional payment paid.
  4. Verify whether Edit Payment for days modal opens if user tried to Edit the normal payment for days.
  5. Verify whether amount is not enabled for Edit Payment for days modal.
  6. Verify whether design of Edit Payment for days modal is similar to the one described here ([$45] Edit payments #80)
  7. Verify whether minimal value of days is 1 (disable - button if the value is 1 and show tooltip saying: The payment cannot be done for less than 1 day)
  8. Verify whether '+' button is disabled if dayspaid will become more than the daysworked (https://github.com/topcoder-platform/taas-apis/blob/dev/src/services/WorkPeriodPaymentService.js#L285-L291)
  9. Verify whether user is able to edit the Additional payment made.

@maxceem
Copy link
Contributor Author

maxceem commented Aug 17, 2021

Challenge https://www.topcoder.com/challenges/fc807c9d-fb26-46e9-a735-d7b13555382e has been created for this ticket.

This is an automated message for maxceem via Topcoder X

@maxceem
Copy link
Contributor Author

maxceem commented Aug 17, 2021

Challenge https://www.topcoder.com/challenges/fc807c9d-fb26-46e9-a735-d7b13555382e has been assigned to madopcode.

This is an automated message for maxceem via Topcoder X

@maxceem
Copy link
Contributor Author

maxceem commented Aug 17, 2021

Payment task has been updated: https://www.topcoder.com/challenges/fc807c9d-fb26-46e9-a735-d7b13555382e
Payments Complete
Winner: madopcode
Copilot: maxceem
Challenge fc807c9d-fb26-46e9-a735-d7b13555382e has been paid and closed.

This is an automated message for maxceem via Topcoder X

@maxceem maxceem reopened this Aug 17, 2021
@sandhiyakavi
Copy link
Collaborator

Verified on Prod Env. Working as expected.

cc: @nkumar-topcoder

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants