Summary
In this chapter, I continued developing the SportsStore application by adding support for placing orders.
- The data model for orders is presented through a separate repository interface but is implemented using the
ORM mixin
class. - The order data is stored in the same database as the catalog, which simplifies data consistency and makes it easier to use transactions for updates.
- The data provided by the user is validated before it is stored.
- The validation system relies on TypeScript to ensure that rules are defined for all data model properties.
- The session feature is used to store the user’s pagination preferences during the checkout process.
In the next chapter, I will add support for letting users identify themselves using their Google accounts, which is done using the OAuth
protocol.