2019-03-05 12:07:58 +01:00
|
|
|
import {Actor, IActor} from './actor.model';
|
2019-01-21 15:08:22 +01:00
|
|
|
|
|
|
|
export enum EventStatus {
|
2019-02-22 11:24:41 +01:00
|
|
|
TENTATIVE,
|
|
|
|
CONFIRMED,
|
|
|
|
CANCELLED,
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export enum EventVisibility {
|
2019-02-22 11:24:41 +01:00
|
|
|
PUBLIC,
|
|
|
|
UNLISTED,
|
|
|
|
RESTRICTED,
|
|
|
|
PRIVATE,
|
2019-02-01 12:33:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export enum EventJoinOptions {
|
2019-02-22 11:24:41 +01:00
|
|
|
FREE,
|
|
|
|
RESTRICTED,
|
|
|
|
INVITE,
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export enum ParticipantRole {
|
2019-02-22 11:24:41 +01:00
|
|
|
NOT_APPROVED = 'not_approved',
|
|
|
|
PARTICIPANT = 'participant',
|
|
|
|
MODERATOR = 'moderator',
|
|
|
|
ADMINISTRATOR = 'administrator',
|
|
|
|
CREATOR = 'creator',
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
|
2019-02-22 16:54:01 +01:00
|
|
|
export enum Category {
|
|
|
|
BUSINESS = 'business',
|
|
|
|
CONFERENCE = 'conference',
|
|
|
|
BIRTHDAY = 'birthday',
|
|
|
|
DEMONSTRATION = 'demonstration',
|
|
|
|
MEETING = 'meeting',
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IParticipant {
|
2019-02-22 11:24:41 +01:00
|
|
|
role: ParticipantRole;
|
|
|
|
actor: IActor;
|
|
|
|
event: IEvent;
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IEvent {
|
2019-02-22 11:24:41 +01:00
|
|
|
id?: number;
|
|
|
|
uuid: string;
|
|
|
|
url: string;
|
|
|
|
local: boolean;
|
|
|
|
|
|
|
|
title: string;
|
|
|
|
description: string;
|
2019-02-22 16:54:01 +01:00
|
|
|
category: Category;
|
2019-02-22 11:24:41 +01:00
|
|
|
|
|
|
|
begins_on: Date;
|
|
|
|
ends_on: Date;
|
|
|
|
publish_at: Date;
|
|
|
|
|
|
|
|
status: EventStatus;
|
|
|
|
visibility: EventVisibility;
|
|
|
|
|
|
|
|
join_options: EventJoinOptions;
|
|
|
|
|
|
|
|
thumbnail: string;
|
|
|
|
large_image: string;
|
|
|
|
|
|
|
|
organizerActor: IActor;
|
|
|
|
attributedTo: IActor;
|
|
|
|
participants: IParticipant[];
|
|
|
|
|
|
|
|
// online_address: Address;
|
|
|
|
// phone_address: string;
|
|
|
|
}
|
2019-03-05 12:07:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
export class EventModel implements IEvent {
|
|
|
|
begins_on: Date = new Date();
|
|
|
|
category: Category = Category.MEETING;
|
|
|
|
description: string = '';
|
|
|
|
ends_on: Date = new Date();
|
|
|
|
join_options: EventJoinOptions = EventJoinOptions.FREE;
|
|
|
|
large_image: string = '';
|
|
|
|
local: boolean = true;
|
|
|
|
participants: IParticipant[] = [];
|
|
|
|
publish_at: Date = new Date();
|
|
|
|
status: EventStatus = EventStatus.CONFIRMED;
|
|
|
|
thumbnail: string = '';
|
|
|
|
title: string = '';
|
|
|
|
url: string = '';
|
|
|
|
uuid: string = '';
|
|
|
|
visibility: EventVisibility = EventVisibility.PUBLIC;
|
|
|
|
attributedTo: IActor = new Actor();
|
|
|
|
organizerActor: IActor = new Actor();
|
|
|
|
}
|