Search in sources :

Example 1 with BankAccountDto

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;
}
Also used : BankAccountDto(org.estatio.canonical.financial.v1.BankAccountDto) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 2 with BankAccountDto

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;
}
Also used : BankAccountsAndMandatesDto(org.estatio.canonical.bankmandate.v1.BankAccountsAndMandatesDto) BankAccountDto(org.estatio.canonical.financial.v1.BankAccountDto) DtoFactoryAbstract(org.estatio.module.base.platform.applib.DtoFactoryAbstract) FinancialAccount(org.estatio.module.financial.dom.FinancialAccount) BankMandateDto(org.estatio.canonical.bankmandate.v1.BankMandateDto) AgreementType(org.estatio.module.agreement.dom.type.AgreementType) AgreementTypeRepository(org.estatio.module.agreement.dom.type.AgreementTypeRepository) DomainService(org.apache.isis.applib.annotation.DomainService) BankAccountDto(org.estatio.canonical.financial.v1.BankAccountDto) FinancialAccountRepository(org.estatio.module.financial.dom.FinancialAccountRepository) Programmatic(org.apache.isis.applib.annotation.Programmatic) Inject(javax.inject.Inject) BankMandateAgreementRoleTypeEnum(org.estatio.module.bankmandate.dom.BankMandateAgreementRoleTypeEnum) AgreementRole(org.estatio.module.agreement.dom.AgreementRole) BankAccountsAndMandatesDto(org.estatio.canonical.bankmandate.v1.BankAccountsAndMandatesDto) BankAccount(org.estatio.module.financial.dom.BankAccount) NatureOfService(org.apache.isis.applib.annotation.NatureOfService) BankMandateAgreementTypeEnum(org.estatio.module.bankmandate.dom.BankMandateAgreementTypeEnum) Party(org.estatio.module.party.dom.Party) AgreementRoleTypeRepository(org.estatio.module.agreement.dom.role.AgreementRoleTypeRepository) Collectors(java.util.stream.Collectors) AgreementRoleType(org.estatio.module.agreement.dom.role.AgreementRoleType) List(java.util.List) BankAccountDtoFactory(org.estatio.module.financial.canonical.v1.BankAccountDtoFactory) AgreementRoleRepository(org.estatio.module.agreement.dom.AgreementRoleRepository) BankMandate(org.estatio.module.bankmandate.dom.BankMandate) FinancialAccountType(org.estatio.module.financial.dom.FinancialAccountType) AgreementType(org.estatio.module.agreement.dom.type.AgreementType) AgreementRole(org.estatio.module.agreement.dom.AgreementRole) AgreementRoleType(org.estatio.module.agreement.dom.role.AgreementRoleType) FinancialAccount(org.estatio.module.financial.dom.FinancialAccount) BankMandateDto(org.estatio.canonical.bankmandate.v1.BankMandateDto) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Aggregations

Programmatic (org.apache.isis.applib.annotation.Programmatic)2 BankAccountDto (org.estatio.canonical.financial.v1.BankAccountDto)2 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Inject (javax.inject.Inject)1 DomainService (org.apache.isis.applib.annotation.DomainService)1 NatureOfService (org.apache.isis.applib.annotation.NatureOfService)1 BankAccountsAndMandatesDto (org.estatio.canonical.bankmandate.v1.BankAccountsAndMandatesDto)1 BankMandateDto (org.estatio.canonical.bankmandate.v1.BankMandateDto)1 AgreementRole (org.estatio.module.agreement.dom.AgreementRole)1 AgreementRoleRepository (org.estatio.module.agreement.dom.AgreementRoleRepository)1 AgreementRoleType (org.estatio.module.agreement.dom.role.AgreementRoleType)1 AgreementRoleTypeRepository (org.estatio.module.agreement.dom.role.AgreementRoleTypeRepository)1 AgreementType (org.estatio.module.agreement.dom.type.AgreementType)1 AgreementTypeRepository (org.estatio.module.agreement.dom.type.AgreementTypeRepository)1 BankMandate (org.estatio.module.bankmandate.dom.BankMandate)1 BankMandateAgreementRoleTypeEnum (org.estatio.module.bankmandate.dom.BankMandateAgreementRoleTypeEnum)1 BankMandateAgreementTypeEnum (org.estatio.module.bankmandate.dom.BankMandateAgreementTypeEnum)1 DtoFactoryAbstract (org.estatio.module.base.platform.applib.DtoFactoryAbstract)1 BankAccountDtoFactory (org.estatio.module.financial.canonical.v1.BankAccountDtoFactory)1