Hacker News new | ask | show | jobs
by oftenwrong 2898 days ago
I don't think I understand this. Isn't the double-entry more of an implementation detail?

Instead of...

  entries: [
    Entry(side: .debit, account: cash, amount: Decimal(42)),
    Entry(side: .credit, account: revenue, amount: Decimal(42))
  ],
...you could have:

  debitAccount: cash,
  creditAccount: revenue,
  amount: Decimal(42)
In other words, why does the client need to care about multiple entries in the call. I just want to record that X amount was sent from account Y to account Z. You can atomically record that as two entries in the back-end.
1 comments

A single transaction should not be limited to just two nominal codes. For example, an invoice/payment might be split between Hardware, Software, Haulage and Tax/Vat and the other side would be the bank account. You also don't want to see multiple entries on your bank nominal when there was only one actual payment.
Exactly :) - Each Transaction can have (arbitrary limit) 100 entries in Amatino.