# SourceConnector

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

## Fields

| Field | Type | Required | Key |
|---|---|---|---|
| `id` | `String` | ✓ | PK |
| `projectId` | `String` | ✓ |  |
| `organizationId` | `String` | ✓ |  |
| `type` | `ConnectorType` | ✓ |  |
| `config` | `Json` | ✓ |  |
| `cursor` | `String` | - |  |
| `enabled` | `Boolean` | ✓ |  |
| `syncIntervalMinutes` | `Int` | ✓ |  |
| `status` | `String` | ✓ |  |
| `lastError` | `String` | - |  |
| `lastSyncedAt` | `DateTime` | - |  |
| `lastItemCount` | `Int` | - |  |
| `createdById` | `String` | ✓ |  |
| `createdAt` | `DateTime` | ✓ |  |
| `updatedAt` | `DateTime` | ✓ |  |

## Diagram

```mermaid
erDiagram
    SourceConnector {
        id String [PK]
        projectId String
        organizationId String
        type ConnectorType
        config Json
        cursor String?
        enabled Boolean
        syncIntervalMinutes Int
        status String
        lastError String?
        lastSyncedAt DateTime?
        lastItemCount Int?
        createdById String
        createdAt DateTime
        updatedAt DateTime
    }
    SourceConnector ||--|| Project : ""
    SourceConnector ||--|| Organization : ""
```

## Relationships

- HAS_ONE → `Project`
- HAS_ONE → `Organization`
