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
ConstructorsConstructorDescriptionDayAccrualMethodServiceImpl(Context context, QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.booleanbooleanDeprecated.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:AccrualMethodServiceReceives 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:
prepareDatain interfaceAccrualMethodService<Void>
-
check
public boolean check(Voucher voucher, Order order, org.joda.time.LocalDate deadline, Void preparedData) - Specified by:
checkin interfaceAccrualMethodService<Void>
-
calculate
public BigDecimal calculate(Voucher voucher, Order order, org.joda.time.LocalDate deadline, Void preparedData) - Specified by:
calculatein interfaceAccrualMethodService<Void>
-
check
Deprecated.- Specified by:
checkin interfaceAccrualMethodService<Void>
-
calculate
Deprecated.- Specified by:
calculatein interfaceAccrualMethodService<Void>
-