# AuditEvent

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

## Fields

| Field | Type | Required | Key |
|---|---|---|---|
| `id` | `String` | ✓ | PK |
| `organizationId` | `String` | ✓ |  |
| `projectId` | `String` | - |  |
| `docVersionId` | `String` | - |  |
| `actorId` | `String` | ✓ |  |
| `actorEmail` | `String` | ✓ |  |
| `actorRole` | `String` | ✓ |  |
| `action` | `String` | ✓ |  |
| `entityType` | `String` | ✓ |  |
| `entityId` | `String` | ✓ |  |
| `metadata` | `Json` | - |  |
| `ipAddress` | `String` | - |  |
| `userAgent` | `String` | - |  |
| `createdAt` | `DateTime` | ✓ |  |

## Diagram

```mermaid
erDiagram
    AuditEvent {
        id String [PK]
        organizationId String
        projectId String?
        docVersionId String?
        actorId String
        actorEmail String
        actorRole String
        action String
        entityType String
        entityId String
        metadata Json?
        ipAddress String?
        userAgent String?
        createdAt DateTime
    }
    AuditEvent ||--|| Project : ""
```

## Relationships

- HAS_ONE → `Project`
