Comments (5)
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.
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.
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.
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.
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)
- Serilog and Seq HOT 4
- Exception Middleware HOT 1
- Integration Tests using SQL Server and EF
- Use OpenIddict for identity HOT 1
- Identity API refactor in Accounts Controller
- Update to .NET 8 HOT 2
- Breaking changes in .NET 8 Docker images HOT 1
- Update all projects to .NET 6 HOT 9
- Health Checks failing & missing icons HOT 2
- Migrate gateways from Ocelot to YARP? HOT 1
- Ordering API returning 404 to admin orders page HOT 2
- Use of AutoMapper in Discount Grpc HOT 1
- Basket API and AutoMapper
- Adding an Ordering/Marketing Aggregator?
- Stripe API updates HOT 2
- Time to consider .NET 7 HOT 4
- Extending Serilog and Seq to all projects
- Marketing client application HOT 2
- Email confirmation when registering
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fotostoriomicroservices.