1 00:00:01,030 --> 00:00:02,770 So what are we going to work on next. 2 00:00:02,770 --> 00:00:07,730 Well this one time we have wired up our order service that is listening to the ticket created event 3 00:00:07,980 --> 00:00:09,880 and the ticket updated event. 4 00:00:09,880 --> 00:00:13,350 So what our service is processing those events pretty darn well. 5 00:00:13,600 --> 00:00:17,140 The order service in turn is also emitting a couple of events. 6 00:00:17,140 --> 00:00:22,420 So for example the order service is publishing order created and order canceled. 7 00:00:22,420 --> 00:00:27,460 We need to now make sure that the ticket service is going to have a listener is going to watch for the 8 00:00:27,460 --> 00:00:30,740 order created event and the order canceled event. 9 00:00:30,760 --> 00:00:35,920 The reason for this remember is we need to make sure that we lock down a ticket after an order has been 10 00:00:35,920 --> 00:00:37,120 created for it. 11 00:00:37,120 --> 00:00:42,130 So once a ticket has been reserved the ticket service needs to make sure that the person who owns this 12 00:00:42,130 --> 00:00:47,350 ticket the person who created the ticket can not come back and start to edit it as we don't want a user 13 00:00:47,350 --> 00:00:52,300 to start to go through the process of purchasing a ticket and then see the price just mysteriously change 14 00:00:52,300 --> 00:00:54,900 or the description change or anything like that. 15 00:00:54,990 --> 00:00:57,620 So to implement that we're going to go back over to our ticket service. 16 00:00:57,730 --> 00:01:03,310 We're going to implement two different listeners whenever the ticket service sees a list or an event 17 00:01:03,370 --> 00:01:04,990 of order created. 18 00:01:04,990 --> 00:01:09,400 We're going to find the appropriate ticket inside the ticket service and set something on there that's 19 00:01:09,400 --> 00:01:15,770 going to lock down that ticket and prevent us from making any further changes to it then whenever we 20 00:01:15,770 --> 00:01:20,870 see an order canceled event which indicates that the person who's trying to buy the ticket says forget 21 00:01:20,870 --> 00:01:25,130 this I don't want the ticket or maybe the order times out or whatever else or then going to make sure 22 00:01:25,190 --> 00:01:31,170 that we unreserved the ticket or essentially unlock it down and allow editing of its ticket once again. 23 00:01:31,250 --> 00:01:32,100 That's pretty much it. 24 00:01:32,150 --> 00:01:36,070 It's pretty much an on off flag whenever we see what are created. 25 00:01:36,080 --> 00:01:38,780 Lock the ticket whenever we see canceled unlock the ticket. 26 00:01:38,780 --> 00:01:39,880 That's all it is. 27 00:01:39,950 --> 00:01:42,050 So not the worst thing in the world. 28 00:01:42,260 --> 00:01:46,550 Now we've got an idea of what we're doing was right here start to implement this in the next video.