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

# PersonWebLink

> PersonWebLink is a soft-deletable bridge (pivot) relation that attaches one or more web hyperlinks to a person record

PersonWebLink is a soft-deletable bridge (pivot) relation that attaches one or more web hyperlinks to a person record. It connects the `People` entity to the `WebLink` atomic entity, enabling a person to carry multiple URLs (e.g. LinkedIn profile, personal website) without denormalising the link data. The pivot follows the standard dual-direction indexing pattern: a composite index on `(person, deleted_at)` for the forward traversal and a single-column index on `web_link` for the reverse traversal.

| Naming                          | Value                             |
| ------------------------------- | --------------------------------- |
| Object                          | PersonWebLink                     |
| Resource type (JSON:API `type`) | `person_web_link`                 |
| Collection / records root       | — <sub>(not a records root)</sub> |
| REST base                       | `/v1/person-web-links`            |
| Entity class                    | `PersonWebLink`                   |

<Note>
  **Internal object.** Not currently exposed on the public REST API. The operations below describe the intended contract.
</Note>

## API operations

| Operation | Method & path                      | Status     |
| --------- | ---------------------------------- | ---------- |
| List      | `GET /v1/person-web-links`         | 🟡 Planned |
| Retrieve  | `GET /v1/person-web-links/{id}`    | 🟡 Planned |
| Create    | `POST /v1/person-web-links`        | 🟡 Planned |
| Update    | `PATCH /v1/person-web-links/{id}`  | 🟡 Planned |
| Delete    | `DELETE /v1/person-web-links/{id}` | 🟡 Planned |

## Data model

### Attributes

| Field       | Type                                        | Required | Constraints                                                                                      | Allowed values | Description                                                                                                                                                                                  |
| ----------- | ------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------ | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| created\_at | Date (timestamptz) — 🔒 system              | ✅ Yes    | set once on INSERT via onCreate hook; never null                                                 | —              | Timestamp at which the pivot row was created. Set automatically by the MikroORM onCreate hook; not editable by the user.                                                                     |
| updated\_at | Date (timestamptz) \| undefined — 🔒 system | ⚪ No     | set on INSERT and on every UPDATE via onCreate/onUpdate hooks; nullable in DB (timestamptz null) | —              | Timestamp of the last modification to this pivot row. Updated automatically by MikroORM; not editable by the user.                                                                           |
| deleted\_at | Date (timestamptz) \| null — 🔒 system      | ⚪ No     | nullable; soft-delete sentinel; all active-record queries must filter deleted\_at IS NULL        | —              | Soft-delete timestamp. Null means the link is active. Set by the soft-delete cascade when the parent person is deleted or the link is explicitly removed. Not directly editable by the user. |

### Relationships

| Name      | Type               | Required | Description                                                                                                                                                                                                                               |
| --------- | ------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| person    | to-one (ManyToOne) | ✅ Yes    | The People record to which this web link belongs. Foreign key: person\_pk → core\_api.peoples.pk. Cascade: ON UPDATE CASCADE. Indexed via the composite partial index idx\_person\_web\_links\_person\_deleted (person\_pk, deleted\_at). |
| web\_link | to-one (ManyToOne) | ✅ Yes    | The WebLink atomic entity carrying the actual URL. Foreign key: web\_link\_pk → core\_api.web\_links.pk. Cascade: ON UPDATE CASCADE. Indexed via idx\_person\_web\_links\_web\_link.                                                      |

### System-computed

* created\_at — set on INSERT via MikroORM onCreate hook (new Date()); never written by API consumers
* updated\_at — set on INSERT and refreshed on every UPDATE via onCreate/onUpdate hooks
* deleted\_at — set by soft-delete cascade; never set directly by the user; queries must always predicate deleted\_at IS NULL
* No public UUID (\*\_id) column exists on this entity — it is a pure pivot table identified by its two FK columns; the external API should reference it via the parent person\_id + web\_link\_id pair
* No workspace\_pk column — tenant isolation is inherited through the parent people → workspace relationship; queries must join through People to apply workspace scope

## Example

```json theme={null}
{
  "data": {
    "type": "person_web_link",
    "id": "a3f7c912-08b4-4e61-bd2a-91c053e7f8d0",
    "attributes": {
      "created_at": "2025-10-14T09:22:00.000Z",
      "updated_at": "2025-10-14T09:22:00.000Z",
      "deleted_at": null
    },
    "relationships": {
      "person": {
        "data": { "type": "people", "id": "e8d22a41-3319-4c7e-b901-7714fce6a1b2" }
      },
      "web_link": {
        "data": { "type": "web_link", "id": "c14b89f3-5510-4df0-a823-003e8fa0d77c" }
      }
    }
  }
}
```

<sub>Source: `apps/api/src/database/entities/PersonWebLink.ts` · domain: financial-graph · tier: Supporting</sub>
