1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-02-22 16:51:18 +00:00

35 lines
585 B
TypeScript
Raw Normal View History

/**
* Survey information
*
* @author Pierre HUBERT
*/
export interface SurveyChoice {
id: number,
name: string,
count: number
}
export interface SurveyBuilder {
id: number;
userID: number;
timeCreate: number;
postID: number;
question: string;
choices: SurveyChoice[]
}
export class Survey implements SurveyBuilder {
id: number; userID: number;
timeCreate: number;
postID: number;
question: string;
choices: SurveyChoice[];
public constructor(info: SurveyBuilder) {
for (const key in info) {
if (info.hasOwnProperty(key))
this[key] = info[key];
}
}
}