adamsaghy commented on code in PR #6021:
URL: https://github.com/apache/fineract/pull/6021#discussion_r3481277262
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -231,6 +239,181 @@ private CommandProcessingResult createGroupingType(final
JsonCommand command, fi
}
}
+ @Transactional
+ @Override
+ public GroupActivateResponse activateGroup(final GroupActivateRequest
request) {
+ try {
+ final AppUser currentUser = this.context.authenticatedUser();
+ currentUser.validateHasPermissionTo("ACTIVATE_GROUP");
+ final Group group =
this.groupRepository.findOneWithNotFoundDetection(request.getGroupId());
+
+ if (group.isGroup()) {
+ validateGroupRulesBeforeActivation(group);
+ }
+
+ final LocalDate activationDate =
parseDate(request.getActivationDate(), request.getDateFormat(),
request.getLocale());
+
validateOfficeOpeningDateisAfterGroupOrCenterOpeningDate(group.getOffice(),
group.getGroupLevel(), activationDate);
+
+ group.activate(currentUser, activationDate);
+ this.groupRepository.saveAndFlush(group);
Review Comment:
save and flush is not needed here..
--
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]