Skip to content
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

Setting Employee Mapping error, resolving and export exception decorator #445

Merged
merged 46 commits into from
Nov 27, 2023

Conversation

Ashutosh619-sudo
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented Nov 7, 2023

Tests Skipped Failures Errors Time
1 0 💤 0 ❌ 1 🔥 2.304s ⏱️

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #445 (cc17962) into master (07ecdcd) will increase coverage by 0.15%.
Report is 1 commits behind head on master.
The diff coverage is 95.67%.

❗ Current head cc17962 differs from pull request most recent head 1c66ec1. Consider uploading reports for the commit 1c66ec1 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #445      +/-   ##
==========================================
+ Coverage   94.99%   95.14%   +0.15%     
==========================================
  Files          47       49       +2     
  Lines        4574     4633      +59     
==========================================
+ Hits         4345     4408      +63     
+ Misses        229      225       -4     
Files Coverage Δ
apps/mappings/signals.py 100.00% <100.00%> (ø)
apps/netsuite/actions.py 100.00% <100.00%> (ø)
apps/netsuite/tasks.py 95.08% <100.00%> (+1.65%) ⬆️
apps/workspaces/models.py 99.06% <100.00%> (+0.14%) ⬆️
apps/workspaces/serializers.py 100.00% <100.00%> (ø)
apps/workspaces/views.py 91.24% <92.30%> (-0.07%) ⬇️
apps/mappings/tasks.py 96.07% <92.59%> (-0.19%) ⬇️
apps/netsuite/exceptions.py 92.40% <92.40%> (ø)
apps/workspaces/tasks.py 91.47% <83.33%> (-4.07%) ⬇️

Copy link

github-actions bot commented Nov 7, 2023

Tests Skipped Failures Errors Time
209 0 💤 0 ❌ 0 🔥 34.853s ⏱️

Copy link

github-actions bot commented Nov 8, 2023

Tests Skipped Failures Errors Time
211 0 💤 0 ❌ 0 🔥 33.379s ⏱️

Copy link

Tests Skipped Failures Errors Time
211 0 💤 0 ❌ 0 🔥 36.178s ⏱️

Copy link

Tests Skipped Failures Errors Time
213 0 💤 1 ❌ 0 🔥 20.718s ⏱️

Copy link

Tests Skipped Failures Errors Time
213 0 💤 0 ❌ 0 🔥 20.894s ⏱️

logger.exception('Something unexpected happened workspace_id: %s %s', task_log.workspace_id, task_log.detail)


def update_last_export_details(workspace_id):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be present in actions.py

Comment on lines 70 to 76
workspace_id=workspace_id,
task_id='PAYMENT_{}'.format(entity_object['unique_id']),
defaults={
'status': 'IN_PROGRESS',
'type': 'CREATING_VENDOR_PAYMENT'
}
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent is off

Comment on lines 87 to 98
if payment:
logger.info(
'NetSuite Credentials not found for workspace_id %s',
workspace_id
)
detail = {
'message': 'NetSuite Account not connected'
}
task_log.status = 'FAILED'
task_log.detail = detail

task_log.save()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why special treatment for payment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the payment function there is no expense_group

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also the Error Model needs expense_group

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can assign expense_group = None inside 55 line block and then in __handle_netsuite_connection_error(), check for expense_group existence and update or create things

Comment on lines 114 to 115
if not payment:
all_details[0]['expense_group_id'] = expense_group.id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this info isn't needed, can remove it off

expense_group.workspace_id
)
detail = {
'expense_group_id': expense_group.id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed, can treat payment and exports same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

* category mapping error settings and resolution

* test added

* Setting tax mapping and resolve (#447)

* Setting tax mapping and resolve

* resolved comments

* Setting and Resolving Netsuite Error (#448)

* Setting Netsuite Error

* resolving netsuite error

* setting netsuite error resolved

* comment resolved

---------

Co-authored-by: Ashutosh619-sudo <[email protected]>

---------

Co-authored-by: Ashutosh619-sudo <[email protected]>

---------

Co-authored-by: Ashutosh619-sudo <[email protected]>
Copy link

Tests Skipped Failures Errors Time
215 0 💤 0 ❌ 0 🔥 20.837s ⏱️

Copy link

Tests Skipped Failures Errors Time
215 0 💤 0 ❌ 0 🔥 21.190s ⏱️

Comment on lines 87 to 98
if payment:
logger.info(
'NetSuite Credentials not found for workspace_id %s',
workspace_id
)
detail = {
'message': 'NetSuite Account not connected'
}
task_log.status = 'FAILED'
task_log.detail = detail

task_log.save()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can assign expense_group = None inside 55 line block and then in __handle_netsuite_connection_error(), check for expense_group existence and update or create things

Copy link

Tests Skipped Failures Errors Time
215 0 💤 0 ❌ 0 🔥 20.842s ⏱️

@Ashutosh619-sudo Ashutosh619-sudo merged commit 125a594 into master Nov 27, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants