# DocumentTemplate

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

## Fields

| Field | Type | Required | Key |
|---|---|---|---|
| `id` | `String` | ✓ | PK |
| `name` | `String` | ✓ |  |
| `description` | `String` | - |  |
| `category` | `TemplateCategory` | ✓ |  |
| `content` | `String` | ✓ |  |
| `thumbnail` | `String` | - |  |
| `metadata` | `Json` | - |  |
| `defaultType` | `DocumentType` | ✓ |  |
| `defaultAudienceIds` | `String[]` | ✓ |  |
| `isPublic` | `Boolean` | ✓ |  |
| `organizationId` | `String` | - |  |
| `useCount` | `Int` | ✓ |  |
| `createdAt` | `DateTime` | ✓ |  |
| `updatedAt` | `DateTime` | ✓ |  |
| `createdById` | `String` | ✓ |  |

## Diagram

```mermaid
erDiagram
    DocumentTemplate {
        id String [PK]
        name String
        description String?
        category TemplateCategory
        content String
        thumbnail String?
        metadata Json?
        defaultType DocumentType
        defaultAudienceIds String[]
        isPublic Boolean
        organizationId String?
        useCount Int
        createdAt DateTime
        updatedAt DateTime
        createdById String
    }
    DocumentTemplate ||--|| User : ""
    DocumentTemplate ||--|| Organization : ""
```

## Relationships

- HAS_ONE → `User`
- HAS_ONE → `Organization`
