Ticket control system in Scala