Add admin dashboard, event reporting, moderation report screens, moderation log
Close #156 and #158 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
9
js/src/types/admin.model.ts
Normal file
9
js/src/types/admin.model.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { IEvent } from '@/types/event.model';
|
||||
|
||||
export interface IDashboard {
|
||||
lastPublicEventPublished: IEvent;
|
||||
numberOfUsers: number;
|
||||
numberOfEvents: number;
|
||||
numberOfComments: number;
|
||||
numberOfReports: number;
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
export enum ICurrentUserRole {
|
||||
USER = 'USER',
|
||||
MODERATOR = 'MODERATOR',
|
||||
ADMINISTRATOR = 'ADMINISTRATOR',
|
||||
}
|
||||
|
||||
export interface ICurrentUser {
|
||||
id: number;
|
||||
email: string;
|
||||
isLoggedIn: boolean;
|
||||
role: ICurrentUserRole;
|
||||
}
|
||||
|
||||
47
js/src/types/report.model.ts
Normal file
47
js/src/types/report.model.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { IActor, IPerson } from '@/types/actor';
|
||||
import { IEvent } from '@/types/event.model';
|
||||
|
||||
export enum ReportStatusEnum {
|
||||
OPEN = 'OPEN',
|
||||
CLOSED = 'CLOSED',
|
||||
RESOLVED = 'RESOLVED',
|
||||
}
|
||||
|
||||
export interface IReport extends IActionLogObject {
|
||||
id: string;
|
||||
reported: IActor;
|
||||
reporter: IPerson;
|
||||
event?: IEvent;
|
||||
content: string;
|
||||
notes: IReportNote[];
|
||||
insertedAt: Date;
|
||||
updatedAt: Date;
|
||||
status: ReportStatusEnum;
|
||||
}
|
||||
|
||||
export interface IReportNote extends IActionLogObject{
|
||||
id: string;
|
||||
content: string;
|
||||
moderator: IActor;
|
||||
}
|
||||
|
||||
export interface IActionLogObject {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export enum ActionLogAction {
|
||||
NOTE_CREATION = 'NOTE_CREATION',
|
||||
NOTE_DELETION = 'NOTE_DELETION',
|
||||
REPORT_UPDATE_CLOSED = 'REPORT_UPDATE_CLOSED',
|
||||
REPORT_UPDATE_OPENED = 'REPORT_UPDATE_OPENED',
|
||||
REPORT_UPDATE_RESOLVED = 'REPORT_UPDATE_RESOLVED',
|
||||
EVENT_DELETION = 'EVENT_DELETION',
|
||||
}
|
||||
|
||||
export interface IActionLog {
|
||||
id: string;
|
||||
object: IReport|IReportNote|IEvent;
|
||||
actor: IActor;
|
||||
action: ActionLogAction;
|
||||
insertedAt: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user