# CollaborationSession

**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#L922)

## Fields

| Field | Type | Required | Key |
|---|---|---|---|
| `id` | `String` | ✓ | PK |
| `documentId` | `String` | ✓ |  |
| `userId` | `String` | ✓ |  |
| `joinedAt` | `DateTime` | ✓ |  |
| `lastActiveAt` | `DateTime` | ✓ |  |
| `cursorPosition` | `Int` | - |  |
| `selectionStart` | `Int` | - |  |
| `selectionEnd` | `Int` | - |  |

## Diagram

```mermaid
erDiagram
    CollaborationSession {
        id String [PK]
        documentId String
        userId String
        joinedAt DateTime
        lastActiveAt DateTime
        cursorPosition Int?
        selectionStart Int?
        selectionEnd Int?
    }
    CollaborationSession ||--|| Document : ""
    CollaborationSession ||--|| User : ""
```

## Relationships

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