1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-21 17:15:17 +00:00

Export all responses of user to surveys

This commit is contained in:
2020-03-26 12:11:06 +01:00
parent 1626b49c37
commit 7e9e35765e
6 changed files with 86 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import { User } from "./User";
import { Post } from "./Post";
import { Comment } from "./Comment";
import { UserLike } from "./UserLike";
import { SurveyResponse } from "./SurveyResponse";
export interface AccountExportBuilder {
userID: number;
@ -15,6 +16,7 @@ export interface AccountExportBuilder {
postsList: Post[];
comments: Comment[];
likes: UserLike[];
surveyResponses: SurveyResponse[];
}
export class AccountExport implements AccountExportBuilder {
@ -23,6 +25,7 @@ export class AccountExport implements AccountExportBuilder {
postsList: Post[];
comments: Comment[];
likes: UserLike[];
surveyResponses: SurveyResponse[];
public constructor(info: AccountExportBuilder) {
for (const key in info) {

View File

@ -0,0 +1,28 @@
/**
* Response to a survey
*
* @author Pierre HUBERT
*/
export interface SurveyResponseBuilder {
id: number,
timeSent: number,
userID: number,
surveyID: number,
choiceID: number
}
export class SurveyResponse implements SurveyResponseBuilder {
id: number;
timeSent: number;
userID: number;
surveyID: number;
choiceID: number;
public constructor(info: SurveyResponseBuilder) {
for (const key in info) {
if (info.hasOwnProperty(key))
this[key] = info[key];
}
}
}