ItEr49S04ValidacionEProbasFuncionaisItEr48S04: Limiting the assignation of the advanced assignation to always days after or equal start of the task.
This commit is contained in:
parent
2c34b39ef6
commit
bcc4103cfe
1 changed files with 9 additions and 8 deletions
|
|
@ -196,9 +196,8 @@ public class AdvancedAllocationController extends GenericForwardComposer {
|
|||
public static Restriction build(IRestrictionSource restrictionSource) {
|
||||
switch (restrictionSource.getCalculatedValue()) {
|
||||
case END_DATE:
|
||||
return Restriction
|
||||
.fixedHours(restrictionSource
|
||||
.getTotalHours());
|
||||
return Restriction.fixedHours(restrictionSource.getStart(),
|
||||
restrictionSource.getTotalHours());
|
||||
case NUMBER_OF_HOURS:
|
||||
return Restriction.onlyAssignOnInterval(restrictionSource
|
||||
.getStart(), restrictionSource.getEnd());
|
||||
|
|
@ -219,8 +218,8 @@ public class AdvancedAllocationController extends GenericForwardComposer {
|
|||
return new OnlyOnIntervalRestriction(start, end);
|
||||
}
|
||||
|
||||
private static Restriction fixedHours(int hours) {
|
||||
return new FixedHoursRestriction(hours);
|
||||
private static Restriction fixedHours(LocalDate start, int hours) {
|
||||
return new FixedHoursRestriction(start, hours);
|
||||
}
|
||||
|
||||
abstract LocalDate limitStartDate(LocalDate startDate);
|
||||
|
|
@ -289,8 +288,10 @@ public class AdvancedAllocationController extends GenericForwardComposer {
|
|||
|
||||
private static class FixedHoursRestriction extends Restriction {
|
||||
private final int hours;
|
||||
private final LocalDate start;
|
||||
|
||||
private FixedHoursRestriction(int hours) {
|
||||
private FixedHoursRestriction(LocalDate start, int hours) {
|
||||
this.start = start;
|
||||
this.hours = hours;
|
||||
}
|
||||
|
||||
|
|
@ -305,8 +306,8 @@ public class AdvancedAllocationController extends GenericForwardComposer {
|
|||
}
|
||||
|
||||
@Override
|
||||
LocalDate limitStartDate(LocalDate startDate) {
|
||||
return startDate;
|
||||
LocalDate limitStartDate(LocalDate argStart) {
|
||||
return start.compareTo(argStart) > 0 ? start : argStart;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue