1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-07-17 07:08:05 +00:00
Files
comunicapiv2/src/entities/Survey.ts

35 lines
585 B
TypeScript

/**
* 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];
}
}
}