use of org.estatio.canonical.financial.v1.BankAccountDto in project estatio by estatio.
the class BankAccountDtoFactory method newDto.
@Programmatic
public BankAccountDto newDto(final BankAccount bankAccount) {
final BankAccountDto dto = new BankAccountDto();
dto.setSelf(mappingHelper.oidDtoFor(bankAccount));
dto.setAccountNumber(bankAccount.getAccountNumber());
dto.setBankParty(mappingHelper.oidDtoFor(bankAccount.getBank()));
dto.setBranchCode(bankAccount.getBranchCode());
dto.setExternalReference(bankAccount.getExternalReference());
dto.setIban(bankAccount.getIban());
dto.setBic(bankAccount.getBic());
dto.setName(bankAccount.getName());
dto.setNationalBankCode(bankAccount.getNationalBankCode());
dto.setNationalCheckCode(bankAccount.getNationalCheckCode());
dto.setOwnerParty(mappingHelper.oidDtoFor(bankAccount.getOwner()));
dto.setReference(bankAccount.getReference());
return dto;
}
use of org.estatio.canonical.financial.v1.BankAccountDto in project estatio by estatio.
the class PartyBankAccountsAndMandatesDtoFactory method newDto.
@Programmatic
public BankAccountsAndMandatesDto newDto(final Party party) {
final BankAccountsAndMandatesDto dto = new BankAccountsAndMandatesDto();
final List<FinancialAccount> financialAccountList = financialAccountRepository.findAccountsByTypeOwner(FinancialAccountType.BANK_ACCOUNT, party);
final List<BankAccountDto> bankAccountDtos = financialAccountList.stream().map(x -> bankAccountDtoFactory.newDto((BankAccount) x)).collect(Collectors.toList());
dto.setBankAccounts(bankAccountDtos);
final AgreementType bankMandateAt = agreementTypeRepository.find(BankMandateAgreementTypeEnum.MANDATE);
final AgreementRoleType debtorOfMandate = agreementRoleTypeRepository.findByAgreementTypeAndTitle(bankMandateAt, BankMandateAgreementRoleTypeEnum.DEBTOR.getTitle());
final List<AgreementRole> agreementRoles = agreementRoleRepository.findByPartyAndType(party, debtorOfMandate);
final List<BankMandateDto> mandateDtos = agreementRoles.stream().map(x -> x.getAgreement()).map(x -> bankMandateDtoFactory.newDto((BankMandate) x)).collect(Collectors.toList());
dto.setBankMandates(mandateDtos);
return dto;
}
Aggregations