Search in sources :

Example 1 with BankMandateDto

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

Example 2 with BankMandateDto

use of org.estatio.canonical.bankmandate.v1.BankMandateDto 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 BankMandateDto (org.estatio.canonical.bankmandate.v1.BankMandateDto)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 BankAccountDto (org.estatio.canonical.financial.v1.BankAccountDto)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