I need your help about events in Shopware6. I'd like to know how I can get the event when a credit note is created manually through the backend.
As example, I took this event : OrderEvents::ORDER_TRANSACTION_WRITTEN_EVENT which is findable in "/vendor/shopware/core/Checkout/Order/OrderEvents.php".
I tried to copy the same syntax in my documentSubscriber like this : DocumentEvents::DOCUMENT_WRITTEN_EVENT but this event is not findable in "/vendor/shopware/core/Checkout/Document/...".
So naturally, I am having this error : "Attempted to load class "DocumentEvents" from namespace "Emakers\TransmissionPlugin\Subscriber". Did you forget a "use" statement for another namespace?"
I cannot have the correct "use" statement to make this event. I have no clue on which event I can use at this moment, does someone have an idea?
as @Valerii Pravoslavnyi said and after some investigation, every entity has a written event you can find in the core. For example in my case, I used : "document.written" and it worked like a charm !