In this service, we need to store the incoming orders in the database. The models we are creating in this section are representing that information in Swift through Fluent. Additionally, we also need to create input and output models that help us transfer the information from and to the user.
We have the following models to consider:
- Order: This represents the order from a consumer.
- OrderItem: This is an item within an order.
- OrderPayment: This is a payment posted for an order.
Let's go through the following sections: ...