ResponseEntity saveTellerDenomination()

in service/src/main/java/org/apache/fineract/cn/teller/service/rest/TellerManagementRestController.java [262:283]


  ResponseEntity<Void> saveTellerDenomination(@PathVariable("officeIdentifier") final String officeIdentifier,
                                              @PathVariable("tellerCode") final String tellerCode,
                                              @RequestBody @Valid final TellerDenomination tellerDenomination) {
    this.verifyOffice(officeIdentifier);
    final Teller teller = this.verifyTeller(tellerCode);
    if (!teller.getState().equals(Teller.State.PAUSED.name())) {
      throw ServiceException.conflict("Teller {0} is still in use.", tellerCode);
    }

    if (teller.getCashOverShortAccount() == null) {
      throw ServiceException.badRequest("Cash over/short account for teller {0} not set.", tellerCode);
    }

    this.verifyAccount(teller.getCashOverShortAccount());

    final TellerBalanceSheet tellerBalanceSheet = this.tellerManagementService.getBalance(tellerCode);

    this.commandGateway.process(
        new TellerDenominationCommand(tellerCode, tellerBalanceSheet.getCashOnHand(), tellerDenomination));

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