Well it's been just about a minute for me and I see this counselor right here that says I want to publish
the expiration complete event.
Awesome.
So definitely looks good.
We've now got the entire mechanism of receiving end event publishing a job receiving the job processing
it and then potentially we don't quite have it yet but we now need to make sure that we publish an event
of type expiration complete that's we're gonna start to work on in this video we first need to make
sure that our common module has the definition for an expiration complete type event so to get started.
Wrong screen to get started.
I'm going to go back over to my cum module and remember what we do to create a new event.
We'll find the events directory and then instead of here we're going to create a new one of these event
files.
Every event file is going to export a single interface named after the event that we're trying to create.
We also need to make sure we have a new subject that describes this event and we'll also enter in some
data that is going to be contained inside the event as well so in our case we are trying to create an
event of type expiration complete that means we'll first open up our subjects in them file I'll add
add in a new subject of exploration complete and give it a value of expiration.
Colin
after that inside the events directory I'll make a new file of expiration complete event that yes at
the very top we will import that subjects into
and then I will export an interface called expiration complete event.
This will have a subject of subject start expiration complete and a list out the data contained inside
this thing as well and as we previously discussed the only thing we really need to communicate inside
this event is the order I.D..
There's not really anything else we need to communicate to say hey something has expired.
That's all we're going to be communicate inside of here.
Just the order I.D. So for data we'll say order I.D. and this will be of type String and that's pretty
much it.
Just creating this event file is not quite enough.
However remember we do have to make sure we export it from our index to yes file inside of the common
module.
So this is where we have all of our different experts.
I'll go down to the bottom and I'll add on yet another from events expiration that complete event that
looks good.
It will now republish our common module and an update that come in module version used inside of our
expiration service will then be able to create a publisher for expiration complete back at my terminal
I will change into my expiration directory our Susan a common module first.
Got to update the thing though in the coming module we'll do an NPM run Pub.
There we go and then we can go back over to the expiration service and update the version used inside
there all right.
So now back over to expiration that's better and we'll do an NPM update or our company module
it looks like I'm on Version 1 0 2 3 we'll just make sure that after the update runs I see the same
version yep looks good.
I remember since we made a change to our package packages on file scaffold is going to want to rebuild
or technically Docker here is going to rebuild our expiration service image that's going to take a minute
or two.
So I'll take a pause right here and when we come back the next video we'll make sure that we've got
a publisher inside of our expiration service that's going to publish that event that we just created.