Repository navigation
Add update_tracking endpoint to Fulfillment - #432
Conversation
| class FulfillmentOrders(ShopifyResource): | ||
| _prefix_source = "/orders/$order_id/" | ||
|
|
||
| class FulfillmentV2(ShopifyResource): |
There was a problem hiding this comment.
I'm not sure I follow the idea of the V2 nomenclature, is there a particular reason we can't just do this in Fulfillment? If the class is absolutely necessary, we might want to consider renaming it to something that better conveys what it does.
There was a problem hiding this comment.
I don't believe we can do it in the original Fulfillment class because that class points to /orders/$order_id/fulfillment/$fulfillment_id, and the endpoint in this case is only fulfillment/$fulfillment_id. I would also prefer to do it in 1 class, but I'm not quite sure how..
The V2 nomenclature is from shopify_api (that is used by Fulfillment.rb) in a similar manner. Thought I would keep it consistent between the two libs
There was a problem hiding this comment.
All of that makes perfect sense, thanks for the context! I'm still not a fan of calling it V2 but I agree we should keep them consistent.
Not saying we should do this, but I wonder if it wouldn't be cleaner to change _prefix_source for that particular method rather than adding a whole new class for it.
There was a problem hiding this comment.
I tried manipulating _prefix_source but wasn't successful with my attempt. I do believe the convention of changing prefixes is to override the classmethod _prefix depending on passed in options, but in this case the usage is after we define a Fulfillment object already :/
Thus new class
There was a problem hiding this comment.
Nothing wrong with this approach, I was just thinking aloud there!
da3ce77 to
d837bfd
Compare
WHY are these changes introduced?
The fulfillment API has a clear method of updating tracking information that our library doesn't support.
This may help reduce issues such as #310.
WHAT is this pull request doing?
Following the footsteps of shopify_api, a new class was created in order to hit the end point
/fulfillments/$fulfillment_idChecklist