Class DayAccrualMethodServiceImpl
java.lang.Object
ch.tocco.nice2.optional.accrualexport.impl.service.DayAccrualMethodServiceImpl
- All Implemented Interfaces:
AccrualMethodService<Void>
@Component
public class DayAccrualMethodServiceImpl
extends Object
implements AccrualMethodService<Void>
Calculates the accrual amount by count of days after the deadline
compared to the total number of days
-
Constructor Summary
ConstructorDescriptionDayAccrualMethodServiceImpl
(Context context, QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.boolean
boolean
Deprecated.prepareData
(List<Voucher> vouchers) Receives all vouchers which should be handled in this task run and should return all the data which is needed to do its job inAccrualMethodService.check(Voucher, Order, LocalDate, T)
andAccrualMethodService.calculate(Voucher, Order, LocalDate, T)
.
-
Constructor Details
-
DayAccrualMethodServiceImpl
-
-
Method Details
-
prepareData
Description copied from interface:AccrualMethodService
Receives all vouchers which should be handled in this task run and should return all the data which is needed to do its job inAccrualMethodService.check(Voucher, Order, LocalDate, T)
andAccrualMethodService.calculate(Voucher, Order, LocalDate, T)
. This method here should load the needed data as efficient as possible (few queries and only necessary paths). The other methods (`check` and `calculate`) shouldn't have to make any database queries at all.- Specified by:
prepareData
in interfaceAccrualMethodService<Void>
-
check
public boolean check(Voucher voucher, Order order, org.joda.time.LocalDate deadline, Void preparedData) - Specified by:
check
in interfaceAccrualMethodService<Void>
-
calculate
public BigDecimal calculate(Voucher voucher, Order order, org.joda.time.LocalDate deadline, Void preparedData) - Specified by:
calculate
in interfaceAccrualMethodService<Void>
-
check
Deprecated.- Specified by:
check
in interfaceAccrualMethodService<Void>
-
calculate
Deprecated.- Specified by:
calculate
in interfaceAccrualMethodService<Void>
-