{
  "project": "Go-Parts Ship Parallel Integration",
  "last_updated": "2026-02-24",
  "status": "phase2_complete",
  "documentation_file": "documentation/GOPARTS_SHIP_PARALLEL_INTEGRATION.md",

  "systems": {
    "central": {
      "path": "/home/centralgoparts/public_html",
      "framework": "Laravel + Filament",
      "shipping_service": "app/Services/ShipStationService.php",
      "processor": "app/Services/ShipmentProcessorService.php",
      "rate_service": "app/Services/CarrierRateService.php",
      "controller": "app/Http/Controllers/ShipmentController.php",
      "ship_form": "resources/views/shipment/ship.blade.php",
      "config": "config/shipstation.php",
      "warehouses_configured": 22
    },
    "goparts_ship": {
      "path": "/home/shipgoparts/public_html/shipdev",
      "framework": "Laravel 11 + Filament",
      "shipping_backend": "ShipEngine",
      "api_base": "/api/ss/",
      "dev_url": "https://shipdev.go-parts.com/api/ss/",
      "prod_url": "https://ship.go-parts.com/api/ss/",
      "api_routes": "routes/api.php",
      "api_controllers": "app/Http/Controllers/Api/Shipstation/",
      "transformers": "app/Services/ShipstationApi/Transformers/",
      "webhook_dispatcher": "app/Services/ShipstationApi/WebhookDispatcher.php",
      "shipment_service": "app/Services/ShipmentService.php",
      "config": "config/shipengine.php"
    }
  },

  "gaps": {
    "critical": [
      {
        "id": "GAP-001",
        "title": "NJ warehouse credential mismatch - NOT A GAP",
        "description": "Go-Parts Ship has its OWN credentials, separate from Shipstation. NJ being different is expected. Central's config/gopartsship.php now stores Go-Parts Ship credentials independently.",
        "status": "resolved",
        "effort": "none"
      },
      {
        "id": "GAP-002",
        "title": "Missing PARTSBOX warehouses in Go-Parts Ship",
        "description": "Go-Parts Ship seeder is missing PARTSBOX-V, PARTSBOX-E, PARTSBOX-B, PARTSBOX-A warehouses. Once added to Go-Parts Ship, their credentials also need to be added to Central's config/gopartsship.php",
        "fix": "Add 4 PARTSBOX entries to Go-Parts Ship WarehouseApiCredentialSeeder.php, then add their Go-Parts Ship auth strings to Central config/gopartsship.php",
        "status": "open",
        "effort": "small"
      },
      {
        "id": "GAP-003",
        "title": "user_id not set on warehouse_api_credentials",
        "description": "RateController checks warehouse->user_id to find carrier IDs. Without user_id, rate requests fail with 'Carriers not configured'",
        "fix": "Assign a Go-Parts Ship user to each warehouse credential record",
        "status": "open",
        "effort": "medium"
      },
      {
        "id": "GAP-004",
        "title": "ShipEngine sandbox mode enabled",
        "description": "config/shipengine.php has sandbox=true by default. Production usage requires real API key and sandbox=false",
        "fix": "Set SHIPENGINE_SANDBOX=false in .env and configure production API key",
        "status": "open",
        "effort": "small"
      },
      {
        "id": "GAP-005",
        "title": "Carrier accounts not connected in ShipEngine",
        "description": "ShipEngine needs UPS/FedEx/USPS carrier accounts connected to work",
        "fix": "Connect carrier accounts in ShipEngine dashboard",
        "status": "unknown",
        "effort": "medium"
      },
      {
        "id": "GAP-006",
        "title": "Migration and seeder status unknown",
        "description": "Need to verify if database migrations and seeders have been run on Go-Parts Ship",
        "fix": "Run php artisan migrate:status and check tables",
        "status": "unknown",
        "effort": "small"
      }
    ],
    "important": [
      {
        "id": "GAP-007",
        "title": "RateTransformer otherCost always 0",
        "description": "Central uses otherCost in rate calculation. Go-Parts Ship RateTransformer always returns otherCost=0 because ShipEngine bundles costs differently",
        "fix": "Verify if this affects final rate accuracy; may need to split ShipEngine amount into shipmentCost + otherCost",
        "status": "open",
        "effort": "small"
      },
      {
        "id": "GAP-008",
        "title": "RateTransformer missing transitDays",
        "description": "ShipEngine provides delivery_days but RateTransformer doesn't map it to Shipstation's transitDays field",
        "fix": "Add transitDays mapping in RateTransformer::toShipstationFormat()",
        "status": "open",
        "effort": "small"
      },
      {
        "id": "GAP-009",
        "title": "Webhook account_code format may not match old Central",
        "description": "Go-Parts Ship webhook seeder uses warehouse codes (GA, DEPO-IL) as account_code, but old Central may expect different format (ga, depowc)",
        "fix": "Compare against old Central's ShipstationController webhook handler to verify expected format",
        "status": "open",
        "effort": "medium"
      }
    ],
    "low_priority": [
      {
        "id": "GAP-010",
        "title": "No createLabel/voidLabel API endpoints",
        "description": "Go-Parts Ship SS-compatible API doesn't have label creation endpoints. Labels are created via Filament UI only",
        "status": "not_needed_now",
        "effort": "medium"
      },
      {
        "id": "GAP-011",
        "title": "Insurance options not fully mapped",
        "description": "Orders with insurance may not pass insurance options through to ShipEngine correctly",
        "status": "open",
        "effort": "small"
      },
      {
        "id": "GAP-012",
        "title": "CustomField1/2/3 not preserved",
        "description": "PAMS custom field data not stored/returned by Go-Parts Ship",
        "status": "open",
        "effort": "low"
      }
    ]
  },

  "implementation": {
    "phases": [
      {
        "id": "phase-1",
        "name": "Verify Go-Parts Ship Readiness",
        "status": "not_started",
        "tasks": [
          {"task": "Verify migrations have been run", "status": "pending"},
          {"task": "Fix NJ credential in seeder", "status": "pending"},
          {"task": "Add PARTSBOX warehouses to seeder", "status": "pending"},
          {"task": "Run seeders", "status": "pending"},
          {"task": "Set user_id on warehouse credentials", "status": "pending"},
          {"task": "Verify ShipEngine API key", "status": "pending"},
          {"task": "Verify carrier accounts connected", "status": "pending"},
          {"task": "Test carriers endpoint", "status": "pending"},
          {"task": "Test rates endpoint", "status": "pending"}
        ]
      },
      {
        "id": "phase-2",
        "name": "Central Integration",
        "status": "complete",
        "tasks": [
          {"task": "Create config/gopartsship.php", "status": "done"},
          {"task": "Create GoPartsShipService.php", "status": "done"},
          {"task": "Add shipping_provider to shipments table", "status": "done"},
          {"task": "Modify ShipmentProcessorService for provider routing", "status": "done"},
          {"task": "Modify ShipmentController to pass provider", "status": "done"},
          {"task": "Add admin toggle to ship.blade.php", "status": "done"},
          {"task": "Add admin toggle to ship-order.blade.php", "status": "done"},
          {"task": "Update Shipment model with shipping_provider", "status": "done"}
        ]
      },
      {
        "id": "phase-3",
        "name": "Rate Comparison (Optional)",
        "status": "not_started",
        "tasks": [
          {"task": "Add dual rate fetching to CarrierRateService", "status": "pending"},
          {"task": "Show side-by-side rates on ship form", "status": "pending"},
          {"task": "Add rate logging for analysis", "status": "pending"}
        ]
      },
      {
        "id": "phase-4",
        "name": "End-to-End Testing",
        "status": "not_started",
        "tasks": [
          {"task": "Test order creation via Go-Parts Ship", "status": "pending"},
          {"task": "Test label creation in Go-Parts Ship UI", "status": "pending"},
          {"task": "Test webhook delivery to Central", "status": "pending"},
          {"task": "Test tracking number appears in Central", "status": "pending"},
          {"task": "Test Shipstation orders unaffected", "status": "pending"}
        ]
      },
      {
        "id": "phase-5",
        "name": "Gradual Rollout",
        "status": "not_started",
        "tasks": [
          {"task": "Start with GA warehouse only", "status": "pending"},
          {"task": "Monitor rate differences", "status": "pending"},
          {"task": "Monitor webhook reliability", "status": "pending"},
          {"task": "Expand to additional warehouses", "status": "pending"}
        ]
      }
    ]
  },

  "files_created": [
    "config/gopartsship.php",
    "app/Services/GoPartsShipService.php",
    "database/migrations/2026_02_24_000001_add_shipping_provider_to_shipments_table.php"
  ],

  "files_modified": [
    "app/Services/ShipmentProcessorService.php",
    "app/Http/Controllers/ShipmentController.php",
    "resources/views/shipment/ship.blade.php",
    "resources/views/filament/pages/ship-order.blade.php",
    "app/Models/Shipment.php"
  ],

  "files_unchanged": [
    "app/Services/ShipStationService.php",
    "config/shipstation.php",
    "app/Services/PackageCalculatorService.php",
    "app/Services/WarehouseSelectionService.php"
  ]
}
