The order against a listener is looking fantastic.
Now to wrap up our ticket service just a couple more little steps.
First off we have created two listeners now.
So order canceled in order created.
But at no point time do we actually start listening or incoming events.
In other words in the actual application itself not in the test environment.
Do we ever create an instance the listener and tell it to start listening.
You might recall that back inside of our order service we wired all that stuff up and sidebar indexed
yes file.
We're going to do that here once again.
Back inside my index dot test file at the very top.
I'm going to import are two listeners.
So order reader listener from events listeners order created I will also get my order a canceled listener
from events listeners order canceled listener.
While those are really long import statements.
Now we're going to create an instance of both these and pass in the Nats wrapper client to both them
it's scroll down a little bit.
Right after all of our Nats connection stuff we will throw in a new order created listener will pass
in At NATS rapper client.
And remember just creating an instance is not enough.
We've also got on there at the listen method miss the listen function that actually tells the listener
to start listening for incoming events.
So we need to make sure we call listen.
On the very end will then repeat that for order canceled.
Listener Nats rapper or client
looks good.
All right.
There's just one last very small task we have take care of inside of our ticket service.
So we've now got this entire ability through these two listeners to somehow lock down and ticket and
then unlock it later on.
But at no point do we actually implement any logic to prevent a user from editing a ticket that is currently
locked down.
So this should be a very small and simple change inside of our router file for the update route.
We're just gonna make sure that if a ticket is locked down we're going to tell a user sorry you can't
update this thing should be pretty easy and straightforward but I would like to write a test around
it as well.
So let's take a shot at this in just a moment.