-- =============================================================================
-- XPERT 3PL - Migracion 007
-- Campos adicionales de zonas de almacen: capacidad fisica, rango de
-- temperatura preciso, acceso restringido y prioridad de putaway.
-- =============================================================================

ALTER TABLE `warehouse_zones`
    ADD COLUMN `max_pallet_positions`       INT UNSIGNED NULL COMMENT 'Capacidad maxima de posiciones/pallets de la zona (NULL = sin limite)' AFTER `is_refrigerated`,
    ADD COLUMN `max_weight_kg`              DECIMAL(12,2) NULL AFTER `max_pallet_positions`,
    ADD COLUMN `max_volume_m3`              DECIMAL(12,4) NULL AFTER `max_weight_kg`,
    ADD COLUMN `min_temp`                   DECIMAL(5,2) NULL COMMENT 'Rango de temperatura preciso (grados). Independiente del flag is_refrigerated' AFTER `max_volume_m3`,
    ADD COLUMN `max_temp`                   DECIMAL(5,2) NULL AFTER `min_temp`,
    ADD COLUMN `requires_restricted_access` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'Zona de alto valor / acceso restringido, requiere autorizacion especial' AFTER `max_temp`,
    ADD COLUMN `putaway_priority`           TINYINT UNSIGNED NOT NULL DEFAULT 5 COMMENT 'Menor numero = mayor prioridad al sugerir esta zona en el putaway' AFTER `requires_restricted_access`;
