use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class BankAccountSubscriptions method on.
@Programmatic
@com.google.common.eventbus.Subscribe
@org.axonframework.eventhandling.annotation.EventHandler
public void on(final BankAccount.RemoveEvent ev) {
BankAccount sourceBankAccount = ev.getSource();
List<FixedAssetFinancialAccount> results;
switch(ev.getEventPhase()) {
case VALIDATE:
results = fixedAssetFinancialAccountRepository.findByFinancialAccount(sourceBankAccount);
if (results.size() > 0) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("This bank account is assigned to a fixed asset: remove the bank account from the fixed asset. In use by the following fixed assets: ");
for (FixedAssetFinancialAccount fixedAssetFinancialAccount : results) {
stringBuilder.append(fixedAssetFinancialAccount.getFixedAsset().getName() + "\n");
}
ev.invalidate(stringBuilder.toString());
}
break;
default:
break;
}
}
use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class BankMandateDtoFactory method newDto.
@Programmatic
public BankMandateDto newDto(final BankMandate bankMandate) {
final BankMandateDto dto = new BankMandateDto();
dto.setSelf(mappingHelper.oidDtoFor(bankMandate));
dto.setReference(fixup(bankMandate.getReference()));
dto.setScheme(toDto(bankMandate.getScheme()));
dto.setSequenceType(toDto2(bankMandate.getSequenceType()));
dto.setSignatureDate(asXMLGregorianCalendar(bankMandate.getSignatureDate()));
dto.setBankAccount(mappingHelper.oidDtoFor(bankMandate.getBankAccount()));
// not currently in the estatio dom, so hard-coded for now
dto.setStatus(Status.OPEN);
return dto;
}
use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class UdoDomainObject method getId.
// //////////////////////////////////////
@Programmatic
public String getId() {
Object objectId = JDOHelper.getObjectId(this);
if (objectId == null) {
return "";
}
String objectIdStr = objectId.toString();
final String id = objectIdStr.split("\\[OID\\]")[0];
return id;
}
use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class Partitioning method getFractionOfYear.
@Programmatic
public BigDecimal getFractionOfYear() {
BigDecimal numberOfDaysInInterval = BigDecimal.valueOf(getInterval().days());
BigDecimal numberOfDaysInYear = BigDecimal.valueOf(new LocalDateInterval(new LocalDate(getStartDate().getYear(), 01, 01), new LocalDate(getStartDate().getYear() + 1, 01, 01), AbstractInterval.IntervalEnding.EXCLUDING_END_DATE).days());
return numberOfDaysInInterval.divide(numberOfDaysInYear, MathContext.DECIMAL64);
}
use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class ProlongationOptionRepository method checkProlongationAndNotificationPeriodStr.
@Programmatic
public String checkProlongationAndNotificationPeriodStr(final String prolongationPeriod, final String notificationPeriod) {
final Period prolongationPeriodJoda = JodaPeriodUtils.asPeriod(prolongationPeriod);
if (prolongationPeriod != null && prolongationPeriodJoda == null) {
return "Prolongation period format not recognized";
}
final Period notificationPeriodJoda = JodaPeriodUtils.asPeriod(notificationPeriod);
if (notificationPeriod != null && notificationPeriodJoda == null) {
return "Notification period format not recognized";
}
return null;
}
Aggregations