1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.shiftdiff.rule;
17
18 import com.google.common.collect.ImmutableMap;
19 import org.joda.time.DateTime;
20 import org.joda.time.DateTimeZone;
21 import org.joda.time.LocalTime;
22 import org.junit.Assert;
23 import org.junit.Ignore;
24 import org.junit.Test;
25 import org.kuali.hr.KPMEWebTestCase;
26 import org.kuali.kpme.core.FunctionalTest;
27 import org.kuali.kpme.core.api.assignment.Assignment;
28 import org.kuali.kpme.core.api.assignment.AssignmentDescriptionKey;
29 import org.kuali.kpme.core.api.calendar.entry.CalendarEntry;
30 import org.kuali.kpme.core.calendar.CalendarBo;
31 import org.kuali.kpme.core.service.HrServiceLocator;
32 import org.kuali.kpme.core.util.TKUtils;
33 import org.kuali.kpme.tklm.api.time.timeblock.TimeBlock;
34 import org.kuali.kpme.tklm.time.rules.shiftdifferential.ShiftDifferentialRule;
35 import org.kuali.kpme.tklm.time.rules.shiftdifferential.service.ShiftDifferentialRuleService;
36 import org.kuali.kpme.tklm.time.service.TkServiceLocator;
37 import org.kuali.kpme.tklm.time.timesheet.TimesheetDocument;
38 import org.kuali.kpme.tklm.time.util.TkTimeBlockAggregate;
39 import org.kuali.kpme.tklm.utils.TkTestUtils;
40
41 import java.math.BigDecimal;
42 import java.sql.Time;
43 import java.util.ArrayList;
44 import java.util.HashMap;
45 import java.util.List;
46
47
48
49
50
51
52 @FunctionalTest
53 public class ShiftDifferentialRuleServiceProcessTest extends KPMEWebTestCase {
54
55
56 public static final String USER_PRINCIPAL_ID = "admin";
57 private DateTime JAN_AS_OF_DATE = new DateTime(2010, 1, 1, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112 @SuppressWarnings("serial")
113 @Test
114 public void testProcessTimesheetBoundaryCarryoverOverlapCase() throws Exception {
115 DateTimeZone tz = HrServiceLocator.getTimezoneService().getUserTimezoneWithFallback();
116
117 boolean[] dayArray = {false, false, true, true, true, true, true};
118
119 Long jobNumber = 30L;
120 Long workArea = 0L;
121 this.createShiftDifferentialRule(
122 "BWS-CAL", "REG", "PRM", "IN", "SD1", "SD1",
123 (new LocalTime(22, 0)),
124 (new LocalTime(4, 0)),
125 new BigDecimal(3),
126 new BigDecimal("15.00"),
127 dayArray);
128
129
130
131
132
133 DateTime beginPeriodDate = new DateTime(2010, 8, 15, 0, 0, 0, 0, tz);
134 CalendarEntry endOfAugust = HrServiceLocator.getCalendarEntryService().getCalendarEntryByIdAndPeriodEndDate("2", new DateTime(2010, 9, 1, 0, 0, 0, 0));
135 DateTime start = new DateTime(2010, 8, 31, 21, 45, 0, 0, tz);
136 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
137 TimesheetDocument tdoc = TkServiceLocator.getTimesheetService().openTimesheetDocument("admin", endOfAugust);
138 Assignment assignment = HrServiceLocator.getAssignmentService().getAssignment("admin", AssignmentDescriptionKey.get("IU-IN_30_30_30"), beginPeriodDate.toLocalDate());
139 blocks.addAll(TkTestUtils.createUniformActualTimeBlocks(tdoc, assignment, "RGN", start, 1, new BigDecimal(2), BigDecimal.ZERO, "admin"));
140 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, endOfAugust, HrServiceLocator.getCalendarService().getCalendar(endOfAugust.getHrCalendarId()), true);
141 tdoc.setTimeBlocks(blocks);
142 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
143 TkTestUtils.verifyAggregateHourSumsFlatList("August Pre-Check", new HashMap<String,BigDecimal>() {{put("PRM", BigDecimal.ZERO);put("RGN", new BigDecimal(2));}},aggregate);
144 TkServiceLocator.getTimeBlockService().saveOrUpdateTimeBlocks(new ArrayList<TimeBlock>(), aggregate.getFlattenedTimeBlockList(), "admin");
145
146
147
148
149 start = new DateTime(2010, 9, 1, 0, 0, 0, 0, tz);
150 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start.toLocalDate().toDateTimeAtStartOfDay());
151 tdoc = TkServiceLocator.getTimesheetService().openTimesheetDocument("admin", payCalendarEntry);
152 blocks = new ArrayList<TimeBlock>();
153 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start, 1, new BigDecimal("5"), "RGN", jobNumber, workArea));
154 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start.plusHours(6), 1, new BigDecimal("6"), "RGN", jobNumber, workArea));
155 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start.plusHours(22), 1, new BigDecimal("2"), "RGN", jobNumber, workArea));
156 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start.plusDays(1), 1, new BigDecimal("1"), "RGN", jobNumber, workArea));
157 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start.plusDays(1).plusHours(17), 1, new BigDecimal("6"), "RGN", jobNumber, workArea));
158 blocks = setDocumentIdOnBlocks(blocks, tdoc.getDocumentId());
159
160 aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry, HrServiceLocator.getCalendarService().getCalendar(payCalendarEntry.getHrCalendarId()), true);
161
162 TkTestUtils.verifyAggregateHourSumsFlatList("September Pre-Check", new HashMap<String,BigDecimal>() {{put("PRM", BigDecimal.ZERO);put("RGN", new BigDecimal(20));}},aggregate);
163
164
165 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
166 TkTestUtils.verifyAggregateHourSumsFlatList("September Post-Check", new HashMap<String,BigDecimal>() {{put("PRM", new BigDecimal("8.75"));put("RGN", new BigDecimal(22));}},aggregate);
167 }
168
169 private List<TimeBlock> setDocumentIdOnBlocks(List<TimeBlock> blocks, String id) {
170 List<TimeBlock> updatedTimeBlocks = new ArrayList<TimeBlock>();
171 for (TimeBlock b : blocks) {
172 TimeBlock.Builder builder = TimeBlock.Builder.create(b);
173 builder.setDocumentId(id);
174 updatedTimeBlocks.add(builder.build());
175 }
176 return updatedTimeBlocks;
177 }
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196 @SuppressWarnings("serial")
197 @Test
198 public void testProcessShiftTimesheeetBoundaryCarryoverCase() throws Exception {
199
200 boolean[] dayArray = {false, false, true, false, true, true, true};
201
202 Long jobNumber = 30L;
203 Long workArea = 0L;
204
205 DateTimeZone tz = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
206 this.createShiftDifferentialRule(
207 "BWS-CAL",
208 "REG",
209 "PRM",
210 "IN",
211 "SD1",
212 "SD1",
213 (new LocalTime(22, 0)),
214 (new LocalTime(5, 0)),
215 new BigDecimal(3),
216 new BigDecimal("0.25"),
217 dayArray);
218
219
220 DateTime endPeriodDate = new DateTime(2010, 9, 1, 0, 0, 0, 0);
221 CalendarEntry endOfAugust = HrServiceLocator.getCalendarEntryService().getCalendarEntryByIdAndPeriodEndDate("2", endPeriodDate);
222 DateTime start = new DateTime(2010, 8, 31, 22, 0, 0, 0, tz);
223 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
224 TimesheetDocument tdoc = TkServiceLocator.getTimesheetService().openTimesheetDocument("admin", endOfAugust);
225 Assignment assignment = HrServiceLocator.getAssignmentService().getAssignment("admin", AssignmentDescriptionKey.get("IU-IN_30_30_30"), endOfAugust.getBeginPeriodFullDateTime().toLocalDate());
226 blocks.addAll(TkTestUtils.createUniformActualTimeBlocks(tdoc, assignment, "RGN", start, 1, new BigDecimal(2), BigDecimal.ZERO, "admin"));
227 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, endOfAugust, HrServiceLocator.getCalendarService().getCalendar(endOfAugust.getHrCalendarId()), true);
228
229
230
231 tdoc.setTimeBlocks(blocks);
232 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
233 TkTestUtils.verifyAggregateHourSumsFlatList("August Pre-Check", new HashMap<String,BigDecimal>() {{put("PRM", BigDecimal.ZERO);put("RGN", new BigDecimal(2));}},aggregate);
234 TkServiceLocator.getTimeBlockService().saveOrUpdateTimeBlocks(new ArrayList<TimeBlock>(), aggregate.getFlattenedTimeBlockList(), "admin");
235
236
237
238 start = new DateTime(2010, 9, 1, 0, 0, 0, 0, tz);
239 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start.toLocalDate().toDateTimeAtStartOfDay());
240 tdoc = TkServiceLocator.getTimesheetService().openTimesheetDocument("admin", payCalendarEntry);
241 blocks = new ArrayList<TimeBlock>();
242 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start, 1, new BigDecimal("5"), "RGN", jobNumber, workArea));
243 aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry, HrServiceLocator.getCalendarService().getCalendar(payCalendarEntry.getHrCalendarId()), true);
244 TkTestUtils.verifyAggregateHourSumsFlatList("September Pre-Check", new HashMap<String,BigDecimal>() {{put("PRM", BigDecimal.ZERO);put("RGN", new BigDecimal(5));}},aggregate);
245
246
247 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
248 TkTestUtils.verifyAggregateHourSumsFlatList("September Post-Check", new HashMap<String,BigDecimal>() {{put("PRM", new BigDecimal(7));put("RGN", new BigDecimal(7));}},aggregate);
249 }
250
251 @SuppressWarnings("serial")
252 @Test
253
254
255
256
257
258
259
260
261
262
263 public void testProcessShiftSimpleNoisyCase() throws Exception {
264
265 boolean[] dayArray = {true, true, true, true, true, true, true};
266
267 Long jobNumber = 30L;
268 Long workArea = 0L;
269 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
270 this.createShiftDifferentialRule(
271 "BWS-CAL",
272 "REG",
273 "PRM",
274 "IN",
275 "SD1",
276 "SD1",
277 (new LocalTime(16, 0)),
278 (new LocalTime(0, 0)),
279 new BigDecimal(4),
280 new BigDecimal("15"),
281 dayArray);
282
283
284 DateTime start = new DateTime(2010, 3, 29, 14, 0, 0, 0, zone);
285 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
286 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
287 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start, 2, new BigDecimal("4"), "RGN", jobNumber, workArea));
288 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start.plusHours(4).plusMinutes(15), 2, new BigDecimal("2"), "RGN", jobNumber, workArea));
289 blocks.addAll(TkTestUtils.createUniformTimeBlocks(new DateTime(2010, 3, 29, 12, 58, 0, 0, zone), 2, new BigDecimal(1), "RGN", jobNumber, workArea));
290 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
291
292
293 TkTestUtils.verifyAggregateHourSums("Pre-Check", new HashMap<String,BigDecimal>() {{put("PRM", BigDecimal.ZERO);put("RGN", new BigDecimal(14));}},aggregate,2);
294
295
296 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
297 tdoc.setTimeBlocks(blocks);
298 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
299
300
301 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new HashMap<String,BigDecimal>() {{put("PRM", new BigDecimal(8));put("RGN", new BigDecimal(14));}},aggregate,2);
302 }
303
304 @SuppressWarnings("serial")
305 @Test
306
307
308
309
310
311
312
313 public void testProcessShiftSimpleCase() throws Exception {
314
315 boolean[] dayArray = {true, true, true, true, true, true, true};
316
317 Long jobNumber = 30L;
318 Long workArea = 0L;
319 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
320 this.createShiftDifferentialRule(
321 "BWS-CAL",
322 "REG",
323 "PRM",
324 "IN",
325 "SD1",
326 "SD1",
327 (new LocalTime(16, 0)),
328 (new LocalTime(0, 0)),
329 new BigDecimal(4),
330 new BigDecimal("15.00"),
331 dayArray);
332
333
334 DateTime start = new DateTime(2010, 3, 29, 14, 0, 0, 0, zone);
335 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
336 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
337 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start, 2, new BigDecimal("4"), "REG", jobNumber, workArea));
338 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start.plusHours(4).plusMinutes(15), 2, new BigDecimal("2"), "REG", jobNumber, workArea));
339 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
340
341
342 TkTestUtils.verifyAggregateHourSums("Pre-Check", new HashMap<String,BigDecimal>() {{put("PRM", BigDecimal.ZERO);put("REG", new BigDecimal(12));}},aggregate,2);
343
344
345 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
346 tdoc.setTimeBlocks(blocks);
347 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
348
349
350 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new HashMap<String,BigDecimal>() {{put("PRM", new BigDecimal(8));put("REG", new BigDecimal(12));}},aggregate,2);
351 }
352
353
354
355
356
357
358 private void createShiftDifferentialRule(String pyCalendarGroup, String fromEarnGroup, String premiumEarnCode, String location, String payGrade, String hrSalGroup, LocalTime startTime, LocalTime endTime, BigDecimal minHours, BigDecimal maxGap, boolean dayBooleans[]) {
359 Assert.assertTrue("Wrong number of day booleans", dayBooleans.length == 7);
360
361 ShiftDifferentialRuleService service = TkServiceLocator.getShiftDifferentialRuleService();
362 ShiftDifferentialRule sdr = new ShiftDifferentialRule();
363
364 sdr.setBeginTime(new Time(startTime.toDateTimeToday().getMillis()));
365 sdr.setEndTime(new Time(endTime.toDateTimeToday().getMillis()));
366 sdr.setMinHours(minHours);
367 sdr.setMaxGap(maxGap);
368 sdr.setActive(true);
369 sdr.setUserPrincipalId(USER_PRINCIPAL_ID);
370 sdr.setEffectiveLocalDate(JAN_AS_OF_DATE.toLocalDate());
371 sdr.setLocation(location);
372 sdr.setPayGrade(payGrade);
373 sdr.setHrSalGroup(hrSalGroup);
374 sdr.setFromEarnGroup(fromEarnGroup);
375 sdr.setPyCalendarGroup(pyCalendarGroup);
376 sdr.setEarnCode(premiumEarnCode);
377 sdr.setRuleType("default");
378
379 for (int i=0; i<dayBooleans.length; i++) {
380 switch(i) {
381 case 0:
382 sdr.setSunday(dayBooleans[i]);
383 break;
384 case 1:
385 sdr.setMonday(dayBooleans[i]);
386 break;
387 case 2:
388 sdr.setTuesday(dayBooleans[i]);
389 break;
390 case 3:
391 sdr.setWednesday(dayBooleans[i]);
392 break;
393 case 4:
394 sdr.setThursday(dayBooleans[i]);
395 break;
396 case 5:
397 sdr.setFriday(dayBooleans[i]);
398 break;
399 case 6:
400 sdr.setSaturday(dayBooleans[i]);
401 break;
402 }
403 }
404
405 service.saveOrUpdate(sdr);
406
407 ShiftDifferentialRule sdrBack = service.getShiftDifferentialRule(sdr.getTkShiftDiffRuleId());
408
409 DateTimeZone tz = HrServiceLocator.getTimezoneService().getUserTimezoneWithFallback();
410 LocalTime orig_start = new LocalTime(sdr.getBeginTime());
411 LocalTime orig_end = new LocalTime(sdr.getEndTime());
412
413 LocalTime stored_start = new LocalTime(sdrBack.getBeginTime());
414 LocalTime stored_end = new LocalTime(sdrBack.getEndTime());
415
416 Assert.assertTrue("Start times not equal.", orig_start.equals(stored_start));
417 Assert.assertTrue("End times not equal.", orig_end.equals(stored_end));
418 }
419
420
421 @Ignore
422 @Test
423
424
425
426
427
428
429
430
431
432
433 public void simpleCaseWithWorkSchedule() throws Exception {
434
435 boolean[] dayArray = {true, true, true, true, true, true, true};
436
437 Long jobNumber = 30L;
438 Long workArea = 0L;
439 this.createShiftDifferentialRule(
440 "BWS-CAL",
441 "REG",
442 "PRM",
443 "IN",
444 "SD1",
445 "SD1",
446 (new LocalTime(12, 0)),
447 (new LocalTime(17, 0)),
448 new BigDecimal(4),
449 new BigDecimal("15.00"),
450 dayArray);
451
452
453 DateTime start = new DateTime(2010, 3, 29, 12, 0, 0, 0, TKUtils.getSystemDateTimeZone());
454 DateTime holtime = new DateTime(2010, 3, 30, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
455 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
456 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
457 blocks.addAll(TkTestUtils.createUniformTimeBlocks(start, 1, new BigDecimal("4"), "REG", jobNumber, workArea));
458 blocks.addAll(TkTestUtils.createUniformTimeBlocks(holtime, 1, new BigDecimal("4"), "HOL", jobNumber, workArea));
459
460 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
461
462
463 TkTestUtils.verifyAggregateHourSums("Pre-Check", new HashMap<String,BigDecimal>() {{put("PRM", BigDecimal.ZERO);put("REG", new BigDecimal(4));put("HOL", new BigDecimal(4));}},aggregate,2);
464
465
466 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
467 tdoc.setTimeBlocks(blocks);
468 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
469
470
471 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new HashMap<String,BigDecimal>() {{put("PRM", new BigDecimal(8));put("REG", new BigDecimal(4));}},aggregate,2);
472
473 }
474
475
476
477
478
479
480
481
482 @Test
483 public void overlapMultipleShiftsWithSameTimeBlock() {
484
485 boolean[] dayArray = {true, true, true, true, true, true, true};
486
487 Long jobNumber = 30L;
488 Long workArea = 0L;
489 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
490
491
492 this.createShiftDifferentialRule(
493 "BWS-CAL",
494 "REG",
495 "PRM",
496 "IN",
497 "SD1",
498 "SD1",
499 (new LocalTime(15, 0)),
500 (new LocalTime(8, 0)),
501 new BigDecimal(6),
502 new BigDecimal("90.00"),
503 dayArray);
504
505
506 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
507 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
508
509 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
510 DateTime tbStart = new DateTime(2010, 3, 29, 0, 0, 0, 0, zone);
511
512
513 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart, 1, new BigDecimal("24"), "REG", jobNumber, workArea));
514
515 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
516
517
518 TkTestUtils.verifyAggregateHourSums("Pre-Check", new HashMap<String,BigDecimal>() {{put("PRM", BigDecimal.ZERO);put("REG", new BigDecimal(24));}},aggregate,2);
519
520
521 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
522 tdoc.setTimeBlocks(blocks);
523 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
524
525
526 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new HashMap<String,BigDecimal>() {{put("PRM", new BigDecimal(17));put("REG", new BigDecimal(24));}},aggregate,2);
527
528 }
529
530
531
532
533
534
535 @Test
536 public void overlapMultipleShiftsWithMultipleTimeBlocks() {
537
538 boolean[] dayArray = {true, true, true, true, true, true, true};
539
540 Long jobNumber = 30L;
541 Long workArea = 0L;
542 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
543
544
545 this.createShiftDifferentialRule(
546 "BWS-CAL",
547 "REG",
548 "PRM",
549 "IN",
550 "SD1",
551 "SD1",
552 (new LocalTime(15, 0)),
553 (new LocalTime(8, 0)),
554 new BigDecimal(6),
555 new BigDecimal("90.00"),
556 dayArray);
557
558
559 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
560 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
561
562 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
563 DateTime tbStart = new DateTime(2010, 3, 29, 0, 0, 0, 0, zone);
564
565
566 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart, 1, new BigDecimal("24"), "REG", jobNumber, workArea));
567
568
569 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart.plusDays(1), 1, new BigDecimal("24"), "REG", jobNumber, workArea));
570
571 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
572
573
574 TkTestUtils.verifyAggregateHourSums("Pre-Check", new HashMap<String,BigDecimal>() {{put("PRM", BigDecimal.ZERO);put("REG", new BigDecimal(48));}},aggregate,2);
575
576
577 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
578 tdoc.setTimeBlocks(blocks);
579 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
580
581
582
583 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new HashMap<String,BigDecimal>() {{put("PRM", new BigDecimal(34));put("REG", new BigDecimal(48));}},aggregate,2);
584
585 }
586
587
588
589
590
591
592 @Test
593 public void overlapMultipleShiftsWithSameTimeBlockExceedingMinOnOneShift() {
594
595 boolean[] dayArray = {true, true, true, true, true, true, true};
596
597 Long jobNumber = 30L;
598 Long workArea = 0L;
599 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
600
601
602 this.createShiftDifferentialRule(
603 "BWS-CAL",
604 "REG",
605 "PRM",
606 "IN",
607 "SD1",
608 "SD1",
609 (new LocalTime(15, 0)),
610 (new LocalTime(8, 0)),
611 new BigDecimal(6),
612 new BigDecimal("90.00"),
613 dayArray);
614
615 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
616 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
617 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
618
619
620 DateTime tbStart = new DateTime(2010, 3, 30, 3, 0, 0, 0, zone);
621 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart, 1, new BigDecimal("21"), "REG", jobNumber, workArea));
622
623 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
624
625
626 TkTestUtils.verifyAggregateHourSums("Pre-Check", new ImmutableMap.Builder<String, BigDecimal>()
627 .put("PRM", BigDecimal.ZERO)
628 .put("REG", new BigDecimal(21)).build(), aggregate, 2);
629
630
631 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
632 tdoc.setTimeBlocks(blocks);
633 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
634
635
636 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new ImmutableMap.Builder<String, BigDecimal>()
637 .put("PRM", new BigDecimal(9))
638 .put("REG", new BigDecimal(21)).build(),
639 aggregate,
640 2);
641
642 }
643
644
645
646
647
648
649 @Test
650 public void overlapMultipleShiftsWithSameTimeBlockExceedingMinOnFirstShift() {
651
652 boolean[] dayArray = {true, true, true, true, true, true, true};
653
654 Long jobNumber = 30L;
655 Long workArea = 0L;
656 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
657
658
659 this.createShiftDifferentialRule(
660 "BWS-CAL",
661 "REG",
662 "PRM",
663 "IN",
664 "SD1",
665 "SD1",
666 (new LocalTime(15, 0)),
667 (new LocalTime(8, 0)),
668 new BigDecimal(6),
669 new BigDecimal("90.00"),
670 dayArray);
671
672 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
673 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
674 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
675
676
677 DateTime tbStart = new DateTime(2010, 3, 30, 1, 0, 0, 0, zone);
678 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart, 1, new BigDecimal("19"), "REG", jobNumber, workArea));
679
680 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
681
682
683 TkTestUtils.verifyAggregateHourSums("Pre-Check", new ImmutableMap.Builder<String, BigDecimal>()
684 .put("PRM", BigDecimal.ZERO)
685 .put("REG", new BigDecimal(19)).build(), aggregate, 2);
686
687
688 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
689 tdoc.setTimeBlocks(blocks);
690 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
691
692
693 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new ImmutableMap.Builder<String, BigDecimal>()
694 .put("PRM", new BigDecimal(7))
695 .put("REG", new BigDecimal(19)).build(),
696 aggregate,
697 2);
698
699 }
700
701
702
703
704
705
706 @Test
707 public void overlapMultipleShiftsWithSameTimeBlocNeitherExceedingMin() {
708
709 boolean[] dayArray = {true, true, true, true, true, true, true};
710
711 Long jobNumber = 30L;
712 Long workArea = 0L;
713 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
714
715
716 this.createShiftDifferentialRule(
717 "BWS-CAL",
718 "REG",
719 "PRM",
720 "IN",
721 "SD1",
722 "SD1",
723 (new LocalTime(15, 0)),
724 (new LocalTime(8, 0)),
725 new BigDecimal(6),
726 new BigDecimal("90.00"),
727 dayArray);
728
729
730 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
731 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
732 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
733
734
735 DateTime tbStart = new DateTime(2010, 3, 30, 3, 0, 0, 0, zone);
736 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart, 1, new BigDecimal("17"), "REG", jobNumber, workArea));
737
738 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
739
740
741 TkTestUtils.verifyAggregateHourSums("Pre-Check", new ImmutableMap.Builder<String, BigDecimal>()
742 .put("PRM", BigDecimal.ZERO)
743 .put("REG", new BigDecimal(17)).build(), aggregate, 2);
744
745
746 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
747 tdoc.setTimeBlocks(blocks);
748 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
749
750
751 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new ImmutableMap.Builder<String, BigDecimal>()
752 .put("PRM", BigDecimal.ZERO)
753 .put("REG", new BigDecimal(17)).build(),
754 aggregate,
755 2);
756 }
757
758
759
760
761
762
763 @Test
764 public void multipleTimeBlocksOvernightExceedingMin() {
765
766 boolean[] dayArray = {true, true, true, true, true, true, true};
767
768 Long jobNumber = 30L;
769 Long workArea = 0L;
770 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
771
772
773 this.createShiftDifferentialRule(
774 "BWS-CAL",
775 "REG",
776 "PRM",
777 "IN",
778 "SD1",
779 "SD1",
780 (new LocalTime(15, 0)),
781 (new LocalTime(8, 0)),
782 new BigDecimal(6),
783 new BigDecimal("90.00"),
784 dayArray);
785
786
787 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
788 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
789 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
790
791
792 DateTime tbStart1 = new DateTime(2010, 3, 30, 22, 0, 0, 0, zone);
793 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart1, 1, new BigDecimal("2"), "REG", jobNumber, workArea));
794
795 DateTime tbStart2 = new DateTime(2010, 3, 31, 0, 0, 0, 0, zone);
796 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart2, 1, new BigDecimal("5"), "REG", jobNumber, workArea));
797
798 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
799
800
801 TkTestUtils.verifyAggregateHourSums("Pre-Check", new ImmutableMap.Builder<String, BigDecimal>()
802 .put("PRM", BigDecimal.ZERO)
803 .put("REG", BigDecimal.valueOf(7)).build(), aggregate, 2);
804
805
806 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
807 tdoc.setTimeBlocks(blocks);
808 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
809
810
811 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new ImmutableMap.Builder<String, BigDecimal>()
812 .put("PRM", BigDecimal.valueOf(7))
813 .put("REG", BigDecimal.valueOf(7)).build(),
814 aggregate,
815 2);
816 }
817
818
819
820
821
822
823 @Test
824 public void multipleTimeBlocksOvernightExceedingMinWithSixtyMinuteGap() {
825
826 boolean[] dayArray = {true, true, true, true, true, true, true};
827
828 Long jobNumber = 30L;
829 Long workArea = 0L;
830 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
831
832
833 this.createShiftDifferentialRule(
834 "BWS-CAL",
835 "REG",
836 "PRM",
837 "IN",
838 "SD1",
839 "SD1",
840 (new LocalTime(15, 0)),
841 (new LocalTime(8, 0)),
842 new BigDecimal(6),
843 new BigDecimal("90.00"),
844 dayArray);
845
846
847 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
848 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
849 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
850
851
852 DateTime tbStart1 = new DateTime(2010, 3, 30, 22, 0, 0, 0, zone);
853 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart1, 1, new BigDecimal("2"), "REG", jobNumber, workArea));
854
855 DateTime tbStart2 = new DateTime(2010, 3, 31, 1, 0, 0, 0, zone);
856 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart2, 1, new BigDecimal("4"), "REG", jobNumber, workArea));
857
858 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
859
860
861 TkTestUtils.verifyAggregateHourSums("Pre-Check", new ImmutableMap.Builder<String, BigDecimal>()
862 .put("PRM", BigDecimal.ZERO)
863 .put("REG", BigDecimal.valueOf(6)).build(), aggregate, 2);
864
865
866 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
867 tdoc.setTimeBlocks(blocks);
868 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
869
870
871 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new ImmutableMap.Builder<String, BigDecimal>()
872 .put("PRM", BigDecimal.valueOf(6))
873 .put("REG", BigDecimal.valueOf(6)).build(),
874 aggregate,
875 2);
876 }
877
878
879
880
881
882
883 @Test
884 public void multipleTimeBlocksOvernightExceedingMinWithNinetyMinuteGap() {
885
886 boolean[] dayArray = {true, true, true, true, true, true, true};
887
888 Long jobNumber = 30L;
889 Long workArea = 0L;
890 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
891
892
893 this.createShiftDifferentialRule(
894 "BWS-CAL",
895 "REG",
896 "PRM",
897 "IN",
898 "SD1",
899 "SD1",
900 (new LocalTime(15, 0)),
901 (new LocalTime(8, 0)),
902 new BigDecimal(6),
903 new BigDecimal("90.00"),
904 dayArray);
905
906
907 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
908 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
909 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
910
911
912 DateTime tbStart1 = new DateTime(2010, 3, 30, 22, 0, 0, 0, zone);
913 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart1, 1, new BigDecimal("2"), "REG", jobNumber, workArea));
914
915 DateTime tbStart2 = new DateTime(2010, 3, 31, 1, 30, 0, 0, zone);
916 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart2, 1, new BigDecimal("4"), "REG", jobNumber, workArea));
917
918 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
919
920
921 TkTestUtils.verifyAggregateHourSums("Pre-Check", new ImmutableMap.Builder<String, BigDecimal>()
922 .put("PRM", BigDecimal.ZERO)
923 .put("REG", BigDecimal.valueOf(6)).build(), aggregate, 2);
924
925
926 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
927 tdoc.setTimeBlocks(blocks);
928 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
929
930
931 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new ImmutableMap.Builder<String, BigDecimal>()
932 .put("PRM", BigDecimal.valueOf(6))
933 .put("REG", BigDecimal.valueOf(6)).build(),
934 aggregate,
935 2);
936 }
937
938
939
940
941
942
943 @Test
944 public void multipleTimeBlocksOvernightExceedingMinButExceedingGap() {
945
946 boolean[] dayArray = {true, true, true, true, true, true, true};
947
948 Long jobNumber = 30L;
949 Long workArea = 0L;
950 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
951
952
953 this.createShiftDifferentialRule(
954 "BWS-CAL",
955 "REG",
956 "PRM",
957 "IN",
958 "SD1",
959 "SD1",
960 (new LocalTime(15, 0)),
961 (new LocalTime(8, 0)),
962 new BigDecimal(6),
963 new BigDecimal("90.00"),
964 dayArray);
965
966
967 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
968 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
969 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
970
971
972 DateTime tbStart1 = new DateTime(2010, 3, 30, 22, 0, 0, 0, zone);
973 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart1, 1, new BigDecimal("2"), "REG", jobNumber, workArea));
974
975 DateTime tbStart2 = new DateTime(2010, 3, 31, 1, 36, 0, 0, zone);
976 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart2, 1, new BigDecimal("4"), "REG", jobNumber, workArea));
977
978 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
979
980
981 TkTestUtils.verifyAggregateHourSums("Pre-Check", new ImmutableMap.Builder<String, BigDecimal>()
982 .put("PRM", BigDecimal.ZERO)
983 .put("REG", BigDecimal.valueOf(6)).build(), aggregate, 2);
984
985
986 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
987 tdoc.setTimeBlocks(blocks);
988 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
989
990
991 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new ImmutableMap.Builder<String, BigDecimal>()
992 .put("PRM", BigDecimal.valueOf(0))
993 .put("REG", BigDecimal.valueOf(6)).build(),
994 aggregate,
995 2);
996 }
997
998
999
1000
1001
1002
1003
1004 @Test
1005 public void threeBlocksWithinSameShift() {
1006
1007 boolean[] dayArray = {true, true, true, true, true, true, true};
1008
1009 Long jobNumber = 30L;
1010 Long workArea = 0L;
1011 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
1012
1013
1014 this.createShiftDifferentialRule(
1015 "BWS-CAL",
1016 "REG",
1017 "PRM",
1018 "IN",
1019 "SD1",
1020 "SD1",
1021 (new LocalTime(15, 0)),
1022 (new LocalTime(8, 0)),
1023 new BigDecimal(6),
1024 new BigDecimal("90.00"),
1025 dayArray);
1026
1027
1028 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
1029 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
1030
1031 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
1032
1033
1034 DateTime tbStart1 = new DateTime(2010, 3, 30, 15, 0, 0, 0, zone);
1035 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart1, 1, new BigDecimal("2"), "REG", jobNumber, workArea));
1036
1037
1038 DateTime tbStart2 = new DateTime(2010, 3, 30, 18, 0, 0, 0, zone);
1039 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart2, 1, new BigDecimal("3"), "REG", jobNumber, workArea));
1040
1041
1042 DateTime tbStart3 = new DateTime(2010, 3, 30, 22, 0, 0, 0, zone);
1043 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart3, 1, new BigDecimal("1"), "REG", jobNumber, workArea));
1044
1045 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
1046
1047
1048 TkTestUtils.verifyAggregateHourSums("Pre-Check", new ImmutableMap.Builder<String, BigDecimal>()
1049 .put("PRM", BigDecimal.ZERO)
1050 .put("REG", BigDecimal.valueOf(6)).build(), aggregate, 2);
1051
1052
1053 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
1054 tdoc.setTimeBlocks(blocks);
1055 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
1056
1057
1058 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new ImmutableMap.Builder<String, BigDecimal>()
1059 .put("PRM", BigDecimal.valueOf(6))
1060 .put("REG", BigDecimal.valueOf(6)).build(),
1061 aggregate,
1062 2);
1063 }
1064
1065
1066
1067
1068
1069
1070 @Test
1071 public void fourBlocksWithinSameShiftSpanningTwoDays() {
1072
1073 boolean[] dayArray = {true, true, true, true, true, true, true};
1074
1075 Long jobNumber = 30L;
1076 Long workArea = 0L;
1077 DateTimeZone zone = HrServiceLocator.getTimezoneService().getTargetUserTimezoneWithFallback();
1078
1079
1080 this.createShiftDifferentialRule(
1081 "BWS-CAL",
1082 "REG",
1083 "PRM",
1084 "IN",
1085 "SD1",
1086 "SD1",
1087 (new LocalTime(15, 0)),
1088 (new LocalTime(8, 0)),
1089 new BigDecimal(6),
1090 new BigDecimal("90.00"),
1091 dayArray);
1092
1093
1094 DateTime start = new DateTime(2010, 3, 29, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone());
1095 CalendarEntry payCalendarEntry = HrServiceLocator.getCalendarEntryService().getCurrentCalendarDates("admin", start);
1096
1097 List<TimeBlock> blocks = new ArrayList<TimeBlock>();
1098
1099
1100 DateTime tbStart1 = new DateTime(2010, 3, 30, 17, 0, 0, 0, zone);
1101 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart1, 1, new BigDecimal("1"), "REG", jobNumber, workArea));
1102
1103
1104 DateTime tbStart2 = new DateTime(2010, 3, 30, 19, 30, 0, 0, zone);
1105 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart2, 1, new BigDecimal("1"), "REG", jobNumber, workArea));
1106
1107
1108 DateTime tbStart3 = new DateTime(2010, 3, 30, 22, 0, 0, 0, zone);
1109 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart3, 1, new BigDecimal("2"), "REG", jobNumber, workArea));
1110
1111
1112 DateTime tbStart4 = new DateTime(2010, 3, 31, 1, 30, 0, 0, zone);
1113 blocks.addAll(TkTestUtils.createUniformTimeBlocks(tbStart4, 1, new BigDecimal("3"), "REG", jobNumber, workArea));
1114
1115 TkTimeBlockAggregate aggregate = new TkTimeBlockAggregate(blocks, payCalendarEntry);
1116
1117
1118 TkTestUtils.verifyAggregateHourSums("Pre-Check", new ImmutableMap.Builder<String, BigDecimal>()
1119 .put("PRM", BigDecimal.ZERO)
1120 .put("REG", BigDecimal.valueOf(7)).build(), aggregate, 2);
1121
1122
1123 TimesheetDocument tdoc = TkTestUtils.populateBlankTimesheetDocument(start, "admin");
1124 tdoc.setTimeBlocks(blocks);
1125 TkServiceLocator.getShiftDifferentialRuleService().processShiftDifferentialRules(tdoc, aggregate);
1126
1127
1128 TkTestUtils.verifyAggregateHourSums("Post Rules Check", new ImmutableMap.Builder<String, BigDecimal>()
1129 .put("PRM", BigDecimal.valueOf(7))
1130 .put("REG", BigDecimal.valueOf(7)).build(),
1131 aggregate,
1132 2);
1133 }
1134 }