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

[$45] Edit payments #80

Closed
Closed
@maxceem

Description

@maxceem

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)

    • the maximum value of days: we cannot pay for more days than user worked this week. So WorkPeriod.daysPaid cannot be more than WorkPeriod.daysWorked. WorkPeriod.daysPaid is calculated as a sum of the days of all the payments of this WorkPeriod not including cancelled or failed payments. Disable the + button if increasing one days would cause WorkPeriod.daysPaid to be more than WorkPeriod.daysWorked, see how we calculate it server-side https://github.com/topcoder-platform/taas-apis/blob/dev/src/services/WorkPeriodPaymentService.js#L285-L291
  • 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions