ResponseEntity createOffice()

in service/src/main/java/org/apache/fineract/cn/office/rest/controller/OfficeRestController.java [106:116]


  ResponseEntity<Void> createOffice(@RequestBody @Valid final Office office) throws InterruptedException {
    if (office == null) {
      throw ServiceException.badRequest("An office must be given.");
    }

    if (this.officeService.officeExists(office.getIdentifier())) {
      throw ServiceException.conflict("Office {0} already exists.", office.getIdentifier());
    }
    this.commandGateway.process(new CreateOfficeCommand(office));
    return ResponseEntity.accepted().build();
  }