package dev.service;

import dev.dao.MenuItemDao;
import dev.model.MenuItem;
import java.util.List;

public class MenuService {

    private final MenuItemDao menuItemDao = new MenuItemDao();

    public void showMenu() {
        List<MenuItem> items = menuItemDao.findAll();
        System.out.println("\n--- MENU ---");
        System.out.printf("%-4s | %-20s | %-40s | %-8s | %-10s\n", "ID", "Name", "Description", "Price", "Category");
        System.out.println("-".repeat(90));
        for (MenuItem item : items) {
            System.out.printf("%-4d | %-20s | %-40s | $%-7.2f | %-10s\n",
                    item.getId(), item.getName(), item.getDescription(), item.getPrice(), item.getCategory());
        }
        System.out.println("-".repeat(90));
    }
}