protected Set<AccountingTransaction> internalProcess(User user, Collection<EntryDTO> entryDTOs, Event event,
Account fromAccount, Account toAccount, AccountingTransactionDetailDTO transactionDetail) {
final Set<AccountingTransaction> result = new HashSet<AccountingTransaction>();
final Set<Entry> createdEntries = new HashSet<Entry>();
final AnnualEvent annualEvent = (AnnualEvent) event;
for (final EntryDTO entryDTO : entryDTOs) {
if (entryDTO.getEntryType() == EntryType.INSURANCE_FEE) {
createdEntries.addAll(getPostingRuleForInsurance(annualEvent.getStartDate(), annualEvent.getEndDate()).process(
user, Collections.singletonList(entryDTO), event, fromAccount, toAccount, transactionDetail));
} else if (entryDTO.getEntryType() == EntryType.ADMINISTRATIVE_OFFICE_FEE) {
createdEntries.addAll(getPostingRuleForAdministrativeOfficeFee(annualEvent.getStartDate(),
annualEvent.getEndDate()).process(user, Collections.singletonList(entryDTO), event, fromAccount,
toAccount, transactionDetail));
} else {
throw new DomainException(
"error.accounting.postingRules.AdministrativeOfficeFeeAndInsurancePR.invalid.entry.type");
}