Implementation of category creation.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.codiki.infrastructure.category;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -22,4 +23,18 @@ public class CategoryJpaAdapter implements CategoryPort {
|
||||
return categoryRepository.findById(categoryId)
|
||||
.map(CategoryEntity::toDomain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(Category category) {
|
||||
CategoryEntity categoryEntity = new CategoryEntity(category);
|
||||
categoryRepository.save(categoryEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Category> findAllByIds(final List<UUID> subCategoryIds) {
|
||||
return categoryRepository.findAllById(subCategoryIds)
|
||||
.stream()
|
||||
.map(CategoryEntity::toDomain)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user