Implementing the order flow
Now that the data model extends to describe and store order data, the next step is to create the workflow that allows orders to be created and stored.
Validating data
The process of creating an order requires data from the user, which will be validated before it is used and stored. To install the validation package and its TypeScript descriptions, use a command prompt to run the commands shown in Listing 18.14 in the sportsstore
folder.
Listing 18.14: Installing the validation packages
npm install [email protected]
npm install --save-dev @types/[email protected]
These packages are described in Table 18.1 for quick reference.
Table 18.1: The validation packages
Name |
Description |
|
This package contains validators for common data types. |