So what are we going to work on next.
Well this one time we have wired up our order service that is listening to the ticket created event
and the ticket updated event.
So what our service is processing those events pretty darn well.
The order service in turn is also emitting a couple of events.
So for example the order service is publishing order created and order canceled.
We need to now make sure that the ticket service is going to have a listener is going to watch for the
order created event and the order canceled event.
The reason for this remember is we need to make sure that we lock down a ticket after an order has been
created for it.
So once a ticket has been reserved the ticket service needs to make sure that the person who owns this
ticket the person who created the ticket can not come back and start to edit it as we don't want a user
to start to go through the process of purchasing a ticket and then see the price just mysteriously change
or the description change or anything like that.
So to implement that we're going to go back over to our ticket service.
We're going to implement two different listeners whenever the ticket service sees a list or an event
of order created.
We're going to find the appropriate ticket inside the ticket service and set something on there that's
going to lock down that ticket and prevent us from making any further changes to it then whenever we
see an order canceled event which indicates that the person who's trying to buy the ticket says forget
this I don't want the ticket or maybe the order times out or whatever else or then going to make sure
that we unreserved the ticket or essentially unlock it down and allow editing of its ticket once again.
That's pretty much it.
It's pretty much an on off flag whenever we see what are created.
Lock the ticket whenever we see canceled unlock the ticket.
That's all it is.
So not the worst thing in the world.
Now we've got an idea of what we're doing was right here start to implement this in the next video.