Financial Entries
An Entry is the core entity in Moonlight. It records a financial operation: the movement of money between parties.
The entry model below reflects the current build. Moonlight is in active development, so a few fields are still being stabilised and a couple of statuses (notably CANCELLED) are present in the schema but not yet used by any workflow. Where this matters, the page calls it out explicitly.
Entry Structure
Each entry contains:
| Field | Description |
|---|---|
entryType | INCOME or EXPENSE |
entryStatus | Current lifecycle status |
amountCents | Amount in cents (e.g., 50000 = $500.00) |
baseCurrency | Currency code (USD, EUR, etc.) |
fromParty / toParty | Parties involved in the operation |
entryDate | Date of the financial operation |
reference | External reference number (invoice #, etc.) |
isComplete | Whether all required proofs are present |
isReconciled | Whether the entry has been verified by the accountant |
reconciledAt | Timestamp when entry was marked as reconciled |
reconciledBy | User ID of the person who reconciled the entry |
relatedEntryId | Link to related entry (refund, reimbursement) |
externalId | Stable id from the source system (e.g. neary:purchase:100); see External References |
externalSource | Name of the source system (e.g. neary) |
fxSettlementCurrency | Currency the entry is settled into (e.g. KHR for Cambodia) |
fxRate | Conversion rate baseCurrency → fxSettlementCurrency |
fxSettlementAmountCents | amountCents × fxRate, stored to avoid recomputation drift |
fxRateDate | Date of the FX rate snapshot |
fxRateSource | Source of the rate (e.g. NBC for the National Bank of Cambodia) |
The FX columns are populated whenever the ingest payload carries an
fx block; they let accountants reconcile entries against statements
issued in the local settlement currency without losing the original
USD amount.
Entry Notes
Accountants and users can attach notes to entries for tracking purposes (e.g., "verified against bank statement", "pending clarification from vendor"). Notes are stored in a separate entry_note table with author and timestamp information.
Entry Statuses
| Status | Description |
|---|---|
PENDING | Newly created, not yet sent to an external system |
UNDER_REVIEW | Pushed to an external accounting system, awaiting approval |
COMPLETED | Approved and finalized |
REJECTED | Rejected by reviewer or external accounting system |
VOIDED | Permanently annulled — via void action (duplicate, error, cancellation) or as a result of a refund |
CANCELLED status exists in the enum but is not currently used in workflows. Entries are voided instead of cancelled.
Entry Types
INCOME
Money flowing into the organization. Examples: customer payments, sales revenue.
EXPENSE
Money flowing out of the organization. Examples: vendor payments, salaries, operational costs.
Entry Relations
Entries can be linked to each other via relatedEntryId and relationType:
| Relation Type | Description |
|---|---|
REFUND | This entry is a refund for the related entry |
REIMBURSEMENT | This entry reimburses an employee for the related expense |
CORRECTION | This entry corrects the related entry |
Entry Items
Each entry can have line items (EntryItem) representing specific components:
| Item Type | Description |
|---|---|
PRODUCT | Physical goods |
SERVICE | Services rendered |
TAX | Tax charges |
DISCOUNT | Discounts applied |
Related Pages
- Documents — attach invoices, receipts, and payment proofs to entries
- Completeness — automatic verification that entries have all required documents
- Parties — the from/to participants in every entry
- Accounting Review — the accountant review workflow before sync
- Entries API — REST endpoints for managing entries