package dev.service;

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

import java.util.List;

public class MenuService {

    private MenuItemDao menuItemDao = new MenuItemDao();

    public void showMenu() {

        // TODO:
        // Display menu items
        List<MenuItem> items = menuItemDao.findAll();

        //AI generated.
        System.out.println("Available Items:");
        if (items == null || items.isEmpty()) {
            System.out.println("No items available at the moment.");
            return;
        }
        for (MenuItem item : items) {
            System.out.printf("%d. %s - $%.2f%n",
                    item.getId(),
                    item.getName(),
                    item.getPrice()
            );
        }
    }
}