# Comment

**Kind:** Database Model

**Source:** [`atloria-monorepo/libs/database/prisma/schema.prisma`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/database/prisma/schema.prisma#L573)

## Fields

| Field | Type | Required | Key |
|---|---|---|---|
| `id` | `String` | ✓ | PK |
| `documentId` | `String` | ✓ |  |
| `parentCommentId` | `String` | - |  |
| `content` | `String` | ✓ |  |
| `selectionText` | `String` | - |  |
| `positionStart` | `Int` | - |  |
| `positionEnd` | `Int` | - |  |
| `resolved` | `Boolean` | ✓ |  |
| `resolvedAt` | `DateTime` | - |  |
| `resolvedById` | `String` | - |  |
| `mentions` | `String[]` | ✓ |  |
| `createdById` | `String` | ✓ |  |
| `createdAt` | `DateTime` | ✓ |  |
| `updatedAt` | `DateTime` | ✓ |  |

## Diagram

```mermaid
erDiagram
    Comment {
        id String [PK]
        documentId String
        parentCommentId String?
        content String
        selectionText String?
        positionStart Int?
        positionEnd Int?
        resolved Boolean
        resolvedAt DateTime?
        resolvedById String?
        mentions String[]
        createdById String
        createdAt DateTime
        updatedAt DateTime
    }
    Comment ||--|| User : ""
    Comment ||--|| User : ""
    Comment ||--|| Document : ""
    Comment ||--|| Comment : ""
    Comment ||--}o Comment : ""
```

## Relationships

- HAS_ONE → `User`
- HAS_ONE → `User`
- HAS_ONE → `Document`
- HAS_ONE → `Comment`
- HAS_ONE → `Comment`

## Referenced By

- `User` (HAS_ONE)
- `User` (HAS_ONE)
- `Comment` (HAS_ONE)
- `Comment` (HAS_ONE)
