in service/src/main/java/org/apache/fineract/cn/group/rest/GroupDefinitionRestController.java [71:85]
ResponseEntity<Void> createDefinition(@RequestBody @Valid final GroupDefinition groupDefinition) {
if (this.groupDefinitionService.groupDefinitionExists(groupDefinition.getIdentifier())) {
throw ServiceException.conflict("Group definition {0} already exists.", groupDefinition.getIdentifier());
}
this.commandGateway.process(new CreateGroupDefinitionCommand(groupDefinition));
return ResponseEntity.accepted().build();
// this.groupDefinitionService.findByIdentifier(groupDefinition.getIdentifier())
// .ifPresent(gd -> {
// throw ServiceException.conflict("Group definition {0} already exists.", gd.getIdentifier());
// });
//
// this.commandGateway.process(new CreateGroupDefinitionCommand(groupDefinition));
// return ResponseEntity.accepted().build();
}