Exploring Some More Ideas
Explore advanced functional programming techniques by enhancing a reservation application. Learn to apply Reader and State monads, manage asynchronous operations with TaskEither, implement event-driven architecture using DynamoDB streams, and orchestrate workflows with AWS step functions. This lesson shows how to structure data and processes for a scalable and modular system in TypeScript.
We'll cover the following...
Expansions in the application
How about making the price depend on the hotel? What would change is that we’d get another type of data in the database, probably with the prefix HOTEL#, containing all relevant information about a hotel, like its name, location, and pricing. We’d also have to change the code in the Create Lambda before calculating the price, we’d do a retrieval of price data from the database, meaning our Either would become a TaskEither a bit earlier than before. Furthermore, to pass the information along, we could enrich our CreateReservationRequest with price information (roomPrice, for example), while leaving CreateReservationPricedRequest as-is because when the request has been priced, we no longer need that information. As usual, having the right kind ...