Record income receipts as a user receivable, not an entity asset

When a user submits income, the money is physically in *their* pocket,
not the entity's cash drawer. The original income endpoint posted DR
on a configurable payment-method asset account (Cash/Bank/Lightning),
which implicitly assumed the entity already had the funds.

Mirror the expense flow instead: DR Assets:Receivable:User-{id[:8]}
(via get_or_create_user_account), CR the revenue account. The user
now owes the entity until they hand the cash over via the existing
/settle-receivable workflow. With this, the per-user Outstanding
Balances card correctly nets expenses (entity owes user, -liability)
against income receipts (user owes entity, +receivable).

Drops payment_method_account from IncomeEntry — no longer needed.
This commit is contained in:
Padreug 2026-05-16 23:40:08 +02:00
commit 0f2a38ee7f
3 changed files with 21 additions and 23 deletions

View file

@ -128,12 +128,18 @@ class RevenueEntry(BaseModel):
class IncomeEntry(BaseModel):
"""Helper model for user-facing income/revenue submission (pending approval)"""
"""Helper model for user-facing income/revenue submission (pending approval).
The user records that they personally received money on the entity's
behalf so the postings are DR Assets:Receivable:User-{id} / CR
revenue_account. The user now owes the entity until they settle via
the existing /settle-receivable flow. Symmetric with ExpenseEntry,
which credits Liabilities:Payable:User-{id} (entity owes user).
"""
description: str
amount: Decimal # Fiat amount in the specified currency
revenue_account: str # Income/Revenue account name or ID
payment_method_account: str # Asset account receiving the funds (Cash, Bank, Lightning)
currency: str # Required: fiat currency code (EUR, USD, etc.)
reference: Optional[str] = None
entry_date: Optional[datetime] = None