in service/src/main/java/org/apache/fineract/cn/deposit/service/rest/ProductDefinitionRestController.java [228:240]
ResponseEntity<Void> deleteProductDefinition(@PathVariable("identifier") final String identifier) {
if (!this.productDefinitionService.findProductDefinition(identifier).isPresent()) {
throw ServiceException.notFound("Product Definition {0} not found", identifier);
}
if (!this.productInstanceService.findByProductDefinition(identifier).isEmpty()) {
throw ServiceException.conflict("Product Definition {0} has assigned instances.", identifier);
}
this.commandGateway.process(new DeleteProductDefinitionCommand(identifier));
return ResponseEntity.accepted().build();
}