#!/usr/bin/env bash
# UOCL Loop Start v1 — CURRENT Ride Start inbound example
# Replace YOUR_API_KEY. Never commit real secrets.

set -euo pipefail

API_KEY="${UOCL_API_KEY:-YOUR_API_KEY}"
ENDPOINT="${UOCL_LOOP_START_URL:-https://flows.mmdirect-n8n.com/webhook/ride-start}"

curl -sS -X POST "$ENDPOINT" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ${API_KEY}" \
  -d '{
    "hubspot_deal_id": "TEST_DEAL_123",
    "source": "docs_curl_example",
    "title": "Ride Confirmation",
    "instructions": "Please review the trip and complete the driver fields.",
    "submitLabel": "Submit Ride",
    "booking": {
      "name": "Jane Smith",
      "email": "jane@example.com"
    },
    "fields": [
      {
        "name": "name",
        "label": "Name",
        "type": "text",
        "value": "Jane Smith",
        "editable": false
      },
      {
        "name": "driver_name",
        "label": "Driver Name",
        "type": "text",
        "value": "",
        "editable": true
      }
    ]
  }'
echo
