From the course: Java: Serverless Applications on AWS

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Solution: Customize handler method with new input/output

Solution: Customize handler method with new input/output

From the course: Java: Serverless Applications on AWS

Solution: Customize handler method with new input/output

(poppy music) - Welcome back. I hope you were able to solve it. Solving challenges around promotions is a common use case. And this is a perfect example of how such a business case can be separated as an escalated function. Maintained and updated without necessarily touching other functionalities of the client application. If we review our task, we have two objects we need to deal with. First is CarData. And the second one is PromotionData. Let's go ahead and create those two Bojo classes. First create a new class CarData. We need to add fields sum and couponCode. We shouldn't forget to add getters and setters. Otherwise CarData wont get populated and let's create another entity called promotion data. A promotion should contain reduced price, a free shipping flag, and the promo message. I will now create a new clause that will hold our handler function. We can use both of these bojo's as part of handler…

Contents