# Production HubSpot Webhook Project

This directory owns the production subscription project
`hubspot-webhooks-new-prod-cutover` for portal `4466002`, app `44166359`. Its
six project/component source files match downloaded build 6 byte for byte.
The generic `src/app/settings/HUBSPOT_SETTINGS.md` tutorial is excluded as
non-runtime scaffold; the equality claim covers the six retained files. Keep
the existing project name and component UIDs so future uploads update the same app.

The webhook target is
`https://nexuscrm-new-prod.pingcap.com/webhooks/hubspot-crm-connector/webhook`,
with `maxConcurrentRequests=6`. There are 45 active contact subscriptions:
42 property changes plus creation, merge, and association change. Build 6 added
`account_status__c`, `agreement_time__c`, `created_at__c`, `ip_address__c`,
`mql_priority`, `tied_card_time__c`, and `time_zone__c`. Their full and delta
mappings already live in
`packs/PingCAP-HubSpot-Companion/field_mappings/contact_lead_inbound.json`; the
companion `HubSpot_Contact_Lead_Upsert` Flow selects those delta mappings.
Subscriptions are explicit: mapping presence alone does not decide field
authority or authorize subscribing every mapped property.

## Publication and readback

This HubSpot project is published independently of a NexusCRM pack/BOM rollout.
Use an authenticated HubSpot CLI session for the production portal. Validation
is read-only; upload can deploy a build when project auto-deploy is enabled.
Run upload and deploy only within an authorized production change.

```bash
cd deployments/offline/hubspot-projects/production-webhooks
hs project validate --account=4466002
hs project upload --account=4466002 --message="production webhook subscription update"
hs project list-builds --account=4466002 --project=hubspot-webhooks-new-prod-cutover --limit=3 --json
```

Require the selected build to finish successfully and verify its deployment
status. If auto-deploy did not deploy it, deploy that exact reviewed build with
`hs project deploy --account=4466002 --project=hubspot-webhooks-new-prod-cutover --build=BUILD_ID`.
Do not choose an unrelated latest build or force a deployment.

Download that exact build into a temporary directory with
`hs project download --account=4466002 --project=hubspot-webhooks-new-prod-cutover --build=BUILD_ID --dest=READBACK_DIR`.
Compare parsed JSON with the checked-in project, app, webhook, and settings
metadata; compare the settings source and dependency manifest as well. Confirm
the target URL, concurrency, component UIDs, active subscriptions, and scopes.
For functional verification, correlate a provider-delivered event from this app
with terminal processed WorkItem coverage and the expected stored field value.
HTTP acceptance or a successful project build alone is not business-effect proof.

## Source boundary

Keep CLI account/configuration files, tokens, client secrets, environment files,
caches, dependencies, build outputs, raw provider/DB logs, replay manifests, and
record snapshots outside this directory. Assigned subscription IDs belong in
readback evidence, not the subscription authoring schema.

The settings component is retained exactly from build 6 so a later full-project
upload does not accidentally remove it. It is starter UI with
`console.log({context})` and an unpinned `@hubspot/ui-extensions` dependency.
Review that logging and dependency separately before changing the component;
they are not part of the webhook subscription repair.
