1 00:00:00,900 --> 00:00:05,550 Well it's been just about a minute for me and I see this counselor right here that says I want to publish 2 00:00:05,550 --> 00:00:07,580 the expiration complete event. 3 00:00:07,620 --> 00:00:08,050 Awesome. 4 00:00:08,050 --> 00:00:09,530 So definitely looks good. 5 00:00:09,570 --> 00:00:15,450 We've now got the entire mechanism of receiving end event publishing a job receiving the job processing 6 00:00:15,450 --> 00:00:21,000 it and then potentially we don't quite have it yet but we now need to make sure that we publish an event 7 00:00:21,060 --> 00:00:26,280 of type expiration complete that's we're gonna start to work on in this video we first need to make 8 00:00:26,280 --> 00:00:33,590 sure that our common module has the definition for an expiration complete type event so to get started. 9 00:00:33,650 --> 00:00:35,330 Wrong screen to get started. 10 00:00:35,330 --> 00:00:41,110 I'm going to go back over to my cum module and remember what we do to create a new event. 11 00:00:41,180 --> 00:00:45,470 We'll find the events directory and then instead of here we're going to create a new one of these event 12 00:00:45,530 --> 00:00:46,610 files. 13 00:00:46,880 --> 00:00:52,310 Every event file is going to export a single interface named after the event that we're trying to create. 14 00:00:52,340 --> 00:00:57,050 We also need to make sure we have a new subject that describes this event and we'll also enter in some 15 00:00:57,050 --> 00:01:02,300 data that is going to be contained inside the event as well so in our case we are trying to create an 16 00:01:02,300 --> 00:01:09,790 event of type expiration complete that means we'll first open up our subjects in them file I'll add 17 00:01:09,910 --> 00:01:15,220 add in a new subject of exploration complete and give it a value of expiration. 18 00:01:15,220 --> 00:01:15,700 Colin 19 00:01:20,690 --> 00:01:31,700 after that inside the events directory I'll make a new file of expiration complete event that yes at 20 00:01:31,700 --> 00:01:33,770 the very top we will import that subjects into 21 00:01:36,790 --> 00:01:43,760 and then I will export an interface called expiration complete event. 22 00:01:43,800 --> 00:01:50,500 This will have a subject of subject start expiration complete and a list out the data contained inside 23 00:01:50,500 --> 00:01:54,880 this thing as well and as we previously discussed the only thing we really need to communicate inside 24 00:01:54,880 --> 00:01:56,280 this event is the order I.D.. 25 00:01:56,650 --> 00:02:01,470 There's not really anything else we need to communicate to say hey something has expired. 26 00:02:01,600 --> 00:02:03,490 That's all we're going to be communicate inside of here. 27 00:02:03,520 --> 00:02:11,650 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 28 00:02:11,650 --> 00:02:11,980 much it. 29 00:02:14,930 --> 00:02:17,260 Just creating this event file is not quite enough. 30 00:02:17,270 --> 00:02:22,100 However remember we do have to make sure we export it from our index to yes file inside of the common 31 00:02:22,100 --> 00:02:23,650 module. 32 00:02:23,700 --> 00:02:25,670 So this is where we have all of our different experts. 33 00:02:25,690 --> 00:02:35,320 I'll go down to the bottom and I'll add on yet another from events expiration that complete event that 34 00:02:35,330 --> 00:02:37,080 looks good. 35 00:02:37,140 --> 00:02:41,850 It will now republish our common module and an update that come in module version used inside of our 36 00:02:41,850 --> 00:02:48,400 expiration service will then be able to create a publisher for expiration complete back at my terminal 37 00:02:50,510 --> 00:02:56,170 I will change into my expiration directory our Susan a common module first. 38 00:02:56,170 --> 00:03:01,000 Got to update the thing though in the coming module we'll do an NPM run Pub. 39 00:03:01,130 --> 00:03:07,400 There we go and then we can go back over to the expiration service and update the version used inside 40 00:03:07,400 --> 00:03:10,570 there all right. 41 00:03:10,600 --> 00:03:17,580 So now back over to expiration that's better and we'll do an NPM update or our company module 42 00:03:21,150 --> 00:03:27,240 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 43 00:03:27,240 --> 00:03:31,530 version yep looks good. 44 00:03:31,530 --> 00:03:36,190 I remember since we made a change to our package packages on file scaffold is going to want to rebuild 45 00:03:36,190 --> 00:03:40,870 or technically Docker here is going to rebuild our expiration service image that's going to take a minute 46 00:03:40,870 --> 00:03:41,200 or two. 47 00:03:41,230 --> 00:03:44,560 So I'll take a pause right here and when we come back the next video we'll make sure that we've got 48 00:03:44,590 --> 00:03:49,630 a publisher inside of our expiration service that's going to publish that event that we just created.