package com.kamco.cd.training.postgres.core;

import com.kamco.cd.training.menu.dto.MenuDto;
import com.kamco.cd.training.postgres.entity.MenuEntity;
import com.kamco.cd.training.postgres.repository.menu.MenuRepository;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class MenuCoreService {

  private final MenuRepository menuRepository;

  public List<MenuDto.Basic> getFindAll() {
    return menuRepository.getFindAll().stream().map(MenuEntity::toDto).toList();
  }
}
