import { Choice, ChoiceGroup } from './choice.model'; import { Comment } from './comment.model'; import { Owner } from './owner.model'; import { DateChoice, TimeSlices } from './dateChoice.model'; import { defaultTimeOfDay } from '../../../../mocks/old-stuff/config/defaultConfigs'; export class Poll { public id = 0; public default_expiracy_days_from_now = 60; public admin_key: string; public kind = 'date'; public description?: string; public password?: string; public expiracy_date?: string; public creation_date?: string = new Date().toISOString(); public creatorPseudo?: string; public creatorEmail?: string; public is_archived?: boolean; public is_zero_knowledge?: boolean = false; public allow_comments?: boolean = true; public allowComments?: boolean = true; public has_several_hours?: boolean = false; public hasSeveralHours?: boolean = false; public isOwnerNotifiedByEmailOnNewVote?: boolean = true; public isOwnerNotifiedByEmailOnNewComment?: boolean = true; public isMaybeAnswerAvailable?: boolean = true; public areResultsPublic?: boolean = true; public allowSeveralHours?: boolean; public archiveNumberOfDays?: number; public max_score?: number; public max_count_of_answers?: number = 150; public maxCountOfAnswers?: number = 150; public comments: Comment[] = []; public choices: Choice[] = []; public choices_grouped: ChoiceGroup[] = []; public votes = []; public stacks = []; public allowed_answers = ['yes']; public modification_policy = 'everybody'; public dateChoices: DateChoice[] = []; // sets of dateChoices as strings, config to set identical time for dateChoices in a special dateChoices poll public timeSlices: TimeSlices[] = Object.create(defaultTimeOfDay); // ranges of time expressed as strings constructor(public owner: Owner = new Owner(), public title = 'mon titre', public custom_url: string = '') {} }