funky-framadate-front/src/app/core/models/poll.model.ts

67 lines
1.9 KiB
TypeScript
Raw Normal View History

2021-05-20 11:04:29 +02:00
import { Choice, ChoiceGroup } from './choice.model';
2020-05-05 18:17:12 +02:00
import { Comment } from './comment.model';
import { Owner } from './owner.model';
2021-05-20 11:04:29 +02:00
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;
2021-04-30 16:00:22 +02:00
public admin_key: string;
public kind = 'date';
public description?: string;
2021-04-30 23:24:48 +02:00
public password?: string;
public expiracy_date?: string;
2021-05-03 14:54:32 +02:00
public creation_date?: string = new Date().toISOString();
public creatorPseudo?: string;
public creatorEmail?: string;
public is_archived?: boolean;
2021-04-30 12:37:04 +02:00
public is_zero_knowledge?: boolean = false;
public allow_comments?: boolean = true;
2021-04-30 23:24:48 +02:00
public allowComments?: boolean = true;
2021-04-30 23:33:56 +02:00
2021-04-30 12:37:04 +02:00
public has_several_hours?: boolean = false;
2021-04-30 23:33:56 +02:00
public hasSeveralHours?: boolean = false;
2021-04-30 23:43:44 +02:00
public isOwnerNotifiedByEmailOnNewVote?: boolean = true;
public isOwnerNotifiedByEmailOnNewComment?: boolean = true;
public isMaybeAnswerAvailable?: boolean = true;
public areResultsPublic?: boolean = true;
2021-04-30 12:37:04 +02:00
public allowSeveralHours?: boolean;
public archiveNumberOfDays?: number;
2021-04-30 12:37:04 +02:00
public max_score?: number;
2021-04-30 12:37:04 +02:00
public max_count_of_answers?: number = 150;
2021-04-30 23:24:48 +02:00
public maxCountOfAnswers?: number = 150;
2021-04-30 12:37:04 +02:00
public comments: Comment[] = [];
public choices: Choice[] = [];
2021-04-30 15:42:50 +02:00
public choices_grouped: ChoiceGroup[] = [];
public votes = [];
2021-04-26 17:04:16 +02:00
public stacks = [];
public allowed_answers = ['yes'];
2021-04-27 13:04:32 +02:00
public modification_policy = 'everybody';
2021-04-30 12:37:04 +02:00
public dateChoices: DateChoice[] = [];
2021-05-18 12:12:08 +02:00
// 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
2021-04-26 11:27:44 +02:00
2021-04-30 22:49:55 +02:00
constructor(public owner: Owner = new Owner(), public title = 'mon titre', public custom_url: string = '') {}
}