Domain Model
Invoice
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 |
| customerId | string | Yes | — | ID of the associated customer |
| invoiceNumber | string | Yes | — | Invoice number |
| workOrderId | string | No | — | ID of the associated work order |
| projectId | string | No | — | ID of the associated project |
| maintenancePlanId | string | No | — | ID of the associated maintenance plan |
| quoteId | string | No | — | ID of the associated quote |
| projectMilestoneId | string | No | — | ID of the associated project milestone |
| monitoringAccountId | string | No | — | ID of the associated monitoring account |
| status | enum(draft, pending_approval, approved, sent, partially_paid, paid, overdue, void, canceled) | Yes | — | Status |
| issueDate | string.date-time | No | — | Issue date |
| dueDate | string.date-time | No | — | Due date |
| subtotal | unknown | No | — | Subtotal |
| taxAmount | unknown | No | — | Tax amount |
| totalAmount | unknown | No | — | Total amount |
| amountPaid | unknown | No | — | Amount paid |
| stripeCustomerId | string | No | — | ID of the associated stripe customer |
| contactId | string | No | — | ID of the associated contact |
| sentAt | unknown | No | — | Sent at |
| viewedAt | unknown | No | — | Viewed at |
| pdfS3Key | unknown | No | — | Pdf s3key |
| personalMessage | unknown | No | — | Personal message |
| stripePaymentIntentId | unknown | No | — | ID of the associated stripe payment intent |
| stripeCheckoutSessionId | unknown | No | — | ID of the associated stripe checkout session |
| paymentUrl | unknown | No | — | Payment url |
| 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 |
|---|---|---|---|---|
| customerId | string | Yes | — | ID of the associated customer |
| invoiceNumber | string | Yes | — | Invoice number |
| workOrderId | string | No | — | ID of the associated work order |
| projectId | string | No | — | ID of the associated project |
| maintenancePlanId | string | No | — | ID of the associated maintenance plan |
| quoteId | string | No | — | ID of the associated quote |
| projectMilestoneId | string | No | — | ID of the associated project milestone |
| monitoringAccountId | string | No | — | ID of the associated monitoring account |
| status | enum(draft, pending_approval, approved, sent, partially_paid, paid, overdue, void, canceled) | Yes | "draft" | Status |
| issueDate | string.date-time | No | — | Issue date |
| dueDate | string.date-time | No | — | Due date |
| subtotal | unknown | No | — | Subtotal |
| taxAmount | unknown | No | — | Tax amount |
| totalAmount | unknown | No | — | Total amount |
| amountPaid | unknown | No | — | Amount paid |
| stripeCustomerId | string | No | — | ID of the associated stripe customer |
| contactId | string | No | — | ID of the associated contact |
| sentAt | unknown | No | — | Sent at |
| viewedAt | unknown | No | — | Viewed at |
| pdfS3Key | unknown | No | — | Pdf s3key |
| personalMessage | unknown | No | — | Personal message |
| stripePaymentIntentId | unknown | No | — | ID of the associated stripe payment intent |
| stripeCheckoutSessionId | unknown | No | — | ID of the associated stripe checkout session |
| paymentUrl | unknown | No | — | Payment url |
| 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 |
|---|---|---|---|---|
| customerId | string | No | — | ID of the associated customer |
| workOrderId | string | No | — | ID of the associated work order |
| projectId | string | No | — | ID of the associated project |
| maintenancePlanId | string | No | — | ID of the associated maintenance plan |
| quoteId | string | No | — | ID of the associated quote |
| projectMilestoneId | string | No | — | ID of the associated project milestone |
| monitoringAccountId | string | No | — | ID of the associated monitoring account |
| status | enum(draft, pending_approval, approved, sent, partially_paid, paid, overdue, void, canceled) | No | "draft" | Status |
| issueDate | string.date-time | No | — | Issue date |
| dueDate | string.date-time | No | — | Due date |
| subtotal | unknown | No | — | Subtotal |
| taxAmount | unknown | No | — | Tax amount |
| totalAmount | unknown | No | — | Total amount |
| amountPaid | unknown | No | — | Amount paid |
| stripeCustomerId | string | No | — | ID of the associated stripe customer |
| contactId | string | No | — | ID of the associated contact |
| sentAt | unknown | No | — | Sent at |
| viewedAt | unknown | No | — | Viewed at |
| pdfS3Key | unknown | No | — | Pdf s3key |
| personalMessage | unknown | No | — | Personal message |
| stripePaymentIntentId | unknown | No | — | ID of the associated stripe payment intent |
| stripeCheckoutSessionId | unknown | No | — | ID of the associated stripe checkout session |
| paymentUrl | unknown | No | — | Payment url |
| notes | string | No | — | Notes |