Giter Site home page Giter Site logo

Comments (7)

nozzlegear avatar nozzlegear commented on May 8, 2024

Thanks for filing this issue! As we discussed, Shopify has changed the enums it uses for fulfillment statuses. We'll need to add the four new values and mark the old ones as obsolete to be removed in ShopifySharp 3.0.

We just moved into our new house this week, and I still don't have my dev machine set up yet. I'll get this fixed as soon as I do -- hopefully later today, but possibly not until tomorrow or Tuesday.

from shopifysharp.

ZubyH avatar ZubyH commented on May 8, 2024

Not a problem, I'm working around this at the moment while I'm running through testing/finalization of my app. Thought I'd raise the issue here in case other users are seeing the same thing.

Thanks!

from shopifysharp.

nozzlegear avatar nozzlegear commented on May 8, 2024

Just leaving some notes while I work through these changes.

  • There are now three versions of a FulfillmentStatus:
    1. On ShopifyOrder.FulfillmentStatus and ShopifyLineItem.FulfillmentStatus; values are still fulfilled, none and partial.
    2. When filtering the .ListAsync result; values are now shipped, partial, unshipped and any.
    3. On ShopifyFulfillment.Status; values are now pending, open, success, cancelled, error and failure.
  • ShopifyOrderStatus enum itself hasn't changed and is still used.

I'm guessing ShopifyOrder.FulfillmentStatus and ShopifyLineItem.FulfillmentStatus values have actually changed to the new shipped, partial, unshipped and any, but they just didn't update the docs.

from shopifysharp.

nozzlegear avatar nozzlegear commented on May 8, 2024

Currently considering a quick 3.0 release (and bump the other 3.0 issues to 4.0) to switch these to strings rather than hardcoded enums, and would then carefully consider removing the other enums in 4.0. Enums are more much convenient than researching the docs to determine which string needs to be used, but they quickly become a hassle and break apps when Shopify makes an unannounced change like this.

If switched to strings, the developer could at least fix their app on their own without waiting for a new ShopifySharp release. Enums would be much better suited to this if Shopify had API versioning a la Stripe, but sadly they don't.

from shopifysharp.

ZubyH avatar ZubyH commented on May 8, 2024

Definitely like the idea, especially if my app hit production and this occurred - would save me being dependant on another person making a fix.

Stupid question, given that I'm not sure how you'd implement this fix, If I'm using the Nuget library instead of the actual source code as a project in my app, would I have the same freedom to amend the strings?

from shopifysharp.

nozzlegear avatar nozzlegear commented on May 8, 2024

Yep, the strings would be coming from your own code rather than living inside this library. Right now the ShopifyOrderFilter looks something like this:

public class ShopifyOrderFilter : BaseFilter
{
  ...
  public ShopifyFulfillmentStatus FulfillmentStatus { get; set; }
  ...
}

And it gets used like this:

var filter = new ShopifyOrderFilter()
{
  FulfillmentStatus = ShopifyFulfillmentStatus.Fulfilled
}

As it is right now, you don't have any way to fix that FulfillmentStatus when the expected values are changed (unless you're using the source code), because they're hardcoded in the lib. It wants that enum rather than the raw string that gets sent to the Shopify API behind the scenes.

If I switched it to strings, the class would look like this instead:

public class ShopifyOrderFilter : BaseFilter
{
  ...
  public string FulfillmentStatus { get; set; }
  ...
}

And it would be used like this in your app:

...

var filter = new ShopifyOrderFilter()
{
  FulfillmentStatus = "Whatever string you want"
}

Since that string is coming from your own app, you'd be able to quickly update it and change the string rather than wait for a new ShopifySharp release.

from shopifysharp.

ZubyH avatar ZubyH commented on May 8, 2024

Ah! Yes that would work well. I may just extend the ShopifyOrderFilter and add my own enums, at least they're in my control that way and I can amend them faster than a ShopifySharp release.

from shopifysharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.