Adding ledger accounts and journal entries#16
Adding ledger accounts and journal entries#16schapman1974 wants to merge 2 commits intoamcintosh:mainfrom
Conversation
|
@amcintosh Please review this draft and let me know if this is how you would want to implement ledger_accounts and journal entries from the client.py and the additional api/business.py |
|
Hi @schapman1974! |
|
I don't think the {
"response": {
"result": {
"client": {
}
}
}But for these new endpoints the result is in the form: {
"data": {
}
}So when you add the data to the model: https://github.com/amcintosh/freshbooks-python-sdk/pull/16/files#diff-cc8690904fb746159ca8b295604ae5606beb2130b5d626243c7ba954865216a5R88 the In the cases of this new set of accounting resources, I don't think we need I think changing the def __init__(self, client_config: SimpleNamespace, accounting_path: str,
delete_via_update: bool = True, missing_endpoints: Optional[List[str]] = None):And then update https://github.com/amcintosh/freshbooks-python-sdk/pull/16/files#diff-cc8690904fb746159ca8b295604ae5606beb2130b5d626243c7ba954865216a5R88 to be: return Result("data", data)should work. Something similar would need to be done for the |
|
I think setting up some tests for the new resource set would help work out the differences. |
| @property | ||
| def journal_entries(self) -> AccountingResource: | ||
| """FreshBooks items resource with calls to get, list, create, update, delete""" | ||
| return AccountingResource(self._client_resource_config(), "journal_entries/journal_entries", "journal_entry", "journal_entries") |
There was a problem hiding this comment.
Looks like you can only create journal entries, so missing_endpoints=["list", "get", "update", "delete"] should be added.
Purpose
The PR adds ledger accounts and a business object to the api in order to support the account/businesses endpoint. The main focus of this is to add additional functionality to the sdk that is not currently exposed.