Allow up to 10 "Working Days" #79
Description
Background
In TaaS we have members (ResourceBookings) who are assigned to the customer's Jobs for some period of time. This time is divided into weeks (WorkPeriods) and payments to the ResourceBookings (members) is processed weekly per WorkPeriod. For each WorkPeriod we can enter how many days user worked per that week (0 till 5) and process payments for the working days. If ResourceBooking's ends in middle of the week (let's say Wednesday), than during that week we cannot enter more working days than actually fit the week (maximum 3 working days can fit week until Wednesday). This is already implemented, but sometimes ResourceBooking can work like double shift or even on the weekends, so we would like to allow managers to enter up to 10 working days per Work Period even there are no so many real working days in that WorkPeriod.
Task
-
Allow setting "Working Days" to maximum
10
. -
When there is already 10 working days selected, the
+
button has to be disabled, the same like when-
is disabled if we choose0
days. -
As soon as we increase the "Working Days" to more than this week can fit we have to show a confirmation modal window:
-
for example if we increase from 5 to 6, we show this modal
-
or if this week can fit only 3 days, then if we increase form 3 to 4, we also show this modal (see this issue to learn how to know the maximum value [$50] We should not allow increasing Working Days more than fit Resource Booking #37 - the code is already implemented to calculate this value and can be reused)
-
but the current value is already more than maximum of this week, we don't show this confirmation anymore, so if we increase from 6 to 7, no more confirmation
-
if inside confirmation we click
yes
then value should stay increased -
if inside confirmation we click
no
, then value should be reverted back to the previous one
-
-
We already have a modal implemented in the Admin App. It can be seen like shown on this screenshot https://monosnap.com/file/vtLasCWUEocTs3CVPg4typTRYbfjVU.
- Please, reuse the code for confirmation modal.
API
- API has been updated to allow up to 10 working days [$40] Allow up to 10 "Working Days" topcoder-platform/taas-apis#428