{
  "opencollection": "1.0.0",
  "info": {
    "name": "OpenGov Purchase Order Surface Versions API",
    "version": "1.0.0"
  },
  "request": {
    "auth": {
      "type": "apikey",
      "key": "Authorization",
      "value": "{{Authorization}}",
      "placement": "header"
    }
  },
  "items": [
    {
      "info": {
        "name": "surfaceVersions",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Get surface version status for a Purchase Order",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api-purchase-order.procurement.opengov.com/api/v1/po/entities/:entityId/purchase-orders/:poId/surface-versions",
            "params": [
              {
                "name": "poId",
                "value": "",
                "type": "path"
              },
              {
                "name": "surfaces",
                "value": "",
                "type": "query"
              }
            ]
          },
          "docs": "Returns current max entry IDs for each surface (COMMENTS, ATTACHMENTS, etc) and the user's last viewed entry ID for each surface. Frontend uses isNewer flag to display 'New' badges. Called on mount of POCommentsPanel to check badge state."
        },
        {
          "info": {
            "name": "Record that user has viewed surfaces up to specific entry IDs",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api-purchase-order.procurement.opengov.com/api/v1/po/entities/:entityId/purchase-orders/:poId/surface-versions",
            "params": [
              {
                "name": "poId",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Called when user opens the comments/attachments panel. Body is array of { surface, lastViewedEntryId } pairs. Backend upserts po_user_surface_views records and increments viewed_count. Returns 204 No Content."
        }
      ]
    }
  ],
  "bundled": true
}