2019-04-26 15:22:16 +02:00
|
|
|
import { ICurrentUser } from '@/types/current-user.model';
|
2019-09-26 16:38:58 +02:00
|
|
|
import { IEvent, IParticipant } from '@/types/event.model';
|
2019-04-26 15:22:16 +02:00
|
|
|
import { Actor, IActor } from '@/types/actor/actor.model';
|
|
|
|
|
|
|
|
export interface IFeedToken {
|
|
|
|
token: string;
|
|
|
|
actor?: IPerson;
|
|
|
|
user: ICurrentUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IPerson extends IActor {
|
|
|
|
feedTokens: IFeedToken[];
|
|
|
|
goingToEvents: IEvent[];
|
2019-09-26 16:38:58 +02:00
|
|
|
participations: IParticipant[];
|
2019-04-26 15:22:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Person extends Actor implements IPerson {
|
|
|
|
feedTokens: IFeedToken[] = [];
|
|
|
|
goingToEvents: IEvent[] = [];
|
2019-09-26 16:38:58 +02:00
|
|
|
participations: IParticipant[] = [];
|
2019-04-26 15:22:16 +02:00
|
|
|
|
|
|
|
constructor(hash: IPerson | {} = {}) {
|
|
|
|
super(hash);
|
|
|
|
|
2019-06-17 17:15:27 +02:00
|
|
|
this.patch(hash);
|
|
|
|
}
|
|
|
|
|
|
|
|
patch (hash: any) {
|
2019-04-26 15:22:16 +02:00
|
|
|
Object.assign(this, hash);
|
|
|
|
}
|
|
|
|
}
|