Implement database-level validation and relations for trip results.

Trip tickets are now "aware" of whether a result can be recorded.