Feature Request: Emit events for price list price changes (price.created, price.updated) #14173
milewskibogumil
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem?
Yes. I'm implementing EU Omnibus Directive compliance for a Polish B2B e-commerce store. This directive requires displaying the lowest price from the last 30 days whenever a product is on sale or has a promotional price.
To achieve this, I need to track all price changes in real-time and store them in a price history table. The problem is:
Price list price changes do not emit any events, making it impossible to track them in real-time without:
Current behavior
When prices are created/updated in a price list via
batchPriceListPricesWorkflow:price.created,price.updated, etc.)pricesCreated,pricesUpdated)product-variant.created/updated(this works!)This creates an asymmetry where regular prices can be tracked via events, but price list prices cannot.
Expected behavior
When prices in a price list are created, updated, or deleted, Medusa should emit events like:
OR expose workflow hooks:
Use cases
Workarounds attempted
/admin/price-lists/:id/prices/batchrouteproduct-variant.updatedbatchPriceListPricesWorkflowhas empty.hookspropertySuggested implementation
The simplest solution would be adding
emitEventStepto the price list workflows:Alternatively, expose hooks similar to
createProductsWorkflow.hooks.productsCreated.Environment
Additional context
The EU Omnibus Directive affects millions of e-commerce stores in Europe. Having built-in support for tracking price changes would make Medusa more attractive for EU-based businesses that need to comply with this regulation.
Beta Was this translation helpful? Give feedback.
All reactions