-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stock control #81
Comments
MVP ApproachThere are levels of sophistication when dealing with stock:
For now we will take the "minimum viable product" approach and implement something along the lines of the first item above. Implementationclass ProductVariant {
// ...
stockOnHand: number;
trackInventory: boolean;
} The The Additionally we need to think about how we deal with attempts to order more items than we have on hand. Some businesses will allow this and have a back-order system in place. Others will not. This should probably be configurable at the GlobalSettings level. |
StockMovementThinking about this further, I think it makes sense to implement a abstract class StockMovement {
id: ID;
createdAt: Date;
productVariantId: ID;
value: number;
}
class Adjustment extends StockMovement {
type: 'adjustment';
}
class Sale extends StockMovement {
type: 'sale';
orderLineId: ID;
}
class Cancellation extends StockMovement {
type: 'cancellation';
orderLineId: ID;
}
class Return extends StockMovement {
type: 'return';
orderItemId: ID;
} StockMovements will be created by Vendure when needed - there is no CRUD operations exposed via the API. Here are the scenarios:
These StockMovements will always be created, even if the ProductVariant is set to |
Future features:A quick note on future stock control features to implement (out of scope of this initial impl):
|
Relates to #81. No logic is implemented yet.
I wonder if there's any way to add a concept of reserved stock since these items are not fulfilled yet, but have been already ordered by one of the customers |
@joe-thong This would be possible. Currently the Feel free to create a new issue with this feature request, we'll be then able to gauge interest. |
How is the current implementation about this issue? This would be a must have for most of our customers. Would be nice to have a global config but also a config on every ProductVariant if one has some exceptions. Like no back-orders in general but for this one product I will allow it. |
@Zwergal there's been no further work on this since closing the issue, so back-orders are not yet implemented. I think the system you outlined makes sense. Please feel free to open a new feature request issue describing in detail how you think this should work and then we can put it on the roadmap for an upcoming release. |
I wrote a small plugin to get productVariant stock availability in the search query. Posting it here just in case anyone else finds the use case for it.
|
We need a way to express stock levels of ProductVariants.
Typically, there are 2 workflows we should support: managed and unmanaged.
The text was updated successfully, but these errors were encountered: