Is it possible to subscribe to a creation of a model?
So I have a ticket model, and I want to execute an handler when a new model is being created, the thing is, if i subscribe to a middleware or $extend, I need to specify from where exactly i create that model, but the thing is, there are many options via nested queries to do that, e.g.:
How can I do that?
And a follow up question, whenever I create a new ticket, I also want to execute something else (push a message broker event), so if one of them fail i want to fallback the query, i.e. i need a $transaction. How can I do that?
Pseudo code of what I want:
How can I do that?
And a follow up question, whenever I create a new ticket, I also want to execute something else (push a message broker event), so if one of them fail i want to fallback the query, i.e. i need a $transaction. How can I do that?
Pseudo code of what I want: