# roadmap_entry_link_project

Link Project to Roadmap Entry

## Beschreibung

Links a project to a roadmap entry so the entry can carry
execution context (which projects are actually delivering
it).

Constraints:
- The project must belong to the same workspace as the roadmap.
  Cross-workspace links are rejected with a validation error.
- Idempotent: re-linking the same project returns the
  existing link row without raising.

Writes an `entry_project_linked` activity row. Reverse with
`roadmap_entry_unlink_project`.

## Zugriff

Zugriffsprofil: `gated`. Module: `projects_tasks`.
Die Freigabe im Profil ersetzt keine Account-, Workspace- oder Rollenberechtigung.

## Parameter

| Name | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `account_id` | string | Ja |  |
| `roadmap_entry_id` | string | Ja | Entry prefix ID (rent_…). |
| `project_id` | string | Ja | Project prefix ID (proj_…). Must belong to the same workspace as the roadmap. |

## Eingabeschema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "account_id": {
      "type": "string"
    },
    "roadmap_entry_id": {
      "type": "string",
      "description": "Entry prefix ID (rent_…)."
    },
    "project_id": {
      "type": "string",
      "description": "Project prefix ID (proj_…). Must belong to the same workspace as the roadmap."
    }
  },
  "required": [
    "account_id",
    "roadmap_entry_id",
    "project_id"
  ],
  "type": "object"
}
```

## Ausgabeschema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "link": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Link prefix ID (rep_…)."
        },
        "roadmap_entry_id": {
          "type": "string",
          "description": "rent_…"
        },
        "project_id": {
          "type": "string",
          "description": "proj_…"
        },
        "project_name": {
          "type": "string",
          "description": "Denormalised for convenience — saves a separate `project_get`."
        }
      },
      "required": [
        "id",
        "roadmap_entry_id",
        "project_id",
        "project_name"
      ]
    }
  },
  "required": [
    "link"
  ],
  "type": "object"
}
```
