The ProcessingController is an internal-only controller. It will be used for performing actions with orders that the user has no input into.
Follow these steps to create our controller:
- Open Sources/App/Controllers, create a ProcessingController.swift file, and enter the following content into the file:
import Fluentimport Vaporfinal class ProcessingController {}
This code is only the container for the class. We will need the following three functions:
- getOrders: This returns a list of orders based on a status.
- processOrderInformation: This checks the prices of an order according to the PMS.
- getProductInformation: This returns the prices from the PMS.
- Create the three function templates:
func getOrders(status: ...