ResponseEntity createIdentificationCard()

in service/src/main/java/org/apache/fineract/cn/customer/rest/controller/CustomerRestController.java [512:525]


  ResponseEntity<Void> createIdentificationCard(@PathVariable("identifier") final String identifier,
                                @RequestBody @Valid final IdentificationCard identificationCard) {
    if (this.customerService.customerExists(identifier)) {
      if (this.customerService.identificationCardExists(identificationCard.getNumber())) {
        throw ServiceException.conflict("IdentificationCard {0} already exists.", identificationCard.getNumber());
      }

      this.commandGateway.process(new CreateIdentificationCardCommand(identifier, identificationCard));
    } else {
      throw ServiceException.notFound("Customer {0} not found.", identifier);
    }

    return ResponseEntity.accepted().build();
  }