Interface AccrualMethodService<T>

All Known Implementing Classes:
DayAccrualMethodServiceImpl, ReservationAccrualMethodServiceImpl

public interface AccrualMethodService<T>
Calculates the accrual amount of a given service if the check is successful
  • Method Details

    • prepareData

      T 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 in check(Voucher, Order, LocalDate, T) and 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.
    • check

      boolean check(Voucher voucher, Order order, org.joda.time.LocalDate deadline, T preparedData)
    • calculate

      BigDecimal calculate(Voucher voucher, Order order, org.joda.time.LocalDate deadline, T preparedData)
    • check

      @Deprecated boolean check(Entity voucher, org.joda.time.LocalDate deadline)
      Deprecated.
      Has been replaced with check(Voucher, Order, LocalDate, T) to be able to do the stuff with the prepared data of multiple entities at once (more efficient)
    • calculate

      @Deprecated BigDecimal calculate(Entity voucher, org.joda.time.LocalDate deadline)
      Deprecated.
      Has been replaced with calculate(Voucher, Order, LocalDate, T) to be able to do the stuff with the prepared data of multiple entities at once (more efficient)