class ObaAisConsentMapper {

    public AisConsentTO toTo(CmsAisAccountConsent consent) {
        return new AisConsentTO(consent.getId(),
            resolveUserId(consent.getPsuIdDataList()),
            Optional.ofNullable(consent.getTppInfo()).map(TppInfo::getAuthorisationNumber).orElse(null),
            consent.getFrequencyPerDay(),
            toAccess(consent.getAccess()),
            consent.getValidUntil(),
            consent.isRecurringIndicator());
    }

}