Closed nitsujri closed 1 year ago
What you are asking seems more related to business logic than to modeling.
Do you intend to have each organization run off its own database?
Over-engineering can be bad for the design and development of systems.
I believe it would be sufficient to write tests that ensure that transactions do not cross over into other organizations even though that in my view is already a form of over-engineering.
A simple thing you can do is to attach an account to an organization see below.
class Company(models.Model)
organisation = models.ForeignKey('Organisation' ...)
(type)_account = models.One2OneField(HordakAccount...) # where type could be asset, liability...
@darahsten oh this is extremely helpful! I had this weird assumption that I should have an arbitrary number of accounts but clearly there should be a set number of root accounts and specific objects point to sub accounts.
like if a company has multiple bank accounts?
i am new to all this so it was super helpful. I think this is enough for me to move forward!
Yes, absolutely, you can have multiple accounts attached to a single root account. Glad, this was helpful.
Thanks for this great library! Apologies if issues is not the right place to ask this question. It's got everything we're evaluating for, multi-currency, strong tests.
For us, we need multi-tenancy and was hoping for some guidance. In our setup we have multiple
Organization
s and each org can have multipleCompany
s that are isolated groups.Each org and company should have its own ledger. Money flows only between a company and its parent org. So not between companies and not between orgs.
What would be the recommended way of extending the current library to achieve this?
Would it be:
Account
and adding a foreign key columnTransaction
check the "organization"Thanks! Justin