adamsaghy commented on code in PR #3650: URL: https://github.com/apache/fineract/pull/3650#discussion_r1438867129
########## fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java: ########## @@ -2387,7 +2387,49 @@ public void undoTransaction(final Long transactionId) { } } - public void undoSavingsTransaction(final Long transactionId) { + protected Map<String, Object> undoActivate() { + final Map<String, Object> actualChanges = new LinkedHashMap<>(); + + final List<ApiParameterError> dataValidationErrors = new ArrayList<>(); + final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors) + .resource(depositAccountType().resourceName() + SavingsApiConstants.undoActivateAction); + + final SavingsAccountStatusType currentStatus = SavingsAccountStatusType.fromInt(this.status); + if (!SavingsAccountStatusType.ACTIVE.hasStateOf(currentStatus)) { + baseDataValidator.reset().parameter(SavingsApiConstants.activatedOnDateParamName) + .failWithCodeNoParameterAddedToErrorCode("not.in.active.state"); + + if (!dataValidationErrors.isEmpty()) { + throw new PlatformApiDataValidationException(dataValidationErrors); + } + } + + final LocalDate businessDate = DateUtils.getBusinessLocalDate();; + + this.status = SavingsAccountStatusType.APPROVED.getValue(); + actualChanges.put(SavingsApiConstants.statusParamName, SavingsEnumerations.status(this.status)); + + this.rejectedOnDate = null; + this.rejectedBy = null; + this.withdrawnOnDate = null; + this.withdrawnBy = null; + this.closedOnDate = null; + this.closedBy = null; + this.activatedOnDate = null; + this.activatedBy = null; + this.lockedInUntilDate = null; + + validateActivityNotBeforeClientOrGroupTransferDate(SavingsEvent.SAVINGS_UNOD_ACTIVATE, businessDate); Review Comment: Typo in the event name -- 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: commits-unsubscr...@fineract.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org