-- Fix Printer Names to Follow Convention: CSFNAME-Location-Brand-Description
-- Convention: CSF21-7701-HP-Laserjet
-- Date: 2025-12-08

-- =====================================================
-- PRINTERS WITH CSF NAMES
-- Format: CSF##-Location-Brand-Description
-- =====================================================

-- CSF01 - Materials - Xerox EC8036
UPDATE printers SET printerwindowsname = 'CSF01-Materials-Xerox-EC8036' WHERE printerid = 7;

-- CSF02 - TBD location - HP LaserJet
UPDATE printers SET printerwindowsname = 'CSF02-TBD-HP-LaserJet' WHERE printerid = 22;

-- CSF04 - WJRP2035 - HP LaserJet
UPDATE printers SET printerwindowsname = 'CSF04-WJRP2035-HP-LaserJet' WHERE printerid = 9;

-- CSF05 - Spools Inspection - HP LaserJet
UPDATE printers SET printerwindowsname = 'CSF05-SpoolsInspection-HP-LaserJet' WHERE printerid = 41;

-- CSF06 - 3037 - HP LaserJet (already correct format)
UPDATE printers SET printerwindowsname = 'CSF06-3037-HP-LaserJet' WHERE printerid = 14;

-- CSF07 - 3005 - HP LaserJet
UPDATE printers SET printerwindowsname = 'CSF07-3005-HP-LaserJet' WHERE printerid = 32;

-- CSF08 - VentureCleanRoom - HP LaserJet (location was missing, using machine assignment)
UPDATE printers SET printerwindowsname = 'CSF08-VentureCleanRoom-HP-LaserJet' WHERE printerid = 43;

-- CSF09 - 2022 - HP LaserJet (already correct format)
UPDATE printers SET printerwindowsname = 'CSF09-2022-HP-LaserJet' WHERE printerid = 13;

-- CSF11 - CMM07 - HP LaserJet (location was missing, using machine assignment)
UPDATE printers SET printerwindowsname = 'CSF11-CMM07-HP-LaserJet' WHERE printerid = 10;

-- CSF12 - 7701 - HP LaserJet
UPDATE printers SET printerwindowsname = 'CSF12-7701-HP-LaserJet' WHERE printerid = 40;

-- CSF13 - FPIInspection - HP LaserJet
UPDATE printers SET printerwindowsname = 'CSF13-FPIInspection-HP-LaserJet' WHERE printerid = 33;

-- CSF15 - 6502 - HP LaserJet
UPDATE printers SET printerwindowsname = 'CSF15-6502-HP-LaserJet' WHERE printerid = 35;

-- CSF18 - BliskInspection - HP LaserJet
UPDATE printers SET printerwindowsname = 'CSF18-BliskInspection-HP-LaserJet' WHERE printerid = 17;

-- CSF21 - 7701 - HP LaserJet (already correct format)
UPDATE printers SET printerwindowsname = 'CSF21-7701-HP-LaserJet' WHERE printerid = 39;

-- CSF22 - WJRP2335 - HP LaserJet
UPDATE printers SET printerwindowsname = 'CSF22-WJRP2335-HP-LaserJet' WHERE printerid = 20;

-- =====================================================
-- PRINTERS WITHOUT CSF NAMES
-- Format: Location-Brand-Description
-- =====================================================

-- 1364 - Xerox Versalink
UPDATE printers SET printerwindowsname = '1364-Xerox-Versalink' WHERE printerid = 34;

-- 6502 - HP LaserJet (Color)
UPDATE printers SET printerwindowsname = '6502-HP-ColorLaserJet' WHERE printerid = 49;

-- 6503 - HP LaserJet
UPDATE printers SET printerwindowsname = '6503-HP-LaserJet' WHERE printerid = 50;

-- Blisk Inspection - Xerox Versalink
UPDATE printers SET printerwindowsname = 'BliskInspection-Xerox-Versalink' WHERE printerid = 18;

