class BankBranchController {

	@PostMapping(value = "/{uniqueId}/_update")
	@ResponseStatus(HttpStatus.OK)
	public BankBranchContractResponse update(@RequestBody @Valid BankBranchContractRequest bankBranchContractRequest,
			BindingResult errors, @PathVariable Long uniqueId) {

		bankBranchService.validate(bankBranchContractRequest, "update", errors);
		if (errors.hasErrors()) {
			throw new CustomBindException(errors);
		}
		bankBranchContractRequest.getRequestInfo().setAction("update");
		bankBranchService.fetchRelatedContracts(bankBranchContractRequest);
		bankBranchContractRequest.getBankBranch().setId(uniqueId);
		bankBranchService.push(bankBranchContractRequest);
		BankBranchContractResponse bankBranchContractResponse = new BankBranchContractResponse();
		bankBranchContractResponse.setBankBranch(new BankBranchContract());

		bankBranchContractResponse.setBankBranch(bankBranchContractRequest.getBankBranch());

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

}