mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-25 23:09:22 +00:00
26 lines
459 B
TypeScript
26 lines
459 B
TypeScript
|
/**
|
||
|
* New survey information handler
|
||
|
*
|
||
|
* @author Pierre HUBERT
|
||
|
*/
|
||
|
|
||
|
export interface NewSurveyBuilder {
|
||
|
postID?: number,
|
||
|
userID: number,
|
||
|
question: string,
|
||
|
choices: Array<string>
|
||
|
}
|
||
|
|
||
|
export class NewSurvey implements NewSurveyBuilder {
|
||
|
postID: number;
|
||
|
userID: number;
|
||
|
question: string;
|
||
|
choices: string[];
|
||
|
|
||
|
public constructor(info: NewSurveyBuilder) {
|
||
|
for (const key in info) {
|
||
|
if (info.hasOwnProperty(key))
|
||
|
this[key] = info[key];
|
||
|
}
|
||
|
}
|
||
|
}
|