use of com.salesmanager.core.model.catalog.catalog.Catalog in project shopizer by shopizer-ecommerce.
the class CatalogFacadeImpl method getCatalog.
@Override
public ReadableCatalog getCatalog(Long id, MerchantStore store, Language language) {
Validate.notNull(id, "Catalog id cannot be null");
Validate.notNull(store, "MerchantStore cannot be null");
Catalog catalog = catalogService.getById(id, store).orElseThrow(() -> new ResourceNotFoundException("Catalog with id [" + id + "] not found"));
return readableCatalogMapper.convert(catalog, store, language);
}
use of com.salesmanager.core.model.catalog.catalog.Catalog in project shopizer by shopizer-ecommerce.
the class CatalogFacadeImpl method addCatalogEntry.
@Override
public ReadableCatalogCategoryEntry addCatalogEntry(PersistableCatalogCategoryEntry entry, MerchantStore store, Language language) {
Validate.notNull(entry, "PersistableCatalogEntry cannot be null");
Validate.notNull(entry.getCatalog(), "CatalogEntry.catalog cannot be null");
Validate.notNull(store, "MerchantStore cannot be null");
Catalog catalog = catalogService.getByCode(entry.getCatalog(), store).orElseThrow(() -> new ResourceNotFoundException("catalog [" + entry.getCatalog() + "] not found"));
CatalogCategoryEntry catalogEntryModel = persistableCatalogEntryMapper.convert(entry, store, language);
catalogEntryService.add(catalogEntryModel, catalog);
return readableCatalogEntryMapper.convert(catalogEntryModel, store, language);
}
use of com.salesmanager.core.model.catalog.catalog.Catalog in project shopizer by shopizer-ecommerce.
the class CatalogFacadeImpl method getCatalog.
@Override
public ReadableCatalog getCatalog(String code, MerchantStore store, Language language) {
Validate.notNull(code, "Catalog code cannot be null");
Validate.notNull(store, "MerchantStore cannot be null");
Validate.notNull(language, "Language cannot be null");
Catalog catalog = catalogService.getByCode(code, store).orElseThrow(() -> new ResourceNotFoundException("Catalog with code [" + code + "] not found"));
return readableCatalogMapper.convert(catalog, store, language);
}
Aggregations