- Streamlined the README.md for clarity and conciseness. - Deleted outdated documentation files related to Freebit SIM management, SIM management API data flow, and various architectural guides to reduce clutter and improve maintainability. - Updated the last modified date in the README to reflect the latest changes.
3.1 KiB
3.1 KiB
Provisioning Runbook (Salesforce Platform Events → Portal → WHMCS)
This runbook helps operators diagnose issues in the order fulfillment path.
Paths & Channels
- Salesforce Platform Event:
OrderProvisionRequested__e - Backend health:
GET /health
Required Env (Backend)
SF_LOGIN_URL,SF_CLIENT_ID,SF_USERNAMESF_PRIVATE_KEY_PATH(prod:/app/secrets/sf-private.key)SF_EVENTS_ENABLED=trueSF_PROVISION_EVENT_CHANNEL=/event/OrderProvisionRequested__eSF_EVENTS_REPLAY=LATEST(orALL)PORTAL_PRICEBOOK_ID
Common Symptoms and Fixes
-
No events received
- Verify Flow publishes
OrderProvisionRequested__eon Order approval - Confirm the BFF has
SF_EVENTS_ENABLED=trueand valid SF JWT settings - Check BFF logs for subscription start on the expected channel
- Verify Flow publishes
-
Event replays not advancing
- Ensure Redis is healthy; last
replayIdis stored undersf:pe:replay:<channel> - If needed, set
SF_EVENTS_REPLAY=ALLfor a one-time backfill, then revert toLATEST
- Ensure Redis is healthy; last
-
409 Payment method missing
- Customer has no WHMCS payment method
- Ask customer to add a payment method; retry fulfill
-
WHMCS Add/Accept errors
- Check product mappings:
Product2.WH_Product_ID__candBilling_Cycle__c - Backend logs show the item mapping report; fix missing mappings
- Check product mappings:
-
Salesforce status not updated
- Backend updates
Activation_Status__candWHMCS_Order_ID__con success - Verify connected app JWT config and that the API user has Order update permissions
- Backend updates
Verification Steps
- In SF, create an Order with OrderItems
- Approve Order → Flow sets
Activation_Status__c = Activatingand publishesOrderProvisionRequested__e - Check
/health: database/redis connected, environment correct - Tail logs; confirm: Platform Event enqueued → Guard sees status=Activating → WHMCS add → WHMCS accept → Activated
- Verify SF fields updated and WHMCS order/service IDs exist
Logging Cheatsheet
- "Platform Event enqueued for provisioning" — subscriber enqueue
- "Starting fulfillment orchestration" — orchestrator start
- Step logs:
validation,sf_status_update,order_details,mapping,whmcs_create,whmcs_accept,sf_success_update - On error: orchestrator updates SF with
Activation_Status__c='Failed'
Security Notes
-
No inbound Salesforce webhooks are used for provisioning.
-
BFF authenticates to Salesforce via JWT; grant API access and Platform Event object read via Permission Set.
-
No WHMCS webhooks are consumed; the portal uses the WHMCS API for billing operations.
-
Health endpoint
/healthincludesintegrations.redisprobe to confirm queue/replay storage availability.
Ops: Manual Retry Flow
- Click "Provision / Retry" on the Order in Salesforce.
- If
Activation_Status__c = Activating, show a toast "Already in progress". - Else, set
Activation_Status__c = Activating, clear last error fields, and let the Record‑Triggered Flow publish the event.
- If
Portal does not auto-retry jobs. Network/5xx/timeouts will mark the Order Failed with:
Activation_Error_Code__c(e.g., 429, 503, ETIMEOUT)Activation_Error_Message__c(short reason)