class CmsConfirmationOfFundsMapper {

    public CmsConfirmationOfFundsConsent mapToCmsConfirmationOfFundsConsent(ConsentEntity consent, List<AuthorisationEntity> authorisations) {
        ConsentTppInformationEntity tppInformation = consent.getTppInformation();
        PiisConsentData piisConsentData = consentDataMapper.mapToPiisConsentData(consent.getData());

        return new CmsConfirmationOfFundsConsent(
            consent.getExternalId(),
            getAccountReference(consent),
            consent.getValidUntil(),
            consent.getExpireDate(),
            consent.getLastActionDate(),
            consent.getConsentStatus(),
            tppInformation.isTppRedirectPreferred(),
            psuDataMapper.mapToPsuIdDataList(consent.getPsuDataList()),
            tppInfoMapper.mapToTppInfo(tppInformation.getTppInfo()),
            authorisationTemplateMapper.mapToAuthorisationTemplate(consent.getAuthorisationTemplate()),
            consent.isMultilevelScaRequired(),
            consent.getCreationTimestamp(),
            consent.getStatusChangeTimestamp(),
            mapToAuthorisations(authorisations),
            piisConsentData.getCardNumber(),
            piisConsentData.getCardExpiryDate(),
            piisConsentData.getCardInformation(),
            piisConsentData.getRegistrationInformation()
        );
    }

}