mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-02-22 08:43:44 +00:00
35 lines
585 B
TypeScript
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];
|
|
}
|
|
}
|
|
} |