Show recommended aircraft

This procedure takes in a customer’s id number and produces a list of aircraft that are flyable for the customer based on their ratings, the annual inspection date, flyable hours before the aircraft is due for the 100 hour maintenance, and also shows the date of the most recent maintenance that was performed on the aircraft.

The procedure checks all available aircraft in the school and only selects classes that the customer holds ratings for. For example, if a customer only has a Private Pilot License rating for Aircraft Single Engine Land, the procedure will not show aircraft of class Aircraft Single Engine Sea. The various endorsements/ratings such as if the aircraft are Tailwheel, Comlex, or High Performance are also checked against the customer’s ratings they hold.

The procedure then ensures that the plane is not scheduled for its Annual Inspection within 1 day of when the procedure is run. The procedure also shows how many hours is left on the engine before it is due for the 100 Hour Inspection which is to be done every 100 hours the engine is run in a certain RPM band, and important for the customer to choose a suitable plane (e.g., If an aircraft only has 1.2 hours left before it’s due for its 100 Hour but the customer wants to make a 3 hour flight then the customer won’t choose that aircraft).

Finally, the procedure also shows the date of the most recent maintenance that was performed on it.

This could be a commonly used query that is complex enough to be stored instead of manually recreated each time, and suitable to be implemented on the front-end as something that is accessible for each customer where the results could be included as a list of “Recommended” or “Most Suitable” aircraft for the particular moment the customer is attempting to create a new reservation.

Recommended sample Customer ID values for testing on the current set of sample data are 1, 4, and 422.