public TransferDTO createTransfer(String senderId) throws Exception { CustomerDTO customerDTO = customerManager.selectCustomer(senderId); TransferDTO transferDTO = new TransferDTO(); transferDTO.setSenderId(senderId); transferDTO.setSenderName(customerDTO.getName()); transferDTO.setExecutionDate(Calendar.getInstance().getTime()); return transferDTO; }
public PasswordDTO createPassword(String senderId) throws Exception { PasswordDTO passwordDTO = new PasswordDTO(); CustomerDTO customerDTO = customerManager.selectCustomer(senderId); switch (customerDTO.getSecurityType()) { case OTP: passwordDTO.setOtpTokenSerialNumber(customerDTO.getOtpTokenSerialNumber()); break; case SECURITY_CARD: passwordDTO.setSecurityCardSerialNumber(customerDTO.getSecurityCardSerialNumber()); break; default: throw new RollbackCommonException("Unsupported security type"); } return passwordDTO; }