757d2cabec
Now requires quering the person endpoint to know if an actor participates in an event, organizers can make authenticated requests to event { participants { } } to see the pending / approved participants. Also closes #174 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
32 lines
709 B
TypeScript
32 lines
709 B
TypeScript
import { ICurrentUser } from '@/types/current-user.model';
|
|
import { IEvent, IParticipant } from '@/types/event.model';
|
|
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[];
|
|
participations: IParticipant[];
|
|
}
|
|
|
|
export class Person extends Actor implements IPerson {
|
|
feedTokens: IFeedToken[] = [];
|
|
goingToEvents: IEvent[] = [];
|
|
participations: IParticipant[] = [];
|
|
|
|
constructor(hash: IPerson | {} = {}) {
|
|
super(hash);
|
|
|
|
this.patch(hash);
|
|
}
|
|
|
|
patch (hash: any) {
|
|
Object.assign(this, hash);
|
|
}
|
|
}
|