square / square-nodejs-sdk

Other
89 stars 40 forks source link

Catalog MODIFIER is missing location overrides #106

Closed gdogaru closed 1 year ago

gdogaru commented 2 years ago

Describe the bug A catalog modifier can have price overrides per location. This information is present in the rest API example:

{
  "object": {
    "type": "MODIFIER",
    "id": "7B7MGIYPGF3H7J4CRPMFPHSF",
    "updated_at": "2022-10-17T19:36:44.61Z",
    "created_at": "2020-06-03T20:02:59.476Z",
    "version": 1666035404610,
    "is_deleted": false,
    "present_at_all_locations": true,
    "modifier_data": {
      "name": "Toasted",
      "price_money": {
        "amount": 0,
        "currency": "CAD"
      },
      "on_by_default": false,
      "ordinal": 1,
      "modifier_list_id": "MNV7LHUVFVTEEIAJY3QTYQPB",
      "location_overrides": [
        {
          "location_id": "LHF8MXF0DYMNB",
          "price_money": {
            "amount": 8,
            "currency": "CAD"
          }
        }
      ]
    }
  }
}

but it is not present on the javascript interface CatalogModifier

Expected behavior Add locationOverrides to CatalogModifier similar to CatalogItemVariation

To Reproduce Steps to reproduce the bug:

  1. get catalog modifier with price overrides or search catalog objects

Square SDK version For example: 22.0.0

zenmasterjobo commented 1 year ago

Hi @gdogaru ,

I have notified our SDK team and we are looking into this. Thanks for finding this and calling it out!

zenmasterjobo commented 1 year ago

Hi @gdogaru,

Just wanted to let you know that the SDK model for these have been updated to support location_overrides. SDK version 27.0.0 has this support https://github.com/square/square-nodejs-sdk/blob/1bd30b373becab255c0b08e3034d1e3e187590bf/src/models/catalogModifier.ts

Thank you very much for bringing this to our attention!