public static domain.StandingOrder mapStandingOrder(StandingOrder figoStandingOrder) { domain.StandingOrder standingOrder = new domain.StandingOrder(); standingOrder.setOrderId(figoStandingOrder.getStandingOrderId()); standingOrder.setExecutionDay(figoStandingOrder.getExecutionDay()); standingOrder.setAmount(figoStandingOrder.getAmount()); standingOrder.setUsage(figoStandingOrder.getPurposeText()); standingOrder.setCycle(Cycle.valueOf(figoStandingOrder.getInterval().toString())); standingOrder.setOtherAccount(new BankAccount() .owner(figoStandingOrder.getName()) .accountNumber(figoStandingOrder.getAccountNumber()) .blz(figoStandingOrder.getBankCode()) .currency(figoStandingOrder.getCurrency()) ); return standingOrder; }
static BookingCategory mapToBookingcategory(WrappedBooking wrappedBooking) { BookingCategory bookingCategory = new BookingCategory(); bookingCategory.setReceiver(wrappedBooking.getOtherAccount()); bookingCategory.setMainCategory(wrappedBooking.getMainCategory()); bookingCategory.setSubCategory(wrappedBooking.getSubCategory()); bookingCategory.setSpecification(wrappedBooking.getSpecification()); bookingCategory.setCustom(wrappedBooking.getCustom()); bookingCategory.setEmail(wrappedBooking.getEmail()); bookingCategory.setHomepage(wrappedBooking.getHomepage()); bookingCategory.setHotline(wrappedBooking.getHotline()); bookingCategory.setLogo(wrappedBooking.getLogo()); if (wrappedBooking.getCycle() != null) { bookingCategory.setInterval(Cycle.valueOf(wrappedBooking.getCycle().toString())); } bookingCategory.setRules(wrappedBooking.getRuleIds()); return bookingCategory; }
static BookingCategory mapToBookingcategory(WrappedBooking wrappedBooking) { BookingCategory bookingCategory = new BookingCategory(); bookingCategory.setReceiver(wrappedBooking.getOtherAccount()); bookingCategory.setMainCategory(wrappedBooking.getMainCategory()); bookingCategory.setSubCategory(wrappedBooking.getSubCategory()); bookingCategory.setSpecification(wrappedBooking.getSpecification()); bookingCategory.setCustom(wrappedBooking.getCustom()); bookingCategory.setEmail(wrappedBooking.getEmail()); bookingCategory.setHomepage(wrappedBooking.getHomepage()); bookingCategory.setHotline(wrappedBooking.getHotline()); bookingCategory.setLogo(wrappedBooking.getLogo()); if (wrappedBooking.getCycle() != null) { bookingCategory.setInterval(Cycle.valueOf(wrappedBooking.getCycle().toString())); } bookingCategory.setRules(wrappedBooking.getRuleIds()); return bookingCategory; }
static ContractEntity toContract(String userId, String accountId, BookingGroup bookingGroup) { ContractEntity contractEntity = new ContractEntity(); contractEntity.setAmount(bookingGroup.getAmount()); contractEntity.setInterval(Cycle.valueOf(bookingGroup.getCycle().toString())); contractEntity.setUserId(userId); contractEntity.setAccountId(accountId); contractEntity.setEmail(bookingGroup.getEmail()); contractEntity.setHomepage(bookingGroup.getHomepage()); contractEntity.setHotline(bookingGroup.getHotline()); contractEntity.setLogo(bookingGroup.getLogo()); contractEntity.setMainCategory(bookingGroup.getMainCategory()); contractEntity.setSubCategory(bookingGroup.getSubCategory()); contractEntity.setSpecification(bookingGroup.getSpecification()); contractEntity.setProvider(bookingGroup.getOtherAccount()); contractEntity.setMandateReference(bookingGroup.getMandatreference()); return contractEntity; }
static ContractEntity toContract(String userId, String accountId, BookingGroup bookingGroup) { ContractEntity contractEntity = new ContractEntity(); contractEntity.setAmount(bookingGroup.getAmount()); contractEntity.setInterval(Cycle.valueOf(bookingGroup.getCycle().toString())); contractEntity.setUserId(userId); contractEntity.setAccountId(accountId); contractEntity.setEmail(bookingGroup.getEmail()); contractEntity.setHomepage(bookingGroup.getHomepage()); contractEntity.setHotline(bookingGroup.getHotline()); contractEntity.setLogo(bookingGroup.getLogo()); contractEntity.setMainCategory(bookingGroup.getMainCategory()); contractEntity.setSubCategory(bookingGroup.getSubCategory()); contractEntity.setSpecification(bookingGroup.getSpecification()); contractEntity.setProvider(bookingGroup.getOtherAccount()); contractEntity.setMandateReference(bookingGroup.getMandatreference()); return contractEntity; }
static de.adorsys.multibanking.domain.BookingGroup toBookingGroup(BookingGroup bookingsGroup) { de.adorsys.multibanking.domain.BookingGroup bookingGroup = de.adorsys.multibanking.domain.BookingGroup.builder() .amount(bookingsGroup.getAmount()) .mainCategory(bookingsGroup.getMainCategory()) .subCategory(bookingsGroup.getSubCategory()) .specification(bookingsGroup.getSpecification()) .bookingPeriods(mapBookingPeriods(bookingsGroup.getBookingPeriods())) .type(de.adorsys.multibanking.domain.BookingGroup.Type.valueOf(bookingsGroup.getGroupType().toString())) .contract(Contract.builder() .email(bookingsGroup.getEmail()) .homepage(bookingsGroup.getHomepage()) .logo(bookingsGroup.getLogo()) .mandateReference(bookingsGroup.getMandatreference()) .hotline(bookingsGroup.getHotline()) .email(bookingsGroup.getEmail()) .interval(bookingsGroup.getCycle() != null ? Cycle.valueOf(bookingsGroup.getCycle().name()) : null) .build() ) .build(); if (bookingsGroup.getGroupType() == Group.Type.CUSTOM || bookingsGroup.getGroupType() == Group.Type.OTHER_INCOME || bookingsGroup.getGroupType() == Group.Type.OTHER_EXPENSES) { bookingGroup.setOtherAccount(""); } else { bookingGroup.setOtherAccount(bookingsGroup.getOtherAccount()); } return bookingGroup; }
static de.adorsys.multibanking.domain.BookingGroup toBookingGroup(BookingGroup bookingsGroup) { de.adorsys.multibanking.domain.BookingGroup bookingGroup = de.adorsys.multibanking.domain.BookingGroup.builder() .amount(bookingsGroup.getAmount()) .mainCategory(bookingsGroup.getMainCategory()) .subCategory(bookingsGroup.getSubCategory()) .specification(bookingsGroup.getSpecification()) .bookingPeriods(mapBookingPeriods(bookingsGroup.getBookingPeriods())) .type(de.adorsys.multibanking.domain.BookingGroup.Type.valueOf(bookingsGroup.getGroupType().toString())) .contract(Contract.builder() .email(bookingsGroup.getEmail()) .homepage(bookingsGroup.getHomepage()) .logo(bookingsGroup.getLogo()) .mandateReference(bookingsGroup.getMandatreference()) .hotline(bookingsGroup.getHotline()) .email(bookingsGroup.getEmail()) .interval(bookingsGroup.getCycle() != null ? Cycle.valueOf(bookingsGroup.getCycle().name()) : null) .build() ) .build(); if (bookingsGroup.getGroupType() == Group.Type.CUSTOM || bookingsGroup.getGroupType() == Group.Type.OTHER_INCOME || bookingsGroup.getGroupType() == Group.Type.OTHER_EXPENSES) { bookingGroup.setOtherAccount(""); } else { bookingGroup.setOtherAccount(bookingsGroup.getOtherAccount()); } return bookingGroup; }