public function doCheckIn($data, CheckInForm $form)
    {
        /** @var CheckInController $controller */
        $controller = $form->getController();
        $validator = CheckInValidator::create();
        $result = $validator->validate($data['TicketCode']);
        switch ($result['Code']) {
            case CheckInValidator::MESSAGE_CHECK_OUT_SUCCESS:
                $validator->getAttendee()->checkOut();
                break;
            case CheckInValidator::MESSAGE_CHECK_IN_SUCCESS:
                $validator->getAttendee()->checkIn();
                break;
        }
        
        $form->sessionMessage($result['Message'], strtolower($result['Type']), false);
        $this->extend('onAfterCheckIn', $response, $form, $result);
        return $response ? $response : $controller->redirect($controller->Link());
    }