Search in sources :

Example 1 with BreakType

use of org.estatio.module.lease.dom.breaks.BreakType in project estatio by estatio.

the class BreakOptionImport method importData.

@Programmatic
@Override
public List<Object> importData(final Object previousRow) {
    final Lease lease = fetchLease(leaseReference);
    final BreakType breakTypeValue = BreakType.valueOf(breakType);
    final BreakExerciseType breakExerciseTypeValue = BreakExerciseType.valueOf(breakExcerciseType);
    if (notificationDate != null) {
        final Period period = new Period(notificationDate, breakDate);
        notificationPeriod = JodaPeriodUtils.asSimpleString(period);
    }
    BreakOption br = breakOptionRepository.findByLeaseAndTypeAndBreakDateAndExerciseType(lease, breakTypeValue, breakDate, breakExerciseTypeValue);
    if (br == null) {
        breakOptionRepository.newBreakOption(lease, breakDate, notificationPeriod, breakTypeValue, breakExerciseTypeValue, description);
    }
    return Lists.newArrayList();
}
Also used : BreakOption(org.estatio.module.lease.dom.breaks.BreakOption) Lease(org.estatio.module.lease.dom.Lease) BreakType(org.estatio.module.lease.dom.breaks.BreakType) Period(org.joda.time.Period) BreakExerciseType(org.estatio.module.lease.dom.breaks.BreakExerciseType) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Aggregations

Programmatic (org.apache.isis.applib.annotation.Programmatic)1 Lease (org.estatio.module.lease.dom.Lease)1 BreakExerciseType (org.estatio.module.lease.dom.breaks.BreakExerciseType)1 BreakOption (org.estatio.module.lease.dom.breaks.BreakOption)1 BreakType (org.estatio.module.lease.dom.breaks.BreakType)1 Period (org.joda.time.Period)1