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

Add a command to delete frivolous stock orders #7

Open
pulkitsinghal opened this issue Mar 4, 2015 · 4 comments
Open

Add a command to delete frivolous stock orders #7

pulkitsinghal opened this issue Mar 4, 2015 · 4 comments

Comments

@pulkitsinghal
Copy link
Contributor

Reference: https://developers.vendhq.com/documentation/api/0.x/consignments.html#post-api-consignment-product

$ vend-tools delete-stock-orders --status OPEN
1. OPEN - Order - Wed 28 Jan 2015 - 2015-01-28 21:45:34
2. OPEN - blah - 2015-02-27 23:57:06
3. OPEN - test123 - 2015-03-03 22:33:51
Which stock order should be deleted?
@pulkitsinghal
Copy link
Contributor Author

Some open questions:

  1. Is there some way to query for consignments that don't have any products attached to them? That way perhaps only those can be offered up for deletion in the presented options.
  2. Do bad things happen if we delete a consignment and do not delete associated consignment products beforehand?
  3. Is there a way to get a total count for the products attached to a consignment? Other than counting the results from: GET /api/consignment_product/?consignment_id

cc @pzurek and @jtrotsky ... please feel free to weigh-in

@pzurek
Copy link

pzurek commented Mar 4, 2015

  1. Nope but if you look at the /api/stock_movements endpoint that should help. Stock movements give you the consignment along with all the products included. This way it's easy to fine the ones without any product on them.
  2. Don't think so.
  3. No but as in point 1, stock_movements should help.

@pulkitsinghal
Copy link
Contributor Author

@pzurek - At first look, the GET /api/stock_movements endpoint looks pretty shocking. It returns all consignments and it does not accept any parameters. That's a lot of raw data to page through (download-wise) ... just to figure out if a given consignment has products attached ... no?

I'm not bashing anyone, I'm just trying to make sure I understand the API impact properly before I add this command.

@pzurek
Copy link

pzurek commented Mar 6, 2015

An absolutely fair point but I'm just suggesting workarounds. This endpoint wasn't made for this, but it probably offers the easiest way to achieve what you are trying to do.
I think it will actually accept the since parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants