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:
@ -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) {
|
||||
|
28
src/entities/SurveyResponse.ts
Normal file
28
src/entities/SurveyResponse.ts
Normal 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];
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user