package com.braintree.converters.populators.configuration;

import com.braintree.enums.BraintreePaymentMethodLimitData;
import com.braintree.hybris.data.BraintreeVenmoConfigurationData;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.core.model.BraintreeVenmoConfigurationModel;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;

public class BraintreeVenmoConfigurationPopulator implements Populator<BraintreeVenmoConfigurationModel, BraintreeVenmoConfigurationData> {

    @Override
    public void populate(BraintreeVenmoConfigurationModel source, BraintreeVenmoConfigurationData target) throws ConversionException {
        target.setEnabled(source.isEnabled());
        target.setProfileId(source.getProfileId());
        target.setSavedVenmoAccountLimit(BraintreePaymentMethodLimitData.valueOf(source.getSavedVenmoAccountLimit().getCode()));
    }
}
