adamsaghy commented on code in PR #4046:
URL: https://github.com/apache/fineract/pull/4046#discussion_r1744152839
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -405,6 +414,58 @@ public CommandProcessingResult withdrawal(final Long
savingsId, final JsonComman
.build();
}
+ @Transactional
+ @Override
+ public CommandProcessingResult withdrawToLinkedAccount(final Long
savingsId, final JsonCommand command) {
+
+ boolean isPaymentHubIntegrationEnabled =
configurationDomainService.isPaymentHubIntegrationEnabled();
+ if (!isPaymentHubIntegrationEnabled) {
+ throw new
GlobalConfigurationNotEnabledException("enable-payment-hub-integration");
+ }
+
+ this.savingsAccountTransactionDataValidator.validate(command);
+
+ final LocalDate transactionDate =
command.localDateValueOfParameterNamed("transactionDate");
+ final BigDecimal transactionAmount =
command.bigDecimalValueOfParameterNamed("transactionAmount");
+
+ final Locale locale = command.extractLocale();
+ final DateTimeFormatter fmt =
DateTimeFormatter.ofPattern(command.dateFormat()).withLocale(locale);
+
+ final Map<String, Object> changes = new LinkedHashMap<>();
+ final PaymentDetail paymentDetail =
this.paymentDetailWritePlatformService.createAndPersistPaymentDetail(command,
changes);
+
+ final boolean backdatedTxnsAllowedTill =
this.savingAccountAssembler.getPivotConfigStatus();
+
+ final SavingsAccount account =
this.savingAccountAssembler.assembleFrom(savingsId, backdatedTxnsAllowedTill);
+
+ InteropIdentifier identifier1 =
interopService.getIndentifierByAccount(account);
+ InteropIdentifierType identifierType = identifier1.getType();
+ String identifierValue = identifier1.getValue();
+
+ changes.put(PaymentDetailConstants.routingCodeParamName,
identifierType);
+ changes.put(PaymentDetailConstants.accountNumberParamName,
identifierValue);
+
+ paymentDetail.setRoutingCode(identifierType.toString());
+ paymentDetail.setAccountNumber(identifierValue);
+
+ checkClientOrGroupActive(account);
+
+
this.savingsAccountTransactionDataValidator.validateTransactionWithPivotDate(transactionDate,
account);
+
+ SdkWithdrawalService sdkWithdrawalService = new
SdkWithdrawalServiceImpl();
Review Comment:
Please rework this to be a Spring bean, so if someone wanna override it
eventually, they can...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]