update user_details method to provide group code
add generate_code method to group model
modify new method in group_controller to call generate_code