Work on dashboard

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-09-18 17:32:37 +02:00
parent 48fd14bf9c
commit ffa4ec9209
33 changed files with 931 additions and 204 deletions

View File

@@ -10,6 +10,8 @@ export interface IActor {
suspended: boolean;
avatar: IPicture | null;
banner: IPicture | null;
displayName();
}
export class Actor implements IActor {

View File

@@ -1,3 +1,5 @@
import { IParticipant } from '@/types/event.model';
export enum ICurrentUserRole {
USER = 'USER',
MODERATOR = 'MODERATOR',
@@ -9,4 +11,5 @@ export interface ICurrentUser {
email: string;
isLoggedIn: boolean;
role: ICurrentUserRole;
participations: IParticipant[];
}

View File

@@ -50,6 +50,20 @@ export interface IParticipant {
event: IEvent;
}
export class Participant implements IParticipant {
event!: IEvent;
actor!: IActor;
role: ParticipantRole = ParticipantRole.NOT_APPROVED;
constructor(hash?: IParticipant) {
if (!hash) return;
this.event = new EventModel(hash.event);
this.actor = new Actor(hash.actor);
this.role = hash.role;
}
}
export interface IOffer {
price: number;
priceCurrency: string;
@@ -203,6 +217,7 @@ export class EventModel implements IEvent {
this.onlineAddress = hash.onlineAddress;
this.phoneAddress = hash.phoneAddress;
this.physicalAddress = hash.physicalAddress;
this.participantStats = hash.participantStats;
this.tags = hash.tags;
if (hash.options) this.options = hash.options;