[feature] Implements getTicketNumber to get a new ticket number for a store

A lot of changes in server module and needs to sync up with server module.