-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Responses #10
Comments
The test cases return the right response, so something else is going on. Possibly an error of some sort where nothing is returned. Can you share the currency/add request details? I'll try to reproduce in a test environment and see what's going on. |
Full disclosure: this is the latest Laravel (PHP 8.2 I suppose). I just sailed up a fresh app and pulled down Abivia. Other weird stuff going on: it created domain, ledger and currency but whilst is responds with 200 to creation of account, no record is inserted in ledger_accounts table. Also, after installing Abivia, I manually copied the routes under vendor/abivia/ledger/routes into the routes/api file (I thought publishing config would have taken care of all that). So that's what you need to do to reproduce this. |
I see the problem and have reproduced it. You need to create the ledger first (via api/ledger/root/create), so it is a case of not reporting an error correctly. Fixing that now! Thanks for the report. |
I created a domain and it created records in both ledger_domains and ledger_names. Is that a wrong way to go about it? |
That should have returned an error too. Creating the ledger sets some critical rules, mostly related to ledger accounts. Without the ledger root, not much will work. Right now it's triggering an unexpected exception and no information is being returned because there's a risk of information disclosure. However details are recorded in the audit log. I'm going to change the exception so it's handled differently. I'm also going to set it so that at the least an unexpected exception returns a message to say the request failed. I'll add a half dozen test cases to cover this too. |
To answer your question more directly, creating the ledger root is the first thing you should do before doing anything else. |
I really need to understand the model better then. Since I can have multiple "domains" each having their own ledger root, I would have thought the domain comes first. Do I have things muddled up? |
Domains share the same Chart of Accounts. Each domain is a separate partition in the Journal but they all use the same CoA. The ledger root is the (hidden) parent of all top level accounts, and embeds rules like what an account code can look like, whether or not transactions can be posted to category accounts, and so on. So the process is to create the ledger. Then you can define accounts, currencies, and domains in any order. |
Oh ok, reading here again, that's actually clearly stated. But I first read that a long time ago. So it means Abivia can't really be used to maintain accounts of multiple entities with different chart of accounts within the same Laravel application then. Correct? |
That's essentially correct. It's more designed for a single enterprise with multiple divisions/departments/etc. than a multi-tenant configuration. Possibly the best approach for a multi-tenant application would be to use separate databases. |
Very true |
Fixed in 1.9.0. |
Testing some of the APIs, I note the responses are not as described in the docs. Specifically calling domain/add and currency/add gets a reply with only "time" in the response whilst the docs show a fuller response.
Do I have a wrong config somewhere?
The text was updated successfully, but these errors were encountered: