allisonking / wacks-by-warby

etsy discord integration for a highly specific purpose
0 stars 0 forks source link

add limit 300 to new get num sales method #17

Closed jzengg closed 1 year ago

jzengg commented 1 year ago

There seems to be two bugs contributing to discord notifications reporting the wrong total number of items sold. 1) There's a default limit of 10 orders returned per request. We aren't specifying a limit when making the order search request in the new get_num_sales method so we're miscounting here. kudos to @allisonking for figuring this out by printing out the total order count and comparing with postman to discover we were only getting 20 orders per day back 2) our legacy get_num_sales method to backfill may be flawed now because I think we're over 300 orders at this point (390 total). It turns out the number of orders grows quite a bit faster than expected since every cart counts as an order even if they don't check out

So I think we can fix the problem if we go in to the server and manually fix the number of orders we have saved and then we can't rely on the legacy backfill method anymore.