Skip to content

Commit

Permalink
Update direct export URLs (#584)
Browse files Browse the repository at this point in the history
* Update direct export URLs

* Fix tests
  • Loading branch information
ruuushhh authored Jun 11, 2024
1 parent e36cda6 commit e804566
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions apps/fyle/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

def __get_redirection_url(workspace_id: str, state: str) -> str:
map = {
'IN_PROGRESS': '{}/workspaces/{}/dashboard',
'ERROR': '{}/workspaces/{}/expense_groups?page_number=0&page_size=10&state=FAILED',
'SKIPPED': '{}/workspaces/{}/expense_groups?page_number=0&page_size=10&state=SKIP',
'DELETED': '{}/workspaces/{}/dashboard'
'IN_PROGRESS': '{}/main/dashboard',
'ERROR': '{}/main/dashboard',
'SKIPPED': '{}/main/export_log',
'DELETED': '{}/main/dashboard'
}
if settings.BRAND_ID == 'fyle':
return map[state].format(settings.NETSUITE_INTEGRATION_APP_URL, workspace_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ begin;

update expenses set accounting_export_summary = jsonb_build_object(
'id', expense_id,
'url', CONCAT('https://netsuite.fyleapps.com/workspaces/', workspace_id, '/expense_groups?page_number=0&page_size=10&state=SKIP'),
'url', CONCAT('https://app.fylehq.com/app/settings/#/integrations/native_apps?integrationIframeTarget=integrations/netsuite/main/export_log'),
'state', 'SKIPPED',
'synced', false,
'error_type', null
Expand Down
6 changes: 3 additions & 3 deletions tests/test_fyle/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_update_expenses_in_progress(db):
for expense in expenses:
assert expense.accounting_export_summary['synced'] == False
assert expense.accounting_export_summary['state'] == 'IN_PROGRESS'
assert expense.accounting_export_summary['url'] == '{}/workspaces/{}/dashboard'.format(settings.NETSUITE_INTEGRATION_APP_URL, expense.workspace_id)
assert expense.accounting_export_summary['url'] == '{}/main/dashboard'.format(settings.NETSUITE_INTEGRATION_APP_URL)
assert expense.accounting_export_summary['error_type'] == None
assert expense.accounting_export_summary['id'] == expense.expense_id

Expand All @@ -42,7 +42,7 @@ def test_update_failed_expenses(db):
assert expense.accounting_export_summary['synced'] == False
assert expense.accounting_export_summary['state'] == 'ERROR'
assert expense.accounting_export_summary['error_type'] == 'MAPPING'
assert expense.accounting_export_summary['url'] == '{}/workspaces/{}/expense_groups?page_number=0&page_size=10&state=FAILED'.format(settings.NETSUITE_INTEGRATION_APP_URL, expense.workspace_id)
assert expense.accounting_export_summary['url'] == '{}/main/dashboard'.format(settings.NETSUITE_INTEGRATION_APP_URL)
assert expense.accounting_export_summary['id'] == expense.expense_id

def test_update_complete_expenses(db):
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_handle_post_accounting_export_summary_exception(db):
assert expense.accounting_export_summary['synced'] == True
assert expense.accounting_export_summary['state'] == 'DELETED'
assert expense.accounting_export_summary['error_type'] == None
assert expense.accounting_export_summary['url'] == '{}/workspaces/{}/dashboard'.format(settings.NETSUITE_INTEGRATION_APP_URL, expense.workspace_id)
assert expense.accounting_export_summary['url'] == '{}/main/dashboard'.format(settings.NETSUITE_INTEGRATION_APP_URL)
assert expense.accounting_export_summary['id'] == expense_id


Expand Down

0 comments on commit e804566

Please sign in to comment.