class CategoryServiceImpl implements CategoryService {

    @Override
    public Long deleteById(Long id) {
        log.info(LogMessage.IN_DELETE_BY_ID, id);
        Category category = findById(id);

        if (!category.getPlaces().isEmpty()) {
            throw new BadRequestException(ErrorMessage.NOT_SAVE_DELETION);
        }

        categoryRepo.delete(category);
        return id;
    }

}