> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Marketplace Curator

> Publish new Clinical Marketplace bundle versions and deprecate or reinstate existing bundles.

This screen is the platform curator console for managing Clinical Marketplace bundles and is available at `/cl/marketplace/curator`.

## Overview

The Marketplace Curator page lists all bundles from `cl_marketplace_bundles` (including deprecated ones, unlike the public catalogue). Each bundle card shows name, version badge, bundle key, publish date/time, and a deprecated badge when applicable. Curators can toggle a bundle's deprecated state using the **Deprecate** / **Reinstate** button, which calls `useDeprecateMarketplaceBundle` and toggles `is_deprecated` on the row. A **Publish version** button navigates to `/cl/marketplace/curator/new` where a new bundle version can be authored and published via `usePublishMarketplaceBundleVersion`. Publishing inserts a row into `cl_marketplace_bundles` and then inserts the associated items into `cl_marketplace_bundle_items`; this is a client-side sequence and is not transactional.

## Who it's for

Requires permission: `cl.marketplace.publish`

Access is additionally enforced at the database level by the `cl_can_curate_marketplace` SECURITY DEFINER helper.

## Before you start

You must hold `cl.marketplace.publish` to access this page. The `cl_can_curate_marketplace` DB function is the authoritative access gate.

## Steps

<Steps>
  <Step title="Open Marketplace Curator">
    Navigate to `/cl/marketplace/curator`. All marketplace bundles (including deprecated ones) load for review.
  </Step>

  <Step title="Review existing bundles">
    Each card shows the bundle name, version, bundle key, publish timestamp. Deprecated bundles show a destructive badge labeled "Deprecated."
  </Step>

  <Step title="Deprecate or reinstate a bundle">
    Click **Deprecate** to set `is_deprecated = true` on a bundle. Click **Reinstate** to reverse this. A success toast confirms the action.
  </Step>

  <Step title="Publish a new bundle version">
    Click **Publish version** to navigate to `/cl/marketplace/curator/new`. Fill in the bundle details and items, then submit to insert the new bundle row and its items.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Bundle deprecation vs. deletion">
    Deprecating a bundle sets `is_deprecated` to true. The bundle remains in the table but is excluded from the public catalogue (`useMarketplaceBundles` filters to `is_deprecated = false`). Organizations with existing imports are unaffected.
  </Accordion>

  <Accordion title="Empty and error states">
    When no bundles exist, an empty state is shown: "No bundles yet — Publish the first marketplace bundle for your platform." with a **Publish version** action. If the bundle list fails to load, a destructive alert titled "Error Loading Bundles" is displayed with a sanitized error message.
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Clinical" icon="stethoscope" href="/cl/overview">
    Overview of the Clinical core.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/cl.tsx
  * src/cores/cl/pages/MarketplaceCuratorListPage.tsx
  * src/cores/cl/hooks/useMarketplaceBundles.ts
  * src/cores/cl/hooks/useMarketplaceCurator.ts
</Accordion>
