VONQ
ChangelogVersion 4.8

QA: Set ordered-product status (non-production)

QA: Set ordered-product status (non-production)

The sandbox-only helper window.hapiQA.campaign.setCampaignStatusOnNonProductionEnvironments now also simulates per-ordered-product status transitions, not only the campaign-level status. This lets you reproduce ordered-product states — a job-board link, a delivery date, or an error/solution pair — on acceptance and sandbox without waiting on backend processing.

Calling this on production throws an error by design. Do not rely on this API in production integration code.

What changed

Previously the helper accepted a campaign id and a single campaign-level status. It now accepts an optional third argument, orderedProductsSpecs, and the campaign-level status is now optional too, so you can update only ordered products, only the campaign, or both.

// Only when hapi.core.isProduction === false

// Campaign-level status only (unchanged, still supported)
await window.hapiQA.campaign.setCampaignStatusOnNonProductionEnvironments(
  "your-campaign-uuid",
  "online",
)

// Ordered-product statuses only (no campaign-level change)
await window.hapiQA.campaign.setCampaignStatusOnNonProductionEnvironments(
  "your-campaign-uuid",
  undefined,
  [
    {
      productId: "your-product-uuid",
      status: "online",
      jobBoardLink: "https://example.com/job/123",
      deliveredOn: "2026-01-01T00:00:00.000Z",
    },
  ],
)

// Both at once
await window.hapiQA.campaign.setCampaignStatusOnNonProductionEnvironments(
  "your-campaign-uuid",
  "in progress",
  [
    {
      productId: "your-product-uuid",
      status: "not processed",
      statusDescription: "Awaiting board approval",
      statusRawError: "E_BOARD_TIMEOUT",
      statusSolution: "Retry the posting",
    },
  ],
)

orderedProductsSpecs entries

Each entry describes one ordered product. productId is required, and you must provide at least one other field — an entry that carries only a productId is rejected (both client-side and by the backend).

FieldTypeNotes
productIdstringRequired. The ordered product to update.
statusCampaignStatusonline, offline, in progress, not processed.
statusDescriptionstring | nullHuman-readable status description.
statusRawErrorstring | nullRaw error string for the ordered product.
statusSolutionstring | nullSuggested resolution for the error.
jobBoardLinkstring | nullURL to the live posting (max 1024 characters).
deliveredOnstring | nullISO 8601 date-time.

The new WindowHapiQACampaignOrderedProductSpecStatusUpdate type describing an entry is exported from @vonq/hapi-elements-types.

In-memory state

On success the ATS runtime updates the matching campaign in hapi.campaign.state.campaigns (and hapi.campaign.state.campaignBeingEdited when open): the campaign-level status when provided, plus the overlapping ordered-product fields (status, statusDescription, jobBoardLink, deliveredOn) matched by productId.

statusRawError and statusSolution are sent to the backend but are not part of the in-memory Campaign shape — they live only in the campaign detailed status (orderedProductsStatuses), which is fetched on demand and not held in SDK state. After a successful call, re-fetch the campaign detailed status (e.g. reload the campaign detail view) to see the updated error / solution text.

Debug panel

In the QA debug panel, open the Campaign tab. In the new Set ordered-product status (non-production only) section enter a Campaign ID and a Product ID, fill any of the fields, and click Set ordered-product status. The Campaign status and the Ordered-product status are set independently — set either, both, or leave either on (no change). The delivery date uses a calendar/time picker (with a Now shortcut). Raw error / solution are sent to the backend but not kept in SDK state — refresh the campaign detail page to see them.

Backwards compatibility

  • The third argument is optional; existing two-argument calls (campaignId, status) behave exactly as before.
  • No SDK function, getter, setter, property, or event was removed or renamed.