-- ============================================================
-- HeardCheck — Cut Types for Prep Items
-- Run: mysql -u heardcheck -p heardcheck_db < cut_types.sql
-- ============================================================

USE heardcheck_db;

-- Add cut_type column to prep_items
ALTER TABLE prep_items
  ADD COLUMN cut_type VARCHAR(50) DEFAULT NULL AFTER item_name;

-- Add cut_type to prep_template_items too
ALTER TABLE prep_template_items
  ADD COLUMN cut_type VARCHAR(50) DEFAULT NULL AFTER item_name;

-- Reference table of common cut types with translations
CREATE TABLE cut_types (
  id          INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  name        VARCHAR(50) NOT NULL UNIQUE,
  name_es     VARCHAR(50) NOT NULL,
  sort_order  INT NOT NULL DEFAULT 0
) ENGINE=InnoDB;

INSERT INTO cut_types (name, name_es, sort_order) VALUES
('Whole', 'Entero', 0),
('Diced (Large)', 'Cubos Grandes', 1),
('Diced (Medium)', 'Cubos Medianos', 2),
('Diced (Small)', 'Cubos Pequeños', 3),
('Brunoise', 'Brunoise', 4),
('Minced', 'Picado Fino', 5),
('Sliced (Thick)', 'Rebanado Grueso', 6),
('Sliced (Thin)', 'Rebanado Delgado', 7),
('Rings', 'Aros', 8),
('Half Rings', 'Medios Aros', 9),
('Julienne', 'Juliana', 10),
('Chiffonade', 'Chiffonade', 11),
('Shredded', 'Rallado', 12),
('Chopped', 'Picado', 13),
('Quartered', 'En Cuartos', 14),
('Halved', 'En Mitades', 15),
('Wedges', 'Gajos', 16),
('Batonnets', 'Bastones', 17),
('Tournée', 'Torneado', 18),
('Supremes', 'Supremas', 19),
('Bias Cut', 'Corte en Diagonal', 20),
('Rough Chop', 'Picado Rústico', 21),
('Paysanne', 'Paysanne', 22),
('Frenched', 'Frenched', 23),
('Butterflied', 'Mariposa', 24);
