File: src\internal\ui\Survey\surveyModel.ts
/**
* @module UI
* @submodule UI Survey
* @namespace ui.survey
*/
namespace internal.ui.survey {
/**
* Survey data model
* @class SurveyModel
*/
export interface SurveyModel {
/**
* Partner Id the survey belongs to
* @property {string} partnerId
*/
partnerId: string;
/**
* Team Id (deprecated)
* @property {string} teamId
*/
teamId: string;
/**
* ID of this survey
* @property {string} surveyId
*/
surveyId: string;
/**
* Description of this survey
* @property {string} description
*/
description: string;
/**
* Flights contained within this survey
* @property {ui.survey.Flight[]} flights
*/
flights: Flight[];
}
/**
* Represents a single flight within a survey
* @class Flight
*/
export interface Flight {
/**
* Percent this flight is offered at.
* @property {number} percent
*/
percent: number;
/**
* Locale for this survey
* @property {string} locale
*/
locale: string;
/**
* Localized title of the survey
* @property {string} title
*/
title: string;
/**
* Header text for the survey
* @property {string} header
*/
header: string;
/**
* Footer text for the survey
* @property {string} footer
*/
footer: string;
/**
* Mode of the survey
* @property {string} mode
*/
mode: string;
/**
* FlightID for this flight
* @property {string} flightId
*/
flightId: string;
/**
* Set to true if the questions in the flight in a random order
* @property {boolean} randomizeQuestion
*/
randomizeQuestion: boolean;
/**
* Questions within this flight
* @property {ui.survey.Question[]} questions
*/
questions: Question[];
/**
* Parameters of this flight
* @property {ui.survey.FlightParams} flightParams
*/
flightParams: FlightParams;
/**
* Hyperlinks rendered with this survey
* @property {ui.survey.Hyperlink[]} FlighthyperlinksParams
*/
hyperlinks: Hyperlink[];
}
/**
* Represents a single question within a survey flight
* @class Question
*/
export interface Question {
/**
* Unique ID for this question.
* @property {number} id
*/
id: number;
/**
* Maximum length for the question response.
* @property {number} maxLength
*/
maxLength: number;
/**
* The type of question being asked.
* @property {string} type
*/
type: string;
/**
* Question friendly name
* @property {string} name
*/
name: string;
/**
* The category of this question.
* @property {string} category
*/
category: string;
/**
* Text displayed with this question.
* @property {string} questionText
*/
questionText: string;
/**
* High value for this question if it is a range.
* @property {number} high
*/
high: number;
/**
*Low value for this question if it is a range.
* @property {number} low
*/
low: number;
/**
* True if a response is required for this question. Otherwise false.
* @property {boolean} isRequired
*/
isRequired: boolean;
/**
* Possible options for the response if there are precanned responses.
* @property {ui.survey.ResponseOption[]} responseOptions
*/
responseOptions: ResponseOption[];
/**
* Set to true if the response options are provided in a random order.
* @property {boolean} randomize
*/
randomize: boolean;
}
/**
* Represents a response option for precanned responses.
* @class ResponseOption
*/
export interface ResponseOption {
/**
* Unique ID for this response
* @property {number} sequenceId
*/
sequenceId: number;
/**
* Text associated with this response.
* @property {string} text
*/
text: string;
/**
* Set to true if this is an 'other' resopnse allowing dynamic display of a freeform text field.
* @property {boolean} isOther
*/
isOther: boolean;
}
/**
* Parameters associated with this flight.
* @class FlightParams
*/
export interface FlightParams {
/**
* Percent at which this flight is offered.
* @property {string} percent
*/
percent: string;
/**
* Set to true if this is a random flight. Otherwise set to false.
* @property {boolean} randomize
*/
randomize: boolean;
}
/**
* Represents a hyperlink to be rendered on the survey.
* @class Hyperlink
*/
export interface Hyperlink {
/**
* Name of this hylperlink.
* @property {string} name
*/
name: string;
/**
* Text displayed with the hyperlink.
* @property {string} text
*/
text: string;
/**
* URL of the link.
* @property {string} url
*/
url: string;
}
}