{
  "id": "out-acct",
  "title": "Outbound NexusCRM Account pushes mapped fields to HubSpot company",
  "kind": "hubspot_sync",
  "linkedIssues": [],
  "provenance": {
    "businessScenario": "OUT-ACCT — create a native NexusCRM Account filling §2.6 fields and verify each HubSpot company property equals the oracle, including the Industry->salesforce_industry__icp_ CASE transform (DNB-Software->Software).",
    "reportedBy": "HubSpot sync spec OUT-ACCT (hubspot-nexuscrm-sync-CASE-EXEC-SELFCONTAINED)",
    "capturedAt": "2026-06-18",
    "note": "[calibrated] Industry DNB-Software with Vertical__c 'Mobile App Development' (legal under DNB-Software; maps to ICP 'Software'); added required RecordTypeId/Region__c; dropped salesforce_industry__vertical_ assertion (HS enum differs); assert name + salesforce_industry__icp_ only."
  },
  "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": "OutAcctCo {{__runId}}",
        "AnnualRevenue": 5000000,
        "Country11__c": "United States",
        "NumberOfEmployees": 120,
        "Phone": "+1-415-555-0100",
        "Website": "https://outacct-{{__runId}}.example.com",
        "Vertical__c": "Mobile App Development",
        "Industry": "DNB-Software",
        "RecordTypeId": "{{steps.account-record-type.response.body.records[0].Id}}",
        "Region__c": "NA",
        "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=name,account_id__c,annualrevenue,country11__c,numberofemployees,phone,website,salesforce_industry__vertical_,salesforce_industry__icp_,hubspot_owner_id",
      "expectStatus": 200,
      "poll": {
        "budgetMs": 90000,
        "intervalMs": 3000
      },
      "onTimeout": "fail",
      "assertions": [
        {
          "path": "response.body.properties.name",
          "equals": "OutAcctCo {{__runId}}"
        },
        {
          "path": "response.body.properties.account_id__c",
          "exists": true
        },
        {
          "path": "response.body.properties.annualrevenue",
          "numericEquals": 5000000
        },
        {
          "path": "response.body.properties.country11__c",
          "equals": "United States"
        },
        {
          "path": "response.body.properties.numberofemployees",
          "numericEquals": 120
        },
        {
          "path": "response.body.properties.phone",
          "equals": "+1-415-555-0100"
        },
        {
          "path": "response.body.properties.website",
          "equals": "https://outacct-{{__runId}}.example.com"
        },
        {
          "path": "response.body.properties.salesforce_industry__icp_",
          "equals": "Software"
        }
      ]
    }
  ]
}
