-
Notifications
You must be signed in to change notification settings - Fork 7
removed depreciation from consignment apis #36
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
Open
chronos25
wants to merge
8
commits into
fixes/ritik/addedDeleteFieldForProductType
Choose a base branch
from
fix/ritik/depreciation/consignmentApi
base: fixes/ritik/addedDeleteFieldForProductType
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0ff3978
removed depreciation from consignment apis
ritikatsp b6231e9
handle the new response
ritikatsp 21ed534
replaced optional condition & const with var
ritikatsp 5ceb36e
handle reponse and updated consignment_product endpoint
ritikatsp 595411a
added catch block
ritikatsp c8e78d5
fix delete consignment api
ritikatsp 6bf25b9
Replace size with length.
surajmandal04 553d737
Added product update api changes
surajmandal04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -198,7 +198,7 @@ var fetchStockOrdersForSuppliers = function(args, connectionInfo, retryCounter) | |
| log.debug('retry # ' + retryCounter); | ||
| } | ||
|
|
||
| var path = '/api/consignment'; | ||
| var path = '/api/2.0/consignments'; | ||
| var vendUrl = 'https://' + connectionInfo.domainPrefix + '.vendhq.com' + path; | ||
| var authString = 'Bearer ' + connectionInfo.accessToken; | ||
| log.debug('GET ' + vendUrl); | ||
|
|
@@ -215,8 +215,9 @@ var fetchStockOrdersForSuppliers = function(args, connectionInfo, retryCounter) | |
| page_size: args.pageSize.value // eslint-disable-line camelcase | ||
| } | ||
| }; | ||
|
|
||
| return utils.sendRequest(options, args, connectionInfo, fetchStockOrdersForSuppliers, retryCounter); | ||
| const getOrdersFromSuppliers = utils.sendRequest(options, args, connectionInfo, fetchStockOrdersForSuppliers, retryCounter); | ||
| const result = getOrdersFromSuppliers?.data ? getOrdersFromSuppliers?.data : getOrdersFromSuppliers; | ||
| return result; | ||
| }; | ||
|
|
||
| // TODO: need to add a test | ||
|
|
@@ -251,7 +252,7 @@ var fetchConsignment = function(args, connectionInfo, retryCounter) { | |
| log.debug('retry # ' + retryCounter); | ||
| } | ||
|
|
||
| var path = '/api/1.0/consignment/' + args.apiId.value; | ||
| var path = '/api/2.0/consignments/' + args.apiId.value; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. have you considered creating a new path instead of replacing the existing ones?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No |
||
| var vendUrl = 'https://' + connectionInfo.domainPrefix + '.vendhq.com' + path; | ||
| log.debug('Requesting vend consignment ' + vendUrl); | ||
| var authString = 'Bearer ' + connectionInfo.accessToken; | ||
|
|
@@ -264,8 +265,9 @@ var fetchConsignment = function(args, connectionInfo, retryCounter) { | |
| 'Accept': 'application/json' | ||
| } | ||
| }; | ||
|
|
||
| return utils.sendRequest(options, args, connectionInfo, fetchConsignment, retryCounter); | ||
| const getConsignment = utils.sendRequest(options, args, connectionInfo, fetchConsignment, retryCounter); | ||
| const result = getConsignment?.data ? getConsignment?.data : getConsignment; | ||
| return result; | ||
| }; | ||
|
|
||
| // TODO: need to add a test | ||
|
|
@@ -513,7 +515,7 @@ var createStockOrder = function(args, connectionInfo, retryCounter) { | |
| log.debug('retry # ' + retryCounter); | ||
| } | ||
|
|
||
| var path = '/api/consignment'; | ||
| var path = '/api/2.0/consignment'; | ||
| var vendUrl = 'https://' + connectionInfo.domainPrefix + '.vendhq.com' + path; | ||
| var authString = 'Bearer ' + connectionInfo.accessToken; | ||
|
|
||
|
|
@@ -588,7 +590,7 @@ var markStockOrderAsSent = function(args, connectionInfo, retryCounter) { | |
| log.debug('retry # ' + retryCounter); | ||
| } | ||
|
|
||
| var path = '/api/consignment/' + args.apiId.value; | ||
| var path = '/api/2.0/consignments/' + args.apiId.value; | ||
| var vendUrl = 'https://' + connectionInfo.domainPrefix + '.vendhq.com' + path; | ||
| var authString = 'Bearer ' + connectionInfo.accessToken; | ||
| var body = args.body.value; | ||
|
|
@@ -606,8 +608,9 @@ var markStockOrderAsSent = function(args, connectionInfo, retryCounter) { | |
| }; | ||
| log.debug(options.method + ' ' + options.url); | ||
| log.debug( { message: 'body', body: options.json } ); | ||
|
|
||
| return utils.sendRequest(options, args, connectionInfo, markStockOrderAsSent, retryCounter); | ||
| const updateConsignmentToSent = utils.sendRequest(options, args, connectionInfo, markStockOrderAsSent, retryCounter); | ||
| const result = updateConsignmentToSent?.data ? updateConsignmentToSent?.data : updateConsignmentToSent; | ||
| return result; | ||
| }; | ||
|
|
||
| var markStockOrderAsReceived = function(args, connectionInfo, retryCounter) { | ||
|
|
@@ -623,7 +626,7 @@ var markStockOrderAsReceived = function(args, connectionInfo, retryCounter) { | |
| log.debug('retry # ' + retryCounter); | ||
| } | ||
|
|
||
| var path = '/api/consignment/' + args.apiId.value; | ||
| var path = '/api/2.0/consignments/' + args.apiId.value; | ||
| var vendUrl = 'https://' + connectionInfo.domainPrefix + '.vendhq.com' + path; | ||
| var authString = 'Bearer ' + connectionInfo.accessToken; | ||
| var body = args.body.value; | ||
|
|
@@ -642,7 +645,9 @@ var markStockOrderAsReceived = function(args, connectionInfo, retryCounter) { | |
| log.debug(options.method + ' ' + options.url); | ||
| log.debug( { message: 'body', body: options.json } ); | ||
|
|
||
| return utils.sendRequest(options, args, connectionInfo, markStockOrderAsReceived, retryCounter); | ||
| const updateConsignmentToReceived = utils.sendRequest(options, args, connectionInfo, markStockOrderAsReceived, retryCounter); | ||
| const result = updateConsignmentToReceived?.data ? updateConsignmentToReceived?.data : updateConsignmentToReceived; | ||
| return result; | ||
| }; | ||
|
|
||
| var deleteStockOrder = function(args, connectionInfo, retryCounter) { | ||
|
|
@@ -659,7 +664,7 @@ var deleteStockOrder = function(args, connectionInfo, retryCounter) { | |
| } | ||
|
|
||
| log.debug(args.apiId.value); | ||
| var path = '/api/consignment/' + args.apiId.value; | ||
| var path = '/api/2.0/consignments/' + args.apiId.value; | ||
| log.debug(path); | ||
| var vendUrl = 'https://' + connectionInfo.domainPrefix + '.vendhq.com' + path; | ||
| var authString = 'Bearer ' + connectionInfo.accessToken; | ||
|
|
@@ -675,7 +680,9 @@ var deleteStockOrder = function(args, connectionInfo, retryCounter) { | |
| }; | ||
| log.debug(options.method + ' ' + options.url); | ||
|
|
||
| return utils.sendRequest(options, args, connectionInfo, deleteStockOrder, retryCounter); | ||
| const consignmentDelete = utils.sendRequest(options, args, connectionInfo, deleteStockOrder, retryCounter); | ||
| const result = consignmentDelete?.data ? consignmentDelete?.data : consignmentDelete; | ||
| return result; | ||
| }; | ||
|
|
||
| var deleteConsignmentProduct = function(args, connectionInfo, retryCounter) { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
getOrdersFromSuppliers?.data || getOrdersFromSuppliers