VirtoCommerce/vc-platform

CrudService: Are events and event handler mandatory?

fcu423 opened this issue · 2 comments

I am currently implementing a new service as part of a module for Virto Commerce. Following what I see in other official modules, I am inheriting the CrudService. However, I am forced to provide an implementation for two events that I don't know if I need and there are no docs about this anywhere I have searched.

I have only found:
https://virtocommerce.com/docs/fundamentals/extensibility/extending-using-events/
https://virtocommerce.com/docs/BA%20docs/Preview/Registration/#eventswebhooks

Questions:
Are these events mandatory?
Can I create the event classes even if I don't plan to have a handler for these events or is the handler also mandatory?

Any documentation/guidance you can provide will be really helpful.

Also, please clarify if this is not the right place for this type of "issues". I don't see open discussions being open here in github so I am wondering what is the right way to get info on things that are not well explained in the documentation or hard to find.

Now, Events class for Before and After Update are mandatory.

You need to create model for events using
GenericChangedEntryEvent
https://github.com/VirtoCommerce/vc-module-customer-review/blob/dev/src/VirtoCommerce.CustomerReviews.Core/Events/CustomerReviewChangeEvent.cs

I recommend to view
https://www.youtube.com/watch?v=wcFgDjk2wgA&t=172s

Also look on as Sample
https://github.com/VirtoCommerce/vc-module-customer-review

Is it resolve your issue?