Skip to content

Commit

Permalink
feat(hub-common): update events schema for onlineMeetings (#1421)
Browse files Browse the repository at this point in the history
  • Loading branch information
velveetachef authored Feb 26, 2024
1 parent 8ca8896 commit c81255f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 32 deletions.
82 changes: 51 additions & 31 deletions packages/common/src/events/api/orval/api/orval-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ export type GetEventsParams = {
start?: number;
};

export interface ICreateRegistration {
/** ArcGIS Online id for a user. Will always be extracted from the token unless service token is used. */
agoId?: string;
/** Email for the subscriber. Will always be extracted from the token unless service token is used. */
email?: string;
/** Event id being registered for */
eventId: string;
/** First name for the subscriber. Will always be extracted from the token unless service token is used. */
firstName?: string;
/** Last name for the subscriber. Will always be extracted from the token unless service token is used. */
lastName?: string;
/** Role of the user in the event */
role?: RegistrationRole;
/** Username for the subscriber. Will always be extracted from the token unless service token is used. */
username?: string;
}

export interface IUpdateEvent {
[key: string]: any;
}
Expand Down Expand Up @@ -87,21 +104,29 @@ export interface IUpdateRegistration {
status?: RegistrationStatus;
}

export interface ICreateRegistration {
/** ArcGIS Online id for a user. Will always be extracted from the token unless service token is used. */
agoId?: string;
/** Email for the subscriber. Will always be extracted from the token unless service token is used. */
email?: string;
/** Event id being registered for */
export interface IRegistration {
createdAt: string;
createdBy?: IUser;
createdById: string;
event?: IEvent;
eventId: string;
/** First name for the subscriber. Will always be extracted from the token unless service token is used. */
firstName?: string;
/** Last name for the subscriber. Will always be extracted from the token unless service token is used. */
lastName?: string;
/** Role of the user in the event */
role?: RegistrationRole;
/** Username for the subscriber. Will always be extracted from the token unless service token is used. */
username?: string;
id: number;
role: RegistrationRole;
status: RegistrationStatus;
updatedAt: string;
user?: IUser;
userId: string;
}

export interface IOnlineMeeting {
capacity: number | null;
createdAt: string;
details: string | null;
event?: IEvent;
eventId: string;
id: string;
updatedAt: string;
url: string;
}

export interface IUser {
Expand All @@ -116,25 +141,20 @@ export interface IUser {
username: string;
}

export interface IRegistration {
createdAt: string;
createdBy?: IUser;
createdById: string;
event?: IEvent;
eventId: string;
id: number;
role: RegistrationRole;
status: RegistrationStatus;
updatedAt: string;
user?: IUser;
userId: string;
}

/**
* GeoJSON formatted geometry related to the event
*/
export type ICreateEventGeometry = { [key: string]: any };

export interface ICreateOnlineMeeting {
/** Capacity of the online meeting. Minimum value is 1 */
capacity?: number;
/** Details related to the online meeting */
details?: string;
/** Url for the online meeting */
url: string;
}

export enum EventAttendanceType {
VIRTUAL = "VIRTUAL",
IN_PERSON = "IN_PERSON",
Expand All @@ -152,7 +172,7 @@ export interface IEvent {
geometry: IEventGeometry;
id: string;
notifyAttendees: boolean;
onlineLocations: string[];
onlineMeetings?: IOnlineMeeting[];
recurrence: string | null;
registrations?: IRegistration[];
startDateTime: string;
Expand Down Expand Up @@ -199,8 +219,8 @@ export interface ICreateEvent {
lastName?: string;
/** Flag to notify attendees */
notifyAttendees?: boolean;
/** Online locations for the event */
onlineLocations?: string[];
/** Online meetings for the event. Required if attendanceType includes VIRTUAL */
onlineMeetings?: ICreateOnlineMeeting[];
/** ISO8601 start date-time for the event */
startDateTime: string;
/** Summary of the event */
Expand Down
8 changes: 7 additions & 1 deletion packages/common/test/events/api/events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ describe("Events", () => {
properties: {},
},
notifyAttendees: true,
onlineLocations: ["https://www.esri.com"],
onlineMeetings: [
{
url: "https://www.esri.com",
capacity: 50,
details: "Tacos online are here",
},
],
startDateTime: "2023-12-01T19:52:13.584Z",
summary: "a summary",
timeZone: "America/Los_Angeles",
Expand Down

0 comments on commit c81255f

Please sign in to comment.