Handling orders
The data model for handling orders comes in two parts: the order and the user profile. The order describes the products that have been selected and provides the shipment status of the order. As noted in Chapter 16, the SportsStore application doesn’t extend to implementing the payment and fulfillment processes, which are typically handled by integration with separate platforms.
Creating the data model
To get started, add a file named customer_models.ts
to the src/data
folder, with the content shown in Listing 18.2. This is a placeholder to represent customers with just enough functionality to start working on orders.
Listing 18.2: The contents of the customer_models.ts file in the src/data folder
export interface Customer {
id?: number;
name: string;
email: string;
}
To describe orders, add a file named order_models.ts
to the src/data
folder with the content shown in Listing 18.3.
Listing 18.3: The contents of the order_models...