-
Notifications
You must be signed in to change notification settings - Fork 3
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
added field export_url in expense group and util to generate URL #457
Conversation
|
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## employee_in_expense_new #457 +/- ##
===========================================================
- Coverage 95.09% 95.04% -0.05%
===========================================================
Files 49 49
Lines 4665 4679 +14
===========================================================
+ Hits 4436 4447 +11
- Misses 229 232 +3
|
scripts/python/update-export-url.py
Outdated
url = generate_netsuite_export_url(response_logs=expense_group.response_logs, ns_account_id=netsuite_cred.ns_account_id) | ||
expense_group.export_url = url | ||
expense_group.save() | ||
print('Export URl updated for expense group id {}'.format(expense_group.id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove loggers
scripts/python/update-export-url.py
Outdated
expense_group.save() | ||
print('Export URl updated for expense group id {}'.format(expense_group.id)) | ||
except Exception as exception: | ||
print('Something went wrong during updating export_url for workspace_id {}'.format(expense_group.workspace_id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add valid exceptions here
apps/netsuite/tasks.py
Outdated
@@ -71,6 +72,13 @@ | |||
} | |||
|
|||
|
|||
def add_export_url(response_logs, ns_account_id, expense_group): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generate_export_url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, remove this whole func, call generate_netsuite_export_url directly
apps/netsuite/tasks.py
Outdated
def add_export_url(response_logs, ns_account_id, expense_group): | ||
try: | ||
url = generate_netsuite_export_url(response_logs, ns_account_id) | ||
expense_group.export_url = url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return url from this func and assign value there
fyle_netsuite_api/utils.py
Outdated
@@ -23,3 +23,22 @@ def filter_queryset(self, queryset): | |||
filter_kwargs = {self.lookup_field: lookup_value} | |||
queryset = queryset.filter(**filter_kwargs) | |||
return super().filter_queryset(queryset) | |||
|
|||
|
|||
export_type_redirection = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declare const at top, all caps variable.
scripts/python/update-export-url.py
Outdated
|
||
expense_groups = ExpenseGroup.objects.all() | ||
|
||
for expense_group in expense_groups: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's iterate through workspaces (prod only - exclude workspaces that has name like test / fyle / sandbox). Iterate through workspace and filter expense groups that has response logs != null and do it in batches. https://github.com/fylein/fyle-integration-scripts/blob/master/qbo/batched-fill.py check this out on how to do it in batches
|
|
fyle_netsuite_api/utils.py
Outdated
url = f'https://{ns_account_id}.app.netsuite.com/app/accounting/transactions/${redirection}.nl?id={internal_id}' | ||
return url | ||
except Exception as exception: | ||
logger.info({'error': exception}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.exception
scripts/python/update-export-url.py
Outdated
from fyle_netsuite_api.utils import generate_netsuite_export_url | ||
|
||
|
||
folder_created_workspace_ids = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
scripts/python/update-export-url.py
Outdated
|
||
prod_workspaces = Workspace.objects.exclude( | ||
name__iregex=r'(fyle|test)', | ||
id__in=folder_created_workspace_ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
|
* added more fields in expense serializer * Sync import API (#459) * added expense group sync API * minor changes * added url for expense group sync view
|
36dd0f9
into
employee_in_expense_new
* employee email added to expense group * added field export_url in expense group and util to generate URL (#457) * add employee name in expense and script to populate data * test fixture changes * added field export_url in expense group and util to generate URL * updated test and fixtures * changed scripts to batch update export url * bug fix * comment resolved * added more fields in expense serializer for redirection (#458) * added more fields in expense serializer * Sync import API (#459) * added expense group sync API * minor changes * added url for expense group sync view * remove redundant script
…PI (#454) * exportable expense API and date range filter for expense group view API * test added * filter for date range * comment resolved * comment resolved * employee email added to expense group (#463) * employee email added to expense group * added field export_url in expense group and util to generate URL (#457) * add employee name in expense and script to populate data * test fixture changes * added field export_url in expense group and util to generate URL * updated test and fixtures * changed scripts to batch update export url * bug fix * comment resolved * added more fields in expense serializer for redirection (#458) * added more fields in expense serializer * Sync import API (#459) * added expense group sync API * minor changes * added url for expense group sync view * remove redundant script * added upload_attachments and update exports
No description provided.