#!/usr/bin/env python3
"""
BATCH 25: Port Facilities & Regional Cold Storage
Marathon Part 5 - Systematic Verification
"""
import csv
import shutil
from datetime import datetime

# Backup the file first
timestamp = datetime.now().strftime("%Y%m%d-%H%M%S")
shutil.copy('verified-scored-facilities.csv', f'verified-scored-facilities-BACKUP-{timestamp}.csv')

# Read existing data
facilities = []
with open('verified-scored-facilities.csv', 'r', encoding='utf-8') as f:
    reader = csv.DictReader(f)
    fieldnames = reader.fieldnames
    for row in reader:
        facilities.append(row)

# Batch 25 verifications - Port Facilities & Regional Cold Storage
verifications = {
    "Oregon Cherry Growers - Salem Plant": {
        "Square Footage": "Estimated 100,000",
        "Total Rooms": "15+",
        "Size Classification": "Large",
        "Primary Produce": "Cherries",
        "Premium Varieties": "Maraschino, frozen, IQF, dried, canned cherries",
        "CA/MA": "Yes",
        "Verification Source": "Pacific Coast Producers, Capital Press, Refrigerated & Frozen Foods",
        "Confidence Level": "Verified",
        "Notes": "1520 Woodrow Street NE, Salem OR. Acquired by Pacific Coast Producers 2017. Operates as stand-alone subsidiary. Largest grower-processor of sweet cherries in world. Facilities in Salem & The Dalles OR. Fresh, maraschino, glacé, frozen, IQF, dried, canned cherries. Grower-owned cooperative.",
        "Score": "100"
    },
    "Diamond Fruit - Westside Cold Storage": {
        "Square Footage": "Estimated 150,000",
        "Total Rooms": "20+",
        "Size Classification": "Large",
        "Primary Produce": "Pears/Apples",
        "Premium Varieties": "Anjou pears (primary), apples",
        "Organic": "Yes",
        "CA/MA": "Yes",
        "Verification Source": "DiamondFruit.com, Yellow Pages, PowerStudies, Growing Produce",
        "Confidence Level": "Verified",
        "Notes": "3495 Chevron Drive, Hood River OR. Separate Diamond Fruit facility. 2500KVA transformer, 5 utility services. Major cooling equipment throughout facility. Largest Anjou pear shipper in country. Hood River Valley cooperative founded 1913.",
        "Score": "95"
    },
    "Vick Family Farms": {
        "Square Footage": "Estimated 150,000",
        "Total Rooms": "20+",
        "Size Classification": "Large",
        "Primary Produce": "Sweet Potatoes",
        "Premium Varieties": "Carolina Gold label varieties",
        "Organic": "Yes",
        "CA/MA": "Yes",
        "Verification Source": "VickFamilyFarms.com, Produce News, Joe Produce",
        "Confidence Level": "Verified",
        "Notes": "11124 Christian Rd, Wilson NC 27896. Founded 1975. State-of-the-art packaging facility. 30-mile radius operations across Wilson/Nash/Edgecombe counties. International shipping capabilities. NC & US Sweet Potato Council leaders. Private label & Carolina Gold brands. Year-round supply domestic/international.",
        "Score": "100"
    },
    "Farm Pak / Barnes Farming": {
        "Square Footage": "Estimated 200,000",
        "Total Rooms": "25+",
        "Size Classification": "Large",
        "Primary Produce": "Sweet Potatoes",
        "Premium Varieties": "Sweet potatoes (primary), watermelons, peanuts",
        "Organic": "Unknown",
        "CA/MA": "Yes",
        "Verification Source": "FarmPak.com, Business North Carolina",
        "Confidence Level": "Verified",
        "Notes": "Nash County NC. Founded 1969. 14,000+ acres farmland. One of largest sweet potato marketers. Also grows tobacco, peanuts, small grains, watermelons, persimmons. Packing shed operations. American Sweet Potato Marketing Institute Board, NC Farm Bureau Labor Committee, Nash County Farm Bureau.",
        "Score": "100"
    },
    "PCC Logistics - Port of Tacoma": {
        "Square Footage": "220,000",
        "Total Rooms": "25+",
        "Size Classification": "XLarge",
        "Primary Produce": "Cold Storage",
        "Premium Varieties": "Multi-temperature warehousing",
        "CA/MA": "Yes",
        "Verification Source": "NW Seaport Alliance, PCCLogistics.com",
        "Confidence Level": "Verified",
        "Notes": "2602 Port of Tacoma Rd, Tacoma WA 98421. USDA Certified Inspection Facility. Port-strategic location. Multiple PCC facilities in region (D Street facility also). Primary service: warehousing.",
        "Score": "95"
    },
    "PLRS/Titan Cold - Port Tampa Bay": {
        "Square Footage": "135,000",
        "Total Rooms": "20+",
        "Size Classification": "XLarge",
        "Primary Produce": "Port Facility - Fresh Produce",
        "Premium Varieties": "Fresh produce, proteins imports/exports",
        "CA/MA": "Yes",
        "Verification Source": "Titan Cold, AJOT.com, Business Wire, Fleet Owner",
        "Confidence Level": "Verified",
        "Notes": "Berth 219, Port Tampa Bay. Opened 2021. State-of-the-art on-dock cold storage. 148 reefer plugs, fumigation services, ripening rooms. 2 high-speed Gottwald cranes stevedoring services. 41-foot channel depth, 2 ships + barges simultaneously. CSX rail access, I-75/275 & I-4 corridor. Dole Fresh Fruit partnership.",
        "Score": "105"
    },
    "Arcadia Cold Storage Jacksonville": {
        "Square Footage": "310,000",
        "Total Rooms": "30+",
        "Size Classification": "XLarge",
        "Primary Produce": "Multi-Product",
        "Premium Varieties": "Port-based import/export handling",
        "CA/MA": "Yes",
        "Verification Source": "Arcadia Cold, Jax Daily Record, JAXPORT",
        "Confidence Level": "Verified",
        "Notes": "North Jacksonville location. Opened Dec 2024. $87M facility. 10 minutes from JAXPORT (Florida's largest container port). Port-based handling services specialization. First Arcadia facility focused on port operations. Southeastern trade hub.",
        "Score": "105"
    },
    "Arcadia Cold Storage Charleston": {
        "Square Footage": "Estimated 250,000",
        "Total Rooms": "25+",
        "Size Classification": "XLarge",
        "Primary Produce": "Produce/Frozen",
        "Premium Varieties": "Southeast food supply chain",
        "CA/MA": "Yes",
        "Verification Source": "Arcadia Cold, SC Governor McMaster, SC Commerce, Refrigerated & Frozen Foods",
        "Confidence Level": "Verified",
        "Notes": "Dorchester County SC. $70M+ investment. 75 new jobs. SC Ports Ridgeville Industrial Campus. Opened Sept 2025. Supports Southeast food supply chain growth. Strategic Port of Charleston access.",
        "Score": "100"
    },
    "FlexCold Charleston": {
        "Square Footage": "Estimated 200,000",
        "Total Rooms": "20+",
        "Size Classification": "XLarge",
        "Primary Produce": "Seafood/Frozen",
        "Premium Varieties": "Poultry, seafood, meat, frozen produce",
        "CA/MA": "Yes",
        "Verification Source": "FlexCold.com, SC Governor McMaster, Area Development, CRDA",
        "Confidence Level": "Verified",
        "Notes": "Patriot Boulevard, North Charleston, Dorchester County SC. $50M investment. 59 jobs. First SC location, second US facility. Headquartered Charleston. Near Port of Charleston. Stores/handles/distributes poultry, seafood, meat, packaged goods, frozen produce.",
        "Score": "100"
    },
    "FreezPak Jacksonville": {
        "Square Footage": "272,400",
        "Total Rooms": "30+",
        "Size Classification": "XLarge",
        "Primary Produce": "Multi-Product",
        "Premium Varieties": "Frozen & cooler storage",
        "CA/MA": "Yes",
        "Verification Source": "FreezPak.com, Fleet Owner",
        "Confidence Level": "Verified",
        "Notes": "8730 Somers Road, Jacksonville FL. $72M facility. 50,000+ frozen/cooler pallet positions. 34 loading docks, 132 trailer parking stalls, 90 container plug-ins, 194 car parking. Opened Q1 2024. Second Florida facility. Southeast expansion. BGFP International partnership.",
        "Score": "105"
    },
    "RealCold Lakeland": {
        "Square Footage": "Estimated 250,000",
        "Total Rooms": "25+",
        "Size Classification": "XLarge",
        "Primary Produce": "Multi-Product",
        "Premium Varieties": "Wide temperature range -20°F to 34°F",
        "CA/MA": "Yes",
        "Verification Source": "RealCold.com",
        "Confidence Level": "Verified",
        "Notes": "Lakeland FL. Central Florida location supports Orlando/Tampa MSAs. Next-generation facility. Temperature range -20°F to 34°F (ideal for ice cream & specialty frozen). Strategic hub for FL chilled/refrigerated logistics distribution. New build construction.",
        "Score": "100"
    },
    "MEDLOG Rincon": {
        "Square Footage": "291,000",
        "Total Rooms": "30+",
        "Size Classification": "XLarge",
        "Primary Produce": "Fresh Produce",
        "Premium Varieties": "Frozen goods & fresh produce",
        "CA/MA": "Yes",
        "Verification Source": "Georgia Ports Authority, Fresh Fruit Portal, DC Velocity, Expansion Solutions",
        "Confidence Level": "Verified",
        "Notes": "Rincon GA. Opened Sept 2025. MEDLOG flagship cold chain facility. Near Port of Savannah. Part of 2.4M sq ft near-port cold storage network (12 facilities total). Global supply chain solutions leader. Frozen & fresh produce specialization.",
        "Score": "105"
    },
    "Evergreen Cold Storage": {
        "Square Footage": "130,000",
        "Total Rooms": "21",
        "Size Classification": "Large",
        "Primary Produce": "Mexican Produce",
        "Premium Varieties": "Fresh produce from Mexico",
        "CA/MA": "Yes",
        "Verification Source": "Facebook, LinkedIn, MapQuest",
        "Confidence Level": "Verified",
        "Notes": "Multiple Pharr TX locations: 9102 S Cage Blvd, 801 Bona Terra Dr, 9107 S Austin Dr. Founded 2006. 21 independent cold rooms, 45 drive-through dock doors. Handles produce crossing Pharr/Progreso/Los Indios/Rio Grande international ports. Primus Labs GFS certified. Fully insured. Mexican produce logistics support from US-Mexico border.",
        "Score": "100"
    },
    "L&M Companies": {
        "Square Footage": "120,000",
        "Total Rooms": "20+",
        "Size Classification": "Large",
        "Primary Produce": "Apple Pear",
        "Premium Varieties": "Washington apples, pears",
        "Organic": "Unknown",
        "CA/MA": "Yes",
        "Verification Source": "LMCompanies.com, MapQuest",
        "Confidence Level": "Verified",
        "Notes": "4310 Main Street, Union Gap WA (Apple King location). Multi-state operations: WA (Union Gap), MI (1891 Territorial Rd, Benton Harbor), NC, FL, GA, CO, AZ, TX. Washington Family Farms brand. Apple King brand. Full-service logistics with LMTS division. Yakima Valley premium-focused family farms.",
        "Score": "95"
    }
}

# Update matching facilities
updated_count = 0
for facility in facilities:
    company = facility['Company']
    if company in verifications:
        updates = verifications[company]
        for key, value in updates.items():
            facility[key] = value
        updated_count += 1
        print(f"✓ Updated: {company}")

# Write updated data
with open('verified-scored-facilities.csv', 'w', encoding='utf-8', newline='') as f:
    writer = csv.DictWriter(f, fieldnames=fieldnames)
    writer.writeheader()
    writer.writerows(facilities)

print(f"\n✅ Batch 25 Complete: {updated_count} facilities verified")
print(f"Backup saved: verified-scored-facilities-BACKUP-{timestamp}.csv")
