class CategoryServiceImpl implements CategoryService {

    @Override
    public Category findByName(String name) {
        Category category = categoryRepo.findByName(name);
        if (category == null) {
            throw new NotFoundException(ErrorMessage.CATEGORY_NOT_FOUND_BY_NAME + name);
        }
        return categoryRepo.findByName(name);
    }

}