class PolicyServiceImpl implements PolicyService, Constants {

	@Override
	public String updatePolicies(final UpdatePolicyDetails policyDetails) throws Exception {
		boolean isPolicyExits = policyRepository.existsById(policyDetails.getPolicyId());
		if(isPolicyExits) {
			Policy policyToUpdate = policyRepository.findById(policyDetails.getPolicyId()).get();
			policyToUpdate.setPolicyDesc(policyDetails.getPolicyDesc());
			policyToUpdate.setPolicyUrl(policyDetails.getPolicyUrl());
			policyToUpdate.setPolicyVersion(policyDetails.getPolicyVersion());
			policyToUpdate.setResolution(policyDetails.getResolution());
			policyToUpdate.setModifiedDate(new Date());
			policyRepository.save(policyToUpdate);
			return "Updated Successfully";
		} else {
			return "Policy does not exits!!";
		}
	}

}