flash-oss / medici

Double-entry accounting system for nodejs + mongoose
MIT License
308 stars 84 forks source link

Little Confusion in debit function #32

Closed Uzlopak closed 2 years ago

Uzlopak commented 2 years ago

We push the transaction into the array and later we add meta to the object

https://github.com/flash-oss/medici/blob/master/src/entry.js#L104 https://github.com/flash-oss/medici/blob/master/src/entry.js#L105

In credit we first add meta and later we push it to transactions.

Probably this is no problem, as we have an Object reference so we still manipulate the object in the array. But I think it is still a code smell.

koresar commented 2 years ago

Yeah. Totally agree. But I can see you have already fixed it in your PR! Mate, I'm impressed. Alt Text