{
  "id": "en-04",
  "title": "Inbound shell Lead is created with HubSpot_Sync_Enabled__c true",
  "kind": "hubspot_sync",
  "executionMode": "serial",
  "executionModeReason": "This simple inbound shell oracle is sensitive to full-suite webhook queue pressure; in mixed 54-case runs it can materialize after the parallel wait window even though the record lands correctly, so run it isolated after the parallel batch.",
  "caseTimeoutMs": 540000,
  "linkedIssues": [],
  "provenance": {
    "businessScenario": "EN-04 — a HubSpot contact inbound creates a NexusCRM shell Lead whose HubSpot_Sync_Enabled__c is set to true.",
    "reportedBy": "HubSpot sync spec EN-04 (hubspot-nexuscrm-sync-CASE-EXEC-SELFCONTAINED)",
    "capturedAt": "2026-06-17"
  },
  "steps": [
    {
      "id": "hs",
      "system": "hubspot",
      "method": "POST",
      "path": "/crm/v3/objects/contacts",
      "body": {
        "properties": {
          "email": "en04-{{__runId}}@example.com",
          "firstname": "En04",
          "lastname": "Shell{{__runId}}"
        }
      },
      "expectStatusRange": [
        200,
        299
      ],
      "assertions": [
        {
          "path": "response.body.id",
          "exists": true
        }
      ]
    },
    {
      "id": "waitRow",
      "system": "nexuscrm",
      "authRole": "admin",
      "method": "GET",
      "path": "/services/data/v63.0/query?q=SELECT Id, HubSpot_Sync_Enabled__c FROM Lead WHERE HubSpot_Id__c = '{{steps.hs.response.body.id}}'",
      "expectStatus": 200,
      "poll": {
        "budgetMs": 240000,
        "intervalMs": 6000
      },
      "onTimeout": "blocked",
      "assertions": [
        {
          "path": "response.body.totalSize",
          "atLeast": 1
        }
      ],
      "timeoutMs": 8000
    },
    {
      "id": "q",
      "system": "nexuscrm",
      "authRole": "admin",
      "method": "GET",
      "path": "/services/data/v63.0/query?q=SELECT Id, HubSpot_Sync_Enabled__c FROM Lead WHERE HubSpot_Id__c = '{{steps.hs.response.body.id}}'",
      "expectStatus": 200,
      "poll": {
        "budgetMs": 240000,
        "intervalMs": 8000
      },
      "onTimeout": "fail",
      "assertions": [
        {
          "path": "response.body.records[0].HubSpot_Sync_Enabled__c",
          "equals": true
        }
      ],
      "timeoutMs": 8000
    }
  ]
}
