fix ticket load route and authorization middleware bug
add auto generation of reference code for ticketmodel