{
  "id": "out-fld-13",
  "title": "Outbound Account Industry CASE: DNB-Software maps to Software",
  "kind": "hubspot_sync",
  "linkedIssues": [],
  "provenance": {
    "businessScenario": "OUT-FLD-13 — verify the outbound Industry->salesforce_industry__icp_ CASE transform on Account (DNB-Software->Software, §2.6).",
    "reportedBy": "HubSpot sync spec OUT-FLD-13 (hubspot-nexuscrm-sync-CASE-EXEC-SELFCONTAINED)",
    "capturedAt": "2026-06-18",
    "note": "[calibrated] Account create now includes all required NX fields per sandbox create contract."
  },
  "steps": [
    {
      "id": "account-record-type",
      "system": "nexuscrm",
      "authRole": "admin",
      "method": "GET",
      "path": "/services/data/v63.0/query?q=SELECT Id FROM _System_RecordType WHERE SobjectType = 'Account' AND Name = 'Customer' AND IsActive = true LIMIT 1",
      "expectStatus": 200,
      "assertions": [
        {
          "path": "response.body.totalSize",
          "atLeast": 1
        },
        {
          "path": "response.body.records[0].Id",
          "exists": true
        }
      ]
    },
    {
      "id": "create-record",
      "system": "nexuscrm",
      "authRole": "admin",
      "method": "POST",
      "path": "/services/data/v63.0/sobjects/Account",
      "body": {
        "Name": "OutFld13 {{__runId}}",
        "Website": "https://f13-{{__runId}}.example.com",
        "Industry": "DNB-Software",
        "NumberOfEmployees": 120,
        "RecordTypeId": "{{steps.account-record-type.response.body.records[0].Id}}",
        "Region__c": "NA",
        "Vertical__c": "Mobile App Development",
        "HubSpot_Sync_Enabled__c": true
      },
      "expectStatusRange": [
        200,
        299
      ],
      "assertions": [
        {
          "path": "response.body.id",
          "exists": true
        }
      ]
    },
    {
      "id": "wait-hubspot-id",
      "system": "nexuscrm",
      "authRole": "admin",
      "method": "GET",
      "path": "/services/data/v63.0/query?q=SELECT HubSpot_Id__c FROM Account WHERE Id = '{{steps.create-record.response.body.id}}' LIMIT 1",
      "expectStatus": 200,
      "poll": {
        "budgetMs": 90000,
        "intervalMs": 3000
      },
      "onTimeout": "fail",
      "assertions": [
        {
          "path": "response.body.records[0].HubSpot_Id__c",
          "exists": true
        }
      ]
    },
    {
      "id": "assert-hubspot",
      "system": "hubspot",
      "method": "GET",
      "path": "/crm/v3/objects/companies/{{steps.wait-hubspot-id.response.body.records[0].HubSpot_Id__c}}?properties=salesforce_industry__icp_,name",
      "expectStatus": 200,
      "poll": {
        "budgetMs": 90000,
        "intervalMs": 3000
      },
      "onTimeout": "fail",
      "assertions": [
        {
          "path": "response.body.properties.salesforce_industry__icp_",
          "equals": "Software"
        }
      ]
    }
  ]
}
