-
-
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
More Events for each entity #1219
Comments
Yes I totally agree. I've so far added events on a kinda ad-hoc basis, whenever I realized I needed one, I added it. But now a more systematic approach makes sense, because there are infinite use-cases so we better just add all the events that could reasonably be needed. Do you want to have a go at making a list? |
@michaelbromley somehow like this? So at first I think we can generalize it to this: class EntityEvent<T> extends VendureEvent {
type: 'created' | 'updated' | 'deleted',
entity: T;
input?: any; //< maybe for update event it's nice to know what changed, or the create input to react on custom fields
} I also had the idea to add a Address
Administrator
Asset
Channel
Collection
Country
Customer
CustomerGroup
Facet
FacetValue
Fulfillment
GlobalSettings
HistoryEntry
Order
OrderLine
OrderItem
Payment
PaymentMethod
Product
Promotion
Refund
Role
Session ShippingLine
ShippingMethod
StockMovement
Surcharge
Tag TaxCategory
TaxRate
User
Zone
|
Yes perfect, though I don't think we need to list examples. |
I've updated the list. Maybe we can ask on slack if someone needs a special event. (We need a |
What do you think about this: class VendureEntityEvent<T> extends VendureEvent {
type: 'created' | 'updated' | 'deleted',
entity: T;
input?: any; // the mutation input used for the event
initiator?: User; // the user that initiated the entity operation
} Optional properties |
@Draykee yes this makes sense. We could deprecate the specific Rather than the |
@michaelbromley This feature is pretty urgent for my master thesis about gamification. So maybe I'll start working on this soon. One more question, shall I place every event inside the events directory? Or inside the related entity directory? |
Put any new events next to the existing ones in the "events" dir. If you want to work on this, make a PR against the |
In an EDIT: I saw that other events are using the "before" entity in the event too. I think I will go with this approach and document that. |
Are |
@michaelbromley I think I've covered most of the entity events now. I just would like to ask for assitance with the Order entity. |
Relates to #1219 * feat(core): Added Vendure entity event base class (#1219) * feat(core): Implemented CustomerAddressEvent with new entity event base class (#1219) * feat(core): Implemented AssetEvent with new entity event base class (#1219) * fix: Removed illegal import from src * feat(core): Added verified-event (#1219) * feat(core): Added multiple events (#1219) * feat(core): Added role-change and zone entity events (#1219) * chore(core): Updated documentation of new events and added todo Co-authored-by: Kevin <[email protected]>
Resolved with: #1222 |
Is your feature request related to a problem? Please describe.
I would like to know when a user get's verified. Currently there is no event for this. Having more events can be extremly helpful for analyzing activities.
Describe the solution you'd like
A event for each entity and every special activity (like coupon code usage, promotions, etc.)
Maybe we should make a list first, but implementing it should be easy.
Describe alternatives you've considered
Overwriting each resolver. But that's a hughe overhead
The text was updated successfully, but these errors were encountered: