-- Migration: Add return conditions table for audit management
-- Run: mysql -u root dms_db < dms_return_conditions_migration.sql

CREATE TABLE IF NOT EXISTS return_conditions (
    intId INT AUTO_INCREMENT PRIMARY KEY,
    strCondition VARCHAR(50) NOT NULL UNIQUE,
    intRestockDefault TINYINT(1) NOT NULL DEFAULT 1,
    intSortOrder INT NOT NULL DEFAULT 0,
    intStatus TINYINT(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO return_conditions (strCondition, intRestockDefault, intSortOrder) VALUES
('Good', 1, 1),
('Damaged', 0, 2),
('Defective', 0, 3),
('Used', 0, 4),
('Other', 1, 5);
