GithubHelp home page GithubHelp logo

Comments (5)

DavidAJohn avatar DavidAJohn commented on July 20, 2024

Perhaps we could set a limit of one of each item per transaction, then get the current stock count, and display it as "Only x left in stock!"

from fotostoriomicroservices.

DavidAJohn avatar DavidAJohn commented on July 20, 2024

Hmm. Looking at this again, it turns out to be an interesting little task.

Much as I like those carefully-styled + and - buttons, they've got to go, as well as the hard-coded 'In Stock' text.

The interesting part is that the Store doesn't currently have access to the Inventory API via the Store Gateway. I thought the Admin Gateway might have inventory code I could 'borrow', but it doesn't do exactly what we need here - getting a stock level for a product by its Sku. Plus, I don't think the Admin Gateway should be available via the Store.

So as well as updating the Product Details page, we'll need an Inventory Service and updates to the Ocelot files in the Store Gateway.

Also, don't forget to update the Postman collection stored in the repo as well.

from fotostoriomicroservices.

DavidAJohn avatar DavidAJohn commented on July 20, 2024

Or should we get the stock level via the Products Aggregator?

So the aggregator will need access to the Inventory API as well.

This is getting complicated.

from fotostoriomicroservices.

DavidAJohn avatar DavidAJohn commented on July 20, 2024

The back end part of this process is now complete. An individual product's stock level is now returned.

Now the front end code needs to be updated in the Store Wasm project.

It's probably not a great idea to expose exactly how many of an item you have in stock though, so I may set the stock level to 5 if it's more than 5, for example - given that this is only going to be used by the product details page to give a sense of scarcity to the customer if only a few are left.

from fotostoriomicroservices.

DavidAJohn avatar DavidAJohn commented on July 20, 2024

Rather than 5 (as suggested above), I'm going to change the AggregatedProduct class so that it returns a maximum stock level of 3, even if the real value is much higher.

That allows us to largely conceal how much stock of a particular item we have, while allowing the store UI to present the scarcity level to the customer.

So if the stock level returned is 3 (even if we actually have 200) - the UI should show 'In Stock' (as now).

If the numer is 1 or 2, the UI should show 'Only x left in stock'.

from fotostoriomicroservices.

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.