Skip to content

Commit

Permalink
support for get accounting export lineitems (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sravanksk authored May 26, 2022
1 parent 1825680 commit 6e72286
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
12 changes: 12 additions & 0 deletions fyle/platform/apis/v1beta/admin/accounting_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ def bulk_create_accounting_export_lineitems(self, payload):
api_url=AccountingExports.BULK_CREATE_ACCOUNTING_EXPORT_LINEITEMS,
payload=payload
)

def get_accounting_export_lineitems(self, query_params):
return self.api.make_get_request(
api_url=AccountingExports.ACCOUNTING_EXPORT_LINEITEMS,
query_params=query_params
)

def get_accounting_exports(self, query_params):
return self.api.make_get_request(
api_url=AccountingExports.ACCOUNTING_EXPORTS,
query_params=query_params
)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='fyle',
version='v0.26.0',
version='v0.27.0',
author='Siva Narayanan',
author_email='[email protected]',
description='Python SDK for accessing Fyle Platform APIs',
Expand Down
16 changes: 16 additions & 0 deletions test/integration/admin/fixtures/mock_admin_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@
"org_id": "orwruogwnngg"
}
],
"get_accounting_export": [
{
"client_id":"None",
"created_at":"2022-04-27T09:18:14.174532+00:00",
"description":"Win the trophy",
"exported_at":"2020-06-01T13:14:54.804000+00:00",
"file_ids":[
"fiFqjxHuSwX5"
],
"id":"aeCtoS8IircK",
"name":"Accounting exports tests",
"org_id":"or79Cob97KSh",
"updated_at":"2022-04-27T09:18:14.174532+00:00",
"url":"None"
}
],
"accounting_export_lineitems": [
{
"id": "sdfd2391",
Expand Down
16 changes: 16 additions & 0 deletions test/integration/admin/test_admin_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ def test_list_all_accounting_exports_lineitems(fyle, mock_data):
assert dict_compare_keys(mock_accounting_export_lineitemss[0], accounting_export_lineitems[0]) == [], 'mock_data.accounting_export_lineitems.get() has stuff that fyle doesnt'


def test_get_accounting_exports(fyle, mock_data):
query_params = {
'order': 'created_at.desc',
'id': 'eq.aeCtoS8IircK'
}
accounting_exports = connection.v1beta.admin.accounting_exports.get_accounting_exports(
query_params=query_params
)
mock_accounting_export = mock_data.get_accounting_export.get()
if accounting_exports["data"]:
global account_export_id
account_export_id = accounting_exports["data"][0]["id"]
assert dict_compare_keys(accounting_exports["data"][0], mock_accounting_export[0]) == [], 'response from fyle.v1beta.admin.accounting_export.get_accounting_exports() has stuff that mock_data doesnt'
assert dict_compare_keys(mock_accounting_export[0], accounting_exports["data"][0]) == [], 'mock_data.get_accounting_exports.get() has stuff that fyle doesnt'


def test_create_accounting_exports(fyle, mock_data):
create_accounting_exports = fyle.v1beta.admin.accounting_exports.create_accounting_exports(payload={
"data": {
Expand Down

0 comments on commit 6e72286

Please sign in to comment.