-- Coaching 112 - HP ColorLaserJet
UPDATE printers SET printerwindowsname = 'Coaching112-HP-ColorLaserJet' WHERE printerid = 6;

-- Coaching 115 - Xerox Versalink (THE PROBLEM PRINTER!)
UPDATE printers SET printerwindowsname = 'Coaching115-Xerox-Versalink' WHERE printerid = 4;

-- Guard Desk - HID DTC4500 (card printer)
UPDATE printers SET printerwindowsname = 'GuardDesk-HID-DTC4500' WHERE printerid = 46;

-- Lean Office - HP DesignJet (plotter)
UPDATE printers SET printerwindowsname = 'LeanOffice-HP-DesignJet' WHERE printerid = 36;

-- Office Administration - Xerox Versalink
UPDATE printers SET printerwindowsname = 'OfficeAdmin-Xerox-Versalink' WHERE printerid = 23;

-- PE Room - Xerox Altalink
UPDATE printers SET printerwindowsname = 'PERoom-Xerox-Altalink' WHERE printerid = 8;

-- Router Room - Xerox Versalink
UPDATE printers SET printerwindowsname = 'RouterRoom-Xerox-Versalink' WHERE printerid = 11;

-- Shipping Office - Xerox EC8036
UPDATE printers SET printerwindowsname = 'ShippingOffice-Xerox-EC8036' WHERE printerid = 16;

-- Southern Office - Xerox EC8036
UPDATE printers SET printerwindowsname = 'SouthernOffice-Xerox-EC8036' WHERE printerid = 24;

-- Southern Office - Xerox Versalink (different printer, B7125)
UPDATE printers SET printerwindowsname = 'SouthernOffice-Xerox-VersalinkBW' WHERE printerid = 3;

-- Spools Inspection - Xerox Versalink C405
UPDATE printers SET printerwindowsname = 'SpoolsInspection-Xerox-Versalink' WHERE printerid = 37;

-- Spools Inspection - HP LaserJet
UPDATE printers SET printerwindowsname = 'SpoolsInspection-HP-LaserJet' WHERE printerid = 48;

-- Venture Inspection - Xerox Versalink
UPDATE printers SET printerwindowsname = 'VentureInspection-Xerox-Versalink' WHERE printerid = 38;

-- =====================================================
-- SPECIAL CASES / NEED REVIEW
-- =====================================================

-- Gage Lab - HP LaserJet (has "gage lab " as CSF name with trailing space)
UPDATE printers SET printerwindowsname = 'GageLab-SpoolsInspection-HP-LaserJet', printercsfname = 'GageLab' WHERE printerid = 44;

-- HP4001_SPOOLSHWACHEON - Machine 2004 - HP LaserJet
UPDATE printers SET printerwindowsname = 'SpoolsHwacheon-2004-HP-LaserJet', printercsfname = '' WHERE printerid = 42;

-- HP4250_IMPACT - Shipping Office - HP LaserJet
UPDATE printers SET printerwindowsname = 'ShippingOffice-HP-LaserJet', printercsfname = '' WHERE printerid = 12;

-- TBD Was 08 - IT Closet - HP LaserJet (needs real CSF name)
UPDATE printers SET printerwindowsname = 'ITCloset-HP-LaserJet', printercsfname = '' WHERE printerid = 45;

-- 7901 - HP ColorLaserJet (USB printer)
UPDATE printers SET printerwindowsname = '7901-HP-ColorLaserJet' WHERE printerid = 30;

-- Guard Desk USB - HP LaserJet
UPDATE printers SET printerwindowsname = 'GuardDesk-HP-LaserJet-USB' WHERE printerid = 28;

-- NULL location USB printer
UPDATE printers SET printerwindowsname = 'USB-HP-ColorLaserJet' WHERE printerid = 31;

-- =====================================================
-- Verification query - run after updates
-- =====================================================
-- SELECT printerid, printerwindowsname, printercsfname FROM printers WHERE isactive = 1 ORDER BY printerwindowsname;
