Domain Model
Payment
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string.uuid | Yes | — | Id |
| createdAt | string.date-time | Yes | — | Created at |
| updatedAt | string.date-time | Yes | — | Updated at |
| invoiceId | string | Yes | — | ID of the associated invoice |
| amount | number | Yes | — | Amount |
| paymentMethod | enum(stripe, check, ach, wire, cash, other) | Yes | — | Payment method |
| currency | string | Yes | — | Currency |
| status | enum(pending, processing, completed, failed, refunded) | Yes | — | Status |
| stripePaymentIntentId | string | No | — | ID of the associated stripe payment intent |
| stripeChargeId | string | No | — | ID of the associated stripe charge |
| reference | string | No | — | Reference |
| paidAt | string.date-time | No | — | Paid at |
| notes | string | No | — | Notes |
| workspaceId | string | Yes | — | ID of the associated workspace |
| visibilityMode | enum(global, workspace_local, shared) | Yes | — | Visibility mode |
Create Schema
Fields accepted when creating a new record:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| invoiceId | string | Yes | — | ID of the associated invoice |
| amount | number | Yes | — | Amount |
| paymentMethod | enum(stripe, check, ach, wire, cash, other) | Yes | — | Payment method |
| currency | string | Yes | "USD" | Currency |
| status | enum(pending, processing, completed, failed, refunded) | Yes | "pending" | Status |
| stripePaymentIntentId | string | No | — | ID of the associated stripe payment intent |
| stripeChargeId | string | No | — | ID of the associated stripe charge |
| reference | string | No | — | Reference |
| paidAt | string.date-time | No | — | Paid at |
| notes | string | No | — | Notes |
| workspaceId | string | No | — | ID of the associated workspace |
| visibilityMode | enum(global, workspace_local, shared) | Yes | "workspace_local" | Visibility mode |
Update Schema
All fields are optional when updating:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| amount | number | No | — | Amount |
| paymentMethod | enum(stripe, check, ach, wire, cash, other) | No | — | Payment method |
| currency | string | No | "USD" | Currency |
| status | enum(pending, processing, completed, failed, refunded) | No | "pending" | Status |
| stripePaymentIntentId | string | No | — | ID of the associated stripe payment intent |
| stripeChargeId | string | No | — | ID of the associated stripe charge |
| reference | string | No | — | Reference |
| paidAt | string.date-time | No | — | Paid at |
| notes | string | No | — | Notes |