Data Definition Document: Finance AP/AR
Domain: Finance (Ledger, Budget, AP, AR)
Logical Sub-Domain: AP/AR (Cash Flow)
Physical Packages: @sd/mod-finance/payables, @sd/mod-finance/receivables
Related Documents: Process Blueprint
Context: This document defines the Data Structures for Bills and Invoices.
Source: packages/modules/finance/src/{payables,receivables}/schema.ts
0. Entity Relationship Diagram (ERD)
erDiagram
VENDOR ||--o{ BILL : "issues"
PURCHASE_ORDER ||--o{ BILL : "becomes"
BILL ||--o{ BILL_PAYMENT : "settled_by"
OWNER ||--o{ INVOICE : "receives"
ASSESSMENT_ENTRY ||--o{ INVOICE : "becomes"
INVOICE ||--o{ PAYMENT : "settled_by"
BILL {
string id PK
float amount
date dueDate
enum status "draft, paid"
}
INVOICE {
string id PK
float totalAmount
float paidAmount
enum status "sent, paid, overdue"
}
1. Primary Entities
Entity: Bill (Accounts Payable)
Money the HOA owes to Vendors.
| Field | Type | Required | Description |
|---|---|---|---|
vendorId |
string |
Yes | Supplier. |
amount |
number |
Yes | Total Due. |
status |
string |
Yes | draft, approved, paid. |
lineItems |
object[] |
Yes | Expense breakdown. |
Entity: Invoice (Accounts Receivable)
Money Owners owe to the HOA.
| Field | Type | Required | Description |
|---|---|---|---|
recipientId |
string |
Yes | Owner (Payer). |
totalAmount |
number |
Yes | Total Due. |
paidAmount |
number |
Yes | Partial Payment Track. |
status |
string |
Yes | sent, paid, overdue. |
Entity: Payment
Cash Transfer.
| Field | Type | Required | Description |
|---|---|---|---|
amount |
number |
Yes | Value. |
method |
string |
Yes | check, transfer. |
reference |
string |
No | Check #. |
4. Changelog
| Date | Author | Description | Reference |
|---|---|---|---|
| 2026-01-24 | Antigravity | Initial creation | Implementation Plan |