flash-oss / medici

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

fix: balance query with custom transaction model #59

Closed dolcalmi closed 2 years ago

dolcalmi commented 2 years ago

Problem

Custom schema attributes are not setup correctly for balance query

Solution

Maybe not the cleaner solution but doesn't change other collections schema/behavior


Related issue: https://github.com/flash-oss/medici/issues/58

Uzlopak commented 2 years ago

I was on vacation for 3 weeks. I will have a look at it today or tomorrow.

Uzlopak commented 2 years ago

@dolcalmi

You want to work on this now? :)

dolcalmi commented 2 years ago

@dolcalmi

You want to work on this now? :)

if you have a better/cleaner approach let me know, I will be glad to help

Uzlopak commented 2 years ago

Btw. When the balance snapshotting was implemented I was not very happy about the fact that i did not quite understood the mechanics completely. So I worked the last months on the mongoose code, to get deeper understanding regarding the mongodb and mongoose. Fun Fact: I am now an official contributor of mongoose - LOL.

I will maybe, when I have time inspect the snapshotting of balances further more to ensure we have no race conditions or so.