-
Notifications
You must be signed in to change notification settings - Fork 5
[$45] Edit payments #80
Comments
Sum up:
@MadOPcode feel free to pick up this issue as per this comment. |
@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." |
@MadOPcode is it hard to not allow entering more than 2 digits after point? |
@maxceem no, there just seems to be no meaning in this. |
@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. |
@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. |
right, just not allow entering more than 2 digits after the point. |
…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)
Verified in Dev Env. Below scenarios are also verified and working fine.
|
Challenge https://www.topcoder.com/challenges/fc807c9d-fb26-46e9-a735-d7b13555382e has been created for this ticket. |
Challenge https://www.topcoder.com/challenges/fc807c9d-fb26-46e9-a735-d7b13555382e has been assigned to madopcode. |
Payment task has been updated: https://www.topcoder.com/challenges/fc807c9d-fb26-46e9-a735-d7b13555382e |
Verified on Prod Env. Working as expected. cc: @nkumar-topcoder |
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:
Replace
Cancel
button in this list withActions
dropdown menu with 2 options:Cancel Payment
- which would do the same asCancel
button does now (option should be disabled forcancelled
orin-progress
payments)Edit Payment
- which would open a modal window to edit payment details (option should be disabledin-progress
payments, payment in other statuses can be edited)For modal, use the same design as for adding payment: [$80] Additional Payments #82
We have 2 kind of payments:
days
greater than0
days === 0
Edit Payment for days
Inside payment for days we should NOT allow editing
Amount
we can only editDays
- reuse the same field which we use for Working Days
- the minimal value of days is
1
(disable-
button if the value is1
and show tooltip saying:The payment cannot be done for less than 1 day
)WorkPeriod.daysPaid
cannot be more thanWorkPeriod.daysWorked
.WorkPeriod.daysPaid
is calculated as a sum of thedays
of all the payments of this WorkPeriod not includingcancelled
orfailed
payments. Disable the+
button if increasing one days would causeWorkPeriod.daysPaid
to be more thanWorkPeriod.daysWorked
, see how we calculate it server-side https://github.com/topcoder-platform/taas-apis/blob/dev/src/services/WorkPeriodPaymentService.js#L285-L291Edit Additional Payment
For additional payment
days === 0
and we cannot edit that. We can only edit the amount. It shouldfloat
number greater than0
. And less than100 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/editIf we click
Cancel
orX
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.Payment was successfully updated
:API
PATCH /work-period-payments/:id
endpoint https://topcoder-platform.github.io/taas-apis/#/WorkPeriodPayments/patch_work_period_payments__id_The text was updated successfully, but these errors were encountered: