Coder Social home page Coder Social logo

Comments (2)

bitnautist avatar bitnautist commented on August 17, 2024

If I mess with func MacStudioDataFor Country(), and set the orderedSKUs list to something non-sensical, I get the same error so the problem must be with the specific SKU numbers for Mac Studio and Studio Display.

If I set the country to US and choose a US Apple Store with either the Mac Studio or Studio Display product type, Inventory Checker works fine once again. That must mean the Canadian SKU numbers are incorrect for the Mac Studio and Studio Display.

from inventory-checker-app.

bitnautist avatar bitnautist commented on August 17, 2024

Ok, looks like this problem is fixed if you use the country.altSkuCode for both the StudioDIsplay and MacStudio. So fixed code looks like this:

func StudioDisplayForCountry(_ country: Country) -> SKUData {
let skuCode = country.altSkuCode ?? country.skuCode

let orderedSkus = [
    "MK0U3\(skuCode)/A",
    "MK0Q3\(skuCode)/A",
    "MMYQ3\(skuCode)/A",
    "MMYW3\(skuCode)/A",
    "MMYV3\(skuCode)/A",
    "MMYX3\(skuCode)/A"
]

let skusToName = [
    "MK0U3\(skuCode)/A": "Studio Display - Standard glass - Tilt-adjustable stand",
    "MK0Q3\(skuCode)/A": "Studio Display - Standard glass - Tilt- and height-adjustable stand",
    "MMYQ3\(skuCode)/A": "Studio Display - Standard glass - VESA mount adapter",
    "MMYW3\(skuCode)/A": "Studio Display - Nano-texture glass - Tilt-adjustable stand",
    "MMYV3\(skuCode)/A": "Studio Display - Nano-texture glass - Tilt- and height-adjustable stand",
    "MMYX3\(skuCode)/A": "Studio Display - Nano-texture glass - VESA mount adapter"
]

return SKUData(orderedSKUs: orderedSkus, lookup: skusToName)

}

func MacStudioDataForCountry(_ country: Country) -> SKUData {
let skuCode = country.altSkuCode ?? country.skuCode

let orderedSkus = [
    "MJMV3\(skuCode)/A",
    "MJMW3\(skuCode)/A"
]

let skusToName = [
    "MJMV3\(skuCode)/A": "M1 Max (10c CPU, 24c GPU), 32GB RAM, 512GB SSD",
    "MJMW3\(skuCode)/A": "M1 Ultra (20c CPU, 48c GPU), 64GB RAM, 1TB SSD"
]

return SKUData(orderedSKUs: orderedSkus, lookup: skusToName)

}

from inventory-checker-app.

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.