package dev.service;

import dev.dao.MenuItemDao;
import dev.model.MenuItem;

import java.util.List;

public class MenuService {

    private final MenuItemDao menuItemDao;

    public MenuService() {
        this.menuItemDao = new MenuItemDao();
    }

    public void showMenu() {

        List<MenuItem> items = menuItemDao.findAll();
        if (items.isEmpty())
        {
            System.out.println("menu is empty");
            return;
        }

        System.out.println("\nAvailable Items:");
        for (MenuItem item : items)
        {
            System.out.printf("%d. %s - $%.2f%n",
                    item.getId(),
                    item.getName(),
                    item.getPrice());
        }

    }

}