# CreditTransaction

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

## Fields

| Field | Type | Required | Key |
|---|---|---|---|
| `id` | `String` | ✓ | PK |
| `organizationId` | `String` | ✓ |  |
| `type` | `String` | ✓ |  |
| `amount` | `Int` | ✓ |  |
| `balanceBefore` | `Int` | ✓ |  |
| `balanceAfter` | `Int` | ✓ |  |
| `referenceType` | `String` | - |  |
| `referenceId` | `String` | - |  |
| `description` | `String` | - |  |
| `userId` | `String` | - |  |
| `createdAt` | `DateTime` | ✓ |  |

## Diagram

```mermaid
erDiagram
    CreditTransaction {
        id String [PK]
        organizationId String
        type String
        amount Int
        balanceBefore Int
        balanceAfter Int
        referenceType String?
        referenceId String?
        description String?
        userId String?
        createdAt DateTime
    }
```
