I spent some time working for a company in this exact space. My recommendation would be to integrate a 3rd party accounting/ledger management product rather than building your own. That stuff gets messy real quick and next thing you know you're dealing with accounting more than actually improving your core value offerings.
I got pretty in-the-weeds with the accounting stuff[1], and had thought about reaching for a 3rd party ledger, like Gnucash[2] or beancount[3]. The basics are pretty simple, but I've tried to be thoughtful about the kinds of details that most companies get wrong when they're trying to do things like track balances: using floats for money, allowing transactions to be amended or deleted[4], etc. There’s two parts to this puzzle: the accounting method you employ that keeps an audit (whether it be single or double entry accounting) and the rules governing accounting events that get trigger by the system.
The latter is where real difficulty and liability lies; an event, such as a rental payment, triggers a series of transactions that must be financially sound and sufficient for meeting the expectations of an audit. There were a few other considerations but that really is the core framework. Where the real work begins is implementing the triggers, or events (like I mentioned above), that sets off a set of entries and making those financially sound. I've been able to achieve some basic rules exclusively for the self-storage space whose types of business transactions are very similar, but the truth of this can only be revealed by third party auditors. It leads me to believe that it's very difficult, if not impossible, to come up with a universal system for all businesses and industries since the events that trigger entries are specific to each system.
Happy to riff on this a little more if you're interested!