Search in sources :

Example 1 with ReadableOptin

use of com.salesmanager.shop.model.system.ReadableOptin in project shopizer by shopizer-ecommerce.

the class OptinFacadeImpl method create.

@Override
public ReadableOptin create(PersistableOptin persistableOptin, MerchantStore merchantStore, Language language) {
    Optin optinEntity = persistableOptinConverter.convert(persistableOptin, merchantStore, language);
    Optin savedOptinEntity = createOptin(optinEntity);
    return readableOptinConverter.convert(savedOptinEntity, merchantStore, language);
}
Also used : ReadableOptin(com.salesmanager.shop.model.system.ReadableOptin) Optin(com.salesmanager.core.model.system.optin.Optin) PersistableOptin(com.salesmanager.shop.model.system.PersistableOptin)

Example 2 with ReadableOptin

use of com.salesmanager.shop.model.system.ReadableOptin in project shopizer by shopizer-ecommerce.

the class ReadableOptinMapper method convert.

@Override
public ReadableOptin convert(Optin source, MerchantStore store, Language language) {
    ReadableOptin optinEntity = new ReadableOptin();
    optinEntity.setCode(source.getCode());
    optinEntity.setDescription(source.getDescription());
    optinEntity.setOptinType(source.getOptinType().name());
    return optinEntity;
}
Also used : ReadableOptin(com.salesmanager.shop.model.system.ReadableOptin)

Example 3 with ReadableOptin

use of com.salesmanager.shop.model.system.ReadableOptin in project shopizer by shopizer-ecommerce.

the class ReadableOptinPopulator method populate.

@Override
public ReadableOptin populate(Optin source, ReadableOptin target, MerchantStore store, Language language) throws ConversionException {
    Validate.notNull(store, "MerchantStore cannot be null");
    Validate.notNull(source, "Optin cannot be null");
    if (target == null) {
        target = new ReadableOptin();
    }
    target.setCode(source.getCode());
    target.setDescription(source.getDescription());
    target.setEndDate(source.getEndDate());
    target.setId(source.getId());
    target.setOptinType(source.getOptinType().name());
    target.setStartDate(source.getStartDate());
    target.setStore(store.getCode());
    return target;
}
Also used : ReadableOptin(com.salesmanager.shop.model.system.ReadableOptin)

Aggregations

ReadableOptin (com.salesmanager.shop.model.system.ReadableOptin)3 Optin (com.salesmanager.core.model.system.optin.Optin)1 PersistableOptin (com.salesmanager.shop.model.system.PersistableOptin)1