class BankBranchController {

	@PostMapping("/_update")
	@ResponseStatus(HttpStatus.OK)
	public BankBranchContractResponse updateAll(@RequestBody @Valid BankBranchContractRequest bankBranchContractRequest,
			BindingResult errors) {
		bankBranchService.validate(bankBranchContractRequest, "updateAll", errors);
		if (errors.hasErrors()) {
			throw new CustomBindException(errors);
		}
		bankBranchContractRequest.getRequestInfo().setAction("updateAll");
		bankBranchService.fetchRelatedContracts(bankBranchContractRequest);
		bankBranchService.push(bankBranchContractRequest);
		BankBranchContractResponse bankBranchContractResponse = new BankBranchContractResponse();
		bankBranchContractResponse.setBankBranches(new ArrayList<BankBranchContract>());
		for (BankBranchContract bankBranchContract : bankBranchContractRequest.getBankBranches()) {
			bankBranchContractResponse.getBankBranches().add(bankBranchContract);
		}

		bankBranchContractResponse.setResponseInfo(getResponseInfo(bankBranchContractRequest.getRequestInfo()));
		bankBranchContractResponse.getResponseInfo().setStatus(HttpStatus.OK.toString());

		return bankBranchContractResponse;
	}

}