2020-11-27 19:27:44 +01:00
|
|
|
import type { ICurrentUser } from "../current-user.model";
|
|
|
|
import type { IEvent } from "../event.model";
|
|
|
|
import { Actor } from "./actor.model";
|
|
|
|
import type { IActor } from "./actor.model";
|
|
|
|
import type { Paginate } from "../paginate";
|
|
|
|
import type { IParticipant } from "../participant.model";
|
|
|
|
import type { IMember } from "./member.model";
|
|
|
|
import type { IFeedToken } from "../feedtoken.model";
|
2019-04-26 15:22:16 +02:00
|
|
|
|
|
|
|
export interface IPerson extends IActor {
|
|
|
|
feedTokens: IFeedToken[];
|
|
|
|
goingToEvents: IEvent[];
|
2020-06-15 18:12:49 +02:00
|
|
|
participations: Paginate<IParticipant>;
|
2020-02-18 08:57:00 +01:00
|
|
|
memberships: Paginate<IMember>;
|
2020-06-11 19:13:21 +02:00
|
|
|
user?: ICurrentUser;
|
2019-04-26 15:22:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Person extends Actor implements IPerson {
|
|
|
|
feedTokens: IFeedToken[] = [];
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-04-26 15:22:16 +02:00
|
|
|
goingToEvents: IEvent[] = [];
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2020-06-15 18:12:49 +02:00
|
|
|
participations!: Paginate<IParticipant>;
|
2019-04-26 15:22:16 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
memberships!: Paginate<IMember>;
|
|
|
|
|
2020-06-11 19:13:21 +02:00
|
|
|
user!: ICurrentUser;
|
|
|
|
|
2020-11-06 11:34:32 +01:00
|
|
|
constructor(hash: IPerson | Record<string, unknown> = {}) {
|
2019-04-26 15:22:16 +02:00
|
|
|
super(hash);
|
|
|
|
|
2019-06-17 17:15:27 +02:00
|
|
|
this.patch(hash);
|
|
|
|
}
|
|
|
|
|
2020-11-06 11:34:32 +01:00
|
|
|
patch(hash: IPerson | Record<string, unknown>): void {
|
2019-04-26 15:22:16 +02:00
|
|
|
Object.assign(this, hash);
|
|
|
|
}
|
|
|
|
}
|