class GrantTransferDetailsSaver {

    public RestResult<Void> save(GrantTransferDetailsForm grantTransferDetailsForm, long applicationId) {

        EuGrantTransferResource euGrantResource = euGrantTransferRestService.findDetailsByApplicationId(applicationId).getOptionalSuccessObject().orElse(new EuGrantTransferResource());

        euGrantResource.setGrantAgreementNumber(grantTransferDetailsForm.getGrantAgreementNumber());
        euGrantResource.setParticipantId(grantTransferDetailsForm.getParticipantId());
        euGrantResource.setProjectName(grantTransferDetailsForm.getProjectName());
        euGrantResource.setProjectStartDate(grantTransferDetailsForm.getStartDate());
        euGrantResource.setProjectEndDate(grantTransferDetailsForm.getEndDate());
        euGrantResource.setFundingContribution(grantTransferDetailsForm.getFundingContribution());
        euGrantResource.setProjectCoordinator(grantTransferDetailsForm.getProjectCoordinator());

        EuActionTypeResource euActionTypeResource = new EuActionTypeResource();
        euActionTypeResource.setId(grantTransferDetailsForm.getActionType());
        euGrantResource.setActionType(euActionTypeResource);

        return euGrantTransferRestService.updateGrantTransferDetails(euGrantResource, applicationId);
    }

    public  GrantTransferDetailsSaver(EuGrantTransferRestService euGrantTransferRestService);

